CbmRoot
CbmTofTracklet.cxx
Go to the documentation of this file.
1 
6 #include "CbmTofTracklet.h"
7 
8 #include "CbmTofHit.h" // for CbmTofHit
9 
10 #include <FairLogger.h> // for Logger, LOG
11 #include <FairTrackParam.h> // for FairTrackParam
12 
13 #include <TMath.h> // for Power, Sqrt
14 #include <TObject.h> // for TObject
15 #include <TString.h> // for Form
16 
17 #include <string> // for string
18 
19 
20 using std::vector;
21 
23  : TObject()
24  , fTrackLength(0.)
25  , fPidHypo(-1)
26  , fDistance(0.)
27  , fTime(0.)
28  , fTt(0.)
29  , fT0(0.)
30  , fT0Err(0.)
31  , fTtErr(0.)
32  , fT0TtCov(0.)
33  , fChiSq(0.)
34  , fNDF(0)
35  , fTrackPar()
36  , fParamFirst()
37  , fParamLast()
38  , fTofHit(0, -1)
39  , fTofDet()
40  , fMatChi()
41  , fhit() {}
42 
44  : TObject(t)
45  , fTrackLength(t.fTrackLength)
46  , fPidHypo(t.fPidHypo)
47  , fDistance(t.fDistance)
48  , fTime(t.fTime)
49  , fTt(t.fTt)
50  , fT0(t.fT0)
51  , fT0Err(t.fT0Err)
52  , fTtErr(t.fTtErr)
53  , fT0TtCov(t.fT0TtCov)
54  , fChiSq(t.fChiSq)
55  , fNDF(t.fNDF)
56  , fTrackPar(CbmTofTrackletParam(t.fTrackPar))
57  , fParamFirst(FairTrackParam(t.fParamFirst))
58  , fParamLast(FairTrackParam(t.fParamLast))
59  , fTofHit(t.fTofHit)
60  , fTofDet(t.fTofDet)
61  , fMatChi(t.fMatChi)
62  , fhit(t.fhit) {}
63 
65 
66 /*
67 CbmTofTracklet::CbmTofTracklet(const CbmTofTracklet &fSource) :
68  fTrackLength(0.),
69  fPidHypo(-1),
70  fDistance(0.),
71  fTime(0.),
72  fTt(0.),
73  fT0(0.),
74  fChiSq(0.),
75  fNDF(0),
76  fTrackPar(),
77  fParamFirst(),
78  fParamLast(),
79  fTofHit(0,-1),
80  fTofDet(),
81  fMatChi(),
82  fhit()
83 {
84 }
85 
86 CbmTofTracklet& CbmTofTracklet::operator=(const CbmTofTracklet &fSource){
87  // do something !
88  return *this;
89 }
90 */
91 
93  fParamLast.SetX(par->GetX());
94  fParamLast.SetY(par->GetY());
95  fParamLast.SetZ(par->GetZ());
96  fParamLast.SetTx(par->GetTx());
97  fParamLast.SetTy(par->GetTy());
98  fParamLast.SetQp(par->GetQp());
99  for (int i = 0, k = 0; i < 3; i++)
100  for (int j = 0; j <= i; j++, k++)
101  fParamLast.SetCovariance(i, j, par->GetCovariance(k));
102 }
103 
105  fTrackPar.SetX(fParamLast.GetX());
106  fTrackPar.SetY(fParamLast.GetY());
107  fTrackPar.SetZ(fParamLast.GetZ());
108  fTrackPar.SetTx(fParamLast.GetTx());
109  fTrackPar.SetTy(fParamLast.GetTy());
110  fTrackPar.SetQp(fParamLast.GetQp());
111  for (int i = 0, k = 0; i < 3; i++)
112  for (int j = 0; j <= i; j++, k++)
113  fTrackPar.SetCovariance(k, fParamLast.GetCovariance(i, j));
114 }
115 
116 Double_t CbmTofTracklet::GetMatChi2(Int_t iAddr) {
117  //LOG(debug1) << "array sizes: " << fTofHit.size() << ", " << fTofDet.size() << ", " << fMatChi.size();
118  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
119  //LOG(debug1) << Form(" -v- ind %d, tofhit %d, 0x%08x, chi %f ",iHit,fTofHit[iHit],fTofDet[iHit],fMatChi[iHit]);
120  //if(0==fTofDet[iHit]) LOG(fatal) << " CbmTofTracklet::GetMatChi2 Invalid Detector Type! ";
121  if (iAddr == fTofDet[iHit]) return fMatChi[iHit];
122  }
123  return -1.;
124 }
125 
126 Int_t CbmTofTracklet::GetFirstInd(Int_t iAddr) {
127  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
128  // LOG(info) << " GFI "<< iSm <<", "<<iHit<<", "<< fTofDet[iHit];
129  if (iAddr != fTofDet[iHit]) return fTofHit[iHit];
130  }
131  LOG(fatal) << " CbmTofTracklet::GetFirstInd, did only find " << iAddr;
132  return -1;
133 }
134 
136  Double_t dZ0 = 0.;
137  if (fTrackPar.GetTx() != 0.)
138  dZ0 = -fTrackPar.GetX() / fTrackPar.GetTx() + fTrackPar.GetZ();
139  return dZ0;
140 }
141 
143  Double_t dZ0 = 0.;
144  if (fTrackPar.GetTy() != 0.)
145  dZ0 = -fTrackPar.GetY() / fTrackPar.GetTy() + fTrackPar.GetZ();
146  return dZ0;
147 }
148 
150  Double_t dR0 =
151  TMath::Sqrt(TMath::Power(GetFitX(0.), 2) + TMath::Power(GetFitY(0.), 2));
152  return dR0;
153 }
154 
156  /*
157  Double_t dR2=0.;
158  dR2 += TMath::Power(fTrackPar.GetX()-pHit->GetX(),2);
159  dR2 += TMath::Power(fTrackPar.GetY()-pHit->GetY(),2);
160  dR2 += TMath::Power(fTrackPar.GetZ()-pHit->GetZ(),2);
161  Double_t dR = TMath::Sqrt(dR2);
162  */
163  /*
164  Double_t dR = pHit->GetR();
165  LOG(debug) <<Form(" CbmTofTracklet::GetTex T0 %7.1f dR %7.1f, Tt %7.4f => Tex %7.3f, ",
166  fT0,dR,fTt,fT0 + dR*fTt)
167  <<fTrackPar.ToString()
168  ;
169  return fT0 + dR*fTt;
170  */
171  Double_t dZ = pHit->GetZ();
172  Double_t dSign = 1.;
173  if (pHit->GetZ() < fhit[0].GetZ()) dSign = -1;
174  Double_t dTex = fhit[0].GetTime() + fTt * dSign * Dist3D(pHit, &fhit[0]);
175  LOG(debug) << Form(
176  "GetTex T0 %7.3f, Z %7.1f, DZ %5.1f, Sign %2.0f, Tt %7.4f => Tex %7.3f, ",
177  fhit[0].GetTime(),
178  dZ,
179  dZ - fhit[0].GetZ(),
180  dSign,
181  fTt,
182  dTex) << fTrackPar.ToString();
183  return dTex;
184 }
185 
186 Double_t CbmTofTracklet::UpdateT0() { //returns estimated time at R=0
187  // Double_t dT0=0.;
188  Int_t nValidHits = 0;
189  Int_t iHit1;
190  Double_t dDist1;
191 
192  Double_t aR[fTofHit.size()];
193  Double_t at[fTofHit.size()];
194  Double_t ae[fTofHit.size()];
195  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
196  if (fTofDet[iHit] >= 0) { // exclude faked hits
197  if (nValidHits == 0) {
198  iHit1 = iHit;
199  //dDist1=fhit[iHit1].GetR();
200  dDist1 = fhit[iHit1].GetZ()
201  * TMath::Sqrt(1. + fTrackPar.GetTx() * fTrackPar.GetTx()
202  + fTrackPar.GetTy() * fTrackPar.GetTy());
203  }
204  //aR[nValidHits]=fhit[iHit].GetR();
205  Double_t dSign = 1.;
206  if (fhit[iHit].GetZ() < fhit[iHit1].GetZ()) dSign = -1.;
207  aR[nValidHits] = dDist1 + dSign * Dist3D(&fhit[iHit], &fhit[iHit1]);
208  at[nValidHits] = fhit[iHit].GetTime();
209  ae[nValidHits] = 0.1; // const timing error, FIXME (?)
210  //ae[nValidHits]=fhit[iHit].GetTimeError();
211  nValidHits++;
212  }
213  }
214 
215  /*
216  //
217  // follow tutorial solveLinear.C to solve the linear equation t=t0+tt*R
218  //
219  TVectorD R; R.Use(nValidHits,aR);
220  TVectorD t; t.Use(nValidHits,at);
221  TVectorD e; e.Use(nValidHits,ae);
222 
223  const Int_t nrVar = 2;
224  TMatrixD A(nValidHits,nrVar);
225  TMatrixDColumn(A,0) = 1.0;
226  TMatrixDColumn(A,1) = R;
227 
228  // first bring the weights in place
229  TMatrixD Aw = A;
230  TVectorD yw = t;
231  for (Int_t irow = 0; irow < A.GetNrows(); irow++) {
232  TMatrixDRow(Aw,irow) *= 1/e(irow);
233  yw(irow) /= e(irow);
234  }
235 
236  TDecompSVD svd(Aw);
237  Bool_t ok;
238  const TVectorD c_svd = svd.Solve(yw,ok);
239 
240  // c_svd.Print();
241 
242  fT0=c_svd[0];
243  fTt=c_svd[1];
244  */
245 
246  //
247  // Using analyctical Solution of Chi2-Fit to solve the linear equation t=t0+tt*R
248  // Converted into Matrix Form, Matrices calcualted and only resulting formula are implemented
249  // J.Brandt
250  //
251  Double_t RRsum = 0; // Values will follow this procedure:
252  Double_t Rsum = 0; // $Rsum=\sum_{i}^{nValidHits}\frac{R_i}{e_i^2}$
253  Double_t tsum =
254  0; // where e_i will always be the error on the t measurement
255  Double_t esum =
256  0; // RR=R^2 in numerator, e denotes 1 in numerator , Rt= R*t in numerator
257  Double_t Rtsum = 0; //
258  Double_t sig_weight = 0; // ae^2
259  Double_t yoffset =
260  at[0] - 10; // T0 time offset to scale times to ns regime and not 10^10ns
261  for (Int_t i = 0; i < nValidHits; i++) {
262  at[i] -= yoffset; // substract offset
263  sig_weight = (ae[i] * ae[i]);
264  Rsum += (aR[i] / sig_weight);
265  tsum += (at[i] / sig_weight);
266  RRsum += (aR[i] * aR[i] / sig_weight);
267  Rtsum += (aR[i] * at[i] / sig_weight);
268  esum += (1 / sig_weight);
269  }
270  Double_t det_cov_mat =
271  esum * RRsum
272  - Rsum
273  * Rsum; // Determinant of inverted Covariance Matrix -> 1/det is common Faktor of Cavariance Matrix
274  fT0 = (RRsum * tsum - Rsum * Rtsum)
275  / det_cov_mat; // Best Guess for time at origin
276  fTt = (-Rsum * tsum + esum * Rtsum)
277  / det_cov_mat; // Best guess for inverted velocity
278  fT0Err = TMath::Sqrt(
279  RRsum / det_cov_mat); // sqrt of (0,0) in Covariance matrix -> error on fT0
280  fTtErr = TMath::Sqrt(
281  esum / det_cov_mat); // sqrt of (1,1) in Covariance Matrix -> error on fTt
282  fT0TtCov =
283  -Rsum / det_cov_mat; // (0,1)=(1,0) in Covariance Matrix -> cov(fT0,fTt)
284 
285  fT0 += yoffset; // Adding yoffset again
286 
287  //if (iHit0>-1) fhit[iHit0].SetTime(fT0);
288 
289  LOG(debug) << Form("Trkl size %u, validHits %d, Tt = %6.4f TtErr = %2.4f T0 "
290  "= %6.2f T0Err = %2.2f T0TtCov = %6.4f",
291  (UInt_t) fTofHit.size(),
292  nValidHits,
293  fTt,
294  fTtErr,
295  fT0,
296  fT0Err,
297  fT0TtCov);
298 
299  return fT0;
300 }
301 
303  Double_t dTt = 0.;
304  Int_t iNt = 0;
305  for (UInt_t iHL = 0; iHL < fhit.size() - 1; iHL++) {
306  //if( fTofDet[iHL]>0 ) // exclude faked hits
307  for (UInt_t iHH = iHL + 1; iHH < fhit.size(); iHH++) {
308  //if( fTofDet[iHH]>0) // exclude faked hits
309  {
310  dTt +=
311  (fhit[iHH].GetTime() - fhit[iHL].GetTime())
312  / (fhit[iHH].GetR()
313  - fhit[iHL]
314  .GetR()); // only valid for tracks from nominal vertex (0,0,0)
315  iNt++;
316  }
317  }
318  }
319  if (iNt == 0) {
320  LOG(WARNING) << "No valid hit pair ";
321  return fTt;
322  }
323  fTt = dTt / (Double_t) iNt;
324  return fTt;
325 }
326 
327 Double_t CbmTofTracklet::GetXdif(Int_t iDetId, CbmTofHit* pHit) {
328  Double_t dXref = 0.;
329  Int_t iNref = 0;
330  Double_t dTx = 0;
331 
332  if (1) {
333  for (UInt_t iHL = 0; iHL < fhit.size() - 1; iHL++) {
334  if (iDetId == fTofDet[iHL] || 0 == fTofDet[iHL])
335  continue; // exclude faked hits
336  for (UInt_t iHH = iHL + 1; iHH < fhit.size(); iHH++) {
337  if (iDetId == fTofDet[iHH] || 0 == fTofDet[iHH])
338  continue; // exclude faked hits
339  //dTt+=(fhit[iHH].GetTime()-fhit[iHL].GetTime())/(fhit[iHH].GetR()-fhit[iHL].GetR()); // for projective geometries only !!!
340  dTx += (fhit[iHH].GetX() - fhit[iHL].GetX())
341  / (fhit[iHH].GetZ() - fhit[iHL].GetZ());
342  iNref++;
343  }
344  }
345  dTx /= iNref;
346  } else {
347  dTx = fTrackPar.GetTx();
348  }
349 
350  iNref = 0;
351  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
352  if (iDetId == fTofDet[iHit] || 0 == fTofDet[iHit]) continue;
353 
354  Double_t dDZ = pHit->GetZ() - fhit[iHit].GetZ();
355  dXref += fhit[iHit].GetX() + dTx * dDZ;
356  iNref++;
357  }
358 
359  if (iNref == 0) {
360  LOG(error) << "DetId " << iDetId << ", Nref " << iNref << " sizes "
361  << fTofHit.size() << ", " << fhit.size();
362  return 1.E20;
363  }
364 
365  dXref /= iNref;
366 
367  return pHit->GetX() - dXref;
368 }
369 
370 Double_t CbmTofTracklet::GetYdif(Int_t iDetId, CbmTofHit* pHit) {
371  Double_t dYref = 0.;
372  Int_t iNref = 0;
373  Double_t dTy = 0;
374 
375  if (1) {
376  for (UInt_t iHL = 0; iHL < fhit.size() - 1; iHL++) {
377  if (iDetId == fTofDet[iHL] || 0 == fTofDet[iHL])
378  continue; // exclude faked hits
379  for (UInt_t iHH = iHL + 1; iHH < fhit.size(); iHH++) {
380  if (iDetId == fTofDet[iHH] || 0 == fTofDet[iHH])
381  continue; // exclude faked hits
382  dTy += (fhit[iHH].GetY() - fhit[iHL].GetY())
383  / (fhit[iHH].GetZ() - fhit[iHL].GetZ());
384  iNref++;
385  }
386  }
387  dTy /= iNref;
388  } else {
389  dTy = fTrackPar.GetTy();
390  }
391 
392  iNref = 0;
393  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
394  if (iDetId == fTofDet[iHit] || 0 == fTofDet[iHit]) continue;
395 
396  Double_t dDZ = pHit->GetZ() - fhit[iHit].GetZ();
397  dYref += fhit[iHit].GetY() + dTy * dDZ;
398  iNref++;
399  }
400 
401  if (iNref == 0) {
402  LOG(error) << "DetId " << iDetId << ", Nref " << iNref << " sizes "
403  << fTofHit.size() << ", " << fhit.size();
404  return 1.E20;
405  }
406 
407  dYref /= iNref;
408 
409  return pHit->GetY() - dYref;
410 }
411 
412 Double_t CbmTofTracklet::GetTdif(Int_t iDetId, CbmTofHit* pHit) {
413  Double_t dTref = 0.;
414  Double_t Nref = 0;
415  Double_t dTt = 0.;
416  Int_t iNt = 0;
417 
418  if (1) {
419  for (UInt_t iHL = 0; iHL < fhit.size() - 1; iHL++) {
420  if (iDetId == fTofDet[iHL] || 0 == fTofDet[iHL])
421  continue; // exclude faked hits
422  for (UInt_t iHH = iHL + 1; iHH < fhit.size(); iHH++) {
423  if (iDetId == fTofDet[iHH] || 0 == fTofDet[iHH])
424  continue; // exclude faked hits
425  //dTt+=(fhit[iHH].GetTime()-fhit[iHL].GetTime())/(fhit[iHH].GetR()-fhit[iHL].GetR()); // for projective geometries only !!!
426  Double_t dDist =
427  TMath::Sqrt(TMath::Power((fhit[iHH].GetX() - fhit[iHL].GetX()), 2)
428  + TMath::Power((fhit[iHH].GetY() - fhit[iHL].GetY()), 2)
429  + TMath::Power((fhit[iHH].GetZ() - fhit[iHL].GetZ()), 2));
430  Double_t dSign = 1.;
431  if (fhit[iHH].GetZ() < fhit[iHL].GetZ()) dSign = -1.;
432  dTt += (fhit[iHH].GetTime() - fhit[iHL].GetTime()) / dDist * dSign;
433  iNt++;
434  }
435  }
436 
437  if (iNt == 0) {
438  LOG(error) << "No valid hit pair ";
439  return 1.E20;
440  }
441  dTt /= (Double_t) iNt;
442  } else {
443  dTt = fTt;
444  }
445 
446  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
447  if (iDetId == fTofDet[iHit] || 0 == fTofDet[iHit]) continue;
448  //dTref += fhit[iHit].GetTime() - dTt*(fhit[iHit].GetR()-pHit->GetR());
449  Double_t dSign = 1.;
450  if (fhit[iHit].GetZ() < pHit->GetZ()) dSign = -1;
451  dTref += fhit[iHit].GetTime() - dTt * dSign * Dist3D(&fhit[iHit], pHit);
452  Nref++;
453  }
454  if (Nref == 0) {
455  LOG(error) << "DetId " << iDetId << ", Nref " << Nref << " sizes "
456  << fTofHit.size() << ", " << fhit.size();
457  return 1.E20;
458  }
459  dTref /= (Double_t) Nref;
460  Double_t dTdif = pHit->GetTime() - dTref;
461  // LOG(debug) << "iSt "<< iSt<<" DetId "<<iDetId<<", Nref "<<Nref<<" Tdif
462  // "<<dTdif;
463  return dTdif;
464 }
465 
466 Bool_t CbmTofTracklet::ContainsAddr(Int_t iAddr) {
467  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
468  Int_t iHaddr = fhit[iHit].GetAddress() & 0x003FFFFF;
469  /*
470  LOG(debug)<<Form(" Contain test hit %d for 0x%08x, 0x%08x = 0x%08x ?",
471  iHit,fhit[iHit].GetAddress(),iHaddr,iAddr)
472  ;
473  */
474  if (iHaddr == iAddr) return kTRUE;
475  }
476  return kFALSE;
477 }
478 
479 Int_t CbmTofTracklet::HitIndexOfAddr(Int_t iAddr) {
480  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
481  if ((fhit[iHit].GetAddress() & 0x003FFFFF) == iAddr) return iHit;
482  }
483  return -1;
484 }
485 
487  for (UInt_t iHit = 0; iHit < fTofHit.size(); iHit++) {
488  if ((fhit[iHit].GetAddress() & 0x003FFFFF) == iAddr) return &fhit[iHit];
489  }
490  return nullptr;
491 }
492 
493 const Double_t*
494 CbmTofTracklet::GetPoint(Int_t n) { // interface to event display: CbmTracks
495  fP[0] = fhit[n].GetX();
496  fP[1] = fhit[n].GetY();
497  fP[2] = fhit[n].GetZ();
498  fP[3] = fhit[n].GetTime();
499  // LOG(info) <<Form("CbmTofTracklet::GetPoint %d, %6.2f, %6.2f, %6.2f, %6.2f ",n,fP[0],fP[1],fP[2],fP[3]);
500  return fP;
501 }
502 
503 const Double_t*
504 CbmTofTracklet::GetFitPoint(Int_t n) { // interface to event display: CbmTracks
505  fP[0] = GetFitX(fhit[n].GetZ());
506  fP[1] = GetFitY(fhit[n].GetZ());
507  fP[2] = fhit[n].GetZ();
508  fP[3] = fhit[n].GetTime();
509  /*
510  LOG(info) <<Form("CbmTofTracklet::GetFitPoint %d, %6.2f - %6.2f, %6.2f - %6.2f, %6.2f, %6.2f ",
511  n,fP[0],fhit[n]->GetX(),fP[1],fhit[n]->GetY(),fP[2],fP[3]);
512  */
513  return fP;
514 }
515 
516 Double_t CbmTofTracklet::GetFitX(Double_t dZ) {
517  return fTrackPar.GetX() + fTrackPar.GetTx() * (dZ - fTrackPar.GetZ());
518 }
519 
520 Double_t CbmTofTracklet::GetFitY(Double_t dZ) {
521  return fTrackPar.GetY() + fTrackPar.GetTy() * (dZ - fTrackPar.GetZ());
522 }
523 
524 Double_t CbmTofTracklet::GetFitT(Double_t dZ) {
525  // return fT0 + dR*fTt;
526  //return fT0 + fTt*dZ*TMath::Sqrt(fTrackPar.GetTx()*fTrackPar.GetTx()+fTrackPar.GetTy()*fTrackPar.GetTy());
527  return fT0
528  + fTt * (dZ - fTrackPar.GetZ())
529  * TMath::Sqrt(1. + fTrackPar.GetTx() * fTrackPar.GetTx()
530  + fTrackPar.GetTy() * fTrackPar.GetTy());
531 }
532 
533 void CbmTofTracklet::Clear(Option_t* /*option*/) {
534  // LOG(debug) << "Clear TofTracklet with option "<<*option;
535  fTofHit.clear();
536  fTofDet.clear();
537  fMatChi.clear();
538  fhit.clear();
539 }
540 
542  LOG(info) << Form(
543  "TrklInfo: Nhits %d, Tt %6.3f, stations: ", GetNofHits(), GetTt());
544  LOG(info);
545  for (Int_t iH = 0; iH < GetNofHits(); iH++) {
546  LOG(info) << Form(
547  " Hit %2d: Ind %5d, det 0x%08x, addr 0x%08x, chi %6.3f, ae[]= %6.4f",
548  iH,
549  fTofHit[iH],
550  fTofDet[iH],
551  fhit[iH].GetAddress(),
552  fMatChi[iH],
553  fhit[iH].GetTimeError());
554  }
555 }
556 
557 Double_t CbmTofTracklet::Dist3D(CbmTofHit* pHit0, CbmTofHit* pHit1) {
558  Double_t dDist =
559  TMath::Sqrt(TMath::Power((pHit0->GetX() - pHit1->GetX()), 2)
560  + TMath::Power((pHit0->GetY() - pHit1->GetY()), 2)
561  + TMath::Power((pHit0->GetZ() - pHit1->GetZ()), 2));
562  return dDist;
563 }
564 
565 Double_t CbmTofTracklet::GetRefVel(UInt_t iNhit) {
566  Double_t dVel = 0.;
567  Double_t dTt = 0.;
568  Int_t iNt = 0;
569  if (fhit.size() >= iNhit) {
570  for (UInt_t iHL = 0; iHL < iNhit - 1; iHL++) {
571  for (UInt_t iHH = iHL + 1; iHH < iNhit; iHH++) {
572  dTt += (fhit[iHH].GetTime() - fhit[iHL].GetTime())
573  / (fhit[iHH].GetR() - fhit[iHL].GetR());
574  iNt++;
575  }
576  }
577  }
578  if (iNt == 0) {
579  LOG(debug) << " CbmTofTracklet::GetRefVel: No valid hit pair ";
580  } else {
581  dVel = (Double_t) iNt / dTt;
582  }
583  return dVel;
584 }
585 
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmTofTrackletParam::SetQp
void SetQp(Double_t qp)
Definition: CbmTofTrackletParam.h:65
CbmTofTracklet::CbmTofTracklet
CbmTofTracklet()
Definition: CbmTofTracklet.cxx:22
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
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::PrintInfo
virtual void PrintInfo()
Definition: CbmTofTracklet.cxx:541
CbmStsAddress::GetAddress
Int_t GetAddress(UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion)
Construct address.
Definition: CbmStsAddress.cxx:90
CbmTofTracklet::GetNofHits
Int_t GetNofHits() const
Definition: CbmTofTracklet.h:48
CbmTofTrackletParam::SetTy
void SetTy(Double_t ty)
Definition: CbmTofTrackletParam.h:64
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
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTofTrackletParam::GetTx
Double_t GetTx() const
Definition: CbmTofTrackletParam.h:52
CbmTofTracklet::GetZ0x
Double_t GetZ0x()
Definition: CbmTofTracklet.cxx:135
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
CbmTofTrackletParam
Definition: CbmTofTrackletParam.h:27
CbmTofTrackletParam::SetCovariance
void SetCovariance(int index, Double_t cov)
Definition: CbmTofTrackletParam.h:69
CbmTofTrackletParam::SetY
void SetY(Double_t y)
Definition: CbmTofTrackletParam.h:60
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
CbmTofTrackletParam::ToString
std::string ToString() const
Return string representation of class.
Definition: CbmTofTrackletParam.h:118
CbmTofTracklet.h
CbmTofTracklet::GetFairTrackParamLast
virtual void GetFairTrackParamLast()
Definition: CbmTofTracklet.cxx:104
CbmTofTrackletParam::GetX
Double_t GetX() const
Definition: CbmTofTrackletParam.h:48
CbmTofTracklet::GetMatChi2
virtual Double_t GetMatChi2(Int_t iSm)
Definition: CbmTofTracklet.cxx:116
CbmTofTracklet::fTrackPar
CbmTofTrackletParam fTrackPar
Definition: CbmTofTracklet.h:270
CbmTofTracklet::GetR0
Double_t GetR0()
Definition: CbmTofTracklet.cxx:149
CbmTofTracklet::~CbmTofTracklet
virtual ~CbmTofTracklet()
Definition: CbmTofTracklet.cxx:64
CbmTofTrackletParam::SetTx
void SetTx(Double_t tx)
Definition: CbmTofTrackletParam.h:63
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::fT0
Double_t fT0
slope dT/dr
Definition: CbmTofTracklet.h:264
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmTofTracklet::GetTt
Double_t GetTt() const
Definition: CbmTofTracklet.h:54
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmTofTrackletParam::GetZ
Double_t GetZ() const
Definition: CbmTofTrackletParam.h:50
CbmTofTracklet::GetRefVel
Double_t GetRefVel(UInt_t N)
Definition: CbmTofTracklet.cxx:565
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
CbmTofTrackletParam::GetQp
Double_t GetQp() const
Definition: CbmTofTrackletParam.h:54
CbmTofTracklet::UpdateT0
Double_t UpdateT0()
Definition: CbmTofTracklet.cxx:186
CbmTofTracklet::GetTime
Double_t GetTime() const
Definition: CbmTofTracklet.h:112
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
CbmTofTrackletParam::SetX
void SetX(Double_t x)
Definition: CbmTofTrackletParam.h:59
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::GetFitPoint
const Double_t * GetFitPoint(Int_t n)
Definition: CbmTofTracklet.cxx:504
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::UpdateTt
Double_t UpdateTt()
Definition: CbmTofTracklet.cxx:302
CbmTofTracklet::GetXdif
virtual Double_t GetXdif(Int_t iSmType, CbmTofHit *pHit)
Definition: CbmTofTracklet.cxx:327
CbmTofTrackletParam::GetCovariance
Double_t GetCovariance(int index) const
Definition: CbmTofTrackletParam.h:55
CbmTofTrackletParam::GetY
Double_t GetY() const
Definition: CbmTofTrackletParam.h:49
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofTrackletParam::SetZ
void SetZ(Double_t z)
Definition: CbmTofTrackletParam.h:61
CbmTofTracklet::GetZ0y
Double_t GetZ0y()
Definition: CbmTofTracklet.cxx:142
CbmTofTracklet::fMatChi
std::vector< Double_t > fMatChi
DetLayer of TofHit.
Definition: CbmTofTracklet.h:276
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