CbmRoot
CbmMuchPoint.cxx
Go to the documentation of this file.
1 
11 #include "CbmMuchPoint.h"
12 
13 #include <FairLogger.h> // for Logger, LOG
14 #include <FairMCPoint.h> // for FairMCPoint
15 
16 #include <TMathBase.h> // for Abs
17 #include <TVector3.h> // for TVector3
18 
19 // ----- Default constructor -------------------------------------------
21  : FairMCPoint()
22  , fX_out(0.)
23  , fY_out(0.)
24  , fZ_out(0.)
25  , fPx_out(0.)
26  , fPy_out(0.)
27  , fPz_out(0.) {}
28 // -------------------------------------------------------------------------
29 
30 
31 // ----- Standard constructor ------------------------------------------
33  Int_t detID,
34  TVector3 posIn,
35  TVector3 posOut,
36  TVector3 momIn,
37  TVector3 momOut,
38  Double_t tof,
39  Double_t length,
40  Double_t eLoss,
41  Int_t eventId)
42  : FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss, eventId)
43  , fX_out(posOut.X())
44  , fY_out(posOut.Y())
45  , fZ_out(posOut.Z())
46  , fPx_out(momOut.Px())
47  , fPy_out(momOut.Py())
48  , fPz_out(momOut.Pz()) {}
49 // -------------------------------------------------------------------------
50 
51 
52 // ----- Copy constructor with event and epoch time --------------------
54  Int_t eventId,
55  Double_t eventTime,
56  Double_t epochTime)
57  : FairMCPoint(point)
58  , fX_out(point.fX_out)
59  , fY_out(point.fY_out)
60  , fZ_out(point.fZ_out)
61  , fPx_out(point.fPx_out)
62  , fPy_out(point.fPy_out)
63  , fPz_out(point.fPz_out) {
64  // *this = point;
65  if (eventId > 0) fEventId = eventId;
66  fTime = point.GetTime() + eventTime - epochTime;
67 }
68 // -------------------------------------------------------------------------
69 
70 
71 // ----- Destructor ----------------------------------------------------
73 // -------------------------------------------------------------------------
74 
75 
76 // ----- Public method Print -------------------------------------------
77 void CbmMuchPoint::Print(const Option_t* /*opt*/) const {
78  LOG(info) << "-I- CbmMuchPoint: MUCH Point for track " << fTrackID
79  << " in detector " << fDetectorID;
80  LOG(info) << " Position (" << fX << ", " << fY << ", " << fZ << ") cm";
81  LOG(info) << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV";
82  LOG(info) << " Time " << fTime << " ns, Length " << fLength
83  << " cm, Energy loss " << fELoss * 1.0e06 << " keV";
84 }
85 // -------------------------------------------------------------------------
86 
87 
88 // ----- Point x coordinate from linear extrapolation ------------------
89 Double_t CbmMuchPoint::GetX(Double_t z) const {
90  Double_t dz = fZ_out - fZ;
91  if (TMath::Abs(dz) < 1.e-3) return (fX_out + fX) / 2.;
92  return (fX + (z - fZ) / dz * (fX_out - fX));
93 }
94 // -------------------------------------------------------------------------
95 
96 
97 // ----- Point y coordinate from linear extrapolation ------------------
98 Double_t CbmMuchPoint::GetY(Double_t z) const {
99  Double_t dz = fZ_out - fZ;
100  if (TMath::Abs(dz) < 1.e-3) return (fY_out + fY) / 2.;
101  return (fY + (z - fZ) / dz * (fY_out - fY));
102 }
103 // -------------------------------------------------------------------------
104 
105 
106 // ----- Public method IsUsable ----------------------------------------
107 Bool_t CbmMuchPoint::IsUsable() const {
108  Double_t dz = fZ_out - fZ;
109  if (TMath::Abs(dz) < 1.e-4) return kFALSE;
110  return kTRUE;
111 }
112 // -------------------------------------------------------------------------
113 
114 
CbmMuchPoint
Definition: CbmMuchPoint.h:21
CbmMuchPoint::fZ_out
Double32_t fZ_out
Definition: CbmMuchPoint.h:100
CbmMuchPoint::CbmMuchPoint
CbmMuchPoint()
Definition: CbmMuchPoint.cxx:20
CbmMuchPoint.h
CbmMuchPoint::GetY
Double_t GetY(Double_t z) const
Definition: CbmMuchPoint.cxx:98
CbmMuchPoint::fY_out
Double32_t fY_out
Definition: CbmMuchPoint.h:100
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmMuchPoint::fX_out
Double32_t fX_out
Definition: CbmMuchPoint.h:100
CbmMuchPoint::~CbmMuchPoint
virtual ~CbmMuchPoint()
Definition: CbmMuchPoint.cxx:72
CbmMuchPoint::GetX
Double_t GetX(Double_t z) const
Definition: CbmMuchPoint.cxx:89
CbmMuchPoint::IsUsable
Bool_t IsUsable() const
Definition: CbmMuchPoint.cxx:107
CbmMuchPoint::Print
virtual void Print(const Option_t *opt) const
Definition: CbmMuchPoint.cxx:77