CbmRoot
CbmStsFitPerformanceTask.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmStsFitPerformanceTask source file -----
3 // ----- Created 02/02/05 by E. Kryshen -----
4 // -------------------------------------------------------------------------
5 
7 
8 #include "CbmKF.h"
9 #include "CbmKFMath.h"
11 #include "CbmKFTrack.h"
12 #include "CbmKFTrackInterface.h"
13 #include "CbmKFVertex.h"
14 #include "CbmKFVertexInterface.h"
15 #include "CbmPVFinderKF.h"
17 #include "CbmStsKFTrackFitter.h"
18 
19 #include "CbmMCTrack.h"
20 #include "CbmMvdHit.h"
21 #include "CbmStsAddress.h"
22 #include "CbmStsHit.h"
23 #include "CbmStsSetup.h"
24 #include "CbmStsTrack.h"
25 #include "CbmTrackMatch.h"
26 #include "CbmVertex.h"
27 #include "FairMCApplication.h"
28 #include "FairRootManager.h"
29 
30 #include "TDatabasePDG.h"
31 #include "TF1.h"
32 #include "TParticlePDG.h"
33 #include "TVector3.h"
34 
35 
36 #include <cmath>
37 #include <iomanip>
38 #include <iostream>
39 
40 using std::cout;
41 using std::endl;
42 using std::fabs;
43 using std::vector;
44 
45 // -------------------------------------------------------------------------
46 
47 void writedir2current(TObject* obj) {
48  if (!obj->IsFolder())
49  obj->Write();
50  else {
51  TDirectory* cur = gDirectory;
52  TDirectory* sub = cur->mkdir(obj->GetName());
53  sub->cd();
54  TList* listSub = ((TDirectory*) obj)->GetList();
55  TIter it(listSub);
56  while (TObject* obj1 = it())
57  writedir2current(obj1);
58  cur->cd();
59  }
60 }
61 
63  const char* name,
64  const char* title) {
65  struct {
66  const char* name;
67  const char* title;
68  Int_t n;
69  Double_t l, r;
70  } Table[10] = {
71  {"x", "Residual X [#mum]", 100, -100., 100.},
72  {"y", "Residual Y [#mum]", 100, -100., 100.},
73  {"tx", "Residual Tx [mrad]", 100, -2., 2.},
74  {"ty", "Residual Ty [mrad]", 100, -2., 2.},
75  {"P", "Resolution P/Q [100%]", 100, -.1, .1},
76  {"px", "Pull X [residual/estimated_error]", 100, -10., 10.},
77  {"py", "Pull Y [residual/estimated_error]", 100, -10., 10.},
78  {"ptx", "Pull Tx [residual/estimated_error]", 100, -10., 10.},
79  {"pty", "Pull Ty [residual/estimated_error]", 100, -10., 10.},
80  {"pQP", "Pull Q/P [residual/estimated_error]", 100, -10., 10.}};
81 
82  for (int i = 0; i < 10; i++) {
83  char n[225], t[255];
84  sprintf(n, "%s_%s", name, Table[i].name);
85  sprintf(t, "%s %s", title, Table[i].title);
86  hist[i] = new TH1D(n, t, Table[i].n, Table[i].l, Table[i].r);
87  }
88 }
89 
91  const char* name,
92  const char* title) {
93  struct {
94  const char* name;
95  const char* title;
96  Int_t n;
97  Double_t l, r;
98  } Table[9] = {
99  {"x", "Residual X [#mum]", 100, -5., 5.},
100  {"y", "Residual Y [#mum]", 100, -5., 5.},
101  {"z", "Residual Z [#mum]", 100, -40., 40.},
102  {"px", "Pull X [residual/estimated_error]", 100, -10., 10.},
103  {"py", "Pull Y [residual/estimated_error]", 100, -10., 10.},
104  {"pz", "Pull Z [residual/estimated_error]", 100, -10., 10.},
105  {"chi2", "Chi2/NDF", 100, 0., 10.},
106  {"prob", "Prob(Chi2,NDF)", 100, 0., 1.},
107  {"ntracks", "N tracks", 100, 0., 1000.},
108  };
109 
110  for (int i = 0; i < 9; i++) {
111  char n[225], t[255];
112  sprintf(n, "%s_%s", name, Table[i].name);
113  sprintf(t, "%s %s", title, Table[i].title);
114  hist[i] = new TH1D(n, t, Table[i].n, Table[i].l, Table[i].r);
115  }
116 }
117 
119  const char* name,
120  const char* title) {
121  struct {
122  const char* name;
123  const char* title;
124  Int_t n;
125  Double_t l, r;
126  } Table[14] = {
127  {"x", "Residual X [#mum]", 100, -100., 100.},
128  {"y", "Residual Y [#mum]", 100, -100., 100.},
129  {"z", "Residual Z [#mum]", 100, -500., 500.},
130  {"px", "Pull X [residual/estimated_error]", 100, -10., 10.},
131  {"py", "Pull Y [residual/estimated_error]", 100, -10., 10.},
132  {"pz", "Pull Z [residual/estimated_error]", 100, -10., 10.},
133  {"chi2", "Chi2/NDF", 100, 0., 10.},
134  {"prob", "Prob(Chi2,NDF)", 100, 0., 1.},
135  {"mass", "Residual Mass", 100, -.1, .1},
136  {"pmass", "Pull Mass [residual/estimated_error]", 100, -10., 10.},
137  {"KaonP", "Kaon P resolution", 100, -.05, .05},
138  {"PionP", "Pion P resolution", 100, -.05, .05},
139  {"KaonP0", "Kaon P resolution before fit", 100, -.05, .05},
140  {"PionP0", "Pion P resolutionbefore fit", 100, -.05, .05}};
141 
142  for (int i = 0; i < 14; i++) {
143  char n[225], t[255];
144  sprintf(n, "%s_%s", name, Table[i].name);
145  sprintf(t, "%s %s", title, Table[i].title);
146  hist[i] = new TH1D(n, t, Table[i].n, Table[i].l, Table[i].r);
147  }
148 }
149 
150 
151 // ----- Standard constructor ------------------------------------------
153  Int_t iVerbose)
154  : FairTask(name, iVerbose)
155  , fEvent(0)
156  , fVertexAnalysis(0)
157  , fD0Analysis(0)
158  , fTrackAnalysis(1)
159  ,
160 
161  fMCTrackArray(0)
162  ,
163  fStsPointArray(0)
164  ,
165  fMvdPointArray(0)
166  ,
167  fRecStsTrackArray(0)
168  ,
169  fStsHitArray(0)
170  ,
171  fMvdHitArray(0)
172  ,
173  fPrimaryVertex(0)
174  ,
175  fSTSTrackMatch(0)
176  ,
177 
178  fhChi2(0)
179  , // x=chi2(), y=entries for all
180  fhProb(0)
181  , // x=Prob function(), y=entries for all
182  fhDP(0)
183  , fhDP2(0)
184  , fhDsP(0)
185  , fhDsP2(0)
186  ,
187 
188  fhZMCf(0)
189  , fhZMCl(0)
190  , // z first/last of MC track
191  fhZRecof(0)
192  , fhZRecol(0)
193  , // z first/last of Reco track
194 
195  fhRes_vs_Mom_f(0)
196  , fhRes_vs_Mom_l(0)
197  , // resolution vs momentum
198  fhExtraTracks2ndMVD(0)
199  , // extra tracks not detected in the second mvd chamber
200 
201  // TH1D* fhFrst[10](),
202  // TH1D* fhMid[10](),
203  // TH1D* fhLast[10](),
204  // TH1D* fhImp[10](),
205  // TH1D* fhImpPi[10](),
206  // TH1D* fhVfit[10](),
207  // TH1D* fhVtx[9](),
208  // TH1D* fhV[13][9](),
209  fhPq()
210  ,
211  // fhD0[4][14](),
212 
213  // fhHitDensity[10](),
214  // fhTrackDensity[8](),
215  fhTrackDensity0L(0)
216  ,
217 
218  histodir(0)
219  , fFitter() {}
220 // -------------------------------------------------------------------------
221 
222 
223 // ----- Destructor ----------------------------------------------------
225 
226 // ----- Init CbmStsFitPerformanceTask task -------------------------------
228  fEvent = 0;
229 
230  TDirectory* curdir = gDirectory;
231  histodir = gDirectory->mkdir("StsFitPerformance");
232  histodir->cd();
233 
234  gDirectory->mkdir("TrackFit");
235  gDirectory->cd("TrackFit");
236  {
237  fhChi2 = new TH1D("hChi2", "hChi2", 100, 0, 10);
238  fhProb = new TH1D("hProb", "hProb", 100, 0, 1.0);
239 
240  fhDP = new TH1D("hDP", "hDP", 1000, -.005, .005);
241  fhDP2 = new TH2D("hDP2", "hDP2", 100, 0., 5.0, 1000, -.005, .005);
242 
243  fhDsP = new TH1D("hDsP", "hDsP", 100, -1, 1);
244  fhDsP2 = new TH2D("hDsP2", "hDsP2", 100, 0., 5.0, 100, -1, 1);
245 
246  fhZMCf = new TH1D("hZMCf", "h Z MC first", 102, -1.0, 101.0);
247  fhZRecof = new TH1D("hZRecof", "h Z Reco first", 102, -1.0, 101.0);
248  fhZMCl = new TH1D("hZMCl", "h Z MC last", 102, -1.0, 101.0);
249  fhZRecol = new TH1D("hZRecol", "h Z Reco last", 102, -1.0, 101.0);
250 
251  fhRes_vs_Mom_f = new TH2D("hRes_vs_Mom_f",
252  "TX Resolusion vs Momentum (first hit)",
253  100,
254  0.0,
255  5.0,
256  100,
257  -50.0,
258  50.0);
259  fhRes_vs_Mom_l = new TH2D("hRes_vs_Mom_l",
260  "TX Resolusion vs Momentum (last hit)",
261  100,
262  0.0,
263  5.0,
264  100,
265  -10.0,
266  10.0);
267 
268  fhExtraTracks2ndMVD = new TH2D("hExtraTracks2ndMVD",
269  "ExtraTracks in the 2nd MVD",
270  200,
271  -10.0,
272  10.0,
273  200,
274  -10.0,
275  10.0);
276 
277  gDirectory->mkdir("AtFirstHit");
278  gDirectory->cd("AtFirstHit");
279  CreateTrackHisto(fhFrst, "fst", "at first STS Hit");
280  gDirectory->cd("..");
281  gDirectory->mkdir("AtLastHit");
282  gDirectory->cd("AtLastHit");
283  CreateTrackHisto(fhLast, "lst", "at last STS Hit");
284  gDirectory->cd("..");
285  gDirectory->mkdir("AtImpactPoint");
286  gDirectory->cd("AtImpactPoint");
287  CreateTrackHisto(fhImp, "imp", "at impact point");
288  gDirectory->cd("..");
289  gDirectory->mkdir("AtImpactPointPion");
290  gDirectory->cd("AtImpactPointPion");
291  CreateTrackHisto(fhImpPi, "impPi", "at impact point");
292  gDirectory->cd("..");
293  gDirectory->mkdir("InTheMiddle");
294  gDirectory->cd("InTheMiddle");
295  CreateTrackHisto(fhMid, "mid", "at 4th station");
296  gDirectory->cd("..");
297  gDirectory->mkdir("FittedToVertex");
298  gDirectory->cd("FittedToVertex");
299  CreateTrackHisto(fhVfit, "vfit", "for vertex fitted track");
300  gDirectory->cd("..");
301 
302  gDirectory->mkdir("PSlidesOnP");
303  gDirectory->cd("PSlidesOnP");
304  fhPq = new TH2D(
305  "Pq", "Resolution P/Q at impact point vs P", 100, 0, 10, 100, -.1, .1);
306  gDirectory->cd("..");
307  }
308  gDirectory->cd("..");
309 
310  for (int i = 0; i < 10; i++) {
311  char n[225], t[255];
312  sprintf(n, "hHitDens%i", i);
313  sprintf(t, "Hit Density, Sts station %i", i);
314  fhHitDensity[i] = new TH1D(n, t, 300, 0, 300);
315  }
316  fhTrackDensity[0] =
317  new TH1D("hTrackDensity0", "Track Density 0cm", 300, 0, 300);
319  new TH1D("hTrackDensity0L", "Track Density Line 0cm", 300, 0, 300);
320  fhTrackDensity[1] =
321  new TH1D("hTrackDensity1", "Track Density 1cm", 300, 0, 300);
322  fhTrackDensity[2] =
323  new TH1D("hTrackDensity2", "Track Density 2cm", 300, 0, 300);
324  fhTrackDensity[3] =
325  new TH1D("hTrackDensity3", "Track Density 3cm", 300, 0, 300);
326  fhTrackDensity[4] =
327  new TH1D("hTrackDensity4", "Track Density 4cm", 300, 0, 300);
328  fhTrackDensity[5] =
329  new TH1D("hTrackDensity5", "Track Density 5cm", 300, 0, 300);
330  fhTrackDensity[6] =
331  new TH1D("hTrackDensity10", "Track Density 10cm", 300, 0, 300);
332  fhTrackDensity[7] =
333  new TH1D("hTrackDensity100", "Track Density 1m", 300, 0, 300);
334 
335  gDirectory->mkdir("VertexFit");
336  gDirectory->cd("VertexFit");
337  {
338  CreateVertexHisto(fhVtx, "vtx", "for Primary Vertex");
339  gDirectory->mkdir("VertexOnNTracks");
340  gDirectory->cd("VertexOnNTracks");
341  for (int i = 0; i < 13; i++) {
342  char name[225], namedir[225], title[225];
343  if (i == 0) {
344  sprintf(namedir, "AllTracks");
345  sprintf(name, "Vall");
346  sprintf(title, "for Primary Vertex on all tracks");
347  } else {
348  sprintf(namedir, "%iTracks", i * 50);
349  sprintf(name, "V%i", i * 50);
350  sprintf(title, "for Primary Vertex on %i tracks", i * 50);
351  }
352  gDirectory->mkdir(namedir);
353  gDirectory->cd(namedir);
354  CreateVertexHisto(fhV[i], name, title);
355  gDirectory->cd("..");
356  }
357  gDirectory->cd("..");
358  }
359  gDirectory->cd("..");
360 
361  gDirectory->mkdir("D0Fit");
362  gDirectory->cd("D0Fit");
363  {
364  gDirectory->mkdir("No constraints");
365  gDirectory->cd("No constraints");
366  CreateD0Histo(fhD0[0], "D0", "for D0 Sec. Vertex");
367  gDirectory->cd("..");
368  gDirectory->mkdir("Topological constraint");
369  gDirectory->cd("Topological constraint");
370  CreateD0Histo(fhD0[1], "D0T", "for D0 Topo Sec. Vertex");
371  gDirectory->cd("..");
372  gDirectory->mkdir("Mass constraint");
373  gDirectory->cd("Mass constraint");
374  CreateD0Histo(fhD0[2], "D0M", "for D0 Mass Sec. Vertex");
375  gDirectory->cd("..");
376  gDirectory->mkdir("Mass+Topological constraint");
377  gDirectory->cd("Mass+Topological constraint");
378  CreateD0Histo(fhD0[3], "D0TM", "for D0 Topo+Mass Sec. Vertex");
379  gDirectory->cd("..");
380  }
381  gDirectory->cd("..");
382 
383  curdir->cd();
384  return ReInit();
385 }
386 
387 // ----- ReInit CbmStsFitPerformanceTask task -------------------------------
389 
390  FairRootManager* fManger = FairRootManager::Instance();
391  fMCTrackArray =
392  reinterpret_cast<TClonesArray*>(fManger->GetObject("MCTrack"));
394  reinterpret_cast<TClonesArray*>(fManger->GetObject("StsPoint"));
396  reinterpret_cast<TClonesArray*>(fManger->GetObject("MvdPoint"));
398  reinterpret_cast<TClonesArray*>(fManger->GetObject("StsTrack"));
399  fStsHitArray = reinterpret_cast<TClonesArray*>(fManger->GetObject("StsHit"));
400  fMvdHitArray = reinterpret_cast<TClonesArray*>(fManger->GetObject("MvdHit"));
401 
402  // Get pointer to PrimaryVertex object from IOManager if it exists
403  // The old name for the object is "PrimaryVertex" the new one
404  // "PrimaryVertex." Check first for the new name
406  dynamic_cast<CbmVertex*>(fManger->GetObject("PrimaryVertex."));
407  if (nullptr == fPrimaryVertex) {
409  dynamic_cast<CbmVertex*>(fManger->GetObject("PrimaryVertex"));
410  }
411  if (nullptr == fPrimaryVertex) {
412  cout << "-W- CbmStsFitPerformanceTask::ReInit : "
413  << "no Primary Vertex!" << endl;
414  }
415 
417  reinterpret_cast<TClonesArray*>(fManger->GetObject("StsTrackMatch"));
418  fFitter.Init();
419 
420  return kSUCCESS;
421 }
422 // -------------------------------------------------------------------------
423 
424 
425 // ----- Exec CbmStsFitPerformanceTask task -------------------------------
426 void CbmStsFitPerformanceTask::Exec(Option_t* /*option*/) {
427  cout << "Event: " << ++fEvent << " ";
428 
429  Int_t nTracks = fRecStsTrackArray->GetEntriesFast();
430  cout << " nTracks: " << nTracks << endl;
431 
432  if (!fSTSTrackMatch) return;
433 
434  Double_t mc[6];
435 
436  Int_t Quality[nTracks];
437 
438  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
439  Quality[iTrack] = 0;
440  CbmStsTrack* track = (CbmStsTrack*) fRecStsTrackArray->At(iTrack);
441  if (!track) continue;
442  CbmTrackMatch* m = (CbmTrackMatch*) fSTSTrackMatch->At(iTrack);
443  if (!m) continue;
444  if (m->GetNofTrueHits() < 0.7
445  * (m->GetNofTrueHits() + m->GetNofWrongHits()
446  + m->GetNofFakeHits()))
447  continue;
448  Int_t mcTrackID = m->GetMCTrackId();
449  if (mcTrackID < 0) continue;
450  if (!IsLong(track)) continue;
451 
452  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTrackArray->At(mcTrackID);
453  if (!mcTrack) continue;
454  if (fabs((mcTrack->GetStartZ())) > 1.) continue;
455 
456  if (mcTrack->GetMotherId() != -1) continue;
457  Quality[iTrack] = 1;
458  }
459 
460  if (0) {
461  // CbmKF &KF = *CbmKF::Instance();
462  int nStsHits = fStsHitArray->GetEntries();
463  int nMvdHits = fMvdHitArray->GetEntries();
464  cout << "Mvd hit density..." << endl;
465  for (int ih = 0; ih < nMvdHits; ih++) {
466  if (ih % 100 == 0) cout << ih << endl;
467  CbmMvdHit* h1 = (CbmMvdHit*) fMvdHitArray->At(ih);
468  if (!h1) continue;
469  double V[3] = {
470  2 * h1->GetDx() * h1->GetDx(), 2 * 0, 2 * h1->GetDy() * h1->GetDy()};
471  Double_t v = 1. / (V[0] * V[2] - V[1] * V[1]);
472  V[0] *= v;
473  V[1] *= v;
474  V[2] *= v;
475  double D2 = 1.e10;
476  for (int jh = 0; jh < nMvdHits; jh++) {
477  if (ih == jh) continue;
478  CbmMvdHit* h2 = (CbmMvdHit*) fMvdHitArray->At(jh);
479  if (!h2) continue;
480  if (h1->GetStationNr() != h2->GetStationNr()) continue;
481  Double_t dx = h1->GetX() - h2->GetX();
482  Double_t dy = h1->GetY() - h2->GetY();
483  Double_t d2 =
484  fabs(dx * dx * V[0] - 2 * dx * dy * V[1] + dy * dy * V[2]);
485  if (d2 < D2) D2 = d2;
486  }
487  fhHitDensity[h1->GetStationNr() - 1]->Fill(sqrt(D2 / 2.));
488  }
489  cout << "Sts hit density..." << endl;
490  for (int ih = 0; ih < nStsHits; ih++) {
491  if (ih % 1000 == 0) cout << ih << endl;
492  CbmStsHit* h1 = (CbmStsHit*) fStsHitArray->At(ih);
493  if (!h1) continue;
494  double V[3] = {2 * h1->GetDx() * h1->GetDx(),
495  2 * h1->GetDxy(),
496  2 * h1->GetDy() * h1->GetDy()};
497  Double_t v = 1. / (V[0] * V[2] - V[1] * V[1]);
498  V[0] *= v;
499  V[1] *= v;
500  V[2] *= v;
501  double D2 = 1.e10;
502  for (int jh = 0; jh < nStsHits; jh++) {
503  if (ih == jh) continue;
504  CbmStsHit* h2 = (CbmStsHit*) fStsHitArray->At(jh);
505  if (!h2) continue;
508  continue;
509  // if( h1->GetBackDigiId()>=0 ){
510  // if( h1->GetFrontDigiId()!=h2->GetFrontDigiId() &&
511  // h1->GetBackDigiId()!=h2->GetBackDigiId() ) continue;
512  // }
513  Double_t dx = h1->GetX() - h2->GetX();
514  Double_t dy = h1->GetY() - h2->GetY();
515  Double_t d2 =
516  fabs(dx * dx * V[0] - 2 * dx * dy * V[1] + dy * dy * V[2]);
517  if (d2 < D2) D2 = d2;
518  }
521  - 1]
522  ->Fill(sqrt(D2 / 2));
523  }
524  }
525 
526  if (0) { // track density
527  cout << "Track density..." << endl;
528  bool flag[nTracks];
529  double sC[nTracks][8][15];
530  double sT[nTracks][8][5];
531  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
532  flag[iTrack] = 0;
533 
534  CbmStsTrack* trackI = (CbmStsTrack*) fRecStsTrackArray->At(iTrack);
535  if (!IsLong(trackI)) continue;
536  flag[iTrack] = 1;
537  double z[8] = {0.2, 1, 2, 3, 4, 5, 10, 100};
538  for (int iz = 0; iz < 8; iz++) {
539  FairTrackParam paramI;
540  fFitter.Extrapolate(trackI, z[iz], &paramI);
541  CbmKFMath::CopyTrackParam2TC(&paramI, sT[iTrack][iz], sC[iTrack][iz]);
542  if (!finite(sC[iTrack][iz][0]) || sC[iTrack][iz][0] < 0
543  || sC[iTrack][iz][0] > 10.) {
544  flag[iTrack] = 0;
545  break;
546  }
547  }
548  }
549  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
550 
551  if (iTrack % 10 == 0) cout << iTrack << endl;
552  if (!flag[iTrack]) continue;
553  double Chi2[8];
554  for (int iz = 0; iz < 8; iz++)
555  Chi2[iz] = 1.e10;
556  double Chi2L = 1.e10;
557 
558  for (Int_t jTrack = 0; jTrack < nTracks; jTrack++) {
559  if (jTrack == iTrack) continue;
560  if (!flag[jTrack]) continue;
561 
562  for (int iz = 0; iz < 8; iz++) {
563  Double_t C[15], d[5];
564  for (int i = 0; i < 15; i++)
565  C[i] = sC[iTrack][iz][i] + sC[jTrack][iz][i];
566  for (int i = 0; i < 5; i++)
567  d[i] = sT[iTrack][iz][i] - sT[jTrack][iz][i];
568  CbmKFMath::invS(C, 5);
569 
570  double chi2 = 0;
571  for (int i = 0; i < 5; i++) {
572  double dCi = 0;
573  for (int j = 0; j < 5; j++)
574  dCi += d[j] * C[CbmKFMath::indexS(i, j)];
575  chi2 += dCi * d[i];
576  }
577  chi2 = fabs(chi2);
578  if (chi2 < Chi2[iz]) Chi2[iz] = chi2;
579 
580  if (iz == 0) {
581  chi2 = 0;
582  for (int i = 0; i < 4; i++) {
583  double dCi = 0;
584  for (int j = 0; j < 4; j++)
585  dCi += d[j] * C[CbmKFMath::indexS(i, j)];
586  chi2 += dCi * d[i];
587  }
588  chi2 = fabs(chi2);
589  if (chi2 < Chi2L) Chi2L = chi2;
590  }
591  }
592  }
593  for (int iz = 0; iz < 8; iz++) {
594  fhTrackDensity[iz]->Fill(sqrt(Chi2[iz] / 5));
595  }
596  fhTrackDensity0L->Fill(sqrt(Chi2L / 4));
597  }
598  }
599  if (fTrackAnalysis) {
600  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
601  if (Quality[iTrack] < 1) continue;
602  CbmStsTrack* track = (CbmStsTrack*) fRecStsTrackArray->At(iTrack);
603  CbmTrackMatch* m = (CbmTrackMatch*) fSTSTrackMatch->At(iTrack);
604  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTrackArray->At(m->GetMCTrackId());
605 
606  if (mcTrack->GetMotherId() != -1) continue; // not primary track //IK
607 
608  // Get MC points;
609  vector<CbmStsPoint*> vPoints;
610  for (Int_t i = 0; i < track->GetNofStsHits(); i++) {
611  Int_t hitID = track->GetHitIndex(i);
612  if (hitID < 0) continue;
613  CbmStsHit* hit = (CbmStsHit*) fStsHitArray->At(hitID);
614  if (!hit) continue;
615  Int_t pointID = hit->GetRefId();
616  if (pointID < 0) continue;
617  CbmStsPoint* point = (CbmStsPoint*) fStsPointArray->At(pointID);
618  if (!point) continue;
619  vPoints.push_back(point);
620  }
621  vector<CbmMvdPoint*> vMPoints;
622  for (Int_t i = 0; i < track->GetNofMvdHits(); i++) {
623  Int_t hitID = track->GetMvdHitIndex(i);
624  if (hitID < 0) continue;
625  CbmMvdHit* hit = (CbmMvdHit*) fMvdHitArray->At(hitID);
626  if (!hit) continue;
627  Int_t pointID = hit->GetRefIndex();
628  if (pointID < 0) continue;
629  CbmMvdPoint* point = (CbmMvdPoint*) fMvdPointArray->At(pointID);
630  if (!point) continue;
631  vMPoints.push_back(point);
632  }
633  // impact mc track
634  Double_t mci[6];
635  Double_t pzi = mcTrack->GetPz();
636  if (fabs(pzi) > 1.e-4) pzi = 1. / pzi;
637  mci[0] = mcTrack->GetStartX();
638  mci[1] = mcTrack->GetStartY();
639  mci[2] = mcTrack->GetPx() * pzi;
640  mci[3] = mcTrack->GetPy() * pzi;
641  mci[4] = (fabs(mcTrack->GetP()) > 1.e-4)
642  ? GetCharge(mcTrack) / mcTrack->GetP()
643  : 0;
644  mci[5] = mcTrack->GetStartZ();
645  if (!vPoints.empty()) {
646  if (track->GetNofStsHits() + track->GetNofMvdHits() >= 8) {
647  Double_t p1 = mcTrack->GetP();
648  TVector3 mom;
649  vPoints.back()->MomentumOut(mom);
650  Double_t p2 = mom.Mag();
651  Double_t s = p1 * p1
652  * TMath::Sqrt(TMath::Abs(
653  track->GetParamFirst()->GetCovariance(4, 4)));
654  Double_t dp =
655  (p1 - p2) * TMath::Sqrt(1 + mci[2] * mci[2] + mci[3] * mci[3]);
656  fhDP->Fill(dp);
657  fhDP2->Fill(p1, dp);
658  fhDsP->Fill(dp / s);
659  fhDsP2->Fill(p1, dp / s);
660  }
661  // first point
662  if (!vMPoints.empty())
663  FillMCStateVectors(vMPoints.front(), mc);
664  else
665  FillMCStateVectors(vPoints.front(), mc);
666  FillTrackHisto(mc, track, fhFrst);
667  fhZMCf->Fill(mc[5]);
668  fhZRecof->Fill(track->GetParamFirst()->GetZ());
669 
670  // last point
671  FillMCStateVectors(vPoints.back(), mc, 1);
672  FillTrackHisto(mc, track, fhLast);
673  fhZMCl->Fill(mc[5]);
674  fhZRecol->Fill(track->GetParamLast()->GetZ());
675 
676  // impact point
677 
678  if (TMath::Abs(mcTrack->GetPdgCode()) == 211)
679  FillTrackHisto(mci, track, fhImpPi);
680  else
681  FillTrackHisto(mci, track, fhImp);
682 
683  // 4th station (check smoother)
684 
685  for (vector<CbmStsPoint*>::iterator i = vPoints.begin();
686  i != vPoints.end();
687  i++) {
688  int id = (*i)->GetDetectorID();
689  CbmKF& KF = *CbmKF::Instance();
690  if (KF.StsStationIDMap.find(id) == KF.StsStationIDMap.end()) continue;
691  if (KF.StsStationIDMap[id] != 3) continue;
692  FillMCStateVectors(*i, mc, 1);
693  //FillTrackHisto( mc, track, fhMid );
694  break;
695  }
696  }
697 
698  if (fPrimaryVertex && mcTrack->GetMotherId() == -1) {
699 
700  // fit track to Primary Vertex
701 
702  CbmStsTrack tt(*track);
703  FairTrackParam par(*tt.GetParamFirst());
704  fFitter.FitToVertex(&tt, fPrimaryVertex, &par);
705  tt.SetParamFirst(&par);
706  //FillTrackHisto(mci,&tt,fhVfit);
707 
708  // fill momentum resolution
709 
710  double z = mci[5];
711  FairTrackParam param;
712  fFitter.Extrapolate(track, z, &param);
713  if (fabs(mci[4]) > 1.e-4 && fabs(param.GetQp()) > 1.e-4)
714  fhPq->Fill(fabs(1. / mci[4]), (mci[4] / param.GetQp() - 1.));
715  }
716 
717  if (track->GetNDF() > 0) {
718  fhChi2->Fill(track->GetChiSq() / track->GetNDF());
719  fhProb->Fill(TMath::Prob(track->GetChiSq(), track->GetNDF()));
720  }
721  }
722  }
723 
724  if (fPrimaryVertex) {
725 
726  // find MC Primary vertex
727 
728  TVector3 MC_V(0, 0, 0);
729  Bool_t Is_MC_V = 0;
730  {
731  TVector3 MC_Vcurr(0, 0, 0);
732  Int_t nvtracks = 0, nvtrackscurr = 0;
733  Int_t nMCTracks = fMCTrackArray->GetEntriesFast();
734  for (Int_t iTrack = 0; iTrack < nMCTracks; iTrack++) {
735  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTrackArray->At(iTrack);
736  if (mcTrack->GetMotherId() != -1) continue; // not primary track
737  double z = mcTrack->GetStartZ();
738  if (!Is_MC_V || fabs(z - MC_Vcurr.Z()) > 1.e-7) { // new vertex
739  Is_MC_V = 1;
740  if (nvtrackscurr > nvtracks) {
741  MC_V = MC_Vcurr;
742  nvtracks = nvtrackscurr;
743  }
744  mcTrack->GetStartVertex(MC_Vcurr);
745  nvtrackscurr = 1;
746  } else
747  nvtrackscurr++;
748  }
749  if (nvtrackscurr > nvtracks) MC_V = MC_Vcurr;
750  }
751 
752 
753  if (Is_MC_V) {
754 
755  // primary vertex fit performance
756 
758 
759  if (fVertexAnalysis) {
760 
761  CbmPVFinderKF Finder;
762  TClonesArray TracksToFit("CbmStsTrack");
763  Int_t N = 0;
764  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
765  if (Quality[iTrack] < 1) continue;
766  new (TracksToFit[N]) CbmStsTrack();
767  *(CbmStsTrack*) TracksToFit.At(N) =
768  *(CbmStsTrack*) fRecStsTrackArray->At(iTrack);
769  N++;
770  if (N % 50 != 0) continue;
771  Int_t i = N / 50;
772  if (i >= 13) continue;
773  CbmVertex V;
774  Finder.FindPrimaryVertex(&TracksToFit, &V);
775  FillVertexHisto(MC_V, &V, fhV[i]);
776  }
777  CbmVertex V;
778  Finder.FindPrimaryVertex(&TracksToFit, &V);
779  FillVertexHisto(MC_V, &V, fhV[0]);
780  }
781 
782  // D0 fit performance (if there are)
783 
784  if (fD0Analysis && fabs(MC_V.Z()) < 1.e-5) {
785  // search for Kaon
786  for (Int_t iK = 0; iK < nTracks; iK++) {
787  if (Quality[iK] < 1) continue;
788  CbmStsTrack* tK = (CbmStsTrack*) fRecStsTrackArray->At(iK);
790  CbmMCTrack* mcK = (CbmMCTrack*) fMCTrackArray->At(m->GetMCTrackId());
791  if (mcK->GetMotherId() != -1) continue; // not primary or D0 track
792  if (abs(mcK->GetPdgCode()) != 321) continue;
793  double zK = mcK->GetPz();
794  if (zK - MC_V.Z() < 1.e-5) continue; // primary
795  double MCPK = mcK->GetP();
796  fFitter.DoFit(tK, 321); // refit
797  // search for Pion
798  for (Int_t iP = 0; iP < nTracks; iP++) {
799  if (Quality[iP] < 1) continue;
800  CbmStsTrack* tP = (CbmStsTrack*) fRecStsTrackArray->At(iP);
801  m = (CbmTrackMatch*) fSTSTrackMatch->At(iP);
802  CbmMCTrack* mcP =
803  (CbmMCTrack*) fMCTrackArray->At(m->GetMCTrackId());
804  if (mcP->GetMotherId() != -1) continue; // not primary or D0 track
805  if (abs(mcP->GetPdgCode()) != 211) continue;
806  if (mcK->GetPdgCode() * mcP->GetPdgCode() >= 0)
807  continue; //same charge
808  double zP = mcP->GetStartZ();
809  if (fabs(zP - zK) > 1.e-8) continue; // different vertex
810  double MCPP = mcP->GetP();
811 
812  const double D0 = 1.8645;
813 
814  TVector3 mc_;
815  mcK->GetStartVertex(mc_);
816 
818  SVFinder.AddTrack(tK);
819  SVFinder.AddTrack(tP);
820 
821  for (int iconst = 0; iconst < 4; iconst++) {
822 
823  switch (iconst) {
824  case 0:
825  SVFinder.SetMassConstraint(); // no constraints
826  SVFinder.SetTopoConstraint();
827  break;
828  case 1:
829  SVFinder.SetMassConstraint(); // Topo constraint
831  break;
832  case 2:
833  SVFinder.SetMassConstraint(D0); // Mass constraint
834  SVFinder.SetTopoConstraint();
835  break;
836  case 3:
837  SVFinder.SetMassConstraint(D0); // Topo + Mass constraint
839  break;
840  default: break;
841  }
842  SVFinder.Fit();
843  CbmVertex sv;
844  //FairTrackParam KFitted, PFitted;
845  Double_t mass, mass_err;
846  SVFinder.GetVertex(sv);
847  //SVFinder.GetFittedTrack(0, &KFitted );
848  //SVFinder.GetFittedTrack(1, &PFitted );
849  SVFinder.GetMass(&mass, &mass_err);
850  if (sv.GetNDF() <= 0) continue;
851  Double_t dx = sv.GetX() - mc_.X();
852  Double_t dy = sv.GetY() - mc_.Y();
853  Double_t dz = sv.GetZ() - mc_.Z();
854  Double_t sx = sv.GetCovariance(0, 0);
855  Double_t sy = sv.GetCovariance(1, 1);
856  Double_t sz = sv.GetCovariance(2, 2);
857  fhD0[iconst][0]->Fill(1.E4 * dx);
858  fhD0[iconst][1]->Fill(1.E4 * dy);
859  fhD0[iconst][2]->Fill(1.E4 * dz);
860  if (sx > 1.e-10) fhD0[iconst][3]->Fill(dx / sqrt(sx));
861  if (sy > 1.e-10) fhD0[iconst][4]->Fill(dy / sqrt(sy));
862  if (sz > 1.e-10) fhD0[iconst][5]->Fill(dz / sqrt(sz));
863  if (sv.GetNDF() > 0) {
864  fhD0[iconst][6]->Fill(sv.GetChi2() / sv.GetNDF());
865  fhD0[iconst][7]->Fill(TMath::Prob(sv.GetChi2(), sv.GetNDF()));
866  }
867  fhD0[iconst][8]->Fill((mass - D0));
868  if (mass_err > 1.e-10)
869  fhD0[iconst][9]->Fill((mass - D0) / mass_err);
870  //fhD0[iconst][10]->Fill( ( fabs(1./KFitted.GetQp()) - MCPK)/MCPK );
871  //fhD0[iconst][11]->Fill( (fabs(1./PFitted.GetQp()) - MCPP)/MCPP );
872  if (fabs(tK->GetParamFirst()->GetQp()) > 1.e-4 && MCPK > 1.e-4)
873  fhD0[iconst][12]->Fill(
874  (fabs(1. / tK->GetParamFirst()->GetQp()) - MCPK) / MCPK);
875  if (fabs(tP->GetParamFirst()->GetQp()) > 1.e-4 && MCPP > 1.e-4)
876  fhD0[iconst][13]->Fill(
877  (fabs(1. / tP->GetParamFirst()->GetQp()) - MCPP) / MCPP);
878  }
879  }
880  }
881  }
882  }
883  } // vertex analysis
884 }
885 // -------------------------------------------------------------------------
886 
887 
888 // ----- Finish CbmStsFitPerformanceTask task -----------------------------
890 // -------------------------------------------------------------------------
891 
892 
893 // -------------------------------------------------------------------------
895  CbmStsTrack* track,
896  TH1D* hist[10]) {
897  if ((mc[5] > 31.0) || (mc[5] < 29.0)) {
898  //cout << " Z out " << track->GetParamFirst()->GetZ() << endl;
899  //return;
900  }
901  //cout << "*Z in " << track->GetParamFirst()->GetZ() << endl;
902  double z = mc[5];
903  FairTrackParam param;
904  //cout<<1<<endl;
905  fFitter.Extrapolate(track, z, &param);
906  //cout<<2<<endl;
907 
908  double t[6], c[15];
909  CbmKFMath::CopyTrackParam2TC(&param, t, c);
910  Bool_t ok = 1;
911  for (int i = 0; i < 6; i++)
912  ok = ok && finite(t[i]);
913  for (int i = 0; i < 15; i++)
914  ok = ok && finite(c[i]);
915  if (!ok) return;
916  //fhExtraTracks2ndMVD->Fill(t[0], t[1]);
917 
918  hist[0]->Fill(1.E4 * (t[0] - mc[0]));
919  hist[1]->Fill(1.E4 * (t[1] - mc[1]));
920  hist[2]->Fill(1.E3 * (t[2] - mc[2]));
921  hist[3]->Fill(1.E3 * (t[3] - mc[3]));
922  if (fabs(t[4]) > 1.e-10) hist[4]->Fill((mc[4] / t[4] - 1.));
923  //if (z < 7.0) // first hit
924  //if ( fabs( t[4] )>1.e-10 ) fhRes_vs_Mom_f->Fill(fabs(1.0/t[4]),1.E3*(t[2] - mc[2]));
925  //if (z > 80.0) // last hit
926  //if ( fabs( t[4] )>1.e-10 ) fhRes_vs_Mom_l->Fill(fabs(1.0/t[4]),1.E3*(t[2] - mc[2]));
927 
928  if (c[0] > 1.e-10) hist[5]->Fill((t[0] - mc[0]) / sqrt(c[0]));
929  if (c[2] > 1.e-10) hist[6]->Fill((t[1] - mc[1]) / sqrt(c[2]));
930  if (c[5] > 1.e-10) hist[7]->Fill((t[2] - mc[2]) / sqrt(c[5]));
931  if (c[9] > 1.e-10) hist[8]->Fill((t[3] - mc[3]) / sqrt(c[9]));
932  if (c[14] > 1.e-10) hist[9]->Fill((t[4] - mc[4]) / sqrt(c[14]));
933 }
934 // -------------------------------------------------------------------------
935 
937  CbmVertex* V,
938  TH1D* hist[8]) {
939  Double_t dx = V->GetX() - mc.X();
940  Double_t dy = V->GetY() - mc.Y();
941  Double_t dz = V->GetZ() - mc.Z();
942  Double_t s2x = V->GetCovariance(0, 0);
943  Double_t s2y = V->GetCovariance(1, 1);
944  Double_t s2z = V->GetCovariance(2, 2);
945 
946  hist[0]->Fill(1.E4 * dx);
947  hist[1]->Fill(1.E4 * dy);
948  hist[2]->Fill(1.E4 * dz);
949  if (s2x > 1.e-10) hist[3]->Fill(dx / sqrt(s2x));
950  if (s2y > 1.e-10) hist[4]->Fill(dy / sqrt(s2y));
951  if (s2z > 1.e-10) hist[5]->Fill(dz / sqrt(s2z));
952  hist[6]->Fill(V->GetChi2() / V->GetNDF());
953  hist[7]->Fill(TMath::Prob(V->GetChi2(), V->GetNDF()));
954  hist[8]->Fill(V->GetNTracks());
955 }
956 
957 // -------------------------------------------------------------------------
959  Double_t mc[],
960  Bool_t out) {
961  if (!point) return;
962  Int_t mcTrackID = point->GetTrackID();
963  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTrackArray->At(mcTrackID);
964  if (!mcTrack) return;
965  Double_t q = GetCharge(mcTrack);
966 
967  // Get MC state vector
968  TVector3 r, p;
969  if (!out) {
970  point->Momentum(p);
971  point->Position(r);
972  } else {
973  point->MomentumOut(p);
974  point->PositionOut(r);
975  }
976  double pzi = p.z();
977  if (fabs(pzi) > 1.e-4) pzi = 1. / pzi;
978  mc[2] = p.x() * pzi;
979  mc[3] = p.y() * pzi;
980  mc[4] = p.Mag() > 1.e-4 ? q / p.Mag() : 0;
981  mc[0] = r.x();
982  mc[1] = r.y();
983  mc[5] = r.z();
984 }
985 
987  Double_t mc[],
988  Bool_t out) {
989  if (!point) return;
990  Int_t mcTrackID = point->GetTrackID();
991  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTrackArray->At(mcTrackID);
992  if (!mcTrack) return;
993  Double_t q = GetCharge(mcTrack);
994 
995  // Get MC state vector
996  TVector3 r, p;
997  if (!out) {
998  point->Momentum(p);
999  point->Position(r);
1000  } else {
1001  point->MomentumOut(p);
1002  point->PositionOut(r);
1003  }
1004  double pzi = p.z();
1005  if (fabs(pzi) > 1.e-4) pzi = 1. / pzi;
1006  mc[2] = p.x() * pzi;
1007  mc[3] = p.y() * pzi;
1008  mc[4] = p.Mag() > 1.e-4 ? q / p.Mag() : 0;
1009  mc[0] = r.x();
1010  mc[1] = r.y();
1011  mc[5] = r.z();
1012 }
1013 
1014 
1015 // ----- GetCharge ----------------------------------------------------
1017  Double_t q;
1018  Int_t pdgCode = mcTrack->GetPdgCode();
1019  TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(pdgCode);
1020  if (particlePDG)
1021  q = particlePDG->Charge() / 3.;
1022  else
1023  q = 0;
1024  return q;
1025 }
1026 
1027 
1028 // -------------------------------------------------------------------------
1030  Int_t nHits = track->GetNofStsHits();
1031  if (nHits < 4) return 0;
1032  Int_t stmin = 1000, stmax = -1000;
1033  Int_t st, iHit, hitID;
1034  for (iHit = 0; iHit < nHits; iHit++) {
1035  hitID = track->GetHitIndex(iHit);
1036  st = ((CbmStsHit*) fStsHitArray->At(hitID))->GetAddress();
1037  if (st < stmin) stmin = st;
1038  if (st > stmax) stmax = st;
1039  }
1040  if (stmax - stmin + 1 < 4) return 0;
1041  return 1;
1042 }
1043 
CbmStsFitPerformanceTask::Init
InitStatus Init()
Definition: CbmStsFitPerformanceTask.cxx:227
CbmVertex::GetNTracks
Int_t GetNTracks() const
Definition: CbmVertex.h:73
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmTrack::GetChiSq
Double_t GetChiSq() const
Definition: CbmTrack.h:58
CbmStsFitPerformanceTask::CreateVertexHisto
void CreateVertexHisto(TH1D *hist[9], const char *name, const char *title)
Definition: CbmStsFitPerformanceTask.cxx:90
CbmStsFitPerformanceTask::fFitter
CbmStsKFTrackFitter fFitter
Definition: CbmStsFitPerformanceTask.h:131
CbmMCTrack::GetStartX
Double_t GetStartX() const
Definition: CbmMCTrack.h:75
CbmVertex.h
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
CbmKFVertexInterface.h
CbmKFPrimaryVertexFinder.h
CbmPixelHit::GetDxy
Double_t GetDxy() const
Definition: CbmPixelHit.h:87
CbmStsFitPerformanceTask::~CbmStsFitPerformanceTask
~CbmStsFitPerformanceTask()
Definition: CbmStsFitPerformanceTask.cxx:224
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmKF.h
CbmStsKFTrackFitter::Extrapolate
void Extrapolate(CbmStsTrack *track, Double_t z, FairTrackParam *e_track)
Definition: CbmStsKFTrackFitter.cxx:134
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
CbmStsFitPerformanceTask::fhZMCf
TH1D * fhZMCf
Definition: CbmStsFitPerformanceTask.h:108
CbmStsFitPerformanceTask::fMCTrackArray
TClonesArray * fMCTrackArray
MCTracks.
Definition: CbmStsFitPerformanceTask.h:92
CbmStsFitPerformanceTask::fhChi2
TH1D * fhChi2
Definition: CbmStsFitPerformanceTask.h:101
CbmStsKFSecondaryVertexFinder.h
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmStsFitPerformanceTask::Exec
void Exec(Option_t *option)
Definition: CbmStsFitPerformanceTask.cxx:426
CbmStsSetup.h
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmStsFitPerformanceTask::FillTrackHisto
void FillTrackHisto(const Double_t mc[6], CbmStsTrack *track, TH1D *hist[10])
Definition: CbmStsFitPerformanceTask.cxx:894
CbmPixelHit::GetDx
Double_t GetDx() const
Definition: CbmPixelHit.h:85
CbmKFMath::indexS
static Int_t indexS(Int_t i, Int_t j)
Definition: CbmKFMath.h:39
CbmStsKFSecondaryVertexFinder::SetMassConstraint
void SetMassConstraint(Double_t MotherMass=-1)
Definition: CbmStsKFSecondaryVertexFinder.cxx:39
CbmStsKFSecondaryVertexFinder
Definition: CbmStsKFSecondaryVertexFinder.h:21
CbmStsFitPerformanceTask::IsLong
Bool_t IsLong(CbmStsTrack *track)
Definition: CbmStsFitPerformanceTask.cxx:1029
CbmKFMath::CopyTrackParam2TC
static void CopyTrackParam2TC(const FairTrackParam *par, Double_t T[], Double_t C[])
Definition: CbmKFMath.cxx:827
CbmStsFitPerformanceTask::fMvdPointArray
TClonesArray * fMvdPointArray
StsPoints.
Definition: CbmStsFitPerformanceTask.h:94
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmStsFitPerformanceTask::fhVfit
TH1D * fhVfit[10]
Definition: CbmStsFitPerformanceTask.h:120
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmStsKFSecondaryVertexFinder::GetVertex
void GetVertex(CbmVertex &vtx)
Definition: CbmStsKFSecondaryVertexFinder.cxx:61
CbmMvdHit::GetStationNr
virtual Int_t GetStationNr() const
Definition: CbmMvdHit.h:61
CbmTrackMatch
Definition: CbmTrackMatch.h:18
CbmKF::MvdStationIDMap
std::map< Int_t, Int_t > MvdStationIDMap
Definition: CbmKF.h:90
CbmStsSetup::Instance
static CbmStsSetup * Instance()
Definition: CbmStsSetup.cxx:293
CbmStsFitPerformanceTask::ReInit
InitStatus ReInit()
Definition: CbmStsFitPerformanceTask.cxx:388
CbmStsFitPerformanceTask::fEvent
Int_t fEvent
Definition: CbmStsFitPerformanceTask.h:89
CbmVertex::GetCovariance
Double_t GetCovariance(Int_t i, Int_t j) const
Definition: CbmVertex.cxx:118
CbmStsFitPerformanceTask::fStsHitArray
TClonesArray * fStsHitArray
Sts hits.
Definition: CbmStsFitPerformanceTask.h:96
CbmStsFitPerformanceTask::CreateD0Histo
void CreateD0Histo(TH1D *hist[14], const char *name, const char *title)
Definition: CbmStsFitPerformanceTask.cxx:118
CbmKF
Definition: CbmKF.h:33
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmMCTrack::GetPx
Double_t GetPx() const
Definition: CbmMCTrack.h:72
CbmStsFitPerformanceTask::fSTSTrackMatch
TClonesArray * fSTSTrackMatch
Related MC tracks.
Definition: CbmStsFitPerformanceTask.h:99
CbmMCTrack::GetPy
Double_t GetPy() const
Definition: CbmMCTrack.h:73
CbmStsPoint
Definition: CbmStsPoint.h:27
CbmTrackMatch.h
CbmStsFitPerformanceTask::FillMCStateVectors
void FillMCStateVectors(CbmStsPoint *point, Double_t mc[], Bool_t out=0)
Definition: CbmStsFitPerformanceTask.cxx:958
CbmPixelHit::GetDy
Double_t GetDy() const
Definition: CbmPixelHit.h:86
CbmStsKFTrackFitter::DoFit
Int_t DoFit(CbmStsTrack *track, Int_t pidHypo=211)
Definition: CbmStsKFTrackFitter.cxx:79
CbmVertex::GetX
Double_t GetX() const
Definition: CbmVertex.h:68
CbmVertex::GetChi2
Double_t GetChi2() const
Definition: CbmVertex.h:71
CbmStsFitPerformanceTask::fhHitDensity
TH1D * fhHitDensity[10]
Definition: CbmStsFitPerformanceTask.h:126
CbmKFTrackInterface.h
CbmStsFitPerformanceTask::fhD0
TH1D * fhD0[4][14]
Definition: CbmStsFitPerformanceTask.h:124
CbmPVFinderKF.h
CbmStsFitPerformanceTask::fhImpPi
TH1D * fhImpPi[10]
Definition: CbmStsFitPerformanceTask.h:119
CbmMvdHit
Definition: CbmMvdHit.h:29
CbmStsFitPerformanceTask::FillVertexHisto
void FillVertexHisto(TVector3 &mc, CbmVertex *V, TH1D *hist[8])
Definition: CbmStsFitPerformanceTask.cxx:936
CbmStsTrack::GetNofMvdHits
Int_t GetNofMvdHits() const
Definition: CbmStsTrack.h:84
CbmStsFitPerformanceTask::fhDsP
TH1D * fhDsP
Definition: CbmStsFitPerformanceTask.h:105
CbmKFMath.h
CbmMCTrack::GetStartZ
Double_t GetStartZ() const
Definition: CbmMCTrack.h:77
CbmStsHit
data class for a reconstructed 3-d hit in the STS
Definition: CbmStsHit.h:31
CbmPVFinderKF
Definition: CbmPVFinderKF.h:15
CbmStsPoint::PositionOut
void PositionOut(TVector3 &pos)
Definition: CbmStsPoint.h:96
CbmKF::Instance
static CbmKF * Instance()
Definition: CbmKF.h:39
finite
T finite(T x)
Definition: CbmL1Def.h:21
CbmStsTrack.h
Data class for STS tracks.
CbmStsFitPerformanceTask.h
CbmMvdPoint
Definition: CbmMvdPoint.h:28
CbmStsFitPerformanceTask::fhImp
TH1D * fhImp[10]
Definition: CbmStsFitPerformanceTask.h:118
CbmKFMath::invS
static Bool_t invS(Double_t A[], Int_t N)
Definition: CbmKFMath.cxx:232
d
double d
Definition: P4_F64vec2.h:24
CbmStsFitPerformanceTask::fhZRecol
TH1D * fhZRecol
Definition: CbmStsFitPerformanceTask.h:109
CbmStsSetup::GetStationNumber
Int_t GetStationNumber(Int_t address)
Definition: CbmStsSetup.cxx:187
CbmStsFitPerformanceTask::fPrimaryVertex
CbmVertex * fPrimaryVertex
Primary vertex.
Definition: CbmStsFitPerformanceTask.h:98
CbmMvdPoint::PositionOut
void PositionOut(TVector3 &pos)
Definition: CbmMvdPoint.h:83
CbmStsKFSecondaryVertexFinder::AddTrack
void AddTrack(CbmStsTrack *Track)
Definition: CbmStsKFSecondaryVertexFinder.cxx:24
CbmStsFitPerformanceTask::fStsPointArray
TClonesArray * fStsPointArray
StsPoints.
Definition: CbmStsFitPerformanceTask.h:93
CbmTrack::GetHitIndex
Int_t GetHitIndex(Int_t iHit) const
Definition: CbmTrack.h:54
CbmStsFitPerformanceTask::Finish
void Finish()
Definition: CbmStsFitPerformanceTask.cxx:889
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmStsFitPerformanceTask::fhPq
TH2D * fhPq
Definition: CbmStsFitPerformanceTask.h:123
CbmVertex
Definition: CbmVertex.h:26
CbmStsPoint::MomentumOut
void MomentumOut(TVector3 &mom)
Definition: CbmStsPoint.h:97
CbmStsFitPerformanceTask::fhProb
TH1D * fhProb
Definition: CbmStsFitPerformanceTask.h:102
CbmStsKFSecondaryVertexFinder::SetTopoConstraint
void SetTopoConstraint(CbmVertex *Parent=0)
Definition: CbmStsKFSecondaryVertexFinder.cxx:43
nMCTracks
Int_t nMCTracks
Definition: CbmHadronAnalysis.cxx:63
CbmStsFitPerformanceTask::CbmStsFitPerformanceTask
CbmStsFitPerformanceTask(const char *name="CbmStsFitPerformanceTask", Int_t iVerbose=1)
Definition: CbmStsFitPerformanceTask.cxx:152
CbmStsFitPerformanceTask::histodir
TDirectory * histodir
Definition: CbmStsFitPerformanceTask.h:130
CbmTrack::GetNDF
Int_t GetNDF() const
Definition: CbmTrack.h:59
CbmVertex::GetZ
Double_t GetZ() const
Definition: CbmVertex.h:70
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmKFTrack.h
CbmStsKFSecondaryVertexFinder::GetMass
void GetMass(Double_t *M, Double_t *Error)
Definition: CbmStsKFSecondaryVertexFinder.cxx:97
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
CbmPVFinderKF::FindPrimaryVertex
virtual Int_t FindPrimaryVertex(TClonesArray *tracks, CbmVertex *vertex)
CbmStsFitPerformanceTask::fhV
TH1D * fhV[13][9]
Definition: CbmStsFitPerformanceTask.h:122
CbmStsFitPerformanceTask::fhDP2
TH2D * fhDP2
Definition: CbmStsFitPerformanceTask.h:104
CbmStsFitPerformanceTask::fhVtx
TH1D * fhVtx[9]
Definition: CbmStsFitPerformanceTask.h:121
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmStsFitPerformanceTask::fhDsP2
TH2D * fhDsP2
Definition: CbmStsFitPerformanceTask.h:106
CbmStsFitPerformanceTask::fhZMCl
TH1D * fhZMCl
Definition: CbmStsFitPerformanceTask.h:108
CbmStsFitPerformanceTask::fhExtraTracks2ndMVD
TH2D * fhExtraTracks2ndMVD
Definition: CbmStsFitPerformanceTask.h:113
CbmStsFitPerformanceTask::fMvdHitArray
TClonesArray * fMvdHitArray
Sts hits.
Definition: CbmStsFitPerformanceTask.h:97
CbmStsKFTrackFitter::Init
void Init()
Definition: CbmStsKFTrackFitter.cxx:29
CbmStsFitPerformanceTask::fTrackAnalysis
Bool_t fTrackAnalysis
Definition: CbmStsFitPerformanceTask.h:90
CbmMCTrack::GetStartY
Double_t GetStartY() const
Definition: CbmMCTrack.h:76
nStsHits
Int_t nStsHits
Definition: CbmHadronAnalysis.cxx:65
CbmStsFitPerformanceTask::CreateTrackHisto
void CreateTrackHisto(TH1D *hist[10], const char *name, const char *title)
Definition: CbmStsFitPerformanceTask.cxx:62
CbmMCTrack.h
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
writedir2current
void writedir2current(TObject *obj)
Definition: CbmStsFitPerformanceTask.cxx:47
CbmStsFitPerformanceTask
Definition: CbmStsFitPerformanceTask.h:33
CbmStsFitPerformanceTask::fhLast
TH1D * fhLast[10]
Definition: CbmStsFitPerformanceTask.h:117
CbmVertex::GetY
Double_t GetY() const
Definition: CbmVertex.h:69
CbmStsFitPerformanceTask::fhTrackDensity0L
TH1D * fhTrackDensity0L
Definition: CbmStsFitPerformanceTask.h:128
CbmStsFitPerformanceTask::fhRes_vs_Mom_l
TH2D * fhRes_vs_Mom_l
Definition: CbmStsFitPerformanceTask.h:111
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmMvdHit::GetRefIndex
Int_t GetRefIndex()
Definition: CbmMvdHit.h:71
CbmMvdHit.h
fabs
friend F32vec4 fabs(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:60
CbmStsFitPerformanceTask::fD0Analysis
Bool_t fD0Analysis
Definition: CbmStsFitPerformanceTask.h:90
CbmStsKFTrackFitter::FitToVertex
Double_t FitToVertex(CbmStsTrack *track, CbmVertex *vtx, FairTrackParam *v_track)
Definition: CbmStsKFTrackFitter.cxx:200
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
CbmTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *par)
Definition: CbmTrack.h:75
CbmStsFitPerformanceTask::GetCharge
Double_t GetCharge(CbmMCTrack *mcTrack)
Definition: CbmStsFitPerformanceTask.cxx:1016
CbmMvdPoint::MomentumOut
void MomentumOut(TVector3 &mom)
Definition: CbmMvdPoint.h:84
CbmStsTrack::GetMvdHitIndex
Int_t GetMvdHitIndex(Int_t iHit) const
Definition: CbmStsTrack.h:70
CbmStsFitPerformanceTask::fhZRecof
TH1D * fhZRecof
Definition: CbmStsFitPerformanceTask.h:109
CbmStsAddress.h
CbmStsFitPerformanceTask::fhFrst
TH1D * fhFrst[10]
Definition: CbmStsFitPerformanceTask.h:115
CbmStsKFSecondaryVertexFinder::Fit
void Fit()
Definition: CbmStsKFSecondaryVertexFinder.cxx:52
CbmStsFitPerformanceTask::fRecStsTrackArray
TClonesArray * fRecStsTrackArray
Reconstructed StsTracks.
Definition: CbmStsFitPerformanceTask.h:95
CbmVertex::GetNDF
Int_t GetNDF() const
Definition: CbmVertex.h:72
CbmStsFitPerformanceTask::fhRes_vs_Mom_f
TH2D * fhRes_vs_Mom_f
Definition: CbmStsFitPerformanceTask.h:111
CbmStsFitPerformanceTask::fhMid
TH1D * fhMid[10]
Definition: CbmStsFitPerformanceTask.h:116
CbmStsFitPerformanceTask::fhDP
TH1D * fhDP
Definition: CbmStsFitPerformanceTask.h:103
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmStsFitPerformanceTask::fhTrackDensity
TH1D * fhTrackDensity[8]
Definition: CbmStsFitPerformanceTask.h:127
CbmKF::StsStationIDMap
std::map< Int_t, Int_t > StsStationIDMap
Definition: CbmKF.h:91
CbmStsFitPerformanceTask::fVertexAnalysis
Bool_t fVertexAnalysis
Definition: CbmStsFitPerformanceTask.h:90
CbmKFVertex.h
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmStsKFTrackFitter.h
CbmMCTrack::GetPz
Double_t GetPz() const
Definition: CbmMCTrack.h:74
CbmStsHit.h
Data class for a reconstructed hit in the STS.
CbmStsTrack::GetNofStsHits
Int_t GetNofStsHits() const
Definition: CbmStsTrack.h:90