CbmRoot
Loading...
Searching...
No Matches
CbmMuchPoint.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Mikhail Ryzhinskiy, Volker Friese, Florian Uhlig, Denis Bertini [committer] */
4
15#include "CbmMuchPoint.h"
16
17#include <FairMCPoint.h> // for FairMCPoint
18#include <Logger.h> // for Logger, LOG
19
20#include <TVector3.h> // for TVector3
21
22#include <cmath>
23
24// ----- Default constructor -------------------------------------------
25CbmMuchPoint::CbmMuchPoint() : FairMCPoint(), fX_out(0.), fY_out(0.), fZ_out(0.), fPx_out(0.), fPy_out(0.), fPz_out(0.)
26{
27}
28// -------------------------------------------------------------------------
29
30
31// ----- Standard constructor ------------------------------------------
32CbmMuchPoint::CbmMuchPoint(int32_t trackID, int32_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn,
33 TVector3 momOut, double tof, double length, double eLoss, int32_t eventId)
34 : FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss, eventId)
35 , fX_out(posOut.X())
36 , fY_out(posOut.Y())
37 , fZ_out(posOut.Z())
38 , fPx_out(momOut.Px())
39 , fPy_out(momOut.Py())
40 , fPz_out(momOut.Pz())
41{
42}
43// -------------------------------------------------------------------------
44
45
46// ----- Copy constructor with event and epoch time --------------------
47CbmMuchPoint::CbmMuchPoint(const CbmMuchPoint& point, int32_t eventId, double eventTime, double epochTime)
48 : FairMCPoint(point)
49 , fX_out(point.fX_out)
50 , fY_out(point.fY_out)
51 , fZ_out(point.fZ_out)
52 , fPx_out(point.fPx_out)
53 , fPy_out(point.fPy_out)
54 , fPz_out(point.fPz_out)
55{
56 // *this = point;
57 if (eventId > 0) fEventId = eventId;
58 fTime = point.GetTime() + eventTime - epochTime;
59}
60// -------------------------------------------------------------------------
61
62
63// ----- Destructor ----------------------------------------------------
65// -------------------------------------------------------------------------
66
67
68// ----- Public method Print -------------------------------------------
69void CbmMuchPoint::Print(const Option_t* /*opt*/) const
70{
71 LOG(info) << "-I- CbmMuchPoint: MUCH Point for track " << fTrackID << " in detector " << fDetectorID;
72 LOG(info) << " Position (" << fX << ", " << fY << ", " << fZ << ") cm";
73 LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
74 LOG(info) << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV";
75}
76// -------------------------------------------------------------------------
77
78
79// ----- Point x coordinate from linear extrapolation ------------------
80double CbmMuchPoint::GetX(double z) const
81{
82 double dz = fZ_out - fZ;
83 if (abs(dz) < 1.e-3) return (fX_out + fX) / 2.;
84 return (fX + (z - fZ) / dz * (fX_out - fX));
85}
86// -------------------------------------------------------------------------
87
88
89// ----- Point y coordinate from linear extrapolation ------------------
90double CbmMuchPoint::GetY(double z) const
91{
92 double dz = fZ_out - fZ;
93 if (abs(dz) < 1.e-3) return (fY_out + fY) / 2.;
94 return (fY + (z - fZ) / dz * (fY_out - fY));
95}
96// -------------------------------------------------------------------------
97
98
99// ----- Public method IsUsable ----------------------------------------
101{
102 double dz = fZ_out - fZ;
103 if (abs(dz) < 1.e-4) return false;
104 return true;
105}
106// -------------------------------------------------------------------------
107
108
ClassImp(CbmConverterManager)
double GetX(double z) const
Double32_t fX_out
Double32_t fZ_out
Double32_t fY_out
bool IsUsable() const
virtual ~CbmMuchPoint()
double GetY(double z) const
virtual void Print(const Option_t *opt) const