CbmRoot
CbmLitTofQa.cxx
Go to the documentation of this file.
1 
6 #include "CbmLitTofQa.h"
7 #include "CbmGlobalTrack.h"
8 #include "CbmHistManager.h"
10 #include "CbmKFVertex.h"
11 #include "CbmLitTofQaReport.h"
12 #include "CbmMCDataManager.h"
13 #include "CbmMCTrack.h"
14 #include "CbmStsTrack.h"
15 #include "CbmTofHit.h"
16 #include "CbmTofPoint.h"
17 #include "CbmTofTrack.h"
18 #include "CbmTrackMatchNew.h"
19 #include "CbmVertex.h"
20 #include "TClonesArray.h"
21 #include "TDatabasePDG.h"
22 #include "TH2F.h"
23 #include "TParticlePDG.h"
25 #include <TFile.h>
26 #include <boost/assign/list_of.hpp>
27 #include <cmath>
28 #include <utility>
29 #include <vector>
30 
31 using boost::assign::list_of;
32 using std::make_pair;
33 using std::min;
34 using std::pair;
35 using std::sqrt;
36 using std::vector;
37 
39  : fIsFixedBounds(true)
40  , fOutputDir("./test/")
41  , fHM(NULL)
42  , fPRangeMin(0.)
43  , fPRangeMax(15.)
44  , fPRangeBins(400)
45  , fGlobalTracks(NULL)
46  , fStsTracks(NULL)
47  , fStsTrackMatches(NULL)
48  , fTofHits(NULL)
49  , fTofPoints(NULL)
50  , fTofHitsMatches(NULL)
51  , fTofTracks(NULL)
52  , fMCTracks(NULL)
53  , fPrimVertex(NULL)
54  , fKFFitter()
55  , fTrackCategories()
56  , fTrackAcceptanceFunctions()
57  , fMCTrackIdForTofHits()
58  , fMCTrackIdForTofPoints() {
60 }
61 
63  if (fHM) delete fHM;
64 }
65 
66 InitStatus CbmLitTofQa::Init() {
67  fHM = new CbmHistManager();
70  fKFFitter.Init();
71  return kSUCCESS;
72 }
73 
74 void CbmLitTofQa::Exec(Option_t* opt) {
75  static Int_t nofEvents = 0;
76  nofEvents++;
77  std::cout << "CbmLitTofQa::Exec: event=" << nofEvents << std::endl;
78  ProcessMC(nofEvents - 1);
82 }
83 
85  FitHistograms();
86 
87  TDirectory* oldir = gDirectory;
88  TFile* outFile = FairRootManager::Instance()->GetOutFile();
89  if (outFile != NULL) {
90  outFile->cd();
91  fHM->WriteToFile();
92  }
93  gDirectory->cd(oldir->GetPath());
94 
95  CbmSimulationReport* report = new CbmLitTofQaReport();
96  report->Create(fHM, fOutputDir);
97  delete report;
98 }
99 
101  FairRootManager* ioman = FairRootManager::Instance();
102  assert(ioman != NULL);
103 
104  CbmMCDataManager* mcManager =
105  (CbmMCDataManager*) ioman->GetObject("MCDataManager");
106 
107  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
108  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
109  fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
110  fTofHits = (TClonesArray*) ioman->GetObject("TofHit");
111  fTofHitsMatches = (TClonesArray*) ioman->GetObject("TofHitMatch");
112  fTofPoints = mcManager->InitBranch("TofPoint");
113  fTofTracks = (TClonesArray*) ioman->GetObject("TofTrack");
114  fMCTracks = mcManager->InitBranch("MCTrack");
115  // fPrimVertex = (CbmVertex*) ioman->GetObject("PrimaryVertex");
116  // Get pointer to PrimaryVertex object from IOManager if it exists
117  // The old name for the object is "PrimaryVertex" the new one
118  // "PrimaryVertex." Check first for the new name
119  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
120  if (nullptr == fPrimVertex) {
121  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex"));
122  }
123  if (nullptr == fPrimVertex) {
124  // LOG(fatal) << "No primary vertex";
125  }
126 }
127 
129  vector<string> tmp = list_of("All")("Positive")("Negative")("Primary")(
130  "Secondary")("Electron")("Muon")("Proton")("AntiProton")("Pion")(
131  "PionPlus")("PionMinus")("Kaon")("KaonPlus")("KaonMinus");
132  fTrackCategories = tmp;
133  // List of all supported track categories
136  fTrackAcceptanceFunctions["Positive"] =
138  fTrackAcceptanceFunctions["Negative"] =
140  fTrackAcceptanceFunctions["Primary"] =
142  fTrackAcceptanceFunctions["Secondary"] =
144  fTrackAcceptanceFunctions["Electron"] =
146  fTrackAcceptanceFunctions["Muon"] =
148  fTrackAcceptanceFunctions["Proton"] =
150  fTrackAcceptanceFunctions["AntiProton"] =
152  fTrackAcceptanceFunctions["Pion"] =
154  fTrackAcceptanceFunctions["PionPlus"] =
156  fTrackAcceptanceFunctions["PionMinus"] =
158  fTrackAcceptanceFunctions["Kaon"] =
160  fTrackAcceptanceFunctions["KaonPlus"] =
162  fTrackAcceptanceFunctions["KaonMinus"] =
164 }
165 
167  Int_t nofTrackCategories = fTrackCategories.size();
168  for (Int_t iCat = 0; iCat < nofTrackCategories; iCat++) {
169  string name = "hmp_Tof_Reco_" + fTrackCategories[iCat] + "_m2p";
170  fHM->Add(name,
171  new TH2F(name.c_str(),
172  string(name + ";P [GeV/c];M^{2} [(GeV/c)^{2}]").c_str(),
173  fPRangeBins,
174  fPRangeMin,
175  fPRangeMax,
176  400,
177  -0.2,
178  1.8));
179  name = "hmp_Tof_RecoMCID_" + fTrackCategories[iCat] + "_m2p";
180  fHM->Add(name,
181  new TH2F(name.c_str(),
182  string(name + ";P [GeV/c];M^{2} [(GeV/c)^{2}]").c_str(),
183  fPRangeBins,
184  fPRangeMin,
185  fPRangeMax,
186  400,
187  -0.2,
188  1.8));
189  name = "hmp_Tof_RecoAccTof_" + fTrackCategories[iCat] + "_m2p";
190  fHM->Add(name,
191  new TH2F(name.c_str(),
192  string(name + ";P [GeV/c];M^{2} [(GeV/c)^{2}]").c_str(),
193  fPRangeBins,
194  fPRangeMin,
195  fPRangeMax,
196  400,
197  -0.2,
198  1.8));
199  name = "hmp_Tof_RecoMCIDAccTof_" + fTrackCategories[iCat] + "_m2p";
200  fHM->Add(name,
201  new TH2F(name.c_str(),
202  string(name + ";P [GeV/c];M^{2} [(GeV/c)^{2}]").c_str(),
203  fPRangeBins,
204  fPRangeMin,
205  fPRangeMax,
206  400,
207  -0.2,
208  1.8));
209 
210  name = "hmp_TofTrack_" + fTrackCategories[iCat] + "_Distance";
211  fHM->Add(
212  name,
213  new TH1F(
214  name.c_str(), string(name + ";Distance [cm]").c_str(), 200, 0., 50.));
215  name = "hmp_TofTrack_" + fTrackCategories[iCat] + "_NormDistance";
216  fHM->Add(name,
217  new TH1F(name.c_str(),
218  string(name + ";Normalized distance").c_str(),
219  200,
220  0.,
221  50.));
222  name = "hmp_TofTrack_" + fTrackCategories[iCat] + "_Length";
223  fHM->Add(
224  name,
225  new TH1F(
226  name.c_str(), string(name + ";Length [cm]").c_str(), 1200, 0., 1200.));
227  name = "hmp_TofTrack_" + fTrackCategories[iCat] + "_NofHitsPerGlobalTrack";
228  fHM->Add(name,
229  new TH1F(name.c_str(),
230  string(name + ";number of hits per global track").c_str(),
231  11,
232  -0.5,
233  10.5));
234  }
235  string name = "hmp_Tof_dTime";
236  fHM->Add(name,
237  new TH1F(name.c_str(),
238  string(name + ";dt [ps];Counter").c_str(),
239  1000,
240  -500.,
241  500.));
242  name = "hmp_Tof_TimeZero_a";
243  fHM->Add(name,
244  new TH1F(name.c_str(),
245  string(name + ";Time [ns];Counter").c_str(),
246  2000,
247  0.,
248  36.));
249  name = "hmp_Tof_TimeZero_reco";
250  fHM->Add(name,
251  new TH1F(name.c_str(),
252  string(name + ";Time [ns];Counter").c_str(),
253  2000,
254  -5.,
255  15.));
256  name = "hmp_Tof_TimeZero_mc";
257  fHM->Add(name,
258  new TH1F(name.c_str(),
259  string(name + ";Time [ns];Counter").c_str(),
260  2000,
261  -5.,
262  15.));
263  name = "hmp_Tof_TimeZero_NofTracks";
264  fHM->Add(name,
265  new TH1F(name.c_str(),
266  string(name + ";Number of tracks;Counter").c_str(),
267  100,
268  0.,
269  100.));
270  name = "hmp_Tof_Time_FirstTrack";
271  fHM->Add(name,
272  new TH1F(name.c_str(),
273  string(name + ";Time [ns];Counter").c_str(),
274  2000,
275  0.,
276  36.));
277 }
278 
279 void CbmLitTofQa::ProcessMC(Int_t iEvent) {
280  fMCTrackIdForTofHits.clear();
281  fMCTrackIdForTofPoints.clear();
282 
283  Int_t nofHits = fTofHits->GetEntriesFast();
284  for (Int_t iHit = 0; iHit < nofHits; iHit++) {
285  const CbmTofHit* tofHit = static_cast<const CbmTofHit*>(fTofHits->At(iHit));
286  CbmMatch* tofHitMatch = static_cast<CbmMatch*>(fTofHitsMatches->At(iHit));
287  if (tofHitMatch == NULL) { continue; }
288  Int_t tofPointIndex = tofHitMatch->GetMatchedLink().GetIndex();
289  Int_t tofPointEventNo = tofHitMatch->GetMatchedLink().GetEntry();
290  const CbmTofPoint* tofPoint = static_cast<const CbmTofPoint*>(
291  fTofPoints->Get(0, tofPointEventNo, tofPointIndex));
292  fMCTrackIdForTofHits.insert(
293  make_pair(tofPointEventNo, tofPoint->GetTrackID()));
294  }
295 
296  Int_t nofPoints = fTofPoints->Size(0, iEvent);
297  for (Int_t iPoint = 0; iPoint < nofPoints; iPoint++) {
298  const CbmTofPoint* tofPoint =
299  static_cast<const CbmTofPoint*>(fTofPoints->Get(0, iEvent, iPoint));
300  fMCTrackIdForTofPoints.insert(
301  pair<Int_t, Int_t>(iEvent, tofPoint->GetTrackID()));
302  }
303 }
304 
306  Double_t timeZeroReco = 0.0;
307  Double_t timeZeroMC = 0.0;
308  Double_t timeFirstTrack = 100.; // ns
309  Double_t timeZeroA = 0.; // ns
310  Int_t nofTracksForTimeZero = 0;
311 
312  Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
313  for (Int_t iTrack = 0; iTrack < nofGlobalTracks; iTrack++) {
314  const CbmGlobalTrack* globalTrack =
315  static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iTrack));
316  Int_t stsId = globalTrack->GetStsTrackIndex();
317  Int_t tofId = globalTrack->GetTofHitIndex();
318  if (stsId < 0 || tofId < 0) continue; // We need both STS track and TOF hit
319 
320  CbmStsTrack* stsTrack = static_cast<CbmStsTrack*>(fStsTracks->At(stsId));
321  const CbmTrackMatchNew* stsMatch =
322  static_cast<const CbmTrackMatchNew*>(fStsTrackMatches->At(stsId));
323  Int_t stsMCTrackId = stsMatch->GetMatchedLink().GetIndex();
324 
325  const CbmTofHit* tofHit =
326  static_cast<const CbmTofHit*>(fTofHits->At(tofId));
327  CbmMatch* tofHitMatch = static_cast<CbmMatch*>(fTofHitsMatches->At(tofId));
328  if (tofHitMatch == NULL) { continue; }
329  Int_t tofMCPointId = tofHitMatch->GetMatchedLink().GetIndex();
330  Int_t tofMCEventId = tofHitMatch->GetMatchedLink().GetEntry();
331  const CbmTofPoint* tofPoint = static_cast<const CbmTofPoint*>(
332  fTofPoints->Get(0, tofMCEventId, tofMCPointId));
333  Int_t tofMCTrackId = tofPoint->GetTrackID();
334 
335 
336  FairTrackParam vtxTrack;
337  // fKFFitter.FitToVertex(stsTrack, fPrimVertex, &vtxTrack);
338  // Double_t chiSqPrimary = fKFFitter.GetChiToVertex(stsTrack, fPrimVertex);
339  float chiSqPrimary = 0.f;
341  stsTrack, fPrimVertex, &vtxTrack, chiSqPrimary);
342 
343  Bool_t chiSqPrimaryOk = chiSqPrimary < 3.;
344 
345  // Double_t ctCorrection = -0.007;
346  Double_t ctCorrection = 0.0;
347  Double_t ctReco = 0.299792458 * tofHit->GetTime()
348  + ctCorrection; // ToF time in ns -> transfrom to ct in m
349  Double_t ctMC =
350  0.299792458
351  * tofPoint->GetTime(); // mc time in ns -> transfrom to ct in m
352  Double_t trackLengthReco = globalTrack->GetLength() / 100.; //global length
353  // Double_t trackLengthMC = tofPoint->GetLength() / 100.; //mc length
354  Double_t preco =
355  (vtxTrack.GetQp() != 0) ? std::abs(1. / vtxTrack.GetQp()) : 0;
356  Double_t t = (trackLengthReco != 0) ? (ctReco / trackLengthReco) : 0;
357  Double_t m2reco = preco * preco * (t * t - 1);
358  Double_t radialPos =
359  sqrt(tofHit->GetX() * tofHit->GetX() + tofHit->GetY() * tofHit->GetY());
360 
361  if (chiSqPrimaryOk && radialPos < 50.) {
362  nofTracksForTimeZero++;
363  Double_t beta = 1.;
364  if (m2reco > 0.6)
365  beta = preco / sqrt(preco * preco + 0.93827231 * 0.93827231);
366  if (m2reco <= 0.6)
367  beta = preco / sqrt(preco * preco + 0.1395679 * 0.1395679);
368  timeZeroReco +=
369  tofHit->GetTime() - trackLengthReco / (beta * 0.299792458);
370  timeZeroMC +=
371  tofPoint->GetTime() - trackLengthReco / (beta * 0.299792458);
372  timeZeroA += trackLengthReco / 0.299792458;
373  timeFirstTrack = std::min(timeFirstTrack, trackLengthReco / 0.299792458);
374  }
375 
376  Int_t nofTrackCategories = fTrackCategories.size();
377  for (Int_t iCat = 0; iCat < nofTrackCategories; iCat++) {
378  string category = fTrackCategories[iCat];
379  LitTrackAcceptanceFunction function =
380  fTrackAcceptanceFunctions.find(category)->second;
381  Bool_t categoryOk = function(fMCTracks, tofMCEventId, stsMCTrackId);
382  //Bool_t accTofOk = fMCTrackIdForTofPoints.find(make_pair(tofMCEventId, stsMCTrackId)) != fMCTrackIdForTofPoints.end();
383  Bool_t accTofOk =
384  fMCTrackIdForTofHits.find(make_pair(tofMCEventId, stsMCTrackId))
385  != fMCTrackIdForTofHits.end();
386 
387  if (categoryOk && chiSqPrimaryOk) {
388  fHM->H1("hmp_Tof_Reco_" + category + "_m2p")->Fill(preco, m2reco);
389  if (accTofOk)
390  fHM->H1("hmp_Tof_RecoAccTof_" + category + "_m2p")
391  ->Fill(preco, m2reco);
392 
393  if (stsMCTrackId == tofMCTrackId) {
394  fHM->H1("hmp_Tof_RecoMCID_" + category + "_m2p")->Fill(preco, m2reco);
395  if (accTofOk)
396  fHM->H1("hmp_Tof_RecoMCIDAccTof_" + category + "_m2p")
397  ->Fill(preco, m2reco);
398  }
399  }
400  }
401  }
402  if (nofTracksForTimeZero > 0) {
403  timeZeroReco /= nofTracksForTimeZero;
404  timeZeroMC /= nofTracksForTimeZero;
405  timeZeroA /= nofTracksForTimeZero;
406  }
407  fHM->H1("hmp_Tof_TimeZero_reco")->Fill(timeZeroReco);
408  fHM->H1("hmp_Tof_TimeZero_mc")->Fill(timeZeroMC);
409  fHM->H1("hmp_Tof_TimeZero_a")->Fill(timeZeroA);
410  fHM->H1("hmp_Tof_TimeZero_NofTracks")->Fill(nofTracksForTimeZero);
411  fHM->H1("hmp_Tof_Time_FirstTrack")->Fill(timeFirstTrack);
412 }
413 
415  Int_t nofTofHits = fTofHits->GetEntriesFast();
416  for (Int_t iHit = 0; iHit < nofTofHits; iHit++) {
417  const CbmTofHit* tofHit = static_cast<const CbmTofHit*>(fTofHits->At(iHit));
418  CbmMatch* tofHitMatch = static_cast<CbmMatch*>(fTofHitsMatches->At(iHit));
419  if (tofHitMatch == NULL) { continue; }
420  Int_t tofMCPointId = tofHitMatch->GetMatchedLink().GetIndex();
421  Int_t tofMCEventId = tofHitMatch->GetMatchedLink().GetEntry();
422  const CbmTofPoint* tofPoint = static_cast<const CbmTofPoint*>(
423  fTofPoints->Get(0, tofMCEventId, tofMCPointId));
424  Int_t tofMCTrackId = tofPoint->GetTrackID();
425 
426  fHM->H1("hmp_Tof_dTime")
427  ->Fill(1000 * (tofPoint->GetTime() - tofHit->GetTime()));
428  }
429 }
430 
432  map<Int_t, Int_t> nofTofHitsPerGlobalTrack;
433  Int_t nofTofTracks = fTofTracks->GetEntriesFast();
434  for (Int_t iTrack = 0; iTrack < nofTofTracks; iTrack++) {
435  const CbmTofTrack* tofTrack =
436  static_cast<const CbmTofTrack*>(fTofTracks->At(iTrack));
437  nofTofHitsPerGlobalTrack[tofTrack->GetTrackIndex()]++;
438  }
439 
440  for (Int_t iTrack = 0; iTrack < nofTofTracks; iTrack++) {
441  const CbmTofTrack* tofTrack =
442  static_cast<const CbmTofTrack*>(fTofTracks->At(iTrack));
443  const CbmTofHit* tofHit =
444  static_cast<const CbmTofHit*>(fTofHits->At(tofTrack->GetTofHitIndex()));
445  CbmMatch* tofHitMatch =
446  static_cast<CbmMatch*>(fTofHitsMatches->At(tofTrack->GetTofHitIndex()));
447  if (tofHitMatch == NULL) { continue; }
448  Int_t tofMCPointId = tofHitMatch->GetMatchedLink().GetIndex();
449  Int_t tofMCEventId = tofHitMatch->GetMatchedLink().GetEntry();
450  const FairMCPoint* tofPoint = static_cast<const FairMCPoint*>(
451  fTofPoints->Get(0, tofMCEventId, tofMCPointId));
452  Int_t tofMCTrackId = tofPoint->GetTrackID();
453 
454  const FairTrackParam* par = tofTrack->GetTrackParameter();
455  Double_t dx = par->GetX() - tofHit->GetX();
456  Double_t dy = par->GetY() - tofHit->GetY();
457  Double_t distance = sqrt(dx * dx + dy * dy);
458 
459  Int_t nofTrackCategories = fTrackCategories.size();
460  for (Int_t iCat = 0; iCat < nofTrackCategories; iCat++) {
461  string category = fTrackCategories[iCat];
462  LitTrackAcceptanceFunction function =
463  fTrackAcceptanceFunctions.find(category)->second;
464  Bool_t categoryOk = function(fMCTracks, tofMCEventId, tofMCTrackId);
465  if (categoryOk) {
466  fHM->H1("hmp_TofTrack_" + category + "_Distance")->Fill(distance);
467  fHM->H1("hmp_TofTrack_" + category + "_NormDistance")
468  ->Fill(tofTrack->GetDistance());
469  fHM->H1("hmp_TofTrack_" + category + "_Length")
470  ->Fill(tofTrack->GetTrackLength());
471  fHM->H1("hmp_TofTrack_" + category + "_NofHitsPerGlobalTrack")
472  ->Fill(nofTofHitsPerGlobalTrack[tofTrack->GetTrackIndex()]);
473  }
474  }
475  }
476 }
477 
479  fHM->H2("hmp_Tof_RecoMCID_Pion_m2p")->FitSlicesY();
480  TH1* meanHist =
481  (TH1*) gDirectory->Get("hmp_Tof_RecoMCID_Pion_m2p_1"); // mean
482  TH1* sigmaHist =
483  (TH1*) gDirectory->Get("hmp_Tof_RecoMCID_Pion_m2p_2"); // sigma
484  Int_t nofBins = meanHist->GetNbinsX();
485  for (Int_t iBin = 0; iBin <= nofBins; iBin++) {
486  Double_t mean = meanHist->GetBinContent(iBin);
487  Double_t sigma = sigmaHist->GetBinContent(iBin);
488  std::cout << "mean=" << mean << " sigma=" << sigma << std::endl;
489  }
490 }
491 
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmLitAcceptanceFunction::NegativeTrackAcceptanceFunction
static Bool_t NegativeTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:31
CbmMCDataManager::GetObject
CbmMCDataObject * GetObject(const char *name)
Definition: CbmMCDataManager.cxx:137
CbmMatch
Definition: CbmMatch.h:22
CbmLitTofQa::ProcessMC
void ProcessMC(Int_t iEvent)
Definition: CbmLitTofQa.cxx:279
CbmMCDataManager.h
CbmVertex.h
CbmLitTofQa::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: CbmLitTofQa.cxx:66
CbmLitAcceptanceFunction::KaonPlusTrackAcceptanceFunction
static Bool_t KaonPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:177
CbmHistManager::WriteToFile
void WriteToFile()
Write all histograms to current opened file.
Definition: core/base/CbmHistManager.cxx:103
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTofTrack.h
CbmLitTofQa::fMCTrackIdForTofHits
set< pair< Int_t, Int_t > > fMCTrackIdForTofHits
Definition: CbmLitTofQa.h:139
CbmLitTofQa::ProcessTofTracks
void ProcessTofTracks()
Definition: CbmLitTofQa.cxx:431
CbmLitTofQa::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmLitTofQa.h:116
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmLitTofQaReport.h
Create report for TOF QA.
CbmLitTofQa::fStsTracks
TClonesArray * fStsTracks
Definition: CbmLitTofQa.h:115
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmMCDataArray::Size
Int_t Size(Int_t fileNumber, Int_t eventNumber)
Definition: CbmMCDataArray.cxx:133
CbmLitTofQa::fPRangeMax
Double_t fPRangeMax
Definition: CbmLitTofQa.h:108
CbmLitAcceptanceFunction.h
Global function to define the track acceptance. Used in QA.
CbmLitAcceptanceFunction::AllTrackAcceptanceFunction
static Bool_t AllTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:25
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
CbmTofTrack::GetTrackParameter
const FairTrackParam * GetTrackParameter() const
Definition: CbmTofTrack.h:80
CbmHistManager::H2
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
Definition: CbmHistManager.h:190
CbmLitTofQa::fPRangeMin
Double_t fPRangeMin
Definition: CbmLitTofQa.h:107
CbmGlobalTrack.h
CbmLitTofQa::fTofHitsMatches
TClonesArray * fTofHitsMatches
Definition: CbmLitTofQa.h:119
CbmGlobalTrack::GetLength
Double_t GetLength() const
Definition: CbmGlobalTrack.h:50
CbmLitTofQa::fTofTracks
TClonesArray * fTofTracks
Definition: CbmLitTofQa.h:120
CbmHistManager.h
Histogram manager.
CbmLitTofQa::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmLitTofQa.h:114
CbmLitAcceptanceFunction::PrimaryTrackAcceptanceFunction
static Bool_t PrimaryTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:55
CbmLitTofQa
Task for TOF QA.
Definition: CbmLitTofQa.h:35
CbmTofTrack::GetTrackLength
Double_t GetTrackLength() const
Definition: CbmTofTrack.h:77
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
fTofTracks
TClonesArray * fTofTracks
Definition: CbmHadronAnalysis.cxx:51
CbmLitTofQa::fTrackCategories
vector< string > fTrackCategories
Definition: CbmLitTofQa.h:127
CbmLitTofQa::ProcessTofHits
void ProcessTofHits()
Definition: CbmLitTofQa.cxx:414
CbmLitAcceptanceFunction::ProtonTrackAcceptanceFunction
static Bool_t ProtonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:123
CbmLitTofQa::fHM
CbmHistManager * fHM
Definition: CbmLitTofQa.h:111
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
CbmLitTofQa::Finish
virtual void Finish()
Inherited from FairTask.
Definition: CbmLitTofQa.cxx:84
CbmLitTofQa::fPRangeBins
Int_t fPRangeBins
Definition: CbmLitTofQa.h:109
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmLitTofQa::fMCTrackIdForTofPoints
set< pair< Int_t, Int_t > > fMCTrackIdForTofPoints
Definition: CbmLitTofQa.h:141
CbmLitTofQa::ProcessGlobalTracks
void ProcessGlobalTracks()
Definition: CbmLitTofQa.cxx:305
CbmLitTofQa.h
Task for TOF QA.
CbmLitTofQa::fTrackAcceptanceFunctions
map< string, LitTrackAcceptanceFunction > fTrackAcceptanceFunctions
Definition: CbmLitTofQa.h:135
CbmLitTofQa::fOutputDir
string fOutputDir
Definition: CbmLitTofQa.h:105
CbmMCDataArray::Get
TObject * Get(const CbmLink *lnk)
Definition: CbmMCDataArray.h:47
CbmLitTofQa::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmLitTofQa.h:123
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmTrackMatchNew.h
CbmVertex
Definition: CbmVertex.h:26
CbmSimulationReport::Create
void Create(CbmHistManager *histManager, const std::string &outputDir)
Main function which creates report data.
CbmLitAcceptanceFunction::AntiProtonTrackAcceptanceFunction
static Bool_t AntiProtonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:132
CbmLitTofQa::ReadDataBranches
void ReadDataBranches()
Reads data branches.
Definition: CbmLitTofQa.cxx:100
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmLitTofQa::LitTrackAcceptanceFunction
Bool_t(* LitTrackAcceptanceFunction)(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitTofQa.h:131
CbmKFParticleInterface.h
CbmTofTrack::GetTrackIndex
Int_t GetTrackIndex() const
Definition: CbmTofTrack.h:74
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmLitTofQa::FillTrackCategoriesAndAcceptanceFunctions
void FillTrackCategoriesAndAcceptanceFunctions()
Assign default track categories and track acceptance functions.
Definition: CbmLitTofQa.cxx:128
CbmTofTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmTofTrack.h:61
CbmLitTofQa::~CbmLitTofQa
virtual ~CbmLitTofQa()
Destructor.
Definition: CbmLitTofQa.cxx:62
CbmMCDataManager
Task class creating and managing CbmMCDataArray objects.
Definition: CbmMCDataManager.h:27
CbmStsKFTrackFitter::Init
void Init()
Definition: CbmStsKFTrackFitter.cxx:29
CbmLitAcceptanceFunction::MuonTrackAcceptanceFunction
static Bool_t MuonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:114
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmLitTofQa::CreateHistograms
void CreateHistograms()
Creates histograms.
Definition: CbmLitTofQa.cxx:166
CbmLitAcceptanceFunction::PositiveTrackAcceptanceFunction
static Bool_t PositiveTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:43
CbmTofTrack::GetDistance
Double_t GetDistance() const
Definition: CbmTofTrack.h:89
CbmKFParticleInterface::ExtrapolateTrackToPV
static void ExtrapolateTrackToPV(const CbmStsTrack *track, CbmVertex *pv, FairTrackParam *paramAtPV, float &chiPrim)
Definition: CbmKFParticleInterface.cxx:153
CbmLitTofQa::fTofPoints
CbmMCDataArray * fTofPoints
Definition: CbmLitTofQa.h:118
CbmMCTrack.h
CbmLitAcceptanceFunction::PionMinusTrackAcceptanceFunction
static Bool_t PionMinusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:159
CbmLitTofQa::fMCTracks
CbmMCDataArray * fMCTracks
Definition: CbmLitTofQa.h:121
CbmTofPoint.h
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
CbmLitAcceptanceFunction::PionPlusTrackAcceptanceFunction
static Bool_t PionPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:150
CbmSimulationReport
Base class for simulation reports.
Definition: CbmSimulationReport.h:28
CbmLitTofQa::Exec
virtual void Exec(Option_t *opt)
Inherited from FairTask.
Definition: CbmLitTofQa.cxx:74
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmTofPoint
Geometric intersection of a MC track with a TOFb detector.
Definition: CbmTofPoint.h:40
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmLitAcceptanceFunction::ElectronTrackAcceptanceFunction
static Bool_t ElectronTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:105
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
CbmLitTofQa::fTofHits
TClonesArray * fTofHits
Definition: CbmLitTofQa.h:117
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmKFVertex.h
CbmLitTofQa::fKFFitter
CbmStsKFTrackFitter fKFFitter
Definition: CbmLitTofQa.h:125
CbmLitTofQa::CbmLitTofQa
CbmLitTofQa()
Constructor.
Definition: CbmLitTofQa.cxx:38
CbmTofTrack
Provides information on attaching a TofHit to a GlobalTrack.
Definition: CbmTofTrack.h:20
CbmLitTofQaReport
Create report for TOF QA.
Definition: CbmLitTofQaReport.h:19
CbmLitTofQa::FitHistograms
void FitHistograms()
Definition: CbmLitTofQa.cxx:478
CbmHistManager::Add
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
Definition: CbmHistManager.h:58