CbmRoot
CbmLitTrackingQa.cxx
Go to the documentation of this file.
1 
7 #include "CbmLitTrackingQa.h"
8 #include "CbmGlobalTrack.h"
9 #include "CbmHistManager.h"
10 #include "CbmHit.h"
11 #include "CbmLitTrackingQaReport.h"
13 #include "CbmMCDataArray.h"
14 #include "CbmMCDataManager.h"
15 #include "CbmMCTrack.h"
16 #include "CbmMatch.h"
17 #include "CbmRichRing.h"
18 #include "CbmRichUtil.h"
19 #include "CbmStsSetup.h"
20 #include "CbmStsTrack.h"
21 #include "CbmTrackMatchNew.h"
22 #include "CbmUtils.h"
23 #include "FairMCPoint.h"
27 
28 #include "TClonesArray.h"
29 #include "TH1.h"
30 #include "TH2F.h"
31 #include <TFile.h>
32 
33 #include <boost/assign/list_of.hpp>
34 
35 #include <fstream>
36 #include <iostream>
37 
38 using boost::assign::list_of;
40 using Cbm::Split;
41 using std::cout;
42 using std::list;
43 using std::make_pair;
44 using std::pair;
45 
47  : FairTask("LitTrackingQA", 1)
48  , fHM(NULL)
49  , fOutputDir("")
50  , fDet()
51  , fMCTrackCreator(NULL)
52  , fMinNofPointsSts(4)
53  , fMinNofPointsTrd(2)
54  , // SIS100
55  fMinNofPointsMuch(10)
56  , fMinNofPointsTof(1)
57  , fMinNofHitsRich(7)
58  , fQuota(0.7)
59  , fQuotaRich(0.6)
60  , fMinNofHitsTrd(2)
61  , // SIS100
62  fMinNofHitsMuch(10)
63  , fUseConsecutivePointsInSts(true)
64  , fPRangeMin(0.)
65  , fPRangeMax(10.)
66  , fPRangeBins(20.)
67  , fYRangeMin(0.)
68  , fYRangeMax(4.)
69  , fYRangeBins(16)
70  , fPtRangeMin(0.)
71  , fPtRangeMax(3.)
72  , fPtRangeBins(12.)
73  , fAngleRangeMin(0.)
74  , fAngleRangeMax(25.)
75  , fAngleRangeBins(10)
76  , fMcToRecoMap()
77  , fMCTracks(NULL)
78  , fGlobalTracks(NULL)
79  , fMvdPoints(NULL)
80  , fMvdHitMatches(NULL)
81  , fStsTracks(NULL)
82  , fStsMatches(NULL)
83  , fRichRings(NULL)
84  , fRichProjections(NULL)
85  , fRichRingMatches(NULL)
86  , fMuchMatches(NULL)
87  , fTrdMatches(NULL)
88  , fTofPoints(NULL)
89  , fTofMatches(NULL)
90  , fRichAnnCut(0.25)
91  , fTrdAnnCut(0.85) {}
92 
94  if (fHM) delete fHM;
95 }
96 
97 InitStatus CbmLitTrackingQa::Init() {
98  // Create histogram manager which is used throughout the program
99  fHM = new CbmHistManager();
100 
104 
109 
111 
113 
114  // --- Get STS setup
115  CbmStsSetup* stsSetup = CbmStsSetup::Instance();
116 
117  if (!stsSetup->IsInit()) stsSetup->Init();
118 
120 
121  fMcToRecoMap.clear();
122  vector<string> trackVariants = GlobalTrackVariants();
123  for (Int_t i = 0; i < trackVariants.size(); i++) {
124  fMcToRecoMap.insert(
125  make_pair(trackVariants[i], multimap<pair<Int_t, Int_t>, Int_t>()));
126  }
127 
130 
131  return kSUCCESS;
132 }
133 
134 void CbmLitTrackingQa::Exec(Option_t* opt) {
135  // Increase event counter
136  fHM->H1("hen_EventNo_TrackingQa")->Fill(0.5);
137  Int_t eventNum = fHM->H1("hen_EventNo_TrackingQa")->GetEntries() - 1;
138  std::cout << "CbmLitTrackingQa::Exec: event=" << eventNum << std::endl;
139 
140  fMCTrackCreator->Create(eventNum);
141 
143  ProcessMcTracks(eventNum);
144  PionSuppression();
146 }
147 
149 
150  TDirectory* oldir = gDirectory;
151  TFile* outFile = FairRootManager::Instance()->GetOutFile();
152  if (outFile != NULL) {
153  outFile->cd();
154  fHM->WriteToFile();
155  }
156  gDirectory->cd(oldir->GetPath());
157 
158  if (fOutputDir != "") {
160  report->Create(fHM, fOutputDir);
161  delete report;
162  }
163 }
164 
166  FairRootManager* ioman = FairRootManager::Instance();
167  if (NULL == ioman) { Fatal("Init", "CbmRootManager is not instantiated"); }
168 
169  CbmMCDataManager* mcManager =
170  (CbmMCDataManager*) ioman->GetObject("MCDataManager");
171  fMCTracks = mcManager->InitBranch("MCTrack");
172  if (NULL == fMCTracks) { Fatal("Init", "No MCTrack array!"); }
173 
174  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
175  if (NULL == fGlobalTracks) { Fatal("Init", "No GlobalTrack array!"); }
176 
178  fMvdPoints = mcManager->InitBranch("MvdPoint");
179  if (NULL == fMvdPoints) { Fatal("Init", ": No MvdPoint array!"); }
180  fMvdHitMatches = (TClonesArray*) ioman->GetObject("MvdHitMatch");
181  if (NULL == fMvdHitMatches) { Fatal("Init", ": No MvdHitMatch array!"); }
182  }
183 
185  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
186  if (NULL == fStsTracks) { Fatal("Init", ": No StsTrack array!"); }
187  fStsMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
188  if (NULL == fStsMatches) { Fatal("Init", ": No StsTrackMatch array!"); }
189  }
190 
192  fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
193  if (NULL == fRichRings) { Fatal("Init", "No RichRing array!"); }
194  fRichProjections = (TClonesArray*) ioman->GetObject("RichProjection");
195  if (NULL == fRichProjections) { Fatal("Init", "No RichProjection array!"); }
196  fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
197  if (NULL == fRichRingMatches) { Fatal("Init", "No RichRingMatch array!"); }
198  }
199 
201  fMuchMatches = (TClonesArray*) ioman->GetObject("MuchTrackMatch");
202  if (NULL == fMuchMatches) { Fatal("Init", "No MuchTrackMatch array!"); }
203  }
204 
206  fTrdMatches = (TClonesArray*) ioman->GetObject("TrdTrackMatch");
207  if (NULL == fTrdMatches) { Fatal("Init", "No TrdTrackMatch array!"); }
208  }
209 
211  fTofPoints = mcManager->InitBranch("TofPoint");
212  if (NULL == fTofPoints) { Fatal("Init", "No TofPoint array!"); }
213  fTofMatches = (TClonesArray*) ioman->GetObject("TofHitMatch");
214  if (NULL == fTofMatches) { Fatal("Init", "No TofHitMatch array!"); }
215  }
216 }
217 
219  vector<string> tmp = list_of("All")("Primary")("Secondary")("Reference")(
220  fDet.GetElectronSetup() ? "Electron" : "Muon")("Proton")("PionPlus")(
221  "PionMinus")("KaonPlus")("KaonMinus");
222  fTrackCategories = tmp;
223 }
224 
226  vector<string> tmp = list_of("All")("AllReference")("Electron")(
227  "ElectronReference")("Pion")("PionReference");
228  fRingCategories = tmp;
229 }
230 
232  if (fDet.GetElectronSetup()) {
233  vector<string> tmp = list_of("Electron");
234  fTrackCategoriesPID = tmp;
235  }
236 }
237 
239  if (fDet.GetElectronSetup()) {
240  vector<string> tmp = list_of("Electron");
241  fRingCategoriesPID = tmp;
242  }
243 }
244 
246  if (fDet.GetElectronSetup()) {
247  vector<string> tmp = list_of("All")("TrueMatch")("WrongMatch");
248  fPiSuppCategories = tmp;
249  }
250 }
251 
253  // List of all supported track categories
256  fTrackAcceptanceFunctions["Primary"] =
258  fTrackAcceptanceFunctions["Secondary"] =
260  fTrackAcceptanceFunctions["Reference"] =
262  fTrackAcceptanceFunctions["Electron"] =
264  fTrackAcceptanceFunctions["Muon"] =
266  fTrackAcceptanceFunctions["Proton"] =
268  fTrackAcceptanceFunctions["Pion"] =
270  fTrackAcceptanceFunctions["PionPlus"] =
272  fTrackAcceptanceFunctions["PionMinus"] =
274  fTrackAcceptanceFunctions["Kaon"] =
276  fTrackAcceptanceFunctions["KaonPlus"] =
278  fTrackAcceptanceFunctions["KaonMinus"] =
280 
281  // List of all supported ring categories
282  fRingAcceptanceFunctions["All"] =
284  fRingAcceptanceFunctions["AllReference"] =
286  fRingAcceptanceFunctions["Electron"] =
288  fRingAcceptanceFunctions["ElectronReference"] =
290  fRingAcceptanceFunctions["Pion"] =
292  fRingAcceptanceFunctions["PionReference"] =
294 
295  // list of pion suppression categories
298  fPiSuppAcceptanceFunctions["TrueMatch"] =
300  fPiSuppAcceptanceFunctions["WrongMatch"] =
302 }
303 
304 void CbmLitTrackingQa::CreateH1Efficiency(const string& name,
305  const string& parameter,
306  const string& xTitle,
307  Int_t nofBins,
308  Double_t minBin,
309  Double_t maxBin,
310  const string& opt) {
311  assert(opt == "track" || opt == "ring" || opt == "track_pid"
312  || opt == "ring_pid");
313  vector<string> types = list_of("Acc")("Rec")("Eff");
314  vector<string> cat =
315  (opt == "track")
317  : (opt == "ring")
319  : (opt == "track_pid") ? fTrackCategoriesPID : fRingCategoriesPID;
320 
321  for (Int_t iCat = 0; iCat < cat.size(); iCat++) {
322  for (Int_t iType = 0; iType < 3; iType++) {
323  string yTitle = (types[iType] == "Eff") ? "Efficiency [%]" : "Counter";
324  string histName =
325  name + "_" + cat[iCat] + "_" + types[iType] + "_" + parameter;
326  string histTitle = histName + ";" + xTitle + ";" + yTitle;
327  fHM->Add(
328  histName,
329  new TH1F(histName.c_str(), histTitle.c_str(), nofBins, minBin, maxBin));
330  }
331  }
332 }
333 
334 void CbmLitTrackingQa::CreateH2Efficiency(const string& name,
335  const string& parameter,
336  const string& xTitle,
337  const string& yTitle,
338  Int_t nofBinsX,
339  Double_t minBinX,
340  Double_t maxBinX,
341  Int_t nofBinsY,
342  Double_t minBinY,
343  Double_t maxBinY,
344  const string& opt) {
345  assert(opt == "track" || opt == "ring" || opt == "track_pid"
346  || opt == "ring_pid");
347  vector<string> types = list_of("Acc")("Rec")("Eff");
348  vector<string> cat =
349  (opt == "track")
351  : (opt == "ring")
353  : (opt == "track_pid") ? fTrackCategoriesPID : fRingCategoriesPID;
354 
355  for (Int_t iCat = 0; iCat < cat.size(); iCat++) {
356  for (Int_t iType = 0; iType < 3; iType++) {
357  string zTitle = (types[iType] == "Eff") ? "Efficiency [%]" : "Counter";
358  string histName =
359  name + "_" + cat[iCat] + "_" + types[iType] + "_" + parameter;
360  string histTitle = histName + ";" + xTitle + ";" + yTitle + ";" + zTitle;
361  fHM->Add(histName,
362  new TH2F(histName.c_str(),
363  histTitle.c_str(),
364  nofBinsX,
365  minBinX,
366  maxBinX,
367  nofBinsY,
368  minBinY,
369  maxBinY));
370  }
371  }
372 }
373 
375  const string& parameter,
376  const string& xTitle,
377  Int_t nofBins,
378  Double_t minBin,
379  Double_t maxBin) {
380  vector<string> types = list_of("RecPions")("Rec")("PionSup");
381  for (Int_t iCat = 0; iCat < fPiSuppCategories.size(); iCat++) {
382  for (Int_t iType = 0; iType < 3; iType++) {
383  string yTitle =
384  (types[iType] == "PionSup") ? "Pion suppression" : "Counter";
385  string histName = name + "_" + fPiSuppCategories[iCat] + "_"
386  + types[iType] + "_" + parameter;
387  string histTitle = histName + ";" + xTitle + ";" + yTitle;
388  fHM->Add(
389  histName,
390  new TH1F(histName.c_str(), histTitle.c_str(), nofBins, minBin, maxBin));
391  }
392  }
393 }
394 
395 void CbmLitTrackingQa::CreateH1(const string& name,
396  const string& xTitle,
397  const string& yTitle,
398  Int_t nofBins,
399  Double_t minBin,
400  Double_t maxBin) {
401  TH1F* h = new TH1F(name.c_str(),
402  string(name + ";" + xTitle + ";" + yTitle).c_str(),
403  nofBins,
404  minBin,
405  maxBin);
406  fHM->Add(name, h);
407 }
408 
409 void CbmLitTrackingQa::CreateH2(const string& name,
410  const string& xTitle,
411  const string& yTitle,
412  const string& zTitle,
413  Int_t nofBinsX,
414  Double_t minBinX,
415  Double_t maxBinX,
416  Int_t nofBinsY,
417  Double_t minBinY,
418  Double_t maxBinY) {
419  TH2F* h =
420  new TH2F(name.c_str(),
421  (name + ";" + xTitle + ";" + yTitle + ";" + zTitle).c_str(),
422  nofBinsX,
423  minBinX,
424  maxBinX,
425  nofBinsY,
426  minBinY,
427  maxBinY);
428  fHM->Add(name, h);
429 }
430 
431 void CbmLitTrackingQa::CreateTrackHitsHistogram(const string& detName) {
432  string type[] = {"All", "True", "Fake", "TrueOverAll", "FakeOverAll"};
433  Double_t min[] = {-0.5, -0.5, -0.5, -0.1, -0.1};
434  Double_t max[] = {99.5, 99.5, 99.5, 1.1, 1.1};
435  Int_t bins[] = {100, 100, 100, 12, 12};
436  for (Int_t i = 0; i < 5; i++) {
437  string xTitle = (i == 3 || i == 4) ? "Ratio" : "Number of hits";
438  string histName = "hth_" + detName + "_TrackHits_" + type[i];
439  CreateH1(histName.c_str(), xTitle, "Yeild", bins[i], min[i], max[i]);
440  }
441 }
442 
444  const vector<string>& detectors) {
445  vector<string> histos;
446  Int_t nofDetectors = detectors.size();
447  for (Int_t iDet = 0; iDet < nofDetectors; iDet++) {
448  string histEff;
449  for (Int_t i = 0; i <= iDet; i++) {
450  histEff += detectors[i];
451  }
452  string histNorm = histEff;
453  histos.push_back("hte_" + histEff + "_" + histNorm);
454  for (Int_t i = iDet + 1; i < nofDetectors; i++) {
455  histNorm += detectors[i];
456  histos.push_back("hte_" + histEff + "_" + histNorm);
457  }
458  }
459  return histos;
460 }
461 
463  // Histograms w/o RICH detector
464  vector<string> detectors;
465  if (fDet.GetDet(ECbmModuleId::kSts)) detectors.push_back("Sts");
466  if (fDet.GetDet(ECbmModuleId::kMuch)) detectors.push_back("Much");
467  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
468  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
469  vector<string> names1 = CreateGlobalTrackingHistogramNames(detectors);
470 
471  // Histograms with RICH detector
472  vector<string> names2;
474  detectors.clear();
475  if (fDet.GetDet(ECbmModuleId::kSts)) detectors.push_back("Sts");
476  if (fDet.GetDet(ECbmModuleId::kRich)) detectors.push_back("Rich");
477  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
478  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
479  names2 = CreateGlobalTrackingHistogramNames(detectors);
480  }
481 
482  set<string> names;
483  names.insert(names1.begin(), names1.end());
484  names.insert(names2.begin(), names2.end());
485  vector<string> nameVector(names.begin(), names.end());
486  return nameVector;
487 }
488 
490  set<string> trackVariants;
491  // Histograms w/o RICH detector
492  vector<string> detectors;
493  if (fDet.GetDet(ECbmModuleId::kSts)) detectors.push_back("Sts");
494  if (fDet.GetDet(ECbmModuleId::kMuch)) detectors.push_back("Much");
495  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
496  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
497  string name("");
498  for (Int_t i = 0; i < detectors.size(); i++) {
499  name += detectors[i];
500  trackVariants.insert(name);
501  }
502 
503  // Histograms with RICH detector
505  detectors.clear();
506  if (fDet.GetDet(ECbmModuleId::kSts)) detectors.push_back("Sts");
507  if (fDet.GetDet(ECbmModuleId::kRich)) detectors.push_back("Rich");
508  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
509  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
510  name = "";
511  for (Int_t i = 0; i < detectors.size(); i++) {
512  name += detectors[i];
513  trackVariants.insert(name);
514  }
515  }
516  vector<string> trackVariantsVector(trackVariants.begin(),
517  trackVariants.end());
518 
519  trackVariantsVector.push_back("Rich");
520 
521  return trackVariantsVector;
522 }
523 
525  set<string> variants;
526  // Histograms w/o RICH detector
527  vector<string> detectors;
528  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
529  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
530  string name("");
531  for (Int_t i = 0; i < detectors.size(); i++) {
532  name += detectors[i];
533  variants.insert(name);
534  }
535 
536  // Histograms with RICH detector
538  detectors.clear();
539  if (fDet.GetDet(ECbmModuleId::kRich)) detectors.push_back("Rich");
540  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
541  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
542  name = "";
543  for (Int_t i = 0; i < detectors.size(); i++) {
544  name += detectors[i];
545  variants.insert(name);
546  }
547  }
548  vector<string> variantsVector(variants.begin(), variants.end());
549  return variantsVector;
550 }
551 
552 string CbmLitTrackingQa::LocalEfficiencyNormalization(const string& detName) {
553  set<string> trackVariants;
554  // Histograms w/o RICH detector
555  vector<string> detectors;
556  if (fDet.GetDet(ECbmModuleId::kSts)) detectors.push_back("Sts");
557  if (fDet.GetDet(ECbmModuleId::kMuch)) detectors.push_back("Much");
558  if (fDet.GetDet(ECbmModuleId::kTrd)) detectors.push_back("Trd");
559  if (fDet.GetDet(ECbmModuleId::kTof)) detectors.push_back("Tof");
560  string name("");
561  for (Int_t i = 0; i < detectors.size(); i++) {
562  name += detectors[i];
563  if (detectors[i] == detName) break;
564  }
565  return name;
566 }
567 
570 
571  // Number of points distributions
572  Double_t minNofPoints = 0.;
573  Double_t maxNofPoints = 100.;
574  Int_t nofBinsPoints = 100;
575 
576  // Reconstruction efficiency histograms
577  // Local efficiency histograms
578  // STS
579  // CreateEffHist3D("hSts3D", "track");
580  CreateH1Efficiency("hte_Sts_Sts",
581  "Np",
582  "Number of points",
583  nofBinsPoints,
584  minNofPoints,
585  maxNofPoints,
586  "track");
587  CreateH1Efficiency("hte_Sts_Sts",
588  "Angle",
589  "Polar angle [deg]",
593  "track");
594  // MUCH
596  string norm = LocalEfficiencyNormalization("Much");
597  string histName = "hte_Much_" + norm;
599  histName, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax, "track");
601  histName, "y", "Rapidity", fYRangeBins, fYRangeMin, fYRangeMax, "track");
602  CreateH1Efficiency(histName,
603  "pt",
604  "P_{t} [GeV/c]",
605  fPtRangeBins,
606  fPtRangeMin,
607  fPtRangeMax,
608  "track");
609  CreateH1Efficiency(histName,
610  "Np",
611  "Number of points",
612  nofBinsPoints,
613  minNofPoints,
614  maxNofPoints,
615  "track");
616  CreateH1Efficiency(histName,
617  "Angle",
618  "Polar angle [deg]",
622  "track");
623  CreateH2Efficiency(histName,
624  "YPt",
625  "Rapidity",
626  "P_{t} [GeV/c]",
627  fYRangeBins,
628  fYRangeMin,
629  fYRangeMax,
630  fPtRangeBins,
631  fPtRangeMin,
632  fPtRangeMax,
633  "track");
634  }
635  // TRD
637  string norm = LocalEfficiencyNormalization("Trd");
638  string histName = "hte_Trd_" + norm;
640  histName, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax, "track");
642  histName, "y", "Rapidity", fYRangeBins, fYRangeMin, fYRangeMax, "track");
643  CreateH1Efficiency(histName,
644  "pt",
645  "P_{t} [GeV/c]",
646  fPtRangeBins,
647  fPtRangeMin,
648  fPtRangeMax,
649  "track");
650  CreateH1Efficiency(histName,
651  "Np",
652  "Number of points",
653  nofBinsPoints,
654  minNofPoints,
655  maxNofPoints,
656  "track");
657  CreateH1Efficiency(histName,
658  "Angle",
659  "Polar angle [deg]",
663  "track");
664  CreateH2Efficiency(histName,
665  "YPt",
666  "Rapidity",
667  "P_{t} [GeV/c]",
668  fYRangeBins,
669  fYRangeMin,
670  fYRangeMax,
671  fPtRangeBins,
672  fPtRangeMin,
673  fPtRangeMax,
674  "track");
675  }
676  // TOF
678  string norm = LocalEfficiencyNormalization("Tof");
679  string histName = "hte_Tof_" + norm;
681  histName, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax, "track");
683  histName, "y", "Rapidity", fYRangeBins, fYRangeMin, fYRangeMax, "track");
684  CreateH1Efficiency(histName,
685  "pt",
686  "P_{t} [GeV/c]",
687  fPtRangeBins,
688  fPtRangeMin,
689  fPtRangeMax,
690  "track");
691  // CreateEfficiencyHistogram(histName, "Np", "Number of points", nofBinsPoints, minNofPoints, maxNofPoints, "track");
692  CreateH1Efficiency(histName,
693  "Angle",
694  "Polar angle [deg]",
698  "track");
699  CreateH2Efficiency(histName,
700  "YPt",
701  "Rapidity",
702  "P_{t} [GeV/c]",
703  fYRangeBins,
704  fYRangeMin,
705  fYRangeMax,
706  fPtRangeBins,
707  fPtRangeMin,
708  fPtRangeMax,
709  "track");
710  }
711 
712  // RICH
714  CreateH1Efficiency("hte_Rich_Rich",
715  "p",
716  "P [GeV/c]",
717  fPRangeBins,
718  fPRangeMin,
719  fPRangeMax,
720  "ring");
721  CreateH1Efficiency("hte_Rich_Rich",
722  "y",
723  "Rapidity",
724  fYRangeBins,
725  fYRangeMin,
726  fYRangeMax,
727  "ring");
728  CreateH1Efficiency("hte_Rich_Rich",
729  "pt",
730  "P_{t} [GeV/c]",
731  fPtRangeBins,
732  fPtRangeMin,
733  fPtRangeMax,
734  "ring");
735  CreateH1Efficiency("hte_Rich_Rich",
736  "RingNh",
737  "Number of hits",
738  nofBinsPoints,
739  minNofPoints,
740  maxNofPoints,
741  "ring");
742  CreateH1Efficiency("hte_Rich_Rich", "BoA", "B/A", 50, 0.0, 1.0, "ring");
744  "hte_Rich_Rich", "RingXc", "X [cm]", 60, -120, 120, "ring");
746  "hte_Rich_Rich", "RingYc", "|Y| [cm]", 25, 100, 200, "ring");
747  // CreateH1Efficiency("hte_Rich_Rich", "RadPos", "Radial position [cm]", 50, 0., 150., "ring");
748  CreateH2Efficiency("hte_Rich_Rich",
749  "RingXcYc",
750  "X [cm]",
751  "Y [cm]",
752  14,
753  -110.,
754  110,
755  60,
756  -300,
757  300,
758  "ring");
759  CreateH2Efficiency("hte_Rich_Rich",
760  "YPt",
761  "Rapidity",
762  "P_{t} [GeV/c]",
763  fYRangeBins,
764  fYRangeMin,
765  fYRangeMax,
766  fPtRangeBins,
767  fPtRangeMin,
768  fPtRangeMax,
769  "ring");
770  }
771 
772  // Global efficiency histograms
773  vector<string> histoNames = CreateGlobalTrackingHistogramNames();
774  for (Int_t iHist = 0; iHist < histoNames.size(); iHist++) {
775  string name = histoNames[iHist];
776  string opt = (name.find("Rich") == string::npos) ? "track" : "ring";
777  // Tracking efficiency
779  name, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax, opt);
781  name, "y", "Rapidity", fYRangeBins, fYRangeMin, fYRangeMax, opt);
783  name, "pt", "P_{t} [GeV/c]", fPtRangeBins, fPtRangeMin, fPtRangeMax, opt);
784  CreateH2Efficiency(name,
785  "YPt",
786  "Rapidity",
787  "P_{t} [GeV/c]",
788  fYRangeBins,
789  fYRangeMin,
790  fYRangeMax,
791  fPtRangeBins,
792  fPtRangeMin,
793  fPtRangeMax,
794  opt);
795 
796  //Global efficiency vs. RingXc or RingYc
797  if (name.find("Rich") != string::npos) {
798  CreateH1Efficiency(name, "RingXc", "Ring Xc [cm]", 60, -120, 120, opt);
799  CreateH1Efficiency(name, "RingYc", "|Ring Yc| [cm]", 25, 100, 200, opt);
800  }
801  // PID
802  opt += "_pid";
803  CreateH1Efficiency(FindAndReplace(name, "hte_", "hpe_"),
804  "p",
805  "P [GeV/c]",
806  fPRangeBins,
807  fPRangeMin,
808  fPRangeMax,
809  opt);
810  // CreateH1Efficiency(name, "y", "Rapidity", fYRangeBins, fYRangeMin, fYRangeMax, opt);
811  // CreateH1Efficiency(name, "pt", "P_{t} [GeV/c]", fPtRangeBins, fPtRangeMin, fPtRangeMax, opt);
812  // CreateH2Efficiency(name, "YPt", "Rapidity", "P_{t} [GeV/c]", fYRangeBins, fYRangeMin, fYRangeMax, fPtRangeBins, fPtRangeMin, fPtRangeMax, opt);
813  }
814 
815 
816  // Create histograms for pion suppression calculation
817  vector<string> psVariants = PionSuppressionVariants();
818  for (Int_t iHist = 0; iHist < psVariants.size(); iHist++) {
819  string name = "hps_" + psVariants[iHist];
821  name, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax);
823  name, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax);
825  name, "p", "P [GeV/c]", fPRangeBins, fPRangeMin, fPRangeMax);
826  }
827 
828  // // Create efficiency histograms with normalization to INPUT
829  // vector<TH1*> effHistos = fHM->H1Vector("hte_+*_Eff_+*");
830  // Int_t nofEffHistos = effHistos.size();
831  // set<string> effNamesSet;
832  // vector<string> effNormNames;
833  // for (Int_t iHist = 0; iHist < nofEffHistos; iHist++) {
834  // TH1* hist = effHistos[iHist];
835  // vector<string> split = Split(hist->GetName(), '_');
836  // string effName = split[1];
837  // string normName = split[2];
838  // if (effNamesSet.find(effName) == effNamesSet.end()) {
839  // effNamesSet.insert(effName);
840  // effNormNames.push_back(effName + "_" + normName);
841  // }
842  // }
843  // for (Int_t i = 0; i < effNormNames.size(); i++) {
844  // std::cout << i << " " << effNormNames[i] << std::endl;
845  // }
846  // Int_t nofEffNormNames = effNormNames.size();
847  // for (Int_t iHist = 0; iHist < effNormNames.size(); iHist++) {
848  //
849  // }
850  // //vector<string> effNormNames(effNormNamesSet.begin(), effNormNames.end());
851  // //
852 
853  // Create histograms for ghost tracks
855  CreateH1("hng_NofGhosts_Sts_Nh",
856  "Number of hits",
857  "Yield",
858  nofBinsPoints,
859  minNofPoints,
860  maxNofPoints);
862  CreateH1("hng_NofGhosts_Trd_Nh",
863  "Number of hits",
864  "Yield",
865  nofBinsPoints,
866  minNofPoints,
867  maxNofPoints);
869  CreateH1("hng_NofGhosts_Much_Nh",
870  "Number of hits",
871  "Yield",
872  nofBinsPoints,
873  minNofPoints,
874  maxNofPoints);
876  CreateH1("hng_NofGhosts_Rich_Nh",
877  "Number of hits",
878  "Yield",
879  nofBinsPoints,
880  minNofPoints,
881  maxNofPoints);
882  CreateH2("hng_NofGhosts_Rich_RingXcYc",
883  "X [cm]",
884  "Y [cm]",
885  "Ghosts per event",
886  28,
887  -110.,
888  110,
889  40,
890  -200,
891  200);
892  CreateH1("hng_NofGhosts_RichStsMatching_Nh",
893  "Number of hits",
894  "Yield",
895  nofBinsPoints,
896  minNofPoints,
897  maxNofPoints);
898  CreateH1("hng_NofGhosts_RichElId_Nh",
899  "Number of hits",
900  "Yield",
901  nofBinsPoints,
902  minNofPoints,
903  maxNofPoints);
904  CreateH1("hng_NofGhosts_StsRichMatching_Nh",
905  "Number of hits",
906  "Yield",
907  nofBinsPoints,
908  minNofPoints,
909  maxNofPoints);
910  }
911 
912  // Create track hits histograms
918 
919 
920  // Create number of object histograms
921  Int_t nofBinsC = 100000;
922  Double_t maxXC = 100000.;
923  CreateH1("hno_NofObjects_GlobalTracks",
924  "Tracks per event",
925  "Yield",
926  nofBinsC,
927  1.,
928  maxXC);
930  CreateH1("hno_NofObjects_StsTracks",
931  "Tracks per event",
932  "Yield",
933  nofBinsC,
934  1.,
935  maxXC);
937  CreateH1("hno_NofObjects_TrdTracks",
938  "Tracks per event",
939  "Yield",
940  nofBinsC,
941  1.,
942  maxXC);
944  CreateH1("hno_NofObjects_MuchTracks",
945  "Tracks per event",
946  "Yield",
947  nofBinsC,
948  1.,
949  maxXC);
951  CreateH1("hno_NofObjects_RichRings",
952  "Rings per event",
953  "Yield",
954  nofBinsC,
955  1.,
956  maxXC);
957  CreateH1("hno_NofObjects_RichProjections",
958  "Projections per event",
959  "Yield",
960  nofBinsC,
961  1.,
962  maxXC);
963  }
964 
965  // Histogram stores number of events
966  CreateH1("hen_EventNo_TrackingQa", "", "", 1, 0, 1.);
967 
968  cout << fHM->ToString();
969 }
970 
971 
973  // Clear all maps for MC to reco matching
974  map<string, multimap<pair<Int_t, Int_t>, Int_t>>::iterator it;
975  for (it = fMcToRecoMap.begin(); it != fMcToRecoMap.end(); it++) {
976  multimap<pair<Int_t, Int_t>, Int_t>& mcRecoMap = (*it).second;
977  mcRecoMap.clear();
978  //(*it).second.clear();
979  }
980 
982 
983  if (fGlobalTracks == nullptr) return;
984 
985  Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
986  for (Int_t iTrack = 0; iTrack < nofGlobalTracks; iTrack++) {
987  const CbmGlobalTrack* globalTrack =
988  static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iTrack));
989 
990  // get track segments indices
991  Int_t stsId = globalTrack->GetStsTrackIndex();
992  Int_t trdId = globalTrack->GetTrdTrackIndex();
993  Int_t muchId = globalTrack->GetMuchTrackIndex();
994  Int_t tofId = globalTrack->GetTofHitIndex();
995  Int_t richId = globalTrack->GetRichRingIndex();
996 
997  // check track segments
998  Bool_t isStsOk = stsId > -1 && fDet.GetDet(ECbmModuleId::kSts);
999  Bool_t isTrdOk = trdId > -1 && fDet.GetDet(ECbmModuleId::kTrd);
1000  Bool_t isMuchOk = muchId > -1 && fDet.GetDet(ECbmModuleId::kMuch);
1001  Bool_t isTofOk = tofId > -1 && fDet.GetDet(ECbmModuleId::kTof);
1002  Bool_t isRichOk = richId > -1 && fDet.GetDet(ECbmModuleId::kRich);
1003 
1004  Double_t rtDistance = 10;
1005 
1006  if (isRichOk) rtDistance = CbmRichUtil::GetRingTrackDistance(iTrack);
1007 
1008  // check the quality of track segments
1009  const CbmTrackMatchNew* stsTrackMatch;
1010  if (isStsOk) {
1011  stsTrackMatch =
1012  static_cast<const CbmTrackMatchNew*>(fStsMatches->At(stsId));
1013  isStsOk = stsTrackMatch->GetTrueOverAllHitsRatio() >= fQuota;
1015  if (!isStsOk) { // ghost track
1016  Int_t nofHits = stsTrackMatch->GetNofHits();
1017  fHM->H1("hng_NofGhosts_Sts_Nh")->Fill(nofHits);
1018 
1019  // calculate number of ghost after RICH matching
1020  if (isRichOk) {
1021  const CbmRichRing* ring =
1022  static_cast<const CbmRichRing*>(fRichRings->At(richId));
1023  if (NULL != ring) {
1024  if (CbmRichUtil::GetRingTrackDistance(iTrack) < 1.)
1025  fHM->H1("hng_NofGhosts_StsRichMatching_Nh")->Fill(nofHits);
1026  }
1027  }
1028  } else {
1029  ProcessMvd(stsId);
1030  }
1031  }
1032  const CbmTrackMatchNew* trdTrackMatch;
1033  if (isTrdOk) {
1034  trdTrackMatch =
1035  static_cast<const CbmTrackMatchNew*>(fTrdMatches->At(trdId));
1036  Int_t nofHits = trdTrackMatch->GetNofHits();
1037  if (nofHits >= fMinNofHitsTrd) {
1038  isTrdOk = trdTrackMatch->GetTrueOverAllHitsRatio() >= fQuota;
1040  if (!isTrdOk) { // ghost track
1041  fHM->H1("hng_NofGhosts_Trd_Nh")->Fill(nofHits);
1042  }
1043  } else {
1044  isTrdOk = false;
1045  }
1046  }
1047  const CbmTrackMatchNew* muchTrackMatch;
1048  if (isMuchOk) {
1049  muchTrackMatch =
1050  static_cast<const CbmTrackMatchNew*>(fMuchMatches->At(muchId));
1051  Int_t nofHits = muchTrackMatch->GetNofHits();
1052  if (nofHits >= fMinNofHitsMuch) {
1053  isMuchOk = muchTrackMatch->GetTrueOverAllHitsRatio() >= fQuota;
1055  if (!isMuchOk) { // ghost track
1056  fHM->H1("hng_NofGhosts_Much_Nh")->Fill(nofHits);
1057  }
1058  } else {
1059  isMuchOk = false;
1060  }
1061  }
1062  const CbmTrackMatchNew* richRingMatch;
1063  if (isRichOk) {
1064  richRingMatch =
1065  static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(richId));
1066  Int_t nofHits = richRingMatch->GetNofHits();
1067  isRichOk = richRingMatch->GetTrueOverAllHitsRatio() >= fQuotaRich;
1069  if (!isRichOk) { // ghost ring
1070  fHM->H1("hng_NofGhosts_Rich_Nh")->Fill(nofHits);
1071 
1072  const CbmRichRing* ring =
1073  static_cast<const CbmRichRing*>(fRichRings->At(richId));
1074  if (NULL != ring) {
1075  // ghost ring distribution vs position on photodetector plane
1076  fHM->H1("hng_NofGhosts_Rich_RingXcYc")
1077  ->Fill(ring->GetCenterX(), ring->GetCenterY());
1078 
1079  // calculate number of ghost after STS matching and electron identification
1080  if (rtDistance < 1.)
1081  fHM->H1("hng_NofGhosts_RichStsMatching_Nh")->Fill(nofHits);
1082 
1083  Double_t momentumMc = 0.;
1084  if (stsTrackMatch != NULL) {
1085  const CbmMCTrack* mcTrack = static_cast<const CbmMCTrack*>(
1086  fMCTracks->Get(stsTrackMatch->GetMatchedLink()));
1087  if (mcTrack != NULL) momentumMc = mcTrack->GetP();
1088  }
1089  if (rtDistance < 1.
1091  iTrack, momentumMc)) {
1092  fHM->H1("hng_NofGhosts_RichElId_Nh")->Fill(nofHits);
1093  }
1094  }
1095  }
1096  }
1097 
1098  // Get MC indices of track segments
1099  pair<Int_t, Int_t> stsMCId = {-1, -1}, trdMCId = {-1, -1},
1100  muchMCId = {-1, -1}, richMCId = {-1, -1};
1101  list<pair<Int_t, Int_t>> tofMCIds;
1102  if (isStsOk) {
1103  stsMCId = {stsTrackMatch->GetMatchedLink().GetEntry(),
1104  stsTrackMatch->GetMatchedLink().GetIndex()};
1105  }
1106  if (isTrdOk) {
1107  trdMCId = {trdTrackMatch->GetMatchedLink().GetEntry(),
1108  trdTrackMatch->GetMatchedLink().GetIndex()};
1109  }
1110  if (isMuchOk) {
1111  muchMCId = {muchTrackMatch->GetMatchedLink().GetEntry(),
1112  muchTrackMatch->GetMatchedLink().GetIndex()};
1113  }
1114  if (isTofOk) {
1115  const CbmMatch* tofMatch =
1116  static_cast<const CbmMatch*>(fTofMatches->At(tofId));
1117  const vector<CbmLink>& tofMCLinks = tofMatch->GetLinks();
1118 
1119  for (vector<CbmLink>::const_iterator tofMCIt = tofMCLinks.begin();
1120  tofMCIt != tofMCLinks.end();
1121  ++tofMCIt) {
1122  const FairMCPoint* tofPoint =
1123  static_cast<const FairMCPoint*>(fTofPoints->Get(*tofMCIt));
1124 
1125  if (tofPoint != NULL)
1126  tofMCIds.push_back(
1127  pair<Int_t, Int_t>(tofMCIt->GetEntry(), tofPoint->GetTrackID()));
1128  }
1129  }
1130  if (isRichOk) {
1131  richMCId = {richRingMatch->GetMatchedLink().GetEntry(),
1132  richRingMatch->GetMatchedLink().GetIndex()};
1133  }
1134 
1135  map<string, multimap<pair<Int_t, Int_t>, Int_t>>::iterator it;
1136  for (it = fMcToRecoMap.begin(); it != fMcToRecoMap.end(); it++) {
1137  string name = (*it).first;
1138  multimap<pair<Int_t, Int_t>, Int_t>& mcRecoMap = (*it).second;
1139  Bool_t sts = (name.find("Sts") != string::npos)
1140  ? isStsOk && stsMCId.second != -1
1141  : true;
1142  Bool_t trd = (name.find("Trd") != string::npos)
1143  ? isTrdOk && stsMCId == trdMCId
1144  : true;
1145  Bool_t much = (name.find("Much") != string::npos)
1146  ? isMuchOk && stsMCId == muchMCId
1147  : true;
1148  Bool_t tof = (name.find("Tof") != string::npos)
1149  ? isTofOk
1150  && find(tofMCIds.begin(), tofMCIds.end(), stsMCId)
1151  != tofMCIds.end()
1152  : true;
1153  Bool_t rich = (name.find("Rich") != string::npos)
1154  ? isRichOk && stsMCId == richMCId
1155  : true;
1156 
1157  if (sts && trd && much && tof && rich) {
1158  pair<pair<Int_t, Int_t>, Int_t> tmp = make_pair(stsMCId, iTrack);
1159  mcRecoMap.insert(tmp);
1160  }
1161  }
1162  }
1163 }
1164 
1166  if (!fDet.GetDet(ECbmModuleId::kRich)) return;
1167  Int_t nofRings = fRichRings->GetEntriesFast();
1168  for (Int_t iRing = 0; iRing < nofRings; iRing++) {
1169  const CbmTrackMatchNew* richRingMatch =
1170  static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(iRing));
1171  Bool_t isRichOk = richRingMatch->GetTrueOverAllHitsRatio() >= fQuotaRich;
1172  pair<Int_t, Int_t> richMCId = {
1173  isRichOk ? richRingMatch->GetMatchedLink().GetEntry() : -1,
1174  isRichOk ? richRingMatch->GetMatchedLink().GetIndex()
1175  : -1}; //GetMCTrackId() : -1;
1176  if (isRichOk && -1 != richMCId.second) {
1177  pair<pair<Int_t, Int_t>, Int_t> tmp = make_pair(richMCId, iRing);
1178  fMcToRecoMap["Rich"].insert(tmp);
1179  }
1180  }
1181 }
1182 
1183 void CbmLitTrackingQa::ProcessMvd(Int_t stsId) {
1184  if (!fDet.GetDet(ECbmModuleId::kMvd)) return;
1185  const CbmStsTrack* track =
1186  static_cast<const CbmStsTrack*>(fStsTracks->At(stsId));
1187  Int_t nofHits = track->GetNofMvdHits();
1188  fHM->H1("hth_Mvd_TrackHits_All")->Fill(nofHits);
1189 
1190  const CbmTrackMatchNew* stsTrackMatch =
1191  static_cast<const CbmTrackMatchNew*>(fStsMatches->At(stsId));
1192  Int_t stsMcTrackId = stsTrackMatch->GetMatchedLink().GetIndex();
1193 
1194  Int_t nofTrueHits = 0, nofFakeHits = 0;
1195  for (Int_t iHit = 0; iHit < nofHits; iHit++) {
1196  Int_t hitId = track->GetMvdHitIndex(iHit);
1197  const CbmMatch* hitMatch =
1198  static_cast<const CbmMatch*>(fMvdHitMatches->At(hitId));
1199  if (NULL == hitMatch) continue;
1200  Int_t pointId = hitMatch->GetMatchedLink().GetIndex();
1201  Int_t eventId = hitMatch->GetMatchedLink().GetEntry();
1202  const FairMCPoint* point =
1203  static_cast<const FairMCPoint*>(fMvdPoints->Get(0, eventId, pointId));
1204  if (NULL == point) continue;
1205  Int_t mcTrackId = point->GetTrackID();
1206  if (mcTrackId == stsMcTrackId) { // true hit
1207  nofTrueHits++;
1208  } else { // fake hit
1209  nofFakeHits++;
1210  }
1211  }
1212  fHM->H1("hth_Mvd_TrackHits_True")->Fill(nofTrueHits);
1213  fHM->H1("hth_Mvd_TrackHits_Fake")->Fill(nofFakeHits);
1214  if (nofHits != 0) {
1215  fHM->H1("hth_Mvd_TrackHits_TrueOverAll")
1216  ->Fill(Double_t(nofTrueHits) / Double_t(nofHits));
1217  fHM->H1("hth_Mvd_TrackHits_FakeOverAll")
1218  ->Fill(Double_t(nofFakeHits) / Double_t(nofHits));
1219  }
1220 }
1221 
1223  const CbmTrackMatchNew* trackMatch,
1224  ECbmModuleId detId) {
1225  string detName = (detId == ECbmModuleId::kSts)
1226  ? "Sts"
1227  : (detId == ECbmModuleId::kTrd)
1228  ? "Trd"
1229  : (detId == ECbmModuleId::kMuch)
1230  ? "Much"
1231  : (detId == ECbmModuleId::kRich) ? "Rich" : "";
1232  assert(detName != "");
1233  string histName = "hth_" + detName + "_TrackHits";
1234  fHM->H1(histName + "_All")->Fill(trackMatch->GetNofHits());
1235  fHM->H1(histName + "_True")->Fill(trackMatch->GetNofTrueHits());
1236  fHM->H1(histName + "_Fake")->Fill(trackMatch->GetNofWrongHits());
1237  fHM->H1(histName + "_TrueOverAll")
1238  ->Fill(trackMatch->GetTrueOverAllHitsRatio());
1239  fHM->H1(histName + "_FakeOverAll")
1240  ->Fill(trackMatch->GetWrongOverAllHitsRatio());
1241 }
1242 
1244  vector<TH1*> effHistos = fHM->H1Vector("(hte|hpe)_.*_Eff_.*");
1245  Int_t nofEffHistos = effHistos.size();
1246 
1247  Int_t nofMcTracks = fMCTracks->Size(0, iEvent);
1248  Int_t nofExistsMcTracks = 0;
1249  for (Int_t iMCTrack = 0; iMCTrack < nofMcTracks; ++iMCTrack) {
1250  const CbmMCTrack* mcTrack =
1251  static_cast<const CbmMCTrack*>(fMCTracks->Get(0, iEvent, iMCTrack));
1252 
1253  // Check accepted tracks cutting on minimal number of MC points
1254  if (!fMCTrackCreator->TrackExists(iEvent, iMCTrack)) { continue; }
1255 
1256  const CbmLitMCTrack& litMCTrack =
1257  fMCTrackCreator->GetTrack(iEvent, iMCTrack);
1258  Int_t nofPointsSts =
1260  Int_t nofPointsTrd =
1262  Int_t nofPointsMuch =
1264  Int_t nofPointsTof = litMCTrack.GetNofPoints(ECbmModuleId::kTof);
1265  Int_t nofHitsRich = litMCTrack.GetNofRichHits();
1266  Double_t boa = litMCTrack.GetRingBaxis() / litMCTrack.GetRingAaxis();
1267  if (litMCTrack.GetRingBaxis() == -1. || litMCTrack.GetRingAaxis() == -1)
1268  boa = -1.;
1269  Double_t ringX = litMCTrack.GetRingCenterX();
1270  Double_t ringY = litMCTrack.GetRingCenterY();
1271 
1272 
1273  // Check local tracks
1274  Bool_t stsConsecutive =
1277  >= fMinNofPointsSts
1278  : true;
1279  Bool_t isStsOk = nofPointsSts >= fMinNofPointsSts
1280  && fDet.GetDet(ECbmModuleId::kSts) && stsConsecutive;
1281  Bool_t isTrdOk =
1282  nofPointsTrd >= fMinNofPointsTrd && fDet.GetDet(ECbmModuleId::kTrd);
1283  Bool_t isMuchOk =
1284  nofPointsMuch >= fMinNofPointsMuch && fDet.GetDet(ECbmModuleId::kMuch);
1285  Bool_t isTofOk =
1286  nofPointsTof >= fMinNofPointsTof && fDet.GetDet(ECbmModuleId::kTof);
1287  Bool_t isRichOk =
1288  nofHitsRich >= fMinNofHitsRich && fDet.GetDet(ECbmModuleId::kRich);
1289 
1290  // calculate polar angle
1291  TVector3 mom;
1292  mcTrack->GetMomentum(mom);
1293  Double_t angle = std::abs(mom.Theta() * 180 / TMath::Pi());
1294  Double_t mcP = mcTrack->GetP();
1295  Double_t mcY = mcTrack->GetRapidity();
1296  Double_t mcPt = mcTrack->GetPt();
1297 
1298  // Fill parameter name to value map
1299  map<string, vector<Double_t>> parMap;
1300 
1301  vector<Double_t> tmp = list_of(mcP);
1302  parMap["p"] = tmp;
1303 
1304  vector<Double_t> tmp1 = list_of(mcY);
1305  parMap["y"] = tmp1;
1306 
1307  vector<Double_t> tmp2 = list_of(mcPt);
1308  parMap["pt"] = tmp2;
1309 
1310  vector<Double_t> tmp3 = list_of(angle);
1311  parMap["Angle"] = tmp3;
1312 
1313  vector<Double_t> tmp4 = list_of(0);
1314  parMap["Np"] =
1315  tmp4; // FIXME : correct to number of points in concrete detector!
1316  // Currently as a temporary solution it is reassigned later
1317 
1318  vector<Double_t> tmp5 = list_of(boa);
1319  parMap["BoA"] = tmp5;
1320 
1321  vector<Double_t> tmp5X = list_of(ringX);
1322  parMap["RingXc"] = tmp5X;
1323 
1324  vector<Double_t> tmp5Y = list_of(std::abs(ringY));
1325  parMap["RingYc"] = tmp5Y;
1326 
1327  vector<Double_t> tmp6 = list_of(ringX)(ringY);
1328  parMap["RingXcYc"] = tmp6;
1329 
1330  vector<Double_t> tmp7 = list_of(nofHitsRich);
1331  parMap["RingNh"] = tmp7;
1332 
1333  vector<Double_t> tmp8 = list_of(mcY)(mcPt);
1334  //parMap["RadPos"] = list_of(1);
1335  parMap["YPt"] = tmp8;
1336 
1337  for (Int_t iHist = 0; iHist < nofEffHistos; iHist++) {
1338  TH1* hist = effHistos[iHist];
1339  string histName = hist->GetName();
1340  vector<string> split = Split(histName, '_');
1341  string effName = split[1];
1342  string normName = split[2];
1343  string catName = split[3];
1344  string histTypeName = split[0];
1345  string parName = split[5];
1346  assert(parMap.count(parName) != 0);
1347 
1348  vector<Double_t> par = list_of(0);
1349  if (parName == "Np") {
1350  vector<Double_t> tmp = list_of(
1351  (effName == "Sts")
1352  ? nofPointsSts
1353  : (effName == "Trd")
1354  ? nofPointsTrd
1355  : (effName == "Much") ? nofPointsMuch
1356  : (effName == "Tof") ? nofPointsTof : 0);
1357  par = tmp;
1358  } else {
1359  par = parMap[parName];
1360  }
1361 
1362  Bool_t sts = (normName.find("Sts") != string::npos) ? isStsOk : true;
1363  Bool_t trd = (normName.find("Trd") != string::npos) ? isTrdOk : true;
1364  Bool_t much = (normName.find("Much") != string::npos) ? isMuchOk : true;
1365  Bool_t tof = (normName.find("Tof") != string::npos) ? isTofOk : true;
1366  Bool_t rich = (normName.find("Rich") != string::npos) ? isRichOk : true;
1367 
1368  if (effName == "Trd" || effName == "Much" || effName == "Tof") {
1369  string prevRecName = FindAndReplace(normName, effName, "");
1370  Bool_t isPrevRec =
1371  fMcToRecoMap[prevRecName].find(make_pair(iEvent, iMCTrack))
1372  != fMcToRecoMap[prevRecName].end();
1373  Bool_t accOk = isPrevRec && sts && trd && much && tof && rich;
1374  if (accOk) {
1376  iMCTrack,
1377  fMcToRecoMap[normName],
1378  histName,
1379  histTypeName,
1380  effName,
1381  catName,
1382  par);
1383  }
1384  } else {
1385  Bool_t accOk = sts && trd && much && tof && rich;
1386  if (accOk) {
1387  if (histName.find("Rich") == string::npos) {
1389  iMCTrack,
1390  fMcToRecoMap[effName],
1391  histName,
1392  histTypeName,
1393  effName,
1394  catName,
1395  par);
1396  } else {
1398  iMCTrack,
1399  fMcToRecoMap[effName],
1400  histName,
1401  histTypeName,
1402  effName,
1403  catName,
1404  par);
1405  }
1406  }
1407  }
1408  } // Loop over efficiency histograms
1409  } // Loop over MCTracks
1410 }
1411 
1413  Int_t mcEventId,
1414  Int_t mcId,
1415  const multimap<pair<Int_t, Int_t>, Int_t>& mcMap,
1416  const string& histName,
1417  const string& histTypeName,
1418  const string& effName,
1419  const string& catName,
1420  const vector<Double_t>& par) {
1421  string accHistName = FindAndReplace(histName, "_Eff_", "_Acc_");
1422  string recHistName = FindAndReplace(histName, "_Eff_", "_Rec_");
1423  LitTrackAcceptanceFunction function =
1424  fTrackAcceptanceFunctions.find(catName)->second;
1425  Bool_t accOk = function(fMCTracks, mcEventId, mcId);
1426  Bool_t recOk =
1427  (histTypeName == "hte")
1428  ? (mcMap.find(pair<Int_t, Int_t>(mcEventId, mcId)) != mcMap.end()
1429  && accOk)
1430  : (ElectronId(mcEventId, mcId, mcMap, effName) && accOk);
1431  Int_t nofParams = par.size();
1432  assert(nofParams < 3 && nofParams > 0);
1433  if (nofParams == 1) {
1434  if (accOk) { fHM->H1(accHistName)->Fill(par[0]); }
1435  if (recOk) { fHM->H1(recHistName)->Fill(par[0]); }
1436  } else if (nofParams == 2) {
1437  if (accOk) { fHM->H1(accHistName)->Fill(par[0], par[1]); }
1438  if (recOk) { fHM->H1(recHistName)->Fill(par[0], par[1]); }
1439  }
1440 }
1441 
1443  Int_t mcEventId,
1444  Int_t mcId,
1445  const multimap<pair<Int_t, Int_t>, Int_t>& mcMap,
1446  const string& histName,
1447  const string& histTypeName,
1448  const string& effName,
1449  const string& catName,
1450  const vector<Double_t>& par) {
1451  Int_t nofHitsInRing =
1452  fMCTrackCreator->GetTrack(mcEventId, mcId).GetNofRichHits();
1453  string accHistName = FindAndReplace(histName, "_Eff_", "_Acc_");
1454  string recHistName = FindAndReplace(histName, "_Eff_", "_Rec_");
1455  LitRingAcceptanceFunction function =
1456  fRingAcceptanceFunctions.find(catName)->second;
1457  Bool_t accOk = function(fMCTracks, mcEventId, mcId, nofHitsInRing);
1458  Bool_t recOk =
1459  (histTypeName == "hte")
1460  ? (mcMap.find(make_pair(mcEventId, mcId)) != mcMap.end() && accOk)
1461  : (ElectronId(mcEventId, mcId, mcMap, effName) && accOk);
1462  Int_t nofParams = par.size();
1463  assert(nofParams < 3 && nofParams > 0);
1464  if (nofParams == 1) {
1465  if (accOk) { fHM->H1(accHistName)->Fill(par[0]); }
1466  if (recOk) { fHM->H1(recHistName)->Fill(par[0]); }
1467  } else if (nofParams == 2) {
1468  if (accOk) { fHM->H1(accHistName)->Fill(par[0], par[1]); }
1469  if (recOk) { fHM->H1(recHistName)->Fill(par[0], par[1]); }
1470  }
1471 }
1472 
1473 Bool_t
1475  Int_t mcId,
1476  const multimap<pair<Int_t, Int_t>, Int_t>& mcMap,
1477  const string& effName) {
1478  multimap<pair<Int_t, Int_t>, Int_t>::const_iterator it =
1479  mcMap.find(pair<Int_t, Int_t>(mcEventId, mcId));
1480  if (it == mcMap.end()) return false;
1481  Int_t globalTrackIndex = (*it).second;
1482  const CbmMCTrack* mcTrack =
1483  static_cast<const CbmMCTrack*>(fMCTracks->Get(0, mcEventId, mcId));
1484  TVector3 mom;
1485  mcTrack->GetMomentum(mom);
1486  Bool_t isRichElectron =
1487  (fDet.GetDet(ECbmModuleId::kRich) && (effName.find("Rich") != string::npos))
1489  mom.Mag())
1490  : true;
1491  Bool_t isTrdElectron =
1492  (fDet.GetDet(ECbmModuleId::kTrd) && (effName.find("Trd") != string::npos))
1494  mom.Mag())
1495  : true;
1496  Bool_t isTofElectron =
1497  (fDet.GetDet(ECbmModuleId::kTof) && (effName.find("Tof") != string::npos))
1499  mom.Mag())
1500  : true;
1501  return isRichElectron && isTrdElectron && isTofElectron;
1502 }
1503 
1505  if (!(fGlobalTracks && fStsMatches && fRichProjections && fMCTracks)) return;
1506  vector<TH1*> histos = fHM->H1Vector("hps_.*_RecPions_.*");
1507  Int_t nofHistos = histos.size();
1508 
1509  Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
1510  for (Int_t iGT = 0; iGT < nofGlobalTracks; iGT++) {
1511  const CbmGlobalTrack* globalTrack =
1512  static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iGT));
1513  Int_t stsIndex = globalTrack->GetStsTrackIndex();
1514  if (stsIndex < 0) continue;
1515  const CbmTrackMatchNew* trackMatch =
1516  static_cast<const CbmTrackMatchNew*>(fStsMatches->At(stsIndex));
1517  const FairTrackParam* richProjection =
1518  static_cast<const FairTrackParam*>(fRichProjections->At(iGT));
1519  if (richProjection == NULL || richProjection->GetX() == 0
1520  || richProjection->GetY() == 0)
1521  continue;
1522  Int_t trdIndex = globalTrack->GetTrdTrackIndex();
1523  if (fDet.GetDet(ECbmModuleId::kTrd) && trdIndex < 0) continue;
1524  Int_t tofIndex = globalTrack->GetTofHitIndex();
1525  if (fDet.GetDet(ECbmModuleId::kTof) && tofIndex < 0) continue;
1526 
1527  if (trackMatch->GetNofLinks() <= 0) continue;
1528  Int_t mcIdSts = trackMatch->GetMatchedLink().GetIndex();
1529  Int_t mcIdStsEvent = trackMatch->GetMatchedLink().GetEntry();
1530  if (mcIdSts < 0) continue;
1531  const CbmMCTrack* mcTrack =
1532  static_cast<const CbmMCTrack*>(fMCTracks->Get(0, mcIdStsEvent, mcIdSts));
1533  TVector3 mom;
1534  mcTrack->GetMomentum(mom);
1535  Double_t p = mom.Mag();
1536  Int_t pdgSts = mcTrack->GetPdgCode();
1537  if (std::abs(pdgSts) == 211) {
1538  Bool_t isRichElectron =
1541  : true;
1542  Bool_t isTrdElectron =
1545  : true;
1546  Bool_t isTofElectron =
1549  : true;
1550 
1551  for (Int_t iHist = 0; iHist < nofHistos; iHist++) {
1552  histos[iHist]->Fill(p); // Fill RecPions histogramm
1553  string name = histos[iHist]->GetName();
1554  vector<string> split = Split(name, '_');
1555  string effName = split[1];
1556  string category = split[2];
1557  //cout << category << endl;
1558  Bool_t isElectron =
1559  ((effName.find("Rich") != string::npos) ? isRichElectron : true)
1560  && ((effName.find("Trd") != string::npos) ? isTrdElectron : true)
1561  && ((effName.find("Tof") != string::npos) ? isTofElectron : true);
1562  if (isElectron) {
1563 
1564  LitPiSuppAcceptanceFunction function =
1565  fPiSuppAcceptanceFunctions.find(category)->second;
1566  Bool_t ok =
1567  function(fGlobalTracks, fStsMatches, fRichRingMatches, iGT);
1568 
1569  if (ok) fHM->H1(FindAndReplace(name, "RecPions", "Rec"))->Fill(p);
1570  }
1571  }
1572  }
1573  }
1574 }
1575 
1577  if (fGlobalTracks != nullptr)
1578  fHM->H1("hno_NofObjects_GlobalTracks")
1579  ->Fill(fGlobalTracks->GetEntriesFast());
1581  fHM->H1("hno_NofObjects_StsTracks")->Fill(fStsTracks->GetEntriesFast());
1582  }
1584  fHM->H1("hno_NofObjects_RichRings")->Fill(fRichRings->GetEntriesFast());
1585  Int_t projCount = 0;
1586  Int_t nProj = fRichProjections->GetEntriesFast();
1587  for (Int_t iProj = 0; iProj < nProj; iProj++) {
1588  FairTrackParam* proj = (FairTrackParam*) fRichProjections->At(iProj);
1589  if (NULL == proj || proj->GetX() == 0. || proj->GetY() == 0) continue;
1590  projCount++;
1591  }
1592  fHM->H1("hno_NofObjects_RichProjections")->Fill(projCount);
1593  }
1595  fHM->H1("hno_NofObjects_TrdTracks")->Fill(fTrdMatches->GetEntriesFast());
1596  }
1598  fHM->H1("hno_NofObjects_MuchTracks")->Fill(fMuchMatches->GetEntriesFast());
1599  }
1600 }
1601 
CbmLitTrackingQa::fPtRangeMax
Double_t fPtRangeMax
Definition: CbmLitTrackingQa.h:318
CbmLitTrackingQa::fMinNofHitsTrd
Int_t fMinNofHitsTrd
Definition: CbmLitTrackingQa.h:307
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmMCDataManager::GetObject
CbmMCDataObject * GetObject(const char *name)
Definition: CbmMCDataManager.cxx:137
CbmMCTrack::GetMomentum
void GetMomentum(TVector3 &momentum) const
Definition: CbmMCTrack.h:172
split
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
Definition: ThermalParticleSystem.cxx:144
CbmMatch
Definition: CbmMatch.h:22
CbmLitTrackingQa::fMinNofPointsTof
Int_t fMinNofPointsTof
Definition: CbmLitTrackingQa.h:287
CbmMCDataManager.h
CbmLitTrackingQa::fMinNofPointsMuch
Int_t fMinNofPointsMuch
Definition: CbmLitTrackingQa.h:286
CbmLitTrackingQa::ProcessGlobalTracks
void ProcessGlobalTracks()
Loop over the reconstructed global tracks. Check if track is correct and fill multimap <MC track inde...
Definition: CbmLitTrackingQa.cxx:972
CbmTrackMatchNew::GetNofWrongHits
Int_t GetNofWrongHits() const
Definition: CbmTrackMatchNew.h:33
CbmHistManager::ToString
std::string ToString() const
Return string representation of class.
Definition: core/base/CbmHistManager.cxx:258
CbmLitAcceptanceFunction::KaonPlusTrackAcceptanceFunction
static Bool_t KaonPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:177
CbmLitTrackingQa::fRingCategories
vector< string > fRingCategories
Definition: CbmLitTrackingQa.h:349
CbmTrackMatchNew::GetTrueOverAllHitsRatio
Double_t GetTrueOverAllHitsRatio() const
Definition: CbmTrackMatchNew.h:35
CbmLitTrackingQa::PionSuppressionVariants
vector< string > PionSuppressionVariants()
Definition: CbmLitTrackingQa.cxx:524
CbmHistManager::WriteToFile
void WriteToFile()
Write all histograms to current opened file.
Definition: core/base/CbmHistManager.cxx:103
CbmLitTrackingQa::fPRangeMax
Double_t fPRangeMax
Definition: CbmLitTrackingQa.h:313
CbmGlobalTrack::GetMuchTrackIndex
Int_t GetMuchTrackIndex() const
Definition: CbmGlobalTrack.h:40
CbmLitTrackingQa::FillTrackAndRingAcceptanceFunctions
void FillTrackAndRingAcceptanceFunctions()
Definition: CbmLitTrackingQa.cxx:252
CbmLitMCTrack::GetNofPoints
UInt_t GetNofPoints(ECbmModuleId detId) const
Return number of MC points for specified detector id.
Definition: CbmLitMCTrack.h:108
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmLitTrackingQa::fTrdAnnCut
Double_t fTrdAnnCut
Definition: CbmLitTrackingQa.h:376
CbmLitTrackingQa::CbmLitTrackingQa
CbmLitTrackingQa()
Constructor.
Definition: CbmLitTrackingQa.cxx:46
CbmLitTrackingQa::CreateH2Efficiency
void CreateH2Efficiency(const string &name, const string &parameter, const string &xTitle, const string &yTitle, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY, const string &opt)
Definition: CbmLitTrackingQa.cxx:334
CbmStsSetup.h
CbmLitTrackingQa::fPtRangeBins
Int_t fPtRangeBins
Definition: CbmLitTrackingQa.h:319
CbmLitTrackingQa::CreateH1PionSuppression
void CreateH1PionSuppression(const string &name, const string &parameter, const string &xTitle, Int_t nofBins, Double_t minBin, Double_t maxBin)
Definition: CbmLitTrackingQa.cxx:374
CbmLitTrackingQa::fPRangeMin
Double_t fPRangeMin
Definition: CbmLitTrackingQa.h:311
CbmMCDataArray::Size
Int_t Size(Int_t fileNumber, Int_t eventNumber)
Definition: CbmMCDataArray.cxx:133
Cbm::FindAndReplace
string FindAndReplace(const string &name, const string &oldSubstr, const string &newSubstr)
Definition: CbmUtils.cxx:45
CbmLitAcceptanceFunction.h
Global function to define the track acceptance. Used in QA.
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
CbmLitTrackingQa::LitRingAcceptanceFunction
Bool_t(* LitRingAcceptanceFunction)(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitTrackingQa.h:360
CbmLitAcceptanceFunction::AllTrackAcceptanceFunction
static Bool_t AllTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:25
CbmLitTrackingQa::FillDefaultTrackCategories
void FillDefaultTrackCategories()
Fill array of track categories with default values.
Definition: CbmLitTrackingQa.cxx:218
CbmLitTrackingQa::fRichAnnCut
Double_t fRichAnnCut
Definition: CbmLitTrackingQa.h:377
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmLitTrackingQa::fRingCategoriesPID
vector< string > fRingCategoriesPID
Definition: CbmLitTrackingQa.h:352
CbmLitTrackingQaReport
Create report for tracking QA.
Definition: CbmLitTrackingQaReport.h:23
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmLitMCTrackCreator::Instance
static CbmLitMCTrackCreator * Instance()
Singleton instance.
Definition: CbmLitMCTrackCreator.cxx:63
CbmLitAcceptanceFunction::PionTrackAcceptanceFunction
static Bool_t PionTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:141
CbmMCDataManager::InitBranch
CbmMCDataArray * InitBranch(const char *name)
Definition: CbmMCDataManager.cxx:106
CbmStsSetup::Instance
static CbmStsSetup * Instance()
Definition: CbmStsSetup.cxx:293
CbmLitMCTrackCreator::GetTrack
const CbmLitMCTrack & GetTrack(int mcEventId, int mcId) const
Return CbmLitMCTrack by its index.
Definition: CbmLitMCTrackCreator.h:74
CbmLitTrackingQa::FillTrackQualityHistograms
void FillTrackQualityHistograms(const CbmTrackMatchNew *trackMatch, ECbmModuleId detId)
Definition: CbmLitTrackingQa.cxx:1222
CbmMCDataArray.h
CbmLitAcceptanceFunction::PrimaryElectronReferenceRingAcceptanceFunction
static Bool_t PrimaryElectronReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:225
CbmLitTrackingQaReport.h
Create report for tracking QA.
CbmGlobalTrack.h
CbmLitTrackingQa::fYRangeBins
Int_t fYRangeBins
Definition: CbmLitTrackingQa.h:324
CbmLitGlobalElectronId::IsTrdElectron
Bool_t IsTrdElectron(Int_t globalTrackindex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:82
ECbmModuleId::kMvd
@ kMvd
Micro-Vertex Detector.
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmLitTrackingQa::fDet
CbmLitDetectorSetup fDet
Definition: CbmLitTrackingQa.h:280
CbmLitGlobalElectronId::SetRichAnnCut
void SetRichAnnCut(Double_t par)
Set cut on RICH ANN output value.
Definition: CbmLitGlobalElectronId.h:107
CbmRichRing
Definition: CbmRichRing.h:17
CbmLitTrackingQa::fQuota
Double_t fQuota
Definition: CbmLitTrackingQa.h:289
CbmLitMCTrack::GetRingBaxis
Double_t GetRingBaxis() const
Return minor semi-axis of the ellipse.
Definition: CbmLitMCTrack.h:173
CbmLitTrackingQa::GlobalTrackVariants
vector< string > GlobalTrackVariants()
Definition: CbmLitTrackingQa.cxx:489
CbmLitTrackingQa::fOutputDir
string fOutputDir
Definition: CbmLitTrackingQa.h:279
CbmRichRing.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmLitAcceptanceFunction::PrimaryElectronRingAcceptanceFunction
static Bool_t PrimaryElectronRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:212
CbmMatch.h
CbmLitTrackingQa::fAngleRangeMin
Double_t fAngleRangeMin
Definition: CbmLitTrackingQa.h:325
CbmLitAcceptanceFunction::AllPiSuppAcceptanceFunction
static Bool_t AllPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:258
CbmHistManager.h
Histogram manager.
CbmLitTrackingQa::fStsMatches
TClonesArray * fStsMatches
Definition: CbmLitTrackingQa.h:336
CbmLitTrackingQa::LocalEfficiencyNormalization
string LocalEfficiencyNormalization(const string &detName)
Definition: CbmLitTrackingQa.cxx:552
CbmLitAcceptanceFunction::PrimaryTrackAcceptanceFunction
static Bool_t PrimaryTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:55
CbmLitMCTrack::GetNofRichHits
Int_t GetNofRichHits() const
Return number of RICH hits in ring.
Definition: CbmLitMCTrack.h:149
CbmLitTrackingQa::fMCTrackCreator
CbmLitMCTrackCreator * fMCTrackCreator
Definition: CbmLitTrackingQa.h:281
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmLitGlobalElectronId::IsRichElectron
Bool_t IsRichElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:52
CbmLitGlobalElectronId::SetTrdAnnCut
void SetTrdAnnCut(Double_t par)
Set cut on TRD ANN output value.
Definition: CbmLitGlobalElectronId.h:97
CbmRichUtil::GetRingTrackDistance
static Double_t GetRingTrackDistance(Int_t globalTrackId)
Definition: alignment/CbmRichUtil.h:20
CbmStsTrack::GetNofMvdHits
Int_t GetNofMvdHits() const
Definition: CbmStsTrack.h:84
CbmTrackMatchNew::GetWrongOverAllHitsRatio
Double_t GetWrongOverAllHitsRatio() const
Definition: CbmTrackMatchNew.h:39
CbmLitTrackingQa::fMinNofPointsSts
Int_t fMinNofPointsSts
Definition: CbmLitTrackingQa.h:284
CbmLitTrackingQa::fRingAcceptanceFunctions
map< string, LitRingAcceptanceFunction > fRingAcceptanceFunctions
Definition: CbmLitTrackingQa.h:372
CbmLitAcceptanceFunction::ProtonTrackAcceptanceFunction
static Bool_t ProtonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:123
CbmLitTrackingQa::Exec
virtual void Exec(Option_t *opt)
Derived from FairTask.
Definition: CbmLitTrackingQa.cxx:134
CbmLitTrackingQa::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmLitTrackingQa.h:339
CbmLitAcceptanceFunction::KaonTrackAcceptanceFunction
static Bool_t KaonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:168
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmHit.h
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmLitTrackingQa::fUseConsecutivePointsInSts
Bool_t fUseConsecutivePointsInSts
Definition: CbmLitTrackingQa.h:292
CbmLitAcceptanceFunction::PionReferenceRingAcceptanceFunction
static Bool_t PionReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:248
CbmLitTrackingQa::FillGlobalReconstructionHistos
void FillGlobalReconstructionHistos(Int_t mcEventId, Int_t mcId, const multimap< pair< Int_t, Int_t >, Int_t > &mcMap, const string &histName, const string &histTypeName, const string &effName, const string &catName, const vector< Double_t > &par)
Fill histograms of accepted and reconstructed tracks.
Definition: CbmLitTrackingQa.cxx:1412
h
Data class with information on a STS local track.
CbmLitTrackingQa::CreateTrackHitsHistogram
void CreateTrackHitsHistogram(const string &detName)
Definition: CbmLitTrackingQa.cxx:431
CbmLitTrackingQa::fTrackAcceptanceFunctions
map< string, LitTrackAcceptanceFunction > fTrackAcceptanceFunctions
Definition: CbmLitTrackingQa.h:370
CbmLitTrackingQa::IncreaseCounters
void IncreaseCounters()
Increase number of objects counters.
Definition: CbmLitTrackingQa.cxx:1576
CbmMCDataArray::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataArray.h:47
CbmLitAcceptanceFunction::PionRingAcceptanceFunction
static Bool_t PionRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:238
CbmLitTrackingQa::FillDefaultTrackPIDCategories
void FillDefaultTrackPIDCategories()
Definition: CbmLitTrackingQa.cxx:231
CbmGlobalTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: CbmGlobalTrack.h:39
CbmTrackMatchNew.h
CbmLitTrackingQaStudyReport.h
Creates study report for tracking QA.
CbmLitDetectorSetup::GetDet
bool GetDet(ECbmModuleId detId) const
Return detector presence in setup.
Definition: CbmLitDetectorSetup.cxx:27
CbmLitTrackingQa::Finish
virtual void Finish()
Derived from FairTask.
Definition: CbmLitTrackingQa.cxx:148
CbmLitTrackingQa::fTrackCategories
vector< string > fTrackCategories
Definition: CbmLitTrackingQa.h:348
CbmSimulationReport::Create
void Create(CbmHistManager *histManager, const std::string &outputDir)
Main function which creates report data.
CbmLitMCTrack::GetRingCenterY
Double_t GetRingCenterY() const
Return Y coordinate of the ellipse center.
Definition: CbmLitMCTrack.h:197
CbmLitTrackingQa::FillGlobalReconstructionHistosRich
void FillGlobalReconstructionHistosRich(Int_t mcEventId, Int_t mcId, const multimap< pair< Int_t, Int_t >, Int_t > &mcMap, const string &histName, const string &histTypeName, const string &effName, const string &catName, const vector< Double_t > &par)
Fill histograms of accepted and reconstructed rings tracks.
Definition: CbmLitTrackingQa.cxx:1442
ClassImp
ClassImp(CbmLitTrackingQa)
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
CbmLitMCTrackCreator.h
Creates CbmLitMCTrack objects.
CbmLitAcceptanceFunction::TrueMatchPiSuppAcceptanceFunction
static Bool_t TrueMatchPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:266
CbmLitTrackingQa::fMinNofHitsRich
Int_t fMinNofHitsRich
Definition: CbmLitTrackingQa.h:295
CbmLitTrackingQa::CreateGlobalTrackingHistogramNames
vector< string > CreateGlobalTrackingHistogramNames()
Definition: CbmLitTrackingQa.cxx:462
CbmLitTrackingQa::~CbmLitTrackingQa
virtual ~CbmLitTrackingQa()
Destructor.
Definition: CbmLitTrackingQa.cxx:93
CbmLitTrackingQa::FillDefaultPiSuppCategories
void FillDefaultPiSuppCategories()
Definition: CbmLitTrackingQa.cxx:245
CbmLitTrackingQa::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmLitTrackingQa.h:332
CbmLitTrackingQa::fHM
CbmHistManager * fHM
Definition: CbmLitTrackingQa.h:278
CbmLitMCTrack::GetRingAaxis
Double_t GetRingAaxis() const
Return major semi-axis of the ellipse.
Definition: CbmLitMCTrack.h:161
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmTrackMatchNew::GetNofHits
Int_t GetNofHits() const
Definition: CbmTrackMatchNew.h:34
CbmStsSetup::Init
Bool_t Init(const char *geometryFile=nullptr)
Initialise the setup.
Definition: CbmStsSetup.cxx:201
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmLitTrackingQa::fQuotaRich
Double_t fQuotaRich
Definition: CbmLitTrackingQa.h:297
CbmLitTrackingQa::LitTrackAcceptanceFunction
Bool_t(* LitTrackAcceptanceFunction)(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitTrackingQa.h:357
CbmLitTrackingQa::FillDefaultRingPIDCategories
void FillDefaultRingPIDCategories()
Definition: CbmLitTrackingQa.cxx:238
CbmStsSetup
Class representing the top level of the STS setup.
Definition: CbmStsSetup.h:39
CbmLitTrackingQa::fPRangeBins
Int_t fPRangeBins
Definition: CbmLitTrackingQa.h:314
CbmLitTrackingQa::CreateHistograms
void CreateHistograms()
Definition: CbmLitTrackingQa.cxx:568
CbmUtils.h
CbmMCTrack::GetPt
Double_t GetPt() const
Definition: CbmMCTrack.h:99
CbmMCDataManager
Task class creating and managing CbmMCDataArray objects.
Definition: CbmMCDataManager.h:27
CbmLitTrackingQa::fRichProjections
TClonesArray * fRichProjections
Definition: CbmLitTrackingQa.h:338
CbmLitGlobalElectronId::IsTofElectron
Bool_t IsTofElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:99
ECbmModuleId::kTrd
@ kTrd
Transition Radiation Detector.
CbmLitMCTrack::GetNofPointsInDifferentStations
UInt_t GetNofPointsInDifferentStations(ECbmModuleId detId) const
Return number of MC points in different stations for specified detector id.
Definition: CbmLitMCTrack.h:117
CbmLitMCTrack::GetNofConsecutivePoints
Int_t GetNofConsecutivePoints(ECbmModuleId detId) const
Return number of consecutive MC points for specified detector id. Currently works only for STS.
Definition: CbmLitMCTrack.h:127
CbmLitAcceptanceFunction::PrimaryElectronTrackAcceptanceFunction
static Bool_t PrimaryElectronTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:83
CbmLitTrackingQa::fYRangeMax
Double_t fYRangeMax
Definition: CbmLitTrackingQa.h:323
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: CbmMCTrack.cxx:177
CbmLitMCTrack::GetRingCenterX
Double_t GetRingCenterX() const
Return X coordinate of the ellipse center.
Definition: CbmLitMCTrack.h:185
CbmLitMCTrack
Monte-Carlo track.
Definition: CbmLitMCTrack.h:30
CbmMCTrack.h
CbmLitTrackingQa::CreateH2
void CreateH2(const string &name, const string &xTitle, const string &yTitle, const string &zTitle, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Definition: CbmLitTrackingQa.cxx:409
CbmTrackMatchNew::GetNofTrueHits
Int_t GetNofTrueHits() const
Definition: CbmTrackMatchNew.h:32
CbmLitAcceptanceFunction::AllReferenceRingAcceptanceFunction
static Bool_t AllReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:202
CbmLitMCTrackCreator::TrackExists
bool TrackExists(int mcEventId, int mcId) const
Check whether a track exists in the array.
Definition: CbmLitMCTrackCreator.h:64
CbmLitTrackingQa.h
FairTask for tracking performance calculation.
CbmHistManager::H1Vector
std::vector< TH1 * > H1Vector(const std::string &pattern) const
Return vector of pointers to TH1 histogram.
Definition: core/base/CbmHistManager.cxx:79
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmLitAcceptanceFunction::PionMinusTrackAcceptanceFunction
static Bool_t PionMinusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:159
CbmLitTrackingQa
Definition: CbmLitTrackingQa.h:32
CbmLitTrackingQa::fTrdMatches
TClonesArray * fTrdMatches
Definition: CbmLitTrackingQa.h:341
CbmLitTrackingQa::FillDefaultRingCategories
void FillDefaultRingCategories()
Definition: CbmLitTrackingQa.cxx:225
CbmLitAcceptanceFunction::SecondaryTrackAcceptanceFunction
static Bool_t SecondaryTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:74
CbmLitAcceptanceFunction::KaonMinusTrackAcceptanceFunction
static Bool_t KaonMinusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:186
CbmLitTrackingQa::CreateH1Efficiency
void CreateH1Efficiency(const string &name, const string &parameter, const string &xTitle, Int_t nofBins, Double_t minBin, Double_t maxBin, const string &opt)
Definition: CbmLitTrackingQa.cxx:304
CbmLitTrackingQa::fRichRings
TClonesArray * fRichRings
Definition: CbmLitTrackingQa.h:337
CbmStsTrack::GetMvdHitIndex
Int_t GetMvdHitIndex(Int_t iHit) const
Definition: CbmStsTrack.h:70
CbmLitTrackingQa::LitPiSuppAcceptanceFunction
Bool_t(* LitPiSuppAcceptanceFunction)(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitTrackingQa.h:364
CbmLitTrackingQa::fYRangeMin
Double_t fYRangeMin
Definition: CbmLitTrackingQa.h:321
CbmLitTrackingQa::fMvdPoints
CbmMCDataArray * fMvdPoints
Definition: CbmLitTrackingQa.h:333
CbmLitAcceptanceFunction::PionPlusTrackAcceptanceFunction
static Bool_t PionPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:150
CbmLitTrackingQa::CreateH1
void CreateH1(const string &name, const string &xTitle, const string &yTitle, Int_t nofBins, Double_t minBin, Double_t maxBin)
Definition: CbmLitTrackingQa.cxx:395
CbmLitTrackingQa::PionSuppression
void PionSuppression()
Definition: CbmLitTrackingQa.cxx:1504
CbmRichRing::GetCenterY
Float_t GetCenterY() const
Definition: CbmRichRing.h:81
CbmLitTrackingQa::fMinNofHitsMuch
Int_t fMinNofHitsMuch
Definition: CbmLitTrackingQa.h:308
CbmLitTrackingQa::fMinNofPointsTrd
Int_t fMinNofPointsTrd
Definition: CbmLitTrackingQa.h:285
CbmSimulationReport
Base class for simulation reports.
Definition: CbmSimulationReport.h:28
CbmLitTrackingQa::fPtRangeMin
Double_t fPtRangeMin
Definition: CbmLitTrackingQa.h:316
CbmLitTrackingQa::ReadDataBranches
void ReadDataBranches()
Read data branches from input data files.
Definition: CbmLitTrackingQa.cxx:165
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmLitAcceptanceFunction::AllRingAcceptanceFunction
static Bool_t AllRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:195
CbmMatch::GetLinks
const std::vector< CbmLink > & GetLinks() const
Definition: CbmMatch.h:36
CbmLitTrackingQa::fAngleRangeMax
Double_t fAngleRangeMax
Definition: CbmLitTrackingQa.h:326
CbmLitTrackingQa::ProcessMvd
void ProcessMvd(Int_t stsId)
Check correctness attached MVD hits.
Definition: CbmLitTrackingQa.cxx:1183
CbmLitGlobalElectronId.h
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
CbmLitTrackingQa::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmLitTrackingQa.h:331
CbmLitTrackingQa::fAngleRangeBins
Int_t fAngleRangeBins
Definition: CbmLitTrackingQa.h:328
CbmLitTrackingQa::fMuchMatches
TClonesArray * fMuchMatches
Definition: CbmLitTrackingQa.h:340
CbmLitTrackingQa::ElectronId
Bool_t ElectronId(Int_t mcEventId, Int_t mcId, const multimap< pair< Int_t, Int_t >, Int_t > &mcMap, const string &effName)
Definition: CbmLitTrackingQa.cxx:1474
CbmLitDetectorSetup::GetElectronSetup
bool GetElectronSetup() const
Return true if electron setup is detected.
Definition: CbmLitDetectorSetup.h:60
CbmStsTrack
Definition: CbmStsTrack.h:37
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmLitTrackingQa::ProcessRichRings
void ProcessRichRings()
Loop over the reconstructed RICH rings. Check if ring is correct and fill multimap <MC track index,...
Definition: CbmLitTrackingQa.cxx:1165
CbmLitTrackingQa::fTofPoints
CbmMCDataArray * fTofPoints
Definition: CbmLitTrackingQa.h:342
CbmLitTrackingQa::fPiSuppAcceptanceFunctions
map< string, LitPiSuppAcceptanceFunction > fPiSuppAcceptanceFunctions
Definition: CbmLitTrackingQa.h:374
CbmLitTrackingQa::fMcToRecoMap
map< string, multimap< pair< Int_t, Int_t >, Int_t > > fMcToRecoMap
Definition: CbmLitTrackingQa.h:346
CbmLitAcceptanceFunction::WrongMatchPiSuppAcceptanceFunction
static Bool_t WrongMatchPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:288
CbmLitTrackingQa::fPiSuppCategories
vector< string > fPiSuppCategories
Definition: CbmLitTrackingQa.h:353
CbmLitTrackingQa::fMvdHitMatches
TClonesArray * fMvdHitMatches
Definition: CbmLitTrackingQa.h:334
CbmLitAcceptanceFunction::PrimaryMuonTrackAcceptanceFunction
static Bool_t PrimaryMuonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:94
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
PairAnalysisStyler::Fill
static Int_t Fill[]
Definition: PairAnalysisStyleDefs.h:82
CbmLitMCTrackCreator::Create
void Create(Int_t eventNum)
Creates array of CbmLitMCTracks for current event.
Definition: CbmLitMCTrackCreator.cxx:68
CbmLitTrackingQa::fTrackCategoriesPID
vector< string > fTrackCategoriesPID
Definition: CbmLitTrackingQa.h:350
CbmLitGlobalElectronId::GetInstance
static CbmLitGlobalElectronId & GetInstance()
Definition: CbmLitGlobalElectronId.h:32
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
Cbm::Split
vector< string > Split(const string &name, char delimiter)
Definition: CbmUtils.cxx:54
CbmRichRing::GetCenterX
Float_t GetCenterX() const
Definition: CbmRichRing.h:80
CbmLitTrackingQa::fTofMatches
TClonesArray * fTofMatches
Definition: CbmLitTrackingQa.h:343
CbmStsSetup::IsInit
Bool_t IsInit() const
Initialisation status for sensor parameters.
Definition: CbmStsSetup.h:124
CbmLitAcceptanceFunction::ReferenceTrackAcceptanceFunction
static Bool_t ReferenceTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:65
CbmLitTrackingQa::fStsTracks
TClonesArray * fStsTracks
Definition: CbmLitTrackingQa.h:335
CbmLitTrackingQa::Init
virtual InitStatus Init()
Derived from FairTask.
Definition: CbmLitTrackingQa.cxx:97
CbmLitTrackingQa::ProcessMcTracks
void ProcessMcTracks(Int_t iEvent)
Loop over the MC tracks. Check track acceptance for different cases. Fill histograms of accepted and ...
Definition: CbmLitTrackingQa.cxx:1243
CbmLitDetectorSetup::DetermineSetup
void DetermineSetup()
Determines detector presence using TGeoManager.
Definition: CbmLitDetectorSetup.cxx:79
CbmHistManager::Add
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
Definition: CbmHistManager.h:58