CbmRoot
CbmTofTracklet.h
Go to the documentation of this file.
1 
6 #ifndef CBMTOFTRACKLET_H
7 #define CBMTOFTRACKLET_H 1
8 
9 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
10 #include <RtypesCore.h> // for Int_t, Double_t, Bool_t, Option_t
11 #include <TMath.h> // for Sqrt, ATan, Power
12 #include <TObject.h> // for TObject
13 
14 #include <FairTrackParam.h> // for FairTrackParam
15 
16 #include <vector> // for vector, __vector_base<>::value_type
17 
18 #include "CbmTofHit.h" // for CbmTofHit
19 #include "CbmTofTrackletParam.h" // for CbmTofTrackletParam
20 
25 class CbmTofTracklet : public TObject {
26 
27 public:
30 
40  virtual ~CbmTofTracklet();
41 
42  virtual void PrintInfo();
43 
45  Int_t GetPidHypo() const { return fPidHypo; }
46 
48  Int_t GetNofHits() const { return fTofHit.size(); }
49 
51  Int_t GetHitIndex(Int_t ind) const { return fTofHit[ind]; }
52 
53  Double_t GetT0() const { return fT0; }
54  Double_t GetTt() const { return fTt; }
55  Double_t GetT0Err() const { return fT0Err; }
56  Double_t GetTtErr() const { return fTtErr; }
57  Double_t GetT0TtCov() const { return fT0TtCov; }
58  Double_t GetTheta() const {
59  return TMath::ATan(TMath::Sqrt(TMath::Power(fTrackPar.GetTy(), 2)
60  + TMath::Power(fTrackPar.GetTx(), 2)));
61  }
62  Double_t GetPhi() const {
63  return TMath::ATan(fTrackPar.GetTy() / fTrackPar.GetTx());
64  }
65  Int_t GetStationHitIndex(Int_t iSm) const {
66  for (Int_t i = 0; i < (Int_t) fTofHit.size(); i++)
67  if (fTofDet[i] == iSm) return fTofHit[i];
68  return -1;
69  }
70 
71  Int_t GetTofHitIndex(Int_t ind) const { return fTofHit[ind]; }
72  CbmTofHit* GetTofHitPointer(Int_t ind) { return &fhit[ind]; }
73  Int_t GetTofDetIndex(Int_t ind) const { return fTofDet[ind]; }
74 
75  const std::vector<Int_t>& GetTofHitInd() const { return fTofHit; }
76 
77  const Double_t*
78  GetPoint(Int_t n); // interface to event display: CbmEvDisTracks
79  const Double_t*
80  GetFitPoint(Int_t n); // interface to event display: CbmEvDisTracks
81 
83  Double_t GetTrackDx() const {
84  return TMath::Sqrt(fTrackPar.GetCovariance(0));
85  }
86 
88  Double_t GetTrackDy() const {
89  return TMath::Sqrt(fTrackPar.GetCovariance(5));
90  }
91 
93  Double_t GetTrackLength() const { return fTrackLength; }
94 
97 
99  Double_t GetTrackX() const { return fTrackPar.GetX(); }
100 
102  Double_t GetTrackY() const { return fTrackPar.GetY(); }
103 
105  Double_t GetTrackTx() const { return fTrackPar.GetTx(); }
106 
108  Double_t GetTrackTy() const { return fTrackPar.GetTy(); }
109 
111  Double_t GetDistance() const { return fDistance; }
112  Double_t GetTime() const { return fTime; }
113  Double_t UpdateTt();
114  Double_t UpdateT0();
115  Double_t GetTex(CbmTofHit* pHit);
116 
117  Int_t
118  GetFirstInd(Int_t iSmType); // return closest Hit to target except in iSmType
119  Double_t GetZ0x(); // return intercept with z-axis
120  Double_t GetZ0y(); // return intercept with z-axis
121  Double_t GetR0(); // return transverse distance at z=0
122  Double_t GetFitX(Double_t Z); // get x value of fit function at position z
123  Double_t GetFitY(Double_t Z); // get y value of fit function at position z
124  Double_t GetFitT(Double_t R); // get time of fit function at distance R
125  Double_t GetRefVel(UInt_t N); // get reference velocity from first N hits
126 
127  Double_t GetChiSq() const { return fChiSq; }
128  Int_t GetNDF() const { return fNDF; }
129 
130  const FairTrackParam* GetParamFirst() const { return &fParamFirst; }
131  const FairTrackParam* GetParamLast() const { return &fParamLast; }
132 
133  virtual void GetFairTrackParamLast();
134 
135  virtual Double_t GetMatChi2(Int_t iSm);
136 
138  inline void SetTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit* pHit) {
139  fTofHit.resize(1);
140  fTofHit[0] = tofHitIndex;
141  fTofDet.resize(1);
142  fTofDet[0] = iDet;
143  fhit.resize(1);
144  fhit[0] = CbmTofHit(*pHit);
145  fMatChi.resize(1);
146  }
147 
148  inline void SetTofHitIndex(Int_t tofHitIndex,
149  Int_t iDet,
150  CbmTofHit* pHit,
151  Double_t chi2) {
152  fTofHit.resize(1);
153  fTofHit[0] = tofHitIndex;
154  fTofDet.resize(1);
155  fTofDet[0] = iDet;
156  fhit.resize(1);
157  fhit[0] = CbmTofHit(*pHit);
158  fMatChi.resize(1);
159  fMatChi[0] = chi2;
160  }
161 
162  inline void SetTofHitInd(const std::vector<Int_t>& tofHitInd) {
163  fTofHit = tofHitInd;
164  }
165 
166 
167  inline void AddTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit* pHit) {
168  fTofHit.resize(fTofHit.size() + 1);
169  fTofHit[fTofHit.size() - 1] = tofHitIndex;
170  fTofDet.resize(fTofHit.size());
171  fTofDet[fTofHit.size() - 1] = iDet;
172  fhit.resize(fTofHit.size());
173  fhit[fTofHit.size() - 1] = CbmTofHit(*pHit);
174  fMatChi.resize(fTofHit.size());
175  }
176 
177  inline void AddTofHitIndex(Int_t tofHitIndex,
178  Int_t iDet,
179  CbmTofHit* pHit,
180  Double_t chi2) {
181  fTofHit.resize(fTofHit.size() + 1);
182  fTofHit[fTofHit.size() - 1] = tofHitIndex;
183  fTofDet.resize(fTofHit.size());
184  fTofDet[fTofHit.size() - 1] = iDet;
185  fhit.resize(fTofHit.size());
186  fhit[fTofHit.size() - 1] = CbmTofHit(*pHit);
187  fMatChi.resize(fTofHit.size());
188  fMatChi[fTofHit.size() - 1] = chi2;
189  }
190 
191  inline void ReplaceTofHitIndex(Int_t tofHitIndex,
192  Int_t iDet,
193  CbmTofHit* pHit,
194  Double_t chi2) {
195  for (Int_t iHit = 0; iHit < (Int_t) fTofHit.size(); iHit++) {
196  if (iDet == fTofDet[iHit]) {
197  fTofHit[iHit] = tofHitIndex;
198  fhit[iHit] = CbmTofHit(*pHit);
199  fMatChi[iHit] = chi2;
200  break;
201  }
202  }
203  }
204 
205  inline void RemoveTofHitIndex(Int_t /*tofHitIndex*/,
206  Int_t iDet,
207  CbmTofHit* /*pHit*/,
208  Double_t /*chi2*/) {
209  for (Int_t iHit = 0; iHit < (Int_t) fTofHit.size(); iHit++) {
210  if (iDet == fTofDet[iHit]) {
211  fTofHit.erase(fTofHit.begin() + iHit);
212  fhit.erase(fhit.begin() + iHit);
213  fMatChi.erase(fMatChi.begin() + iHit);
214  break;
215  }
216  }
217  }
218 
219  virtual Double_t GetXdif(Int_t iSmType, CbmTofHit* pHit);
220  virtual Double_t GetYdif(Int_t iSmType, CbmTofHit* pHit);
221  virtual Double_t GetTdif(Int_t iSmType, CbmTofHit* pHit);
222  virtual Double_t Dist3D(CbmTofHit* pHit0, CbmTofHit* pHit1);
223  virtual Bool_t ContainsAddr(Int_t iAddr);
224  virtual Int_t HitIndexOfAddr(Int_t iAddr);
225  virtual CbmTofHit* HitPointerOfAddr(Int_t iAddr);
226 
228  inline void SetTrackParameter(CbmTofTrackletParam* par) { fTrackPar = *par; }
229 
231  inline void SetTrackLength(Double_t trackLength) {
232  fTrackLength = trackLength;
233  }
234 
236  inline void SetPidHypo(Int_t pid) { fPidHypo = pid; }
237 
239  inline void SetDistance(Double_t distance) { fDistance = distance; }
240  inline void SetTime(Double_t val) { fTime = val; }
241  inline void SetTt(Double_t val) { fTt = val; }
242  inline void SetT0(Double_t val) { fT0 = val; }
243  inline void SetT0Err(Double_t val) { fT0Err = val; }
244  inline void SetTtErr(Double_t val) { fTtErr = val; }
245  inline void SetT0TtCov(Double_t val) { fT0TtCov = val; }
246 
247  inline void SetChiSq(Double_t chiSq) { fChiSq = chiSq; }
248  inline void SetNDF(Int_t ndf) { fNDF = ndf; }
249  inline void SetParamFirst(const FairTrackParam* par) { fParamFirst = *par; }
250  inline void SetParamLast(const FairTrackParam* par) { fParamLast = *par; }
251 
252  void SetParamLast(const CbmTofTrackletParam* par);
253  // void LoadParamLast();
254 
255  void Clear(Option_t* option = "");
258 private:
259  Double_t fTrackLength;
260  Int_t fPidHypo;
261  Double_t fDistance;
262  Double_t fTime;
263  Double_t fTt;
264  Double_t fT0;
265  Double_t fT0Err;
266  Double_t fTtErr;
267  Double_t fT0TtCov;
268  Double_t fChiSq;
269  Int_t fNDF;
271  FairTrackParam
273  FairTrackParam fParamLast;
274  std::vector<Int_t> fTofHit;
275  std::vector<Int_t> fTofDet;
276  std::vector<Double_t> fMatChi;
277  std::vector<CbmTofHit> fhit;
278  Double_t fP[4];
279 
284 };
285 
286 #endif /* CBMTOFTRACKLET_H */
CbmTofTracklet::SetDistance
void SetDistance(Double_t distance)
Definition: CbmTofTracklet.h:239
CbmTofTracklet::GetTrackY
Double_t GetTrackY() const
Definition: CbmTofTracklet.h:102
CbmTofTracklet::GetTrackParameter
CbmTofTrackletParam * GetTrackParameter()
Definition: CbmTofTracklet.h:96
CbmTofTracklet::CbmTofTracklet
CbmTofTracklet()
Definition: CbmTofTracklet.cxx:22
CbmTofTracklet::fP
Double_t fP[4]
vector of TofHit objects
Definition: CbmTofTracklet.h:278
CbmTofTracklet::GetTdif
virtual Double_t GetTdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:412
CbmTofTracklet::SetT0Err
void SetT0Err(Double_t val)
Definition: CbmTofTracklet.h:243
CbmTofTracklet::GetHitIndex
Int_t GetHitIndex(Int_t ind) const
Definition: CbmTofTracklet.h:51
CbmTofTracklet::PrintInfo
virtual void PrintInfo()
Definition: CbmTofTracklet.cxx:541
CbmTofTracklet::GetNofHits
Int_t GetNofHits() const
Definition: CbmTofTracklet.h:48
CbmTofTracklet::SetTofHitIndex
void SetTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit)
Definition: CbmTofTracklet.h:138
CbmTofTracklet::fTofDet
std::vector< Int_t > fTofDet
Index of TofHit.
Definition: CbmTofTracklet.h:275
CbmTofTracklet::fParamLast
FairTrackParam fParamLast
Track parameters at first and last fitted hit.
Definition: CbmTofTracklet.h:273
CbmTofTrackletParam::GetTy
Double_t GetTy() const
Definition: CbmTofTrackletParam.h:53
CbmTofTrackletParam::GetTx
Double_t GetTx() const
Definition: CbmTofTrackletParam.h:52
CbmTofTracklet::SetChiSq
void SetChiSq(Double_t chiSq)
Definition: CbmTofTracklet.h:247
CbmTofTracklet::GetStationHitIndex
Int_t GetStationHitIndex(Int_t iSm) const
Definition: CbmTofTracklet.h:65
CbmTofTracklet::fParamFirst
FairTrackParam fParamFirst
Track parameters at z of TofHit.
Definition: CbmTofTracklet.h:272
CbmTofTracklet::fChiSq
Double_t fChiSq
Covariance od fT0 and fTt.
Definition: CbmTofTracklet.h:268
CbmTofTracklet::GetZ0x
Double_t GetZ0x()
Definition: CbmTofTracklet.cxx:135
CbmTofTracklet::RemoveTofHitIndex
void RemoveTofHitIndex(Int_t, Int_t iDet, CbmTofHit *, Double_t)
Definition: CbmTofTracklet.h:205
CbmTofTracklet::GetTofHitIndex
Int_t GetTofHitIndex(Int_t ind) const
Definition: CbmTofTracklet.h:71
CbmTofTracklet
Provides information on attaching a TofHit to a TofTrack.
Definition: CbmTofTracklet.h:25
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTofHit.h
CbmTofTracklet::fTofHit
std::vector< Int_t > fTofHit
Definition: CbmTofTracklet.h:274
CbmTofTracklet::HitIndexOfAddr
virtual Int_t HitIndexOfAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:479
CbmTofTracklet::GetTrackX
Double_t GetTrackX() const
Definition: CbmTofTracklet.h:99
CbmTofTracklet::GetTrackTy
Double_t GetTrackTy() const
Definition: CbmTofTracklet.h:108
CbmTofTracklet::SetTrackLength
void SetTrackLength(Double_t trackLength)
Definition: CbmTofTracklet.h:231
CbmTofTrackletParam
Definition: CbmTofTrackletParam.h:27
CbmTofTracklet::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTofTracklet.h:130
CbmTofTracklet::GetTex
Double_t GetTex(CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:155
CbmTofTracklet::Dist3D
virtual Double_t Dist3D(CbmTofHit *pHit0, CbmTofHit *pHit1)
Definition: CbmTofTracklet.cxx:557
CbmTofTracklet::GetTrackDx
Double_t GetTrackDx() const
Definition: CbmTofTracklet.h:83
CbmTofTracklet::GetTrackTx
Double_t GetTrackTx() const
Definition: CbmTofTracklet.h:105
CbmTofTracklet::GetFairTrackParamLast
virtual void GetFairTrackParamLast()
Definition: CbmTofTracklet.cxx:104
CbmTofTracklet::SetT0
void SetT0(Double_t val)
Definition: CbmTofTracklet.h:242
CbmTofTracklet::GetTtErr
Double_t GetTtErr() const
Definition: CbmTofTracklet.h:56
CbmTofTrackletParam::GetX
Double_t GetX() const
Definition: CbmTofTrackletParam.h:48
CbmTofTracklet::GetMatChi2
virtual Double_t GetMatChi2(Int_t iSm)
Definition: CbmTofTracklet.cxx:116
CbmTofTracklet::SetTofHitInd
void SetTofHitInd(const std::vector< Int_t > &tofHitInd)
Definition: CbmTofTracklet.h:162
CbmTofTracklet::fTrackPar
CbmTofTrackletParam fTrackPar
Definition: CbmTofTracklet.h:270
CbmTofTracklet::GetTofHitInd
const std::vector< Int_t > & GetTofHitInd() const
Definition: CbmTofTracklet.h:75
CbmTofTracklet::GetR0
Double_t GetR0()
Definition: CbmTofTracklet.cxx:149
CbmTofTracklet::SetTrackParameter
void SetTrackParameter(CbmTofTrackletParam *par)
Definition: CbmTofTracklet.h:228
CbmTofTracklet::GetPhi
Double_t GetPhi() const
Definition: CbmTofTracklet.h:62
CbmTofTracklet::GetNDF
Int_t GetNDF() const
Definition: CbmTofTracklet.h:128
CbmTofTracklet::~CbmTofTracklet
virtual ~CbmTofTracklet()
Definition: CbmTofTracklet.cxx:64
CbmTofTracklet::fNDF
Int_t fNDF
Chi2 of fit.
Definition: CbmTofTracklet.h:269
CbmTofTracklet::ContainsAddr
virtual Bool_t ContainsAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:466
CbmTofTracklet::Clear
void Clear(Option_t *option="")
Definition: CbmTofTracklet.cxx:533
CbmTofTracklet::operator=
CbmTofTracklet & operator=(const CbmTofTracklet &)
transient (transfer) space point to Eve
CbmTofTracklet::SetTime
void SetTime(Double_t val)
Definition: CbmTofTracklet.h:240
CbmTofTracklet::fT0
Double_t fT0
slope dT/dr
Definition: CbmTofTracklet.h:264
CbmTofTracklet::fTime
Double_t fTime
Normalized distance from hit to track.
Definition: CbmTofTracklet.h:262
CbmTofTracklet::SetTt
void SetTt(Double_t val)
Definition: CbmTofTracklet.h:241
CbmTofTracklet::GetTt
Double_t GetTt() const
Definition: CbmTofTracklet.h:54
CbmTofTracklet::SetPidHypo
void SetPidHypo(Int_t pid)
Definition: CbmTofTracklet.h:236
CbmTofTracklet::GetT0
Double_t GetT0() const
Definition: CbmTofTracklet.h:53
CbmTofTracklet::ReplaceTofHitIndex
void ReplaceTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit, Double_t chi2)
Definition: CbmTofTracklet.h:191
CbmTofTracklet::ClassDef
ClassDef(CbmTofTracklet, 3)
CbmTofTracklet::GetRefVel
Double_t GetRefVel(UInt_t N)
Definition: CbmTofTracklet.cxx:565
CbmTofTracklet::SetTofHitIndex
void SetTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit, Double_t chi2)
Definition: CbmTofTracklet.h:148
CbmTofTracklet::SetParamLast
void SetParamLast(const FairTrackParam *par)
Definition: CbmTofTracklet.h:250
CbmTofTracklet::fTtErr
Double_t fTtErr
Error on Time at origin.
Definition: CbmTofTracklet.h:266
CbmTofTracklet::AddTofHitIndex
void AddTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit)
Definition: CbmTofTracklet.h:167
CbmTofTracklet::GetDistance
Double_t GetDistance() const
Definition: CbmTofTracklet.h:111
CbmTofTracklet::GetT0Err
Double_t GetT0Err() const
Definition: CbmTofTracklet.h:55
CbmTofTracklet::UpdateT0
Double_t UpdateT0()
Definition: CbmTofTracklet.cxx:186
CbmTofTracklet::fPidHypo
Int_t fPidHypo
Track length from primary vertex to TOF [cm].
Definition: CbmTofTracklet.h:260
CbmTofTracklet::GetTime
Double_t GetTime() const
Definition: CbmTofTracklet.h:112
CbmTofTracklet::GetTrackLength
Double_t GetTrackLength() const
Definition: CbmTofTracklet.h:93
CbmTofTracklet::fhit
std::vector< CbmTofHit > fhit
Matching Chi2 of TofHit.
Definition: CbmTofTracklet.h:277
CbmTofTracklet::GetFirstInd
Int_t GetFirstInd(Int_t iSmType)
Definition: CbmTofTracklet.cxx:126
CbmTofTracklet::HitPointerOfAddr
virtual CbmTofHit * HitPointerOfAddr(Int_t iAddr)
Definition: CbmTofTracklet.cxx:486
CbmTofTracklet::GetTheta
Double_t GetTheta() const
Definition: CbmTofTracklet.h:58
CbmTofTracklet::SetT0TtCov
void SetT0TtCov(Double_t val)
Definition: CbmTofTracklet.h:245
CbmTofTracklet::GetFitX
Double_t GetFitX(Double_t Z)
Definition: CbmTofTracklet.cxx:516
CbmTofTracklet::GetPoint
const Double_t * GetPoint(Int_t n)
Definition: CbmTofTracklet.cxx:494
CbmTofTracklet::SetParamFirst
void SetParamFirst(const FairTrackParam *par)
Definition: CbmTofTracklet.h:249
CbmTofTracklet::SetTtErr
void SetTtErr(Double_t val)
Definition: CbmTofTracklet.h:244
CbmTofTracklet::GetFitPoint
const Double_t * GetFitPoint(Int_t n)
Definition: CbmTofTracklet.cxx:504
CbmTofTrackletParam.h
CbmTofTracklet::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTofTracklet.h:131
CbmTofTracklet::GetFitY
Double_t GetFitY(Double_t Z)
Definition: CbmTofTracklet.cxx:520
CbmTofTracklet::fT0TtCov
Double_t fT0TtCov
Error on slope dT/dr.
Definition: CbmTofTracklet.h:267
CbmTofTracklet::fT0Err
Double_t fT0Err
Time at origin.
Definition: CbmTofTracklet.h:265
CbmTofTracklet::fTt
Double_t fTt
Reference time of reference hit.
Definition: CbmTofTracklet.h:263
CbmTofTracklet::GetChiSq
Double_t GetChiSq() const
Definition: CbmTofTracklet.h:127
CbmTofTracklet::UpdateTt
Double_t UpdateTt()
Definition: CbmTofTracklet.cxx:302
CbmTofTracklet::GetXdif
virtual Double_t GetXdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:327
CbmTofTracklet::AddTofHitIndex
void AddTofHitIndex(Int_t tofHitIndex, Int_t iDet, CbmTofHit *pHit, Double_t chi2)
Definition: CbmTofTracklet.h:177
CbmTofTrackletParam::GetCovariance
Double_t GetCovariance(int index) const
Definition: CbmTofTrackletParam.h:55
CbmTofTracklet::GetT0TtCov
Double_t GetT0TtCov() const
Definition: CbmTofTracklet.h:57
CbmTofTrackletParam::GetY
Double_t GetY() const
Definition: CbmTofTrackletParam.h:49
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofTracklet::GetTofDetIndex
Int_t GetTofDetIndex(Int_t ind) const
Definition: CbmTofTracklet.h:73
CbmTofTracklet::GetZ0y
Double_t GetZ0y()
Definition: CbmTofTracklet.cxx:142
CbmTofTracklet::fMatChi
std::vector< Double_t > fMatChi
DetLayer of TofHit.
Definition: CbmTofTracklet.h:276
CbmTofTracklet::GetTrackDy
Double_t GetTrackDy() const
Definition: CbmTofTracklet.h:88
CbmTofTracklet::fTrackLength
Double_t fTrackLength
Definition: CbmTofTracklet.h:259
CbmTofTracklet::GetFitT
Double_t GetFitT(Double_t R)
Definition: CbmTofTracklet.cxx:524
CbmTofTracklet::GetYdif
virtual Double_t GetYdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:370
CbmTofTracklet::GetTofHitPointer
CbmTofHit * GetTofHitPointer(Int_t ind)
Definition: CbmTofTracklet.h:72
CbmTofTracklet::SetNDF
void SetNDF(Int_t ndf)
Definition: CbmTofTracklet.h:248
CbmTofTracklet::GetPidHypo
Int_t GetPidHypo() const
Definition: CbmTofTracklet.h:45
CbmTofTracklet::fDistance
Double_t fDistance
PID hypothesis used for track extrapolation.
Definition: CbmTofTracklet.h:261