CbmRoot
CbmAnaJpsiTask.cxx
Go to the documentation of this file.
1 
2 #include "CbmAnaJpsiTask.h"
3 #include "CbmAnaJpsiCandidate.h"
4 #include "CbmAnaJpsiCuts.h"
5 #include "CbmAnaJpsiHist.h"
7 #include "CbmAnaJpsiUtils.h"
8 #include "CbmDrawHist.h"
9 #include "CbmGlobalTrack.h"
10 #include "CbmHistManager.h"
11 #include "CbmMCTrack.h"
12 #include "CbmRichHit.h"
13 #include "CbmRichPoint.h"
14 #include "CbmRichRing.h"
15 #include "CbmStsHit.h"
16 #include "CbmStsTrack.h"
17 #include "CbmTofHit.h"
18 #include "CbmTrackMatchNew.h"
19 #include "CbmTrdHit.h"
20 #include "CbmTrdTrack.h"
21 #include "TCanvas.h"
22 #include "TFile.h"
23 #include "TMath.h"
25 #include <iostream>
26 
27 using namespace std;
28 
30  : FairTask("CbmAnaJpsiTask")
31  , fEventNum(0)
32  , fMcTracks(NULL)
33  , fStsPoints(NULL)
34  , fStsHits(NULL)
35  , fStsTracks(NULL)
36  , fStsTrackMatches(NULL)
37  , fRichPoints(NULL)
38  , fRichHits(NULL)
39  , fRichRings(NULL)
40  , fRichRingMatches(NULL)
41  , fTrdPoints(NULL)
42  , fTrdHits(NULL)
43  , fTrdTracks(NULL)
44  , fTrdTrackMatches(NULL)
45  , fTofPoints(NULL)
46  , fTofHits(NULL)
47  , fTofHitsMatches(NULL)
48  , fGlobalTracks(NULL)
49  , fJpsiCandidates(NULL)
50  , fNofHitsInRingMap()
51  , fPrimVertex(NULL)
52  , fKFVertex()
53  , fCandidates()
54  , fCuts()
55  , fWeight(1.14048e-6)
56  , fHM(NULL)
57  , fUseTrd(kTRUE)
58  , fUseTof(kFALSE) {
59  /*
60  fUseTrd=true;
61  fUseTof=false;
62  fWeight=1.14048e-6;
63 */
64 }
65 
67 
68 InitStatus CbmAnaJpsiTask::Init() {
69  //cout << "CbmRichUrqmdTest::Init"<<endl;
70  FairRootManager* ioman = FairRootManager::Instance();
71  if (NULL == ioman) {
72  Fatal("CbmAnaJpsiTask::Init", "RootManager not instantised!");
73  }
74 
75  fMcTracks = (TClonesArray*) ioman->GetObject("MCTrack");
76  if (NULL == fMcTracks) {
77  Fatal("CbmAnaJpsiTask::Init", "No MCtrack Array! ");
78  }
79 
80  fStsPoints = (TClonesArray*) ioman->GetObject("StsPoint");
81  if (NULL == fStsPoints) {
82  Fatal("CbmAnaJpsiTask::Init", "No StsPoint Array! ");
83  }
84 
85  fStsHits = (TClonesArray*) ioman->GetObject("StsHit");
86  if (NULL == fStsHits) { Fatal("CbmAnaJpsiTask::Init", "No StsHit Array! "); }
87 
88  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
89  if (NULL == fStsTracks) {
90  Fatal("CbmAnaJpsiTask::Init", "No StsTracks Array! ");
91  }
92 
93  fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
94  if (NULL == fStsTrackMatches) {
95  Fatal("CbmAnaJpsiTask::Init", "No StsTrackMatches Array!");
96  }
97 
98  fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
99  if (NULL == fRichHits) {
100  Fatal("CbmAnaJpsiTask::Init", "No RichHits Array! ");
101  }
102 
103  fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
104  if (NULL == fRichPoints) {
105  Fatal("CbmAnaJpsiTask::Init", "No RichPoint Array! ");
106  }
107 
108  fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
109  if (NULL == fRichRings) {
110  Fatal("CbmAnaJpsiTask::Init", "No RichRings Array! ");
111  }
112 
113  fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
114  if (NULL == fRichRingMatches) {
115  Fatal("CbmAnaJpsiTask::Init", "No RichRingMatch array!");
116  }
117 
118  if (fUseTrd == true) {
119  fTrdHits = (TClonesArray*) ioman->GetObject("TrdHit");
120  if (NULL == fTrdHits) {
121  Fatal("CbmAnaJpsiTask::Init", "No TrdHits Array! ");
122  }
123 
124  fTrdPoints = (TClonesArray*) ioman->GetObject("TrdPoint");
125  if (NULL == fTrdPoints) {
126  Fatal("CbmAnaJpsiTask::Init", "No TrdPoint Array! ");
127  }
128 
129  fTrdTrackMatches = (TClonesArray*) ioman->GetObject("TrdTrackMatch");
130  if (NULL == fTrdTrackMatches) {
131  Fatal("CbmAnaDielectronTask::Init", "No TrdTrackMatch array!");
132  }
133 
134  fTrdTracks = (TClonesArray*) ioman->GetObject("TrdTrack");
135  if (NULL == fTrdTracks) {
136  Fatal("CbmAnaJpsiTask::Init", "No TrdTracks Array!");
137  }
138  }
139 
140  fTofHits = (TClonesArray*) ioman->GetObject("TofHit");
141  if (NULL == fTofHits) { Fatal("CbmAnaJpsiTask::Init", "No TofHits Array! "); }
142 
143  fTofHitsMatches = (TClonesArray*) ioman->GetObject("TofHitMatch");
144  if (NULL == fTofHitsMatches) {
145  Fatal("CbmAnaJpsiTask::Init", "No TofHitMatch Array! ");
146  }
147 
148  fTofPoints = (TClonesArray*) ioman->GetObject("TofPoint");
149  if (NULL == fTofPoints) {
150  Fatal("CbmAnaJpsiTask::Init", "No TofPoint Array! ");
151  }
152 
153  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
154  if (NULL == fGlobalTracks) {
155  Fatal("CbmAnaJpsiTask::Init", "No GlobalTracks Array!");
156  }
157 
158  // fPrimVertex = (CbmVertex*) ioman->GetObject("PrimaryVertex");
159  // Get pointer to PrimaryVertex object from IOManager if it exists
160  // The old name for the object is "PrimaryVertex" the new one
161  // "PrimaryVertex." Check first for the new name
162  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
163  if (nullptr == fPrimVertex) {
164  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex"));
165  }
166  if (nullptr == fPrimVertex) { LOG(fatal) << "No PrimaryVertex array!"; }
167 
168  fJpsiCandidates = new TClonesArray("CbmAnaJpsiCandidate");
169  ioman->Register("JpsiCandidates",
170  "Jpsi",
172  IsOutputBranchPersistent("JpsiCandidates"));
173 
174  InitHist();
175 
176  return kSUCCESS;
177 }
178 
179 
181  const string& axisX,
182  const string& axisY,
183  double nBins,
184  double min,
185  double max) {
186  for (Int_t i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
187  string hname = name + "_" + CbmAnaJpsiHist::fAnaSteps[i];
188  fHM->Create1<TH1D>(
189  hname, hname + ";" + axisX + ";" + axisY, nBins, min, max);
190  }
191 }
192 
194  const string& axisX,
195  const string& axisY,
196  const string& axisZ,
197  double nBinsX,
198  double minX,
199  double maxX,
200  double nBinsY,
201  double minY,
202  double maxY) {
203  for (Int_t i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
204  string hname = name + "_" + CbmAnaJpsiHist::fAnaSteps[i];
205  fHM->Create2<TH2D>(hname,
206  hname + ";" + axisX + ";" + axisY + ";" + axisZ,
207  nBinsX,
208  minX,
209  maxX,
210  nBinsY,
211  minY,
212  maxY);
213  }
214 }
215 
216 void CbmAnaJpsiTask::CreateSourceTypesH1(const string& name,
217  const string& axisX,
218  const string& axisY,
219  double nBins,
220  double min,
221  double max) {
222  for (Int_t i = 0; i < CbmAnaJpsiHist::fNofSourceTypes; i++) {
223  string hname = name + "_" + CbmAnaJpsiHist::fSourceTypes[i];
224  fHM->Create1<TH1D>(
225  hname, hname + ";" + axisX + ";" + axisY, nBins, min, max);
226  }
227 }
228 
229 void CbmAnaJpsiTask::CreateSourceTypesH2(const string& name,
230  const string& axisX,
231  const string& axisY,
232  const string& axisZ,
233  double nBinsX,
234  double minX,
235  double maxX,
236  double nBinsY,
237  double minY,
238  double maxY) {
239  string hname = "";
240  for (Int_t i = 0; i < CbmAnaJpsiHist::fNofSourceTypes; i++) {
241  hname = name + "_" + CbmAnaJpsiHist::fSourceTypes[i];
242  fHM->Create2<TH2D>(hname,
243  hname + ";" + axisX + ";" + axisY + ";" + axisZ,
244  nBinsX,
245  minX,
246  maxX,
247  nBinsY,
248  minY,
249  maxY);
250  }
251 }
252 
254  const string& axisX,
255  const string& axisY,
256  double nBins,
257  double min,
258  double max) {
259  for (Int_t i = 0; i < CbmAnaJpsiHist::fNofAnaSteps - 2; i++) {
260  string hname1 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "gg";
261  fHM->Create1<TH1D>(
262  hname1, hname1 + ";" + axisX + ";" + axisY, nBins, min, max);
263  string hname2 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "gp";
264  fHM->Create1<TH1D>(
265  hname2, hname2 + ";" + axisX + ";" + axisY, nBins, min, max);
266  string hname3 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "go";
267  fHM->Create1<TH1D>(
268  hname3, hname3 + ";" + axisX + ";" + axisY, nBins, min, max);
269  string hname4 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "pg";
270  fHM->Create1<TH1D>(
271  hname4, hname4 + ";" + axisX + ";" + axisY, nBins, min, max);
272  string hname5 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "pp";
273  fHM->Create1<TH1D>(
274  hname5, hname5 + ";" + axisX + ";" + axisY, nBins, min, max);
275  string hname6 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "po";
276  fHM->Create1<TH1D>(
277  hname6, hname6 + ";" + axisX + ";" + axisY, nBins, min, max);
278  string hname7 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "og";
279  fHM->Create1<TH1D>(
280  hname7, hname7 + ";" + axisX + ";" + axisY, nBins, min, max);
281  string hname8 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "op";
282  fHM->Create1<TH1D>(
283  hname8, hname8 + ";" + axisX + ";" + axisY, nBins, min, max);
284  string hname9 = name + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2] + "_" + "oo";
285  fHM->Create1<TH1D>(
286  hname9, hname9 + ";" + axisX + ";" + axisY, nBins, min, max);
287  }
288 }
289 
291  fHM = new CbmHistManager();
292 
293  // Event number counter
294  fHM->Create1<TH1D>(
295  "fh_event_number", "fh_event_number;a.u.;Number of events", 1, 0, 1.);
296 
297  //RICH PMT plane XY
298  CreateSourceTypesH2("fh_rich_pmt_xy",
299  "X [cm]",
300  "Y [cm]",
301  "Hits/cm^{2}/event",
302  220,
303  -110,
304  110,
305  400,
306  -200,
307  200);
308 
309  //distributions of ID and analysis cuts
311  "fh_track_chi2prim", "#chi^{2}_{prim}", "particles/event", 200, 0., 20.);
313  "fh_track_mom", "P [GeV/c]", "particles/event", 160, 0., 16.);
315  "fh_track_chi2sts", "#chi^{2}_{STS}", "particles/event", 80, 0., 8.);
317  "fh_track_rapidity", "Rapidity", "particles/event", 40, 0., 4.);
319  "fh_track_pt", "P_{t} [GeV/c]", "particles/event", 40, 0., 4.);
321  "fh_track_rich_ann", "RICH ANN output", "particles/event", 120, -1.2, 1.2);
323  "fh_track_trd_ann", "TRD ANN output", "particles/event", 120, -1.2, 1.2);
324  CreateSourceTypesH2("fh_track_tof_m2",
325  "P [GeV/c]",
326  "m^{2} [GeV/c^{2}]^{2}",
327  "particles/event",
328  900,
329  0.,
330  9.,
331  360,
332  -0.4,
333  1.4);
334 
335  //vertex of the secondary electrons from gamma conversion
336  fHM->Create2<TH2D>("fh_vertex_el_gamma_xz",
337  "fh_vertex_el_gamma_xz;Z [cm];X [cm];Counter per event",
338  200,
339  -10.,
340  190.,
341  400,
342  -130.,
343  130.);
344  fHM->Create2<TH2D>("fh_vertex_el_gamma_yz",
345  "fh_vertex_el_gamma_yz;Z [cm];Y [cm];Counter per event",
346  200,
347  -10.,
348  190.,
349  400,
350  -130.,
351  130.);
352  fHM->Create2<TH2D>("fh_vertex_el_gamma_xy",
353  "fh_vertex_el_gamma_xy;X [cm];Y [cm];Counter per event",
354  400,
355  -130.,
356  130.,
357  400,
358  -130.,
359  130.);
360  fHM->Create2<TH2D>(
361  "fh_vertex_el_gamma_rz",
362  "fh_vertex_el_gamma_rz;Z [cm];#sqrt{X^{2}+Y^{2}} [cm];Counter per event",
363  300,
364  -10.,
365  190.,
366  300,
367  0.,
368  150.);
369 
370  // Number of BG and signal tracks after each cut
371  fHM->Create1<TH1D>(
372  "fh_nof_bg_tracks",
373  "fh_nof_bg_tracks;Analysis steps;Number of BG particles/event",
375  0.,
377  fHM->Create1<TH1D>(
378  "fh_nof_el_tracks",
379  "fh_nof_el_tracks;Analysis steps;Number of signal particles/event",
381  0.,
383  fHM->Create2<TH2D>("fh_source_tracks",
384  "fh_source_tracks;Analysis steps;Particle",
386  0.,
388  7,
389  0.,
390  7.);
391 
392  //Create invariant mass histograms
394  "fh_signal_minv", "M_{ee} [GeV/c^{2}]", "particles/event", 4000, 0, 4.);
396  "fh_bg_minv", "M_{ee} [GeV/c^{2}]", "particles/event", 4000, 0., 4.);
398  "fh_pi0_minv", "M_{ee} [GeV/c^{2}]", "particles/event", 4000, 0., 4.);
400  "fh_gamma_minv", "M_{ee} [GeV/c^{2}]", "particles/event", 4000, 0., 4.);
401 
402  // minv for true matched and mismatched tracks
403  CreateAnalysisStepsH1("fh_bg_truematch_minv",
404  "M_{ee} [GeV/c^{2}]",
405  "particles/event",
406  4000,
407  0.,
408  4.);
409  CreateAnalysisStepsH1("fh_bg_truematch_el_minv",
410  "M_{ee} [GeV/c^{2}]",
411  "particles/event",
412  4000,
413  0.,
414  4.);
415  CreateAnalysisStepsH1("fh_bg_truematch_notel_minv",
416  "M_{ee} [GeV/c^{2}]",
417  "particles/event",
418  4000,
419  0.,
420  4.);
421  CreateAnalysisStepsH1("fh_bg_mismatch_minv",
422  "M_{ee} [GeV/c^{2}]",
423  "particles/event",
424  4000,
425  0.,
426  4.);
427 
428  //Invariant mass vs. Mc Pt
429  CreateAnalysisStepsH2("fh_signal_minv_pt",
430  "M_{ee} [GeV/c^{2}]",
431  "P_{t} [GeV/c]",
432  "particles/event",
433  100,
434  0.,
435  4.,
436  20,
437  0.,
438  2.);
439 
440  // Momentum distribution of the signal
442  "fh_signal_mom", "P [GeV/c]", "particles/event", 250, 0., 25.);
443  //Pt/y distibution of the signal
444  CreateAnalysisStepsH2("fh_signal_pty",
445  "Rapidity",
446  "P_{t} [GeV/c]",
447  "particles/event",
448  80,
449  0.,
450  4.,
451  80,
452  0.,
453  4.);
454 
455  //Number of mismatches after each cut
456  fHM->Create1<TH1D>("fh_nof_mismatches",
457  "fh_nof_mismatches;Analysis steps;particles/event",
459  0.,
461  fHM->Create1<TH1D>("fh_nof_mismatches_rich",
462  "fh_nof_mismatches_rich;Analysis steps;particles/event",
464  0.,
466  fHM->Create1<TH1D>("fh_nof_mismatches_trd",
467  "fh_nof_mismatches_trd;Analysis steps;particles/event",
469  0.,
471  fHM->Create1<TH1D>("fh_nof_mismatches_tof",
472  "fh_nof_mismatches_tof;Analysis steps;particles/event",
474  0.,
476 
477  //Momentum distribution of signal electrons
479  "fh_track_el_mom", "P [GeV/c]", "particles/event", 250, 0., 25.);
480  fHM->Create2<TH2D>("fh_track_el_mom_mc_rec",
481  "fh_track_el_mom_mc_rec;P_{mc};P_{rec};Entries",
482  250,
483  0.,
484  25.,
485  250,
486  0.,
487  25.);
488 
490  "fh_bg_participants_minv", "m_{inv}", "particles/event", 4000, 0., 4.);
491 
493  "fh_PdgCode_of Others_BG", "PDGCode", "particles/event", 500, -0.5, 499.5);
494 
495  fHM->Create1<TH1D>(
496  "fh_ee_signal_minv_diff_ptcuts_0",
497  "fh_ee_signal_minv_diff_ptcuts_0;M_{ee} [GeV/c^{2}];particles/event",
498  4000,
499  0.,
500  4.);
501  fHM->Create1<TH1D>(
502  "fh_ee_signal_minv_diff_ptcuts_1",
503  "fh_ee_signal_minv_diff_ptcuts_1;M_{ee} [GeV/c^{2}];particles/event",
504  4000,
505  0.,
506  4.);
507  fHM->Create1<TH1D>(
508  "fh_ee_signal_minv_diff_ptcuts_2",
509  "fh_ee_signal_minv_diff_ptcuts_2;M_{ee} [GeV/c^{2}];particles/event",
510  4000,
511  0.,
512  4.);
513  fHM->Create1<TH1D>(
514  "fh_ee_signal_minv_diff_ptcuts_3",
515  "fh_ee_signal_minv_diff_ptcuts_3;M_{ee} [GeV/c^{2}];particles/event",
516  4000,
517  0.,
518  4.);
519  fHM->Create1<TH1D>(
520  "fh_ee_signal_minv_diff_ptcuts_4",
521  "fh_ee_signal_minv_diff_ptcuts_4;M_{ee} [GeV/c^{2}];particles/event",
522  4000,
523  0.,
524  4.);
525  fHM->Create1<TH1D>(
526  "fh_ee_signal_minv_diff_ptcuts_5",
527  "fh_ee_signal_minv_diff_ptcuts_5;M_{ee} [GeV/c^{2}];particles/event",
528  4000,
529  0.,
530  4.);
531  fHM->Create1<TH1D>(
532  "fh_ee_signal_minv_diff_ptcuts_6",
533  "fh_ee_signal_minv_diff_ptcuts_6;M_{ee} [GeV/c^{2}];particles/event",
534  4000,
535  0.,
536  4.);
537  fHM->Create1<TH1D>(
538  "fh_ee_signal_minv_diff_ptcuts_7",
539  "fh_ee_signal_minv_diff_ptcuts_7;M_{ee} [GeV/c^{2}];particles/event",
540  4000,
541  0.,
542  4.);
543 }
544 
545 
546 void CbmAnaJpsiTask::Exec(Option_t*) {
547  fJpsiCandidates->Clear();
548 
549  fHM->H1("fh_event_number")->Fill(0.5);
550 
551  fEventNum++;
552  cout << "CbmAnaJpsiTask, event No. " << fEventNum << endl;
553 
554  if (fPrimVertex != NULL) {
556  } else {
557  Fatal("CbmAnaJpsiTask::Exec", "No PrimaryVertex array!");
558  }
559 
560  if (fPrimVertex != NULL) {
562  } else {
563  Fatal("CbmAnaDielectronTask::Exec", "No PrimaryVertex array!");
564  }
565 
567 
568  MCPairs();
569 
570  RichPmtXY();
571 
572  FillCandidates();
573 
575 
577 
579 
581 
582  SignalAndBgReco();
583 
585 }
586 
588  fNofHitsInRingMap.clear();
589  Int_t nofRichHits = fRichHits->GetEntriesFast();
590  for (Int_t iHit = 0; iHit < nofRichHits; iHit++) {
591  CbmRichHit* hit = static_cast<CbmRichHit*>(fRichHits->At(iHit));
592  if (NULL == hit) continue;
593 
594  Int_t iPoint = hit->GetRefId();
595  if (iPoint < 0) continue;
596 
597  FairMCPoint* point = static_cast<FairMCPoint*>(fRichPoints->At(iPoint));
598  if (NULL == point) continue;
599 
600  Int_t iMCTrack = point->GetTrackID();
601  CbmMCTrack* track = static_cast<CbmMCTrack*>(fMcTracks->At(iMCTrack));
602  if (NULL == track) continue;
603 
604  Int_t iMother = track->GetMotherId();
605  if (iMother == -1) continue;
606 
607  fNofHitsInRingMap[iMother]++;
608  }
609 }
610 
612  Int_t nMcTracks = fMcTracks->GetEntries();
613  for (Int_t i = 0; i < nMcTracks; i++) {
614  CbmMCTrack* mctrack = (CbmMCTrack*) fMcTracks->At(i);
615  Bool_t isMcGammaElectron =
617  if (isMcGammaElectron) {
618  TVector3 v;
619  mctrack->GetStartVertex(v);
620  fHM->H2("fh_vertex_el_gamma_xz")->Fill(v.Z(), v.X());
621  fHM->H2("fh_vertex_el_gamma_yz")->Fill(v.Z(), v.Y());
622  fHM->H2("fh_vertex_el_gamma_xy")->Fill(v.X(), v.Y());
623  fHM->H2("fh_vertex_el_gamma_rz")
624  ->Fill(v.Z(), sqrt(v.X() * v.X() + v.Y() * v.Y()));
625  }
626  } // nMcTracks
627 } //MC Pairs
628 
630  fCandidates.clear();
631  Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
632 
633  for (Int_t iGTrack = 0; iGTrack < nofGlobalTracks; iGTrack++) {
634  // create candidate, in which we will store some parameters of reconstructed global track
635  CbmAnaJpsiCandidate cand;
636 
637  //get GlobalTrack from array
638  CbmGlobalTrack* globalTrack = (CbmGlobalTrack*) fGlobalTracks->At(iGTrack);
639  if (NULL == globalTrack) continue;
640 
641  // get StsTrack from global track
642  cand.fStsInd = globalTrack->GetStsTrackIndex();
643  if (cand.fStsInd < 0) continue;
644  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(cand.fStsInd);
645  if (NULL == stsTrack) continue;
646 
647  //calculate and get track parameters
649  &cand, stsTrack, fKFVertex);
650 
651  // RICH
652  cand.fRichInd = globalTrack->GetRichRingIndex();
653  if (cand.fRichInd < 0) continue;
654  CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(cand.fRichInd);
655  if (NULL == richRing) continue;
656 
657  // TRD
658  CbmTrdTrack* trdTrack = NULL;
659  if (fUseTrd == true) {
660  cand.fTrdInd = globalTrack->GetTrdTrackIndex();
661  if (cand.fTrdInd < 0) continue;
662  trdTrack = (CbmTrdTrack*) fTrdTracks->At(cand.fTrdInd);
663  if (trdTrack == NULL) continue;
664  }
665 
666  // ToF
667  cand.fTofInd = globalTrack->GetTofHitIndex();
668  if (cand.fTofInd < 0) continue;
669  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(cand.fTofInd);
670  if (tofHit == NULL) continue;
671 
672  IsElectron(iGTrack, cand.fMomentum.Mag(), &cand);
673  IsRecoTrackAccepted(&cand);
674  if (!cand.fIsRecoTrackAccepted) continue;
675  // push candidate to the array
676  // we store only candidate which have all local segments: STS, RICH, TRD, TOF
677  fCandidates.push_back(cand);
678  }
679 }
680 
682  int nCand = fCandidates.size();
683  for (int i = 0; i < nCand; i++) {
684  //reset MC information
685  fCandidates[i].ResetMcParams();
686 
687  //STS
688  //MCTrackId of the candidate is defined by STS track
689  int stsInd = fCandidates[i].fStsInd;
690  CbmTrackMatchNew* stsMatch =
691  (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
692  if (stsMatch == NULL) continue;
693  fCandidates[i].fStsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
694  if (fCandidates[i].fStsMcTrackId < 0) continue;
695  CbmMCTrack* mcTrack1 =
696  (CbmMCTrack*) fMcTracks->At(fCandidates[i].fStsMcTrackId);
697  if (mcTrack1 == NULL) continue;
698  fCandidates[i].fStsMcMotherId = mcTrack1->GetMotherId();
699  fCandidates[i].fMcPdg = TMath::Abs(mcTrack1->GetPdgCode());
700  fCandidates[i].fIsMcSignalElectron =
702  fCandidates[i].fIsMcGammaElectron =
704  fCandidates[i].fIsMcPi0Electron =
706 
707  // RICH
708  int richInd = fCandidates[i].fRichInd;
709  CbmTrackMatchNew* richMatch =
710  (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
711  if (richMatch == NULL) continue;
712  fCandidates[i].fRichMcTrackId = richMatch->GetMatchedLink().GetIndex();
713 
714  // TRD
715  // CbmTrdTrack* trdTrack = NULL;
716  if (fUseTrd == true) {
717  int trdInd = fCandidates[i].fTrdInd;
718  CbmTrackMatchNew* trdMatch =
719  (CbmTrackMatchNew*) fTrdTrackMatches->At(trdInd);
720  if (trdMatch == NULL) continue;
721  fCandidates[i].fTrdMcTrackId = trdMatch->GetMatchedLink().GetIndex();
722  }
723 
724  // ToF
725  int tofInd = fCandidates[i].fTofInd;
726  if (tofInd < 0) continue;
727  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(tofInd);
728  if (tofHit == NULL) continue;
729  CbmMatch* tofHitMatch = static_cast<CbmMatch*>(fTofHitsMatches->At(tofInd));
730  if (tofHitMatch == NULL) { continue; }
731  Int_t tofPointIndex = tofHitMatch->GetMatchedLink().GetIndex();
732  if (tofPointIndex < 0) continue;
733  FairMCPoint* tofPoint = (FairMCPoint*) fTofPoints->At(tofPointIndex);
734  if (tofPoint == NULL) continue;
735  fCandidates[i].fTofMcTrackId = tofPoint->GetTrackID();
736 
737 
739  } // candidates
740 }
741 
743  Int_t nCand = fCandidates.size();
744  for (Int_t i = 0; i < nCand; i++) {
745  if (fCandidates[i].fIsMcSignalElectron) {
746  fHM->H1("fh_track_chi2prim_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
747  ->Fill(fCandidates[i].fChi2Prim, fWeight);
748  } else {
749  fHM->H1("fh_track_chi2prim_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
750  ->Fill(fCandidates[i].fChi2Prim);
751  }
752  if (fCandidates[i].fIsMcGammaElectron) {
753  fHM->H1("fh_track_chi2prim_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
754  ->Fill(fCandidates[i].fChi2Prim);
755  }
756  if (fCandidates[i].fIsMcPi0Electron) {
757  fHM->H1("fh_track_chi2prim_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
758  ->Fill(fCandidates[i].fChi2Prim);
759  }
760  if (fCandidates[i].fChi2Prim >= fCuts.fChiPrimCut) continue;
761 
762 
763  if (fCandidates[i].fIsMcSignalElectron) {
764  fHM->H1("fh_track_rich_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
765  ->Fill(fCandidates[i].fRichAnn, fWeight);
766  } else {
767  fHM->H1("fh_track_rich_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
768  ->Fill(fCandidates[i].fRichAnn);
769  }
770  if (fCandidates[i].fIsMcGammaElectron) {
771  fHM->H1("fh_track_rich_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
772  ->Fill(fCandidates[i].fRichAnn);
773  }
774  if (fCandidates[i].fIsMcPi0Electron) {
775  fHM->H1("fh_track_rich_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
776  ->Fill(fCandidates[i].fRichAnn);
777  }
778  if (!fCandidates[i].fIsRichEl) continue;
779 
780  if (fCandidates[i].fIsMcSignalElectron) {
781  fHM->H1("fh_track_trd_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
782  ->Fill(fCandidates[i].fTrdAnn, fWeight);
783  } else {
784  fHM->H1("fh_track_trd_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
785  ->Fill(fCandidates[i].fTrdAnn);
786  }
787  if (fCandidates[i].fIsMcGammaElectron) {
788  fHM->H1("fh_track_trd_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
789  ->Fill(fCandidates[i].fTrdAnn);
790  }
791  if (fCandidates[i].fIsMcPi0Electron) {
792  fHM->H1("fh_track_trd_ann_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
793  ->Fill(fCandidates[i].fTrdAnn);
794  }
795  if (!fCandidates[i].fIsTrdEl) continue;
796 
797  if (fCandidates[i].fIsMcSignalElectron) {
798  fHM->H2("fh_track_tof_m2_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
799  ->Fill(fCandidates[i].fMomentum.Mag(), fCandidates[i].fMass2, fWeight);
800  } else {
801  fHM->H2("fh_track_tof_m2_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
802  ->Fill(fCandidates[i].fMomentum.Mag(), fCandidates[i].fMass2);
803  }
804  if (fCandidates[i].fIsMcGammaElectron) {
805  fHM->H2("fh_track_tof_m2_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
806  ->Fill(fCandidates[i].fMomentum.Mag(), fCandidates[i].fMass2);
807  }
808  if (fCandidates[i].fIsMcPi0Electron) {
809  fHM->H2("fh_track_tof_m2_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
810  ->Fill(fCandidates[i].fMomentum.Mag(), fCandidates[i].fMass2);
811  }
812  if (!fCandidates[i].fIsElectron) continue;
813 
814  if (fCandidates[i].fIsMcSignalElectron) {
815  fHM->H1("fh_track_pt_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
816  ->Fill(fCandidates[i].fMomentum.Perp(), fWeight);
817  } else {
818  fHM->H1("fh_track_pt_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
819  ->Fill(fCandidates[i].fMomentum.Perp());
820  }
821  if (fCandidates[i].fIsMcGammaElectron) {
822  fHM->H1("fh_track_pt_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
823  ->Fill(fCandidates[i].fMomentum.Perp());
824  }
825  if (fCandidates[i].fIsMcPi0Electron) {
826  fHM->H1("fh_track_pt_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
827  ->Fill(fCandidates[i].fMomentum.Perp());
828  }
829 
830  } // loop over candidates
831 
832  for (Int_t i = 0; i < nCand; i++) {
833  if (fCandidates[i].fIsMcSignalElectron) {
834  fHM->H1("fh_track_mom_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
835  ->Fill(fCandidates[i].fMomentum.Mag(), fWeight);
836  fHM->H1("fh_track_chi2sts_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
837  ->Fill(fCandidates[i].fChi2sts, fWeight);
838  fHM->H1("fh_track_rapidity_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
839  ->Fill(fCandidates[i].fRapidity, fWeight);
840  } else {
841  fHM->H1("fh_track_mom_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
842  ->Fill(fCandidates[i].fMomentum.Mag());
843  fHM->H1("fh_track_chi2sts_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
844  ->Fill(fCandidates[i].fChi2sts);
845  fHM->H1("fh_track_rapidity_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
846  ->Fill(fCandidates[i].fRapidity);
847  }
848  if (fCandidates[i].fIsMcGammaElectron) {
849  fHM->H1("fh_track_mom_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
850  ->Fill(fCandidates[i].fMomentum.Mag());
851  fHM->H1("fh_track_chi2sts_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
852  ->Fill(fCandidates[i].fChi2sts);
853  fHM->H1("fh_track_rapidity_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
854  ->Fill(fCandidates[i].fRapidity);
855  }
856  if (fCandidates[i].fIsMcPi0Electron) {
857  fHM->H1("fh_track_mom_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
858  ->Fill(fCandidates[i].fMomentum.Mag());
859  fHM->H1("fh_track_chi2sts_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
860  ->Fill(fCandidates[i].fChi2sts);
861  fHM->H1("fh_track_rapidity_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
862  ->Fill(fCandidates[i].fRapidity);
863  }
864  } // loop over candidates
865 }
866 
867 Bool_t CbmAnaJpsiTask::IsMcTrackAccepted(Int_t mcTrackInd) {
868  CbmMCTrack* tr = (CbmMCTrack*) fMcTracks->At(mcTrackInd);
869  if (tr == NULL) return false;
870  Int_t nRichPoints = fNofHitsInRingMap[mcTrackInd];
871  //TVector3 v;
872  //tr->GetStartVertex(v);
873  return (
875  && nRichPoints >= 7 && tr->GetNPoints(ECbmModuleId::kTrd) >= 6
877  > 0 /*&& tr->GetPt()>fCuts.fPtCut && v.Mag()<0.01*/);
878 }
879 
880 
882  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(cand->fStsInd);
883  if (stsTrack == NULL) cand->fIsRecoTrackAccepted = false;
884  int nStsHits = stsTrack->GetNofHits();
885  int nMvdHits = stsTrack->GetNofMvdHits();
886  CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(cand->fRichInd);
887  if (richRing == NULL) cand->fIsRecoTrackAccepted = false;
888  int nRichHits = richRing->GetNofHits();
889  CbmTrdTrack* trdTrack = (CbmTrdTrack*) fTrdTracks->At(cand->fTrdInd);
890  if (trdTrack == NULL) cand->fIsRecoTrackAccepted = false;
891  int nTrdHits = trdTrack->GetNofHits();
892  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(cand->fTofInd);
893  bool nTofHitsGreaterZero = false;
894  if (tofHit == NULL) {
895  cand->fIsRecoTrackAccepted = false;
896  } else {
897  nTofHitsGreaterZero = true;
898  }
899  if ((nMvdHits + nStsHits) >= 4 && nRichHits >= 7 && nTrdHits >= 6
900  && nTofHitsGreaterZero)
901  cand->fIsRecoTrackAccepted = true;
902 }
903 
905  Int_t nMcTracks = fMcTracks->GetEntries();
906  for (Int_t i = 0; i < nMcTracks; i++) {
907  CbmMCTrack* mctrack = (CbmMCTrack*) fMcTracks->At(i);
909  double_t mom = mctrack->GetP();
910  fHM->H1("fh_nof_el_tracks")->Fill(kJpsiMc + 0.5, fWeight);
911  fHM->H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
912  ->Fill(mom, fWeight);
913  if (IsMcTrackAccepted(i)) {
914  fHM->H1("fh_nof_el_tracks")->Fill(kJpsiAcc + 0.5, fWeight);
915  fHM->H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
916  ->Fill(mom, fWeight);
917  }
918  }
919  }
920 }
921 
923  Int_t nMcTracks = fMcTracks->GetEntries();
924  for (Int_t iP = 0; iP < nMcTracks; iP++) {
925  CbmMCTrack* mctrackP = (CbmMCTrack*) fMcTracks->At(iP);
926  Bool_t isMcSignalElectronP = CbmAnaJpsiUtils::IsMcSignalElectron(mctrackP);
927  if (!isMcSignalElectronP) continue;
928  if (mctrackP->GetPdgCode() != 11) continue;
929  Bool_t isAccP = IsMcTrackAccepted(iP);
930  for (Int_t iM = 0; iM < nMcTracks; iM++) {
931  if (iP == iM) continue;
932  CbmMCTrack* mctrackM = (CbmMCTrack*) fMcTracks->At(iM);
933  Bool_t isMcSignalElectronM =
935  if (!isMcSignalElectronM) continue;
936  if (mctrackM->GetPdgCode() != -11) continue;
937  Bool_t isAccM = IsMcTrackAccepted(iM);
940  mctrackM);
941 
942  if (isMcSignalElectronM && isMcSignalElectronP) {
943  fHM->H2("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
944  ->Fill(p.fRapidity, p.fPt, fWeight);
945  fHM->H1("fh_signal_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
946  ->Fill(p.fMomentumMag, fWeight);
947  fHM->H1("fh_signal_minv_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
948  ->Fill(p.fMinv, fWeight);
949  fHM->H2("fh_signal_minv_pt_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
950  ->Fill(p.fMinv, p.fPt, fWeight);
951  //accepted e+/-
952  if (isAccP && isAccM) {
953  //no FillPairHists because we have not declared KinematicParamCand jet
954  fHM->H2("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
955  ->Fill(p.fRapidity, p.fPt, fWeight);
956  fHM->H1("fh_signal_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
957  ->Fill(p.fMomentumMag, fWeight);
958  fHM->H1("fh_signal_minv_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
959  ->Fill(p.fMinv, fWeight);
960  fHM->H2("fh_signal_minv_pt_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
961  ->Fill(p.fMinv, p.fPt, fWeight);
962  }
963  }
964  }
965  }
966 } // PairsAcceptance
967 
968 
970  CbmAnaJpsiCandidate* candM,
972  CbmAnaJpsiKinematicParams* parRec) {
973  Bool_t isBG = !(candP->fIsMcSignalElectron && candM->fIsMcSignalElectron);
974  Double_t weight = 1.;
975  if (candP->fIsMcSignalElectron || candM->fIsMcSignalElectron)
976  weight = fWeight;
977  if (isBG) {
978  if (candM->fIsMcGammaElectron) {
979  if (candP->fIsMcGammaElectron) {
980  fHM
981  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
982  + "_gg")
983  ->Fill(parRec->fMinv, weight); //gamma + gamma
984  } else if (candP->fIsMcPi0Electron) {
985  fHM
986  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
987  + "_gp")
988  ->Fill(parRec->fMinv, weight); //gamma + Pi0
989  } else {
990  fHM
991  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
992  + "_go")
993  ->Fill(parRec->fMinv, weight); //gamma + other
994  fHM->H1("fh_PdgCode_of Others_BG_" + CbmAnaJpsiHist::fAnaSteps[step])
995  ->Fill((double) candP->fMcPdg - 0.5);
996  }
997  } else if (candM->fIsMcPi0Electron) {
998  if (candP->fIsMcGammaElectron) {
999  fHM
1000  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1001  + "_gp")
1002  ->Fill(parRec->fMinv, weight); //pi0 + gamma
1003  } else if (candP->fIsMcPi0Electron) {
1004  fHM
1005  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1006  + "_pp")
1007  ->Fill(parRec->fMinv, weight); //pi0 + Pi0
1008  } else {
1009  fHM
1010  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1011  + "_po")
1012  ->Fill(parRec->fMinv, weight); //pi0 + other
1013  fHM->H1("fh_PdgCode_of Others_BG_" + CbmAnaJpsiHist::fAnaSteps[step])
1014  ->Fill((double) candP->fMcPdg - 0.5);
1015  }
1016  } else {
1017  fHM->H1("fh_PdgCode_of Others_BG_" + CbmAnaJpsiHist::fAnaSteps[step])
1018  ->Fill((double) candM->fMcPdg - 0.5);
1019  if (candP->fIsMcGammaElectron) {
1020  fHM
1021  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1022  + "_og")
1023  ->Fill(parRec->fMinv, weight); //other + gamma
1024  } else if (candP->fIsMcPi0Electron) {
1025  fHM
1026  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1027  + "_po")
1028  ->Fill(parRec->fMinv, weight); //other + Pi0
1029  } else {
1030  fHM
1031  ->H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step]
1032  + "_oo")
1033  ->Fill(parRec->fMinv, weight); //other + other
1034  fHM->H1("fh_PdgCode_of Others_BG_" + CbmAnaJpsiHist::fAnaSteps[step])
1035  ->Fill((double) candP->fMcPdg - 0.5);
1036  }
1037  }
1038  }
1039 }
1040 
1041 
1044  Int_t pdg) {
1045  int binNum = (double) step + 0.5;
1046  // Double_t mom = cand->fMomentum.Mag();
1047  // Double_t pt = cand->fMomentum.Perp();
1048 
1049 
1050  if (cand->fIsMcSignalElectron) {
1051  fHM->H1("fh_nof_el_tracks")->Fill(binNum, fWeight);
1052 
1053  CbmMCTrack* mcCand = (CbmMCTrack*) fMcTracks->At(cand->fStsMcTrackId);
1054  if (mcCand != NULL) {
1055  fHM->H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[step])
1056  ->Fill(mcCand->GetP(), fWeight);
1057  if (step == kJpsiReco)
1058  fHM->H2("fh_track_el_mom_mc_rec")
1059  ->Fill(mcCand->GetP(), cand->fMomentum.Mag(), fWeight);
1060  }
1061  } else {
1062  fHM->H1("fh_nof_bg_tracks")->Fill(binNum);
1063 
1064  if (cand->fIsMismatch) fHM->H1("fh_nof_mismatches")->Fill(binNum);
1065  if (cand->fStsMcTrackId != cand->fRichMcTrackId)
1066  fHM->H1("fh_nof_mismatches_rich")->Fill(binNum);
1067  if (fUseTrd && cand->fStsMcTrackId != cand->fTrdMcTrackId)
1068  fHM->H1("fh_nof_mismatches_trd")->Fill(binNum);
1069  if (cand->fStsMcTrackId != cand->fTofMcTrackId)
1070  fHM->H1("fh_nof_mismatches_tof")->Fill(binNum);
1071 
1072 
1073  if (cand->fIsMcGammaElectron) {
1074  fHM->H2("fh_source_tracks")->Fill(binNum, 0.5);
1075  } else if (cand->fIsMcPi0Electron) {
1076  fHM->H2("fh_source_tracks")->Fill(binNum, 1.5);
1077  } else if (pdg == 211 || pdg == -211) { //Pi+-
1078  fHM->H2("fh_source_tracks")->Fill(binNum, 2.5);
1079  } else if (pdg == 2212) { //P
1080  fHM->H2("fh_source_tracks")->Fill(binNum, 3.5);
1081  } else if (pdg == 321 || pdg == -321) {
1082  fHM->H2("fh_source_tracks")->Fill(binNum, 4.5);
1083  } else if ((pdg == 11 || pdg == -11) && !cand->fIsMcGammaElectron
1084  && !cand->fIsMcPi0Electron && !cand->fIsMcSignalElectron) {
1085  fHM->H2("fh_source_tracks")->Fill(binNum, 5.5);
1086  } else {
1087  fHM->H2("fh_source_tracks")->Fill(binNum, 6.5);
1088  }
1089  } //Signal or not
1090 } //TrackSource
1091 
1092 
1094  CbmAnaJpsiCandidate* candM,
1096  CbmAnaJpsiKinematicParams* parRec,
1097  CbmAnaJpsiAnalysisSteps step) {
1098  Bool_t isSignal = candP->fIsMcSignalElectron && candM->fIsMcSignalElectron;
1099  Bool_t isPi0 = (candP->fIsMcPi0Electron && candM->fIsMcPi0Electron
1100  && candP->fStsMcMotherId == candM->fStsMcMotherId);
1101  Bool_t isGamma = (candP->fIsMcGammaElectron && candM->fIsMcGammaElectron
1102  && candP->fStsMcMotherId == candM->fStsMcMotherId);
1103  Bool_t isBG =
1104  !isSignal; //(!isGamma) && (!isPi0) && (!(candP->fIsMcSignalElectron || candM->fIsMcSignalElectron));
1105  Bool_t isMismatch = (candP->fIsMismatch || candM->fIsMismatch);
1106 
1107  if (isSignal)
1108  fHM->H2("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[step])
1109  ->Fill(parMc->fRapidity, parMc->fPt, fWeight);
1110  if (isSignal)
1111  fHM->H1("fh_signal_mom_" + CbmAnaJpsiHist::fAnaSteps[step])
1112  ->Fill(parMc->fMomentumMag, fWeight);
1113  if (isSignal)
1114  fHM->H1("fh_signal_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1115  ->Fill(parRec->fMinv, fWeight);
1116  if (isSignal)
1117  fHM->H2("fh_signal_minv_pt_" + CbmAnaJpsiHist::fAnaSteps[step])
1118  ->Fill(parRec->fMinv, parMc->fPt, fWeight);
1119  if (isBG) {
1120  if (candP->fIsMcSignalElectron || candM->fIsMcSignalElectron) {
1121  fHM->H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1122  ->Fill(parRec->fMinv, fWeight);
1123  } else {
1124  fHM->H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1125  ->Fill(parRec->fMinv);
1126  }
1127  }
1128  PairSource(candP, candM, step, parRec);
1129  if (isPi0)
1130  fHM->H1("fh_pi0_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1131  ->Fill(parRec->fMinv);
1132  if (isGamma)
1133  fHM->H1("fh_gamma_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1134  ->Fill(parRec->fMinv);
1135  if (isBG && isMismatch)
1136  fHM->H1("fh_bg_mismatch_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1137  ->Fill(parRec->fMinv);
1138  if (isBG && !isMismatch) {
1139  fHM->H1("fh_bg_truematch_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1140  ->Fill(parRec->fMinv);
1141  if (candP->fMcPdg == 11 && candM->fMcPdg == 11)
1142  fHM->H1("fh_bg_truematch_el_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1143  ->Fill(parRec->fMinv);
1144  if (candP->fMcPdg != 11 || candM->fMcPdg != 11)
1145  fHM->H1("fh_bg_truematch_notel_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
1146  ->Fill(parRec->fMinv);
1147  }
1148 }
1149 
1150 
1152  Int_t ncand = fCandidates.size();
1153 
1154  for (Int_t i = 0; i < ncand; i++) {
1155  Int_t pdg = 0;
1156  if (fCandidates[i].fStsMcTrackId > 0) {
1157  CbmMCTrack* mcTrack =
1158  (CbmMCTrack*) fMcTracks->At(fCandidates[i].fStsMcTrackId);
1159  if (NULL != mcTrack) pdg = mcTrack->GetPdgCode();
1160  }
1161 
1162  Bool_t isChi2Prim = (fCandidates[i].fChi2Prim < fCuts.fChiPrimCut);
1163  Bool_t isEl = (fCandidates[i].fIsElectron);
1164  Bool_t isPtCut = (fCandidates[i].fMomentum.Perp() > fCuts.fPtCut);
1165 
1167  if (isChi2Prim) TrackSource(&fCandidates[i], kJpsiChi2Prim, pdg);
1168  if (isChi2Prim && isEl) TrackSource(&fCandidates[i], kJpsiElId, pdg);
1169  if (isChi2Prim && isEl && isPtCut)
1171  }
1172 
1173  for (Int_t iM = 0; iM < ncand; iM++) {
1174  if (fCandidates[iM].fCharge < 0) continue;
1175  CbmMCTrack* mctrackM = NULL;
1176  if (fCandidates[iM].fStsMcTrackId >= 0)
1177  mctrackM = (CbmMCTrack*) fMcTracks->At(fCandidates[iM].fStsMcTrackId);
1178 
1179  for (Int_t iP = 0; iP < ncand; iP++) {
1180  if (fCandidates[iP].fCharge > 0) continue;
1181  CbmMCTrack* mctrackP = NULL;
1182  if (fCandidates[iP].fStsMcTrackId >= 0)
1183  mctrackP = (CbmMCTrack*) fMcTracks->At(fCandidates[iP].fStsMcTrackId);
1184  if (iM == iP) continue;
1185 
1187  if (mctrackP != NULL && mctrackM != NULL)
1189  mctrackM);
1190 
1193  &fCandidates[iP], &fCandidates[iM]);
1194 
1195  Bool_t isChiPrimary = (fCandidates[iP].fChi2Prim < fCuts.fChiPrimCut
1196  && fCandidates[iM].fChi2Prim < fCuts.fChiPrimCut);
1197  Bool_t isEl =
1198  (fCandidates[iP].fIsElectron && fCandidates[iM].fIsElectron);
1199  Bool_t isPtCut = (fCandidates[iP].fMomentum.Perp() > fCuts.fPtCut
1200  && fCandidates[iM].fMomentum.Perp() > fCuts.fPtCut);
1201  Bool_t isSignal = (fCandidates[iP].fIsMcSignalElectron
1202  && fCandidates[iM].fIsMcSignalElectron);
1203 
1204  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kJpsiReco);
1205  if (isChiPrimary) {
1206  FillPairHists(
1207  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kJpsiChi2Prim);
1208  }
1209  if (isChiPrimary && isEl) {
1210  FillPairHists(
1211  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kJpsiElId);
1212  }
1213  if (isChiPrimary && isEl && isPtCut) {
1214  FillPairHists(
1215  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kJpsiPtCut);
1216  }
1217 
1218  if (isSignal && isChiPrimary && isEl && pRec.fPt < 0.4) {
1219  fHM->H1("fh_ee_signal_minv_diff_ptcuts_0")->Fill(pRec.fMinv, fWeight);
1220  }
1221  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 0.4
1222  && pRec.fPt < 0.8) {
1223  fHM->H1("fh_ee_signal_minv_diff_ptcuts_1")->Fill(pRec.fMinv, fWeight);
1224  }
1225  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 0.8
1226  && pRec.fPt < 1.2) {
1227  fHM->H1("fh_ee_signal_minv_diff_ptcuts_2")->Fill(pRec.fMinv, fWeight);
1228  }
1229  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 1.2
1230  && pRec.fPt < 1.6) {
1231  fHM->H1("fh_ee_signal_minv_diff_ptcuts_3")->Fill(pRec.fMinv, fWeight);
1232  }
1233  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 1.6
1234  && pRec.fPt < 2.0) {
1235  fHM->H1("fh_ee_signal_minv_diff_ptcuts_4")->Fill(pRec.fMinv, fWeight);
1236  }
1237  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 2.0
1238  && pRec.fPt < 2.4) {
1239  fHM->H1("fh_ee_signal_minv_diff_ptcuts_5")->Fill(pRec.fMinv, fWeight);
1240  }
1241  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 2.4
1242  && pRec.fPt < 3.0) {
1243  fHM->H1("fh_ee_signal_minv_diff_ptcuts_6")->Fill(pRec.fMinv, fWeight);
1244  }
1245  if (isSignal && isChiPrimary && isEl && pRec.fPt >= 3.0
1246  && pRec.fPt < 6.0) {
1247  fHM->H1("fh_ee_signal_minv_diff_ptcuts_7")->Fill(pRec.fMinv, fWeight);
1248  }
1249 
1250  } //iM
1251  } //iP
1252 }
1253 
1254 void CbmAnaJpsiTask::IsElectron(Int_t globalTrackIndex,
1255  Double_t momentum,
1256  CbmAnaJpsiCandidate* cand) {
1258  globalTrackIndex, momentum);
1260  globalTrackIndex, momentum);
1261 
1263  globalTrackIndex, momentum);
1264  cand->fTrdAnn =
1265  CbmLitGlobalElectronId::GetInstance().GetTrdAnn(globalTrackIndex, momentum);
1266 
1268  globalTrackIndex, momentum);
1269  //Bool_t momCut = (fCuts.fMomentumCut > 0.)?(momentum < fCuts.fMomentumCut):true;
1270 
1271  cand->fIsRichEl = richEl;
1272  cand->fIsTrdEl = trdEl;
1273  cand->fIsTofEl = (fUseTof) ? tofEl : true;
1274  cand->fIsElectron = (richEl && trdEl && tofEl);
1275 }
1276 
1277 
1279  Bool_t IsTrdMcTrackId =
1280  (fUseTrd) ? (cand->fStsMcTrackId == cand->fTrdMcTrackId) : true;
1281  if (cand->fStsMcTrackId == cand->fRichMcTrackId && IsTrdMcTrackId
1282  && cand->fStsMcTrackId == cand->fTofMcTrackId
1283  && cand->fStsMcTrackId != -1)
1284  cand->fIsMismatch = false;
1285  else {
1286  cand->fIsMismatch = true;
1287  }
1288 }
1289 
1291  Int_t nofRichHits = fRichHits->GetEntriesFast();
1292  for (Int_t i = 0; i < nofRichHits; i++) {
1293  // get the RichHit from array
1294  CbmRichHit* richHit = (CbmRichHit*) fRichHits->At(i);
1295  if (NULL == richHit) continue;
1296  Int_t PointInd = richHit->GetRefId();
1297  if (PointInd < 0) continue;
1298 
1299  // get the McRichPoint of the RichHit
1300  CbmRichPoint* richMcPoint = (CbmRichPoint*) fRichPoints->At(PointInd);
1301  if (NULL == richMcPoint) continue;
1302 
1303  // get the RICH photon MC Track
1304  Int_t photonMcTrackId = richMcPoint->GetTrackID();
1305  if (photonMcTrackId == -1) continue;
1306  CbmMCTrack* photonMcTrack = (CbmMCTrack*) fMcTracks->At(photonMcTrackId);
1307  if (NULL == photonMcTrack) continue;
1308 
1309  // get photon mother MC Track (electron, pion etc.)
1310  Int_t photonMotherId = photonMcTrack->GetMotherId();
1311  if (photonMotherId == -1) continue;
1312  CbmMCTrack* photonMotherMcTrack =
1313  (CbmMCTrack*) fMcTracks->At(photonMotherId);
1314  if (NULL == photonMotherMcTrack) continue;
1315 
1316  Bool_t isMcSignalElectron =
1317  CbmAnaJpsiUtils::IsMcSignalElectron(photonMotherMcTrack);
1318  Bool_t isMcGammaElectron =
1319  CbmAnaJpsiUtils::IsMcGammaElectron(photonMotherMcTrack, fMcTracks);
1320  Bool_t isMcPi0Electron =
1321  CbmAnaJpsiUtils::IsMcPi0Electron(photonMotherMcTrack, fMcTracks);
1322  if (isMcSignalElectron) {
1323  fHM->H2("fh_rich_pmt_xy_" + CbmAnaJpsiHist::fSourceTypes[kJpsiSignal])
1324  ->Fill(richHit->GetX(), richHit->GetY(), fWeight);
1325  } else {
1326  fHM->H2("fh_rich_pmt_xy_" + CbmAnaJpsiHist::fSourceTypes[kJpsiBg])
1327  ->Fill(richHit->GetX(), richHit->GetY());
1328  }
1329  if (isMcGammaElectron)
1330  fHM->H2("fh_rich_pmt_xy_" + CbmAnaJpsiHist::fSourceTypes[kJpsiGamma])
1331  ->Fill(richHit->GetX(), richHit->GetY());
1332  if (isMcPi0Electron)
1333  fHM->H2("fh_rich_pmt_xy_" + CbmAnaJpsiHist::fSourceTypes[kJpsiPi0])
1334  ->Fill(richHit->GetX(), richHit->GetY());
1335  }
1336 }
1337 
1339  for (UInt_t i = 0; i < fCandidates.size(); i++) {
1340  new ((*fJpsiCandidates)[i]) CbmAnaJpsiCandidate(fCandidates[i]);
1341  }
1342 }
1343 
1344 
1346  TDirectory* oldir = gDirectory;
1347  TFile* outFile = FairRootManager::Instance()->GetOutFile();
1348  if (outFile != NULL) {
1349  outFile->cd();
1350  fHM->WriteToFile();
1351  }
1352  gDirectory->cd(oldir->GetPath());
1353 }
1354 
1355 
CbmRichPoint.h
CbmAnaJpsiKinematicParams::fMinv
Double_t fMinv
Definition: CbmAnaJpsiKinematicParams.h:17
CbmAnaJpsiKinematicParams::fPt
Double_t fPt
Definition: CbmAnaJpsiKinematicParams.h:15
kJpsiReco
@ kJpsiReco
Definition: CbmAnaJpsiHist.h:23
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmMatch
Definition: CbmMatch.h:22
CbmAnaJpsiUtils::CalculateAndSetTrackParamsToCandidate
static void CalculateAndSetTrackParamsToCandidate(CbmAnaJpsiCandidate *cand, CbmStsTrack *stsTrack, CbmKFVertex &kfVertex)
Definition: CbmAnaJpsiUtils.h:25
CbmAnaJpsiTask::fTofHits
TClonesArray * fTofHits
Definition: CbmAnaJpsiTask.h:74
kJpsiPtCut
@ kJpsiPtCut
Definition: CbmAnaJpsiHist.h:26
kJpsiSignal
@ kJpsiSignal
Definition: CbmAnaJpsiHist.h:11
CbmAnaJpsiTask::IsElectron
void IsElectron(Int_t globalTrackIndex, Double_t momentum, CbmAnaJpsiCandidate *cand)
Identifies particle as Electron (or not)
Definition: CbmAnaJpsiTask.cxx:1254
CbmAnaJpsiTask::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmAnaJpsiTask.h:64
CbmAnaJpsiTask::SignalAndBgReco
void SignalAndBgReco()
Definition: CbmAnaJpsiTask.cxx:1151
CbmAnaJpsiTask::fWeight
Double_t fWeight
Definition: CbmAnaJpsiTask.h:90
CbmAnaJpsiTask::CreateSourceTypesH1
void CreateSourceTypesH1(const string &name, const string &axisX, const string &axisY, double nBins, double min, double max)
Definition: CbmAnaJpsiTask.cxx:216
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
CbmAnaJpsiCandidate::fIsMcGammaElectron
Bool_t fIsMcGammaElectron
Definition: CbmAnaJpsiCandidate.h:74
CbmTrack::GetNofHits
virtual Int_t GetNofHits() const
Definition: CbmTrack.h:53
CbmAnaJpsiTask::fRichHits
TClonesArray * fRichHits
Definition: CbmAnaJpsiTask.h:66
CbmAnaJpsiKinematicParams::KinematicParamsWithMcTracks
static CbmAnaJpsiKinematicParams KinematicParamsWithMcTracks(const CbmMCTrack *mctrackP, const CbmMCTrack *mctrackM)
Definition: CbmAnaJpsiKinematicParams.h:24
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmAnaJpsiTask::CreateAnalysisStepsH1
void CreateAnalysisStepsH1(const string &name, const string &axisX, const string &axisY, double nBins, double min, double max)
Definition: CbmAnaJpsiTask.cxx:180
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmAnaJpsiUtils::IsMcGammaElectron
static Bool_t IsMcGammaElectron(CbmMCTrack *mctrack, TClonesArray *mcTracks)
Definition: CbmAnaJpsiUtils.h:64
CbmAnaJpsiCandidate::fMcPdg
Int_t fMcPdg
Definition: CbmAnaJpsiCandidate.h:76
CbmAnaJpsiTask::CbmAnaJpsiTask
CbmAnaJpsiTask()
Standard constructor.
Definition: CbmAnaJpsiTask.cxx:29
CbmAnaJpsiCandidate::fRichInd
Int_t fRichInd
Definition: CbmAnaJpsiCandidate.h:60
CbmAnaJpsiTask::PairMcAndAcceptance
void PairMcAndAcceptance()
Fill histograms for MC and Acc pairs.
Definition: CbmAnaJpsiTask.cxx:922
CbmHistManager::Create2
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:104
CbmAnaJpsiTask::FillPairHists
void FillPairHists(CbmAnaJpsiCandidate *candP, CbmAnaJpsiCandidate *candM, CbmAnaJpsiKinematicParams *parMc, CbmAnaJpsiKinematicParams *parRec, CbmAnaJpsiAnalysisSteps step)
Definition: CbmAnaJpsiTask.cxx:1093
CbmAnaJpsiTask.h
CbmAnaJpsiTask::fNofHitsInRingMap
std::map< Int_t, Int_t > fNofHitsInRingMap
Definition: CbmAnaJpsiTask.h:81
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
kJpsiElId
@ kJpsiElId
Definition: CbmAnaJpsiHist.h:25
CbmAnaJpsiTask::fMcTracks
TClonesArray * fMcTracks
Definition: CbmAnaJpsiTask.h:60
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmAnaJpsiCandidate::fIsRichEl
Bool_t fIsRichEl
Definition: CbmAnaJpsiCandidate.h:81
kJpsiPi0
@ kJpsiPi0
Definition: CbmAnaJpsiHist.h:13
CbmAnaJpsiTask::CreateAnaStepsPairSourceH1
void CreateAnaStepsPairSourceH1(const string &name, const string &axisX, const string &axisY, double nBins, double min, double max)
Definition: CbmAnaJpsiTask.cxx:253
CbmAnaJpsiCandidate::fStsInd
Int_t fStsInd
Definition: CbmAnaJpsiCandidate.h:59
kJpsiAcc
@ kJpsiAcc
Definition: CbmAnaJpsiHist.h:22
CbmHistManager::H2
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
Definition: CbmHistManager.h:190
CbmLitGlobalElectronId::GetRichAnn
Double_t GetRichAnn(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:125
CbmAnaJpsiTask::MCPairs
void MCPairs()
Definition: CbmAnaJpsiTask.cxx:611
CbmAnaJpsiCandidate
Definition: CbmAnaJpsiCandidate.h:8
CbmGlobalTrack.h
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.
CbmRichRing::GetNofHits
Int_t GetNofHits() const
Definition: CbmRichRing.h:40
CbmRichRing
Definition: CbmRichRing.h:17
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
kJpsiChi2Prim
@ kJpsiChi2Prim
Definition: CbmAnaJpsiHist.h:24
CbmAnaJpsiCuts::fPtCut
Double_t fPtCut
Definition: CbmAnaJpsiCuts.h:39
CbmLitGlobalElectronId::GetTrdAnn
Double_t GetTrdAnn(Int_t globalTrackindex, Double_t momentum)
Return ANN value for electron Identification in the TRD detector.
Definition: CbmLitGlobalElectronId.cxx:131
CbmAnaJpsiTask::fTrdPoints
TClonesArray * fTrdPoints
Definition: CbmAnaJpsiTask.h:69
CbmRichRing.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmAnaJpsiTask::fUseTrd
Bool_t fUseTrd
Definition: CbmAnaJpsiTask.h:94
CbmHistManager.h
Histogram manager.
CbmAnaJpsiTask::fStsPoints
TClonesArray * fStsPoints
Definition: CbmAnaJpsiTask.h:61
CbmAnaJpsiCandidate::fIsTrdEl
Bool_t fIsTrdEl
Definition: CbmAnaJpsiCandidate.h:82
CbmAnaJpsiTask::fCuts
CbmAnaJpsiCuts fCuts
Definition: CbmAnaJpsiTask.h:88
CbmAnaJpsiHist::fAnaSteps
static const std::vector< std::string > fAnaSteps
Definition: CbmAnaJpsiHist.h:37
CbmStsTrack::GetNofHits
virtual Int_t GetNofHits() const
Definition: CbmStsTrack.h:76
CbmAnaJpsiTask::fCandidates
std::vector< CbmAnaJpsiCandidate > fCandidates
Definition: CbmAnaJpsiTask.h:86
CbmAnaJpsiTask::Exec
virtual void Exec(Option_t *option)
Inherited from FairTask.
Definition: CbmAnaJpsiTask.cxx:546
kJpsiBg
@ kJpsiBg
Definition: CbmAnaJpsiHist.h:12
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmAnaJpsiCandidate::fTrdAnn
Double_t fTrdAnn
Definition: CbmAnaJpsiCandidate.h:78
CbmLitGlobalElectronId::IsRichElectron
Bool_t IsRichElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:52
CbmAnaJpsiTask::Finish
virtual void Finish()
Inherited from FairTask.
Definition: CbmAnaJpsiTask.cxx:1345
CbmStsTrack::GetNofMvdHits
Int_t GetNofMvdHits() const
Definition: CbmStsTrack.h:84
CbmAnaJpsiTask::fEventNum
Int_t fEventNum
Definition: CbmAnaJpsiTask.h:58
kJpsiMc
@ kJpsiMc
Definition: CbmAnaJpsiHist.h:21
CbmAnaJpsiKinematicParams::KinematicParamsWithCandidates
static CbmAnaJpsiKinematicParams KinematicParamsWithCandidates(const CbmAnaJpsiCandidate *candP, const CbmAnaJpsiCandidate *candM)
Definition: CbmAnaJpsiKinematicParams.h:61
CbmAnaJpsiTask::fUseTof
Bool_t fUseTof
Definition: CbmAnaJpsiTask.h:95
CbmAnaJpsiTask::IsMcTrackAccepted
Bool_t IsMcTrackAccepted(Int_t mcTrackInd)
Return true if MC track is in detector acceptance.
Definition: CbmAnaJpsiTask.cxx:867
CbmAnaJpsiCuts.h
CbmAnaJpsiTask::fTrdHits
TClonesArray * fTrdHits
Definition: CbmAnaJpsiTask.h:70
CbmAnaJpsiHist.h
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmAnaJpsiTask::DifferenceSignalAndBg
void DifferenceSignalAndBg()
Fill histograms for signal and BG electrons.
Definition: CbmAnaJpsiTask.cxx:742
CbmAnaJpsiTask::IsRecoTrackAccepted
void IsRecoTrackAccepted(CbmAnaJpsiCandidate *cand)
Definition: CbmAnaJpsiTask.cxx:881
CbmAnaJpsiTask::fStsTracks
TClonesArray * fStsTracks
Definition: CbmAnaJpsiTask.h:63
CbmAnaJpsiHist::fSourceTypes
static const std::vector< std::string > fSourceTypes
Definition: CbmAnaJpsiHist.h:32
CbmMCTrack::GetNPoints
Int_t GetNPoints(ECbmModuleId detId) const
Definition: CbmMCTrack.cxx:186
CbmAnaJpsiTask::PairSource
void PairSource(CbmAnaJpsiCandidate *candP, CbmAnaJpsiCandidate *candM, CbmAnaJpsiAnalysisSteps step, CbmAnaJpsiKinematicParams *parRec)
Definition: CbmAnaJpsiTask.cxx:969
CbmAnaJpsiCandidate::fRichAnn
Double_t fRichAnn
Definition: CbmAnaJpsiCandidate.h:77
CbmGlobalTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: CbmGlobalTrack.h:39
CbmTrackMatchNew.h
CbmVertex
Definition: CbmVertex.h:26
CbmAnaJpsiCandidate::fRichMcTrackId
Int_t fRichMcTrackId
Definition: CbmAnaJpsiCandidate.h:68
CbmHistManager::Create1
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:81
CbmAnaJpsiTask::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmAnaJpsiTask.h:68
CbmAnaJpsiTask::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: CbmAnaJpsiTask.cxx:68
CbmAnaJpsiTask::FillRichRingNofHits
void FillRichRingNofHits()
Definition: CbmAnaJpsiTask.cxx:587
CbmAnaJpsiTask::SingleParticleAcceptance
void SingleParticleAcceptance()
Definition: CbmAnaJpsiTask.cxx:904
CbmTrdHit.h
Class for hits in TRD detector.
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmAnaJpsiTask::fTrdTracks
TClonesArray * fTrdTracks
Definition: CbmAnaJpsiTask.h:71
kJpsiGamma
@ kJpsiGamma
Definition: CbmAnaJpsiHist.h:14
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
CbmAnaJpsiCandidate::fTrdInd
Int_t fTrdInd
Definition: CbmAnaJpsiCandidate.h:61
CbmAnaJpsiTask::fRichRings
TClonesArray * fRichRings
Definition: CbmAnaJpsiTask.h:67
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmAnaJpsiTask::fTofPoints
TClonesArray * fTofPoints
Definition: CbmAnaJpsiTask.h:73
CbmAnaJpsiTask::~CbmAnaJpsiTask
virtual ~CbmAnaJpsiTask()
Standard destructor.
Definition: CbmAnaJpsiTask.cxx:66
CbmAnaJpsiCandidate::fMomentum
TVector3 fMomentum
Definition: CbmAnaJpsiCandidate.h:51
CbmAnaJpsiAnalysisSteps
CbmAnaJpsiAnalysisSteps
Definition: CbmAnaJpsiHist.h:20
CbmAnaJpsiKinematicParams
Definition: CbmAnaJpsiKinematicParams.h:12
CbmAnaJpsiTask::IsMismatch
void IsMismatch(CbmAnaJpsiCandidate *cand)
Definition: CbmAnaJpsiTask.cxx:1278
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.
CbmTrdTrack
Definition: CbmTrdTrack.h:22
CbmAnaJpsiHist::fNofSourceTypes
static const int fNofSourceTypes
Definition: CbmAnaJpsiHist.h:31
CbmAnaJpsiKinematicParams::fMomentumMag
Double_t fMomentumMag
Definition: CbmAnaJpsiKinematicParams.h:14
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmAnaJpsiTask::CopyCandidatesToOutputArray
void CopyCandidatesToOutputArray()
Definition: CbmAnaJpsiTask.cxx:1338
CbmAnaJpsiKinematicParams::fRapidity
Double_t fRapidity
Definition: CbmAnaJpsiKinematicParams.h:16
nStsHits
Int_t nStsHits
Definition: CbmHadronAnalysis.cxx:65
CbmMCTrack.h
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
CbmAnaJpsiCandidate::fTrdMcTrackId
Int_t fTrdMcTrackId
Definition: CbmAnaJpsiCandidate.h:69
CbmAnaJpsiKinematicParams.h
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmAnaJpsiUtils::IsMcSignalElectron
static Bool_t IsMcSignalElectron(CbmMCTrack *mctrack)
Definition: CbmAnaJpsiUtils.h:54
CbmAnaJpsiTask::RichPmtXY
void RichPmtXY()
Definition: CbmAnaJpsiTask.cxx:1290
CbmAnaJpsiTask::fTrdTrackMatches
TClonesArray * fTrdTrackMatches
Definition: CbmAnaJpsiTask.h:72
CbmAnaJpsiUtils.h
CbmAnaJpsiCandidate.h
CbmAnaJpsiCandidate::fIsMcPi0Electron
Bool_t fIsMcPi0Electron
Definition: CbmAnaJpsiCandidate.h:73
CbmAnaJpsiTask::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmAnaJpsiTask.h:83
CbmAnaJpsiTask::CreateSourceTypesH2
void CreateSourceTypesH2(const string &name, const string &axisX, const string &axisY, const string &axisZ, double nBinsX, double minX, double maxX, double nBinsY, double minY, double maxY)
Definition: CbmAnaJpsiTask.cxx:229
CbmAnaJpsiTask::fHM
CbmHistManager * fHM
Definition: CbmAnaJpsiTask.h:92
CbmAnaJpsiTask::AssignMcToCandidates
void AssignMcToCandidates()
Assign MC info to the candidates.
Definition: CbmAnaJpsiTask.cxx:681
CbmAnaJpsiCandidate::fIsElectron
Bool_t fIsElectron
Definition: CbmAnaJpsiCandidate.h:64
CbmAnaJpsiTask::CreateAnalysisStepsH2
void CreateAnalysisStepsH2(const string &name, const string &axisX, const string &axisY, const string &axisZ, double nBinsX, double minX, double maxX, double nBinsY, double minY, double maxY)
Definition: CbmAnaJpsiTask.cxx:193
CbmAnaJpsiCandidate::fIsMcSignalElectron
Bool_t fIsMcSignalElectron
Definition: CbmAnaJpsiCandidate.h:72
CbmAnaJpsiTask::fStsHits
TClonesArray * fStsHits
Definition: CbmAnaJpsiTask.h:62
CbmAnaJpsiCuts::fChiPrimCut
Double_t fChiPrimCut
Definition: CbmAnaJpsiCuts.h:38
CbmAnaJpsiCandidate::fTofInd
Int_t fTofInd
Definition: CbmAnaJpsiCandidate.h:62
CbmAnaJpsiTask::TrackSource
void TrackSource(CbmAnaJpsiCandidate *cand, CbmAnaJpsiAnalysisSteps step, Int_t pdg)
Definition: CbmAnaJpsiTask.cxx:1042
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmAnaJpsiTask::fJpsiCandidates
TClonesArray * fJpsiCandidates
Definition: CbmAnaJpsiTask.h:77
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmAnaJpsiCandidate::fTofMcTrackId
Int_t fTofMcTrackId
Definition: CbmAnaJpsiCandidate.h:70
CbmLitGlobalElectronId.h
CbmAnaJpsiCandidate::fStsMcTrackId
Int_t fStsMcTrackId
Definition: CbmAnaJpsiCandidate.h:67
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
CbmRichHit.h
CbmAnaJpsiTask::InitHist
void InitHist()
Definition: CbmAnaJpsiTask.cxx:290
CbmTrdTrack.h
CbmAnaJpsiHist::fNofAnaSteps
static const int fNofAnaSteps
Definition: CbmAnaJpsiHist.h:36
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmRichPoint
Definition: CbmRichPoint.h:24
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmAnaJpsiCandidate::fStsMcMotherId
Int_t fStsMcMotherId
Definition: CbmAnaJpsiCandidate.h:66
CbmAnaJpsiUtils::IsMcPi0Electron
static Bool_t IsMcPi0Electron(CbmMCTrack *mctrack, TClonesArray *mcTracks)
Definition: CbmAnaJpsiUtils.h:82
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmAnaJpsiCandidate::fIsRecoTrackAccepted
Bool_t fIsRecoTrackAccepted
Definition: CbmAnaJpsiCandidate.h:85
CbmAnaJpsiTask::fRichPoints
TClonesArray * fRichPoints
Definition: CbmAnaJpsiTask.h:65
CbmLitGlobalElectronId::GetInstance
static CbmLitGlobalElectronId & GetInstance()
Definition: CbmLitGlobalElectronId.h:32
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmAnaJpsiTask::fKFVertex
CbmKFVertex fKFVertex
Definition: CbmAnaJpsiTask.h:84
CbmAnaJpsiTask::fTofHitsMatches
TClonesArray * fTofHitsMatches
Definition: CbmAnaJpsiTask.h:75
CbmAnaJpsiTask::FillCandidates
void FillCandidates()
Fill fCandidates array with JPsiCandidates. Candidate should have STS, RICH, TRD, TOF local segments.
Definition: CbmAnaJpsiTask.cxx:629
CbmAnaJpsiTask::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmAnaJpsiTask.h:76
CbmRichHit
Definition: CbmRichHit.h:19
CbmAnaJpsiTask
Definition: CbmAnaJpsiTask.h:28
CbmAnaJpsiCandidate::fIsMismatch
Bool_t fIsMismatch
Definition: CbmAnaJpsiCandidate.h:87
CbmKFVertex
Definition: CbmKFVertex.h:6
CbmStsHit.h
Data class for a reconstructed hit in the STS.
CbmAnaJpsiCandidate::fIsTofEl
Bool_t fIsTofEl
Definition: CbmAnaJpsiCandidate.h:83