BmnRoot
Loading...
Searching...
No Matches
CbmStsPoint.cxx
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- CbmStsPoint source file -----
3// ----- Created 26/07/04 by V. Friese -----
4// -------------------------------------------------------------------------
5
6#include "CbmStsPoint.h"
7#include "BmnDetectorList.h"
8
9#include <iostream>
10
11using std::cout;
12using std::endl;
13using std::flush;
14
15
16// ----- Default constructor -------------------------------------------
18 : FairMCPoint(),
19 fX_out(0.),
20 fY_out(0.),
21 fZ_out(0.),
22 fPx_out(0.),
23 fPy_out(0.),
24 fPz_out(0.),
25 fStation(-1),
26 fModule(-1)
27{
28}
29// -------------------------------------------------------------------------
30
31
32
33// ----- Standard constructor ------------------------------------------
34CbmStsPoint::CbmStsPoint(Int_t trackID, Int_t detID, TVector3 posIn,
35 TVector3 posOut, TVector3 momIn, TVector3 momOut,
36 Double_t tof, Double_t length, Double_t eLoss,
37 Int_t eventId)
38 : FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss, eventId),
39 fX_out(posOut.X()),
40 fY_out(posOut.Y()),
41 fZ_out(posOut.Z()),
42 fPx_out(momOut.Px()),
43 fPy_out(momOut.Py()),
44 fPz_out(momOut.Pz()),
45 fStation(-1),
46 fModule(-1)
47{
48 SetLink(FairLink(kMCTrack, trackID));
49}
50// -------------------------------------------------------------------------
51
52
53
54// ----- Destructor ----------------------------------------------------
56// -------------------------------------------------------------------------
57
58
59
60// ----- Copy constructor with event and epoch time --------------------
61CbmStsPoint::CbmStsPoint(const CbmStsPoint& point, Int_t eventId,
62 Double_t eventTime, Double_t epochTime)
63 : FairMCPoint(point),
64 fX_out(point.fX_out),
65 fY_out(point.fY_out),
66 fZ_out(point.fZ_out),
67 fPx_out(point.fPx_out),
68 fPy_out(point.fPy_out),
69 fPz_out(point.fPz_out),
70 fStation(point.fStation),
71 fModule(point.fModule)
72{
73 // *this = point;
74 if ( eventId > 0 ) fEventId = eventId;
75 fTime = point.GetTime() + eventTime - epochTime;
76}
77// -------------------------------------------------------------------------
78
79
80
81
82// ----- Public method Print -------------------------------------------
83void CbmStsPoint::Info() const {
84 LOG(debug2) << "StsPoint: track ID " << fTrackID << ", detector ID "
85 << fDetectorID;
86 LOG(debug2) << " IN Position (" << fX << ", " << fY
87 << ", " << fZ << ") cm";
88 LOG(debug2) << " OUT Position (" << fX_out << ", " << fY_out
89 << ", " << fZ_out << ") cm";
90 LOG(debug2) << " Momentum (" << fPx << ", " << fPy << ", " << fPz
91 << ") GeV";
92 LOG(debug2) << " Time " << fTime << " ns, Length " << fLength
93 << " cm, Energy loss " << fELoss*1.0e06 << " keV";
94 LOG(debug2) << " StationNum " << fStation << ", ModuleNum " << fModule;
95}
96// -------------------------------------------------------------------------
97
98
99
100// ----- Point x coordinate from linear extrapolation ------------------
101Double_t CbmStsPoint::GetX(Double_t z) const {
102 // cout << fZ << " " << z << " " << fZ_out << endl;
103 if ( (fZ_out-z)*(fZ-z) >= 0. ) return (fX_out+fX)/2.;
104 Double_t dz = fZ_out - fZ;
105 return ( fX + (z-fZ) / dz * (fX_out-fX) );
106}
107// -------------------------------------------------------------------------
108
109
110
111// ----- Point y coordinate from linear extrapolation ------------------
112Double_t CbmStsPoint::GetY(Double_t z) const {
113 if ( (fZ_out-z)*(fZ-z) >= 0. ) return (fY_out+fY)/2.;
114 Double_t dz = fZ_out - fZ;
115 // if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
116 return ( fY + (z-fZ) / dz * (fY_out-fY) );
117}
118// -------------------------------------------------------------------------
119
120
121
122// ----- Public method IsUsable ----------------------------------------
123Bool_t CbmStsPoint::IsUsable() const {
124 Double_t dz = fZ_out - fZ;
125 if ( TMath::Abs(dz) < 1.e-4 ) return kFALSE;
126 return kTRUE;
127}
128// -------------------------------------------------------------------------
@ kMCTrack
Bool_t IsUsable() const
Double_t GetY(Double_t z) const
Double_t GetX(Double_t z) const
virtual ~CbmStsPoint()
Double32_t fX_out
Double32_t fZ_out
Double32_t fY_out
void Info() const