CbmRoot
CbmAnaDielectronTask.cxx
Go to the documentation of this file.
1 
8 #include "CbmAnaDielectronTask.h"
9 
10 #include "CbmGlobalTrack.h"
11 #include "CbmStsKFTrackFitter.h"
12 #include "CbmVertex.h"
13 #include "FairEventHeader.h"
14 #include "FairMCPoint.h"
15 #include "FairRootManager.h"
16 #include "FairTask.h"
17 
18 #include "CbmMCTrack.h"
19 
20 #include "CbmKF.h"
21 #include "CbmRichRing.h"
22 #include "CbmStsTrack.h"
23 #include "CbmTofHit.h"
24 #include "CbmTrackMatchNew.h"
25 #include "CbmTrdHit.h"
26 #include "CbmTrdTrack.h"
27 #include "FairTrackParam.h"
29 
30 #include "CbmRichHit.h"
31 #include "CbmRichPoint.h"
32 #include "CbmTofPoint.h"
33 
34 #include "TClonesArray.h"
35 #include "TF1.h"
36 #include "TGraph.h"
37 #include "TH1D.h"
38 #include "TH2D.h"
39 #include "TLorentzVector.h"
40 #include "TMath.h"
41 #include "TObjArray.h"
42 #include "TObject.h"
43 #include "TProfile.h"
44 #include "TRandom3.h"
45 #include "TVector3.h"
46 
47 #include "FairBaseParSet.h"
48 #include "FairGeoMedium.h"
49 #include "FairGeoNode.h"
50 #include "FairGeoTransform.h"
51 #include "FairGeoVector.h"
52 #include "FairGeoVolume.h"
53 #include "FairRunAna.h"
54 #include "FairRuntimeDb.h"
55 #include "TDatabasePDG.h"
56 #include <TFile.h>
57 
58 #include "CbmMatch.h"
59 #include "CbmMvdHit.h"
60 #include "CbmStsHit.h"
61 
62 #include "CbmL1PFFitter.h"
63 #include "L1Field.h"
64 #include "TStopwatch.h"
65 #include "TString.h"
66 #include "TSystem.h"
67 
68 
69 #include "CbmLmvmUtils.h"
70 
71 #include <sstream>
72 #include <vector>
73 
74 using namespace std;
75 
77 
78 
80  const string& name,
81  const string& axisX,
82  const string& axisY,
83  double nBins,
84  double min,
85  double max) {
86  string hname = "";
87  hist.resize(CbmLmvmHist::fNofAnaSteps);
88  for (Int_t i = 0; i < CbmLmvmHist::fNofAnaSteps; i++) {
89  hname = name + "_" + CbmLmvmHist::fAnaSteps[i];
90  hist[i] = new TH1D(hname.c_str(), hname.c_str(), nBins, min, max);
91  hist[i]->GetXaxis()->SetTitle(axisX.c_str());
92  hist[i]->GetYaxis()->SetTitle(axisY.c_str());
93  fHistoList.push_back(hist[i]);
94  }
95 }
96 
98  const string& name,
99  const string& axisX,
100  const string& axisY,
101  const string& axisZ,
102  double nBinsX,
103  double minX,
104  double maxX,
105  double nBinsY,
106  double minY,
107  double maxY) {
108  string hname = "";
109  hist.resize(CbmLmvmHist::fNofAnaSteps);
110  for (Int_t i = 0; i < CbmLmvmHist::fNofAnaSteps; i++) {
111  hname = name + "_" + CbmLmvmHist::fAnaSteps[i];
112  hist[i] = new TH2D(
113  hname.c_str(), hname.c_str(), nBinsX, minX, maxX, nBinsY, minY, maxY);
114  hist[i]->GetXaxis()->SetTitle(axisX.c_str());
115  hist[i]->GetYaxis()->SetTitle(axisY.c_str());
116  hist[i]->GetZaxis()->SetTitle(axisZ.c_str());
117  fHistoList.push_back(hist[i]);
118  }
119 }
120 
122  const string& name,
123  const string& axisX,
124  const string& axisY,
125  double nBins,
126  double min,
127  double max) {
128  string hname = "";
129  hist.resize(CbmLmvmHist::fNofSourceTypes);
130  for (Int_t i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
131  hname = name + "_" + CbmLmvmHist::fSourceTypes[i];
132  hist[i] = new TH1D(hname.c_str(), hname.c_str(), nBins, min, max);
133  hist[i]->GetXaxis()->SetTitle(axisX.c_str());
134  hist[i]->GetYaxis()->SetTitle(axisY.c_str());
135  fHistoList.push_back(hist[i]);
136  }
137 }
138 
140  const string& name,
141  const string& axisX,
142  const string& axisY,
143  const string& axisZ,
144  double nBinsX,
145  double minX,
146  double maxX,
147  double nBinsY,
148  double minY,
149  double maxY) {
150  string hname = "";
151  hist.resize(CbmLmvmHist::fNofSourceTypes);
152  for (Int_t i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
153  hname = name + "_" + CbmLmvmHist::fSourceTypes[i];
154  hist[i] = new TH2D(
155  hname.c_str(), hname.c_str(), nBinsX, minX, maxX, nBinsY, minY, maxY);
156  hist[i]->GetXaxis()->SetTitle(axisX.c_str());
157  hist[i]->GetYaxis()->SetTitle(axisY.c_str());
158  hist[i]->GetZaxis()->SetTitle(axisZ.c_str());
159  fHistoList.push_back(hist[i]);
160  }
161 }
162 
164  : FairTask("CbmAnaDielectronTask")
165  , fMCEventHeader(NULL)
166  , fMCTracks(NULL)
167  , fRichRings(NULL)
168  , fRichProj(NULL)
169  , fRichPoints(NULL)
170  , fRichRingMatches(NULL)
171  , fRichHits(NULL)
172  , fGlobalTracks(NULL)
173  , fStsTracks(NULL)
174  , fStsTrackMatches(NULL)
175  , fStsHits(NULL)
176  , fMvdHits(NULL)
177  , fMvdPoints(NULL)
178  , fMvdHitMatches(NULL)
179  , fTrdTracks(NULL)
180  , fTrdHits(NULL)
181  , fTrdTrackMatches(NULL)
182  , fTofHits(NULL)
183  , fTofHitsMatches(NULL)
184  , fTofPoints(NULL)
185  , fPrimVertex(NULL)
186  , fKFVertex()
187  , fKFFitter()
188  ,
189  // fMCTrackCreator(NULL),
190  fUseMvd(kFALSE)
191  , fUseRich(kTRUE)
192  , fUseTrd(kTRUE)
193  , fUseTof(kTRUE)
194  , fCandidates()
195  , fSTCandidates()
196  , fTTCandidates()
197  , fRTCandidates()
198  , fWeight(0.)
199  , fPionMisidLevel(-1.)
200  , fRandom3(new TRandom3(0))
201  , fCuts()
202  , fHistoList()
203  , fNofHitsInRingMap()
204  , fh_mc_signal_mom_angle()
205  , fh_nof_charged_particles()
206  , fh_nof_charged_particles_acc()
207  , fh_mc_mother_pdg(NULL)
208  , fh_acc_mother_pdg(NULL)
209  , fh_signal_pmtXY(NULL)
210  , fh_pi0_pmtXY(NULL)
211  , fh_gamma_pmtXY(NULL)
212  , fh_vertex_el_gamma_xz()
213  , fh_vertex_el_gamma_yz()
214  , fh_vertex_el_gamma_xy()
215  , fh_vertex_el_gamma_rz()
216  , fh_signal_minv()
217  , fh_bg_minv()
218  , fh_pi0_minv()
219  , fh_eta_minv()
220  , fh_gamma_minv()
221  , fh_signal_mom()
222  , fh_signal_pty()
223  , fh_signal_minv_pt()
224  , fh_eta_minv_pt()
225  , fh_pi0_minv_pt()
226  , fh_bg_truematch_minv()
227  , fh_bg_truematch_el_minv()
228  , fh_bg_truematch_notel_minv()
229  , fh_bg_mismatch_minv()
230  , fh_source_bg_minv()
231  , fh_pt()
232  , fh_mom()
233  , fh_chi2sts()
234  , fh_chi2prim()
235  , fh_ttcut()
236  , fh_stcut()
237  , fh_rtcut()
238  , fh_mvd1cut()
239  , fh_mvd2cut()
240  , fh_richann()
241  , fh_trdann()
242  , fh_tofm2()
243  , fh_ttcut_pion()
244  , fh_ttcut_truepair()
245  , fh_stcut_pion()
246  , fh_stcut_truepair()
247  , fh_rtcut_pion()
248  , fh_rtcut_truepair()
249  , fh_nofMvdHits()
250  , fh_nofStsHits()
251  , fh_mvd1xy()
252  , fh_mvd1r()
253  , fh_mvd2xy()
254  , fh_mvd2r()
255  , fh_mvd1cut_mc_dist_gamma(NULL)
256  , fh_mvd1cut_mc_dist_pi0(NULL)
257  , fh_mvd2cut_mc_dist_gamma(NULL)
258  , fh_mvd2cut_mc_dist_pi0(NULL)
259  , fh_mvd1cut_qa()
260  , fh_mvd2cut_qa()
261  , fh_source_pairs_epem()
262  , fh_source_pairs(NULL)
263  , fh_event_number(NULL)
264  , fh_nof_bg_tracks(NULL)
265  , fh_nof_el_tracks(NULL)
266  , fh_source_tracks(NULL)
267  , fh_nof_topology_pairs_gamma(NULL)
268  , fh_nof_topology_pairs_pi0(NULL)
269  , fh_nof_rec_pairs_gamma(NULL)
270  , fh_nof_rec_pairs_pi0(NULL)
271  , fh_nof_rec_gamma(NULL)
272  , fh_nof_rec_pi0(NULL)
273  , fh_nof_mismatches(NULL)
274  , fh_nof_mismatches_rich(NULL)
275  , fh_nof_mismatches_trd(NULL)
276  , fh_nof_mismatches_tof(NULL)
277  , fh_nof_ghosts(NULL)
278  , fh_source_mom()
279  , fh_source_pt()
280  , fh_opening_angle()
281  , fh_pi_mom_mc(NULL)
282  , fh_pi_mom_acc(NULL)
283  , fh_pi_mom_rec(NULL)
284  , fh_pi_mom_rec_only_sts(NULL)
285  , fh_pi_mom_rec_sts_rich_trd(NULL)
286  , fh_pi_mom_rec_sts_rich_trd_tof(NULL)
287  , fh_pi_rapidity_mc(NULL)
288  , fh_piprim_mom_mc(NULL)
289  , fh_piprim_mom_acc(NULL)
290  , fh_piprim_mom_rec(NULL)
291  , fh_piprim_mom_rec_only_sts(NULL)
292  , fh_piprim_mom_rec_sts_rich_trd(NULL)
293  , fh_piprim_mom_rec_sts_rich_trd_tof(NULL)
294  , fh_piprim_plus_rapidity_mc(NULL)
295  , fh_piprim_minus_rapidity_mc(NULL)
296  , fh_pi0prim_rapidity_mc(NULL)
297  , fh_etaprim_rapidity_mc(NULL) {
298  // weight for rho0 = 0.001081; omega_ee = 0.0026866; omega_dalitz = 0.02242; phi = 0.00039552; pi0 = 4.38 ------ Au + Au, for 25 GeV central collision
299  fWeight = 0.0;
300  fUseRich = true;
301  fUseTrd = true;
302  fUseTof = true;
303  fPionMisidLevel = -1.;
304  fRandom3 = new TRandom3(0);
305 
307 }
308 
310 
312  fHistoList.clear();
313 
314 
315  //MC Pairs
317  new TH2D("fh_mc_signal_mom_angle",
318  "fh_mc_signal_mom_angle; #sqrt{p_{e^{#pm}} p_{e^{#mp}}} [GeV/c]; "
319  "#theta_{e^{+},e^{-}} [deg] ;Counter",
320  100,
321  0.,
322  5.,
323  1000,
324  0.,
325  50.);
327 
328  //Number of Particles per Event
330  new TH1D("fh_nof_charged_particles",
331  "fh_nof_charged_particles; nof charged particles; Yield",
332  500,
333  0.,
334  500.);
337  new TH1D("fh_nof_charged_particles_acc",
338  "fh_nof_charged_particles_acc; nof charged particles; Yield",
339  500,
340  0.,
341  500);
343 
344  // Mother PDG
345  fh_mc_mother_pdg = new TH1D("fh_mc_mother_pdg",
346  "fh_mc_mother_pdg; Pdg code; Particles per event",
347  7000,
348  -3500.,
349  3500.);
350  fHistoList.push_back(fh_mc_mother_pdg);
352  new TH1D("fh_acc_mother_pdg",
353  "fh_acc_mother_pdg; Pdg code; Particles per event",
354  7000,
355  -3500.,
356  3500.);
357  fHistoList.push_back(fh_acc_mother_pdg);
358 
359  //X-Y distribution of MC points on PMT
360  fh_signal_pmtXY = new TH2D("fh_signal_pmtXY",
361  "fh_signal_pmtXY;X [cm];Y [cm];Counter",
362  110,
363  -110,
364  110,
365  200,
366  -200,
367  200);
368  fHistoList.push_back(fh_signal_pmtXY);
369  fh_pi0_pmtXY = new TH2D("fh_pi0_pmtXY",
370  "fh_pi0_pmtXY;X [cm];Y [cm];Counter",
371  110,
372  -110,
373  110,
374  200,
375  -200,
376  200);
377  fHistoList.push_back(fh_pi0_pmtXY);
378  fh_gamma_pmtXY = new TH2D("fh_gamma_pmtXY",
379  "fh_gamma_pmtXY;X [cm];Y [cm];Counter",
380  110,
381  -110,
382  110,
383  200,
384  -200,
385  200);
386  fHistoList.push_back(fh_gamma_pmtXY);
387 
388  //vertex of the secondary electrons from gamma conversion
390  "fh_vertex_el_gamma_xz",
391  "Z [cm]",
392  "X [cm]",
393  "Counter per event",
394  200,
395  -10.,
396  190.,
397  400,
398  -130.,
399  130.);
401  "fh_vertex_el_gamma_yz",
402  "Z [cm]",
403  "Y [cm]",
404  "Counter per event",
405  200,
406  -10.,
407  190.,
408  400,
409  -130.,
410  130.);
412  "fh_vertex_el_gamma_xy",
413  "X [cm]",
414  "Y [cm]",
415  "Counter per event",
416  400,
417  -130.,
418  130.,
419  400,
420  -130.,
421  130.);
423  "fh_vertex_el_gamma_rz",
424  "Z [cm]",
425  "#sqrt{X^{2}+Y^{2}} [cm]",
426  "Counter per event",
427  300,
428  -10.,
429  190.,
430  300,
431  0.,
432  150.);
433 
434  // Number of BG and signal tracks after each cut
435  fh_nof_bg_tracks = new TH1D("fh_nof_bg_tracks",
436  "fh_nof_bg_tracks;Analysis steps;Tracks/event",
438  0.,
440  fHistoList.push_back(fh_nof_bg_tracks);
441  fh_nof_el_tracks = new TH1D("fh_nof_el_tracks",
442  "fh_nof_el_tracks;Analysis steps;Tracks/event",
444  0.,
446  fHistoList.push_back(fh_nof_el_tracks);
447  fh_source_tracks = new TH2D("fh_source_tracks",
448  "fh_source_tracks;Analysis steps;Particle",
450  0.,
452  7,
453  0.,
454  7.);
455  fHistoList.push_back(fh_source_tracks);
456 
458  new TH1D("fh_nof_topology_pairs_gamma",
459  "fh_nof_topology_pairs_gamma;Pair type;Pairs/event",
460  8,
461  0.,
462  8);
464 
466  new TH1D("fh_nof_topology_pairs_pi0",
467  "fh_nof_topology_pairs_pi0;Pair type;Pairs/event",
468  8,
469  0.,
470  8);
472 
473  //Number of mismatches and ghosts after each cut
474  fh_nof_mismatches = new TH1D("fh_nof_mismatches",
475  "fh_nof_mismatches;Analysis steps;Tracks/event",
477  0.,
479  fHistoList.push_back(fh_nof_mismatches);
481  new TH1D("fh_nof_mismatches_rich",
482  "fh_nof_mismatches_rich;Analysis steps;Tracks/event",
484  0.,
488  new TH1D("fh_nof_mismatches_trd",
489  "fh_nof_mismatches_trd;Analysis steps;Tracks/event",
491  0.,
495  new TH1D("fh_nof_mismatches_tof",
496  "fh_nof_mismatches_tof;Analysis steps;Tracks/event",
498  0.,
501  fh_nof_ghosts = new TH1D("fh_nof_ghosts",
502  "fh_nof_ghosts;Analysis steps;Tracks/event",
504  0.,
506  fHistoList.push_back(fh_nof_ghosts);
507 
508  // BG pair source
509  fh_source_pairs = new TH2D("fh_source_pairs",
510  "fh_source_pairs;Analysis steps;Pair",
512  0.,
515  0.,
517  fHistoList.push_back(fh_source_pairs);
518 
519  // Event number counter
520  fh_event_number = new TH1D("fh_event_number", "fh_event_number", 1, 0, 1.);
521  fHistoList.push_back(fh_event_number);
522 
524  fh_richann, "fh_richann", "ANN output", "Yield", 100, -1.1, 1.1);
526  fh_trdann, "fh_trdann", "ANN output", "Yield", 100, -1.1, 1.1);
528  "fh_tofm2",
529  "P [GeV/c]",
530  "m^{2} [GeV/c^{2}]^{2}",
531  "Yield",
532  100,
533  0.,
534  4.,
535  600,
536  -0.000001,
537  0.00001);
538 
539  // Distributions of analysis cuts.
540  // Transverse momentum of tracks.
541  CreateSourceTypesH1(fh_pt, "fh_pt", "P_{t} [GeV/c]", "Yield", 200, 0., 2.);
542  // Momentum of tracks
543  CreateSourceTypesH1(fh_mom, "fh_mom", "P [GeV/c]", "Yield", 200, 0., 10.);
544  // Chi2 of the STS tracks
546  fh_chi2sts, "fh_chi2sts", "#chi^{2}", "Yield", 200, 0., 20.);
547  // Chi2 of the primary vertex
549  fh_chi2prim, "fh_chi2prim", "#chi^{2}_{prim}", "Yield", 200, 0., 20.);
550  // TT cut
552  "fh_ttcut",
553  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
554  "#theta_{e^{+},e^{-}} [deg]",
555  "Yield",
556  100,
557  0.,
558  5.,
559  100,
560  0.,
561  5.);
562  // ST cut
564  "fh_stcut",
565  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
566  "#theta_{e^{#pm},rec} [deg]",
567  "Yield",
568  100,
569  0.,
570  5.,
571  100,
572  0.,
573  5.);
574  // RT cut
576  "fh_rtcut",
577  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
578  "#theta_{e^{#pm},rec} [deg]",
579  "Yield",
580  100,
581  0.,
582  5.,
583  100,
584  0.,
585  5.);
586  // MVD cut at the first station
588  "fh_mvd1cut",
589  "d_{MVD} [cm]",
590  "P_{e} [GeV/c]",
591  "Yield",
592  100,
593  0.,
594  1.,
595  100,
596  0.,
597  5.);
598  // MVD cut at the second station
600  "fh_mvd2cut",
601  "d_{MVD} [cm]",
602  "P_{e} [GeV/c]",
603  "Yield",
604  100,
605  0.,
606  1.,
607  100,
608  0.,
609  5.);
610 
612  "fh_ttcut_pion",
613  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
614  "#theta_{e^{+},e^{-}} [deg]",
615  "Yield",
616  100,
617  0.,
618  5.,
619  100,
620  0.,
621  5.);
623  "fh_ttcut_truepair",
624  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
625  "#theta_{e^{+},e^{-}} [deg]",
626  "Yield",
627  100,
628  0.,
629  5.,
630  100,
631  0.,
632  5.);
634  "fh_stcut_pion",
635  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
636  "#theta_{e^{+},e^{-}} [deg]",
637  "Yield",
638  100,
639  0.,
640  5.,
641  100,
642  0.,
643  5.);
645  "fh_stcut_truepair",
646  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
647  "#theta_{e^{+},e^{-}} [deg]",
648  "Yield",
649  100,
650  0.,
651  5.,
652  100,
653  0.,
654  5.);
656  "fh_rtcut_pion",
657  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
658  "#theta_{e^{+},e^{-}} [deg]",
659  "Yield",
660  100,
661  0.,
662  5.,
663  100,
664  0.,
665  5.);
667  "fh_rtcut_truepair",
668  "#sqrt{p_{e^{#pm}} p_{rec}} [GeV/c]",
669  "#theta_{e^{+},e^{-}} [deg]",
670  "Yield",
671  100,
672  0.,
673  5.,
674  100,
675  0.,
676  5.);
677 
679  "fh_nofMvdHits",
680  "Number of hits in MVD",
681  "Yield",
682  5,
683  -0.5,
684  4.5);
686  "fh_nofStsHits",
687  "Number of hits in STS",
688  "Yield",
689  9,
690  -0.5,
691  8.5);
693  "fh_mvd1xy",
694  "X [cm]",
695  "Y [cm]",
696  "Yield",
697  60,
698  -3.,
699  3.,
700  60,
701  -3.,
702  3.);
704  fh_mvd1r, "fh_mvd1r", "#sqrt{X^{2}+Y^{2}} [cm]", "Yield", 60, 0., 3.);
706  "fh_mvd2xy",
707  "X [cm]",
708  "Y [cm]",
709  "Yield",
710  60,
711  -6.,
712  6.,
713  60,
714  -6.,
715  6.);
717  fh_mvd2r, "fh_mvd2r", "#sqrt{X^{2}+Y^{2}} [cm]", "Yield", 60, 0., 6.);
718 
719  // Check MVD cut quality. [0.5]-correct, [1.5]-wrong
721  fh_mvd1cut_qa, "fh_mvd1cut_qa", "MVD hit assignment", "Yield", 2, 0., 2.);
723  fh_mvd2cut_qa, "fh_mvd2cut_qa", "MVD hit assignment", "Yield", 2, 0., 2.);
724 
725  //Create invariant mass histograms
727  "fh_signal_minv",
728  "M_{ee} [GeV/c^{2}]",
729  "Yield",
730  4000,
731  0.,
732  4.);
734  fh_bg_minv, "fh_bg_minv", "M_{ee} [GeV/c^{2}]", "Yield", 4000, 0., 4.);
736  fh_pi0_minv, "fh_pi0_minv", "M_{ee} [GeV/c^{2}]", "Yield", 4000, 0., 4.);
738  fh_eta_minv, "fh_eta_minv", "M_{ee} [GeV/c^{2}]", "Yield", 4000, 0., 4.);
740  "fh_gamma_minv",
741  "M_{ee} [GeV/c^{2}]",
742  "Yield",
743  4000,
744  0.,
745  4.);
746  // minv for true matched and mismatched tracks
748  "fh_bg_truematch_minv",
749  "M_{ee} [GeV/c^{2}]",
750  "Yield",
751  4000,
752  0.,
753  4.);
755  "fh_bg_truematch_el_minv",
756  "M_{ee} [GeV/c^{2}]",
757  "Yield",
758  4000,
759  0.,
760  4.);
762  "fh_bg_truematch_notel_minv",
763  "M_{ee} [GeV/c^{2}]",
764  "Yield",
765  4000,
766  0.,
767  4.);
769  "fh_bg_mismatch_minv",
770  "M_{ee} [GeV/c^{2}]",
771  "Yield",
772  4000,
773  0.,
774  4.);
775  // Minv for different sources
777  for (int i = 0; i < CbmLmvmHist::fNofBgPairSources; i++) {
778  stringstream ss;
779  ss << "fh_source_bg_minv_" << i;
781  ss.str(),
782  "M_{ee} [GeV/c^{2}]",
783  "Yield",
784  4000,
785  0.,
786  4.);
787  }
788  //Invariant mass vs. Mc Pt
790  "fh_signal_minv_pt",
791  "M_{ee} [GeV/c^{2}]",
792  "P_{t} [GeV/c]",
793  "Yield",
794  100,
795  0.,
796  2.,
797  20,
798  0.,
799  2.);
801  "fh_pi0_minv_pt",
802  "M_{ee} [GeV/c^{2}]",
803  "P_{t} [GeV/c]",
804  "Yield",
805  100,
806  0.,
807  4.,
808  20,
809  0.,
810  2.);
812  "fh_eta_minv_pt",
813  "M_{ee} [GeV/c^{2}]",
814  "P_{t} [GeV/c]",
815  "Yield",
816  100,
817  0.,
818  4.,
819  20,
820  0.,
821  2.);
822 
823  // Momentum distribution of the signal
825  fh_signal_mom, "fh_signal_mom", "P [GeV/c]", "Yield", 100, 0., 15.);
826  //Pt/y distibution of the signal
828  "fh_signal_pty",
829  "Rapidity",
830  "P_{t} [GeV/c]",
831  "Yield",
832  40,
833  0.,
834  4.,
835  20,
836  0.,
837  2.);
838  //Sources pairs 2D
840  "fh_source_pairs_epem",
841  "mother particle e+",
842  "mother particle e-",
843  "Yield",
844  3,
845  0.,
846  3.,
847  3,
848  0.,
849  3.);
850 
854  for (Int_t i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
858  }
859 
860  for (Int_t i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
861  for (Int_t step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
862  string hname = "", htitle = "";
863  hname = "fh_opening_angle_" + CbmLmvmHist::fAnaSteps[step] + "_"
865  htitle = hname + ";#Theta_{1,2} [deg];Yield";
866  fh_opening_angle[i][step] =
867  new TH1D(hname.c_str(), htitle.c_str(), 160, 0., 80.);
868  fHistoList.push_back(fh_opening_angle[i][step]);
869 
870  hname = "fh_source_mom_" + CbmLmvmHist::fAnaSteps[step] + "_"
872  htitle = hname + ";P [GeV/c];Yield";
873  fh_source_mom[i][step] =
874  new TH1D(hname.c_str(), htitle.c_str(), 300, 0., 15.);
875  fHistoList.push_back(fh_source_mom[i][step]);
876 
877  hname = "fh_source_pt_" + CbmLmvmHist::fAnaSteps[step] + "_"
879  htitle = hname + ";P_{t} [GeV/c];Yield";
880  fh_source_pt[i][step] =
881  new TH1D(hname.c_str(), htitle.c_str(), 100, 0., 5.);
882  fHistoList.push_back(fh_source_pt[i][step]);
883  }
884  }
885 
886  //pions vs momentum
887  fh_pi_mom_mc = new TH1D(
888  "fh_pi_mom_mc", "fh_pi_mom_mc;p [GeV/c];dN/dP [1/GeV/c]", 30, 0., 3.);
889  fHistoList.push_back(fh_pi_mom_mc);
890  fh_pi_mom_acc = new TH1D(
891  "fh_pi_mom_acc", "fh_pi_mom_acc;p [GeV/c];dN/dP [1/GeV/c]", 30, 0., 3.);
892  fHistoList.push_back(fh_pi_mom_acc);
893  fh_pi_mom_rec = new TH1D(
894  "fh_pi_mom_rec", "fh_pi_mom_rec;p [GeV/c];dN/dP [1/GeV/c]", 30, 0., 3.);
895  fHistoList.push_back(fh_pi_mom_rec);
897  new TH1D("fh_pi_mom_rec_only_sts",
898  "fh_pi_mom_rec_only_sts;p [GeV/c];dN/dP [1/GeV/c]",
899  30,
900  0.,
901  3.);
904  new TH1D("fh_pi_mom_rec_sts_rich_trd",
905  "fh_pi_mom_rec_sts_rich_trd;p [GeV/c];dN/dP [1/GeV/c]",
906  30,
907  0.,
908  3.);
911  new TH1D("fh_pi_mom_rec_sts_rich_trd_tof",
912  "fh_pi_mom_rec_sts_rich_trd_tof;p [GeV/c];dN/dP [1/GeV/c]",
913  30,
914  0.,
915  3.);
917  fh_pi_rapidity_mc = new TH1D(
918  "fh_pi_rapidity_mc", "fh_pi_rapidity_mc;Rapidity;dN/dY", 400, 0., 4.);
919  fHistoList.push_back(fh_pi_rapidity_mc);
920 
921 
922  //pions vs momentum for primary pions
923  fh_piprim_mom_mc = new TH1D("fh_piprim_mom_mc",
924  "fh_piprim_mom_mc;p [GeV/c];dN/dP [1/GeV/c]",
925  30,
926  0.,
927  3.);
928  fHistoList.push_back(fh_piprim_mom_mc);
929  fh_piprim_mom_acc = new TH1D("fh_piprim_mom_acc",
930  "fh_piprim_mom_acc;p [GeV/c];dN/dP [1/GeV/c]",
931  30,
932  0.,
933  3.);
934  fHistoList.push_back(fh_piprim_mom_acc);
935  fh_piprim_mom_rec = new TH1D("fh_piprim_mom_rec",
936  "fh_piprim_mom_rec;p [GeV/c];dN/dP [1/GeV/c]",
937  30,
938  0.,
939  3.);
940  fHistoList.push_back(fh_piprim_mom_rec);
942  new TH1D("fh_piprim_mom_rec_only_sts",
943  "fh_piprim_mom_rec_only_sts;p [GeV/c];dN/dP [1/GeV/c]",
944  30,
945  0.,
946  3.);
949  new TH1D("fh_piprim_mom_rec_sts_rich_trd",
950  "fh_piprim_mom_rec_sts_rich_trd;p [GeV/c];dN/dP [1/GeV/c]",
951  30,
952  0.,
953  3.);
956  new TH1D("fh_piprim_mom_rec_sts_rich_trd_tof",
957  "fh_piprim_mom_rec_sts_rich_trd_tof;p [GeV/c];dN/dP [1/GeV/c]",
958  30,
959  0.,
960  3.);
962 
964  new TH1D("fh_piprim_plus_rapidity_mc",
965  "fh_piprim_plus_rapidity_mc;Rapidity;dN/dY",
966  400,
967  0.,
968  4.);
971  new TH1D("fh_piprim_minus_rapidity_mc",
972  "fh_piprim_minus_rapidity_mc;Rapidity;dN/dY",
973  400,
974  0.,
975  4.);
977  fh_pi0prim_rapidity_mc = new TH1D("fh_pi0prim_rapidity_mc",
978  "fh_pi0prim_rapidity_mc;Rapidity;dN/dY",
979  400,
980  0.,
981  4.);
983  fh_etaprim_rapidity_mc = new TH1D("fh_etaprim_rapidity_mc",
984  "fh_etaprim_rapidity_mc;Rapidity;dN/dY",
985  400,
986  0.,
987  4.);
989 
990 
992  new TH1D("fh_nof_rec_pairs_gamma",
993  "fh_nof_rec_pairs_gamma;Pair category; Number per event",
994  3,
995  -0.5,
996  2.5);
999  new TH1D("fh_nof_rec_pairs_pi0",
1000  "fh_nof_rec_pairs_pi0;Pair category; Number per event",
1001  3,
1002  -0.5,
1003  2.5);
1004  fHistoList.push_back(fh_nof_rec_pairs_pi0);
1005 
1007  new TH1D("fh_nof_rec_gamma",
1008  "fh_nof_rec_gamma;Track category; Number per event",
1009  3,
1010  -0.5,
1011  2.5);
1012  fHistoList.push_back(fh_nof_rec_gamma);
1013  fh_nof_rec_pi0 = new TH1D("fh_nof_rec_pi0",
1014  "fh_nof_rec_pi0;Track category; Number per event",
1015  3,
1016  -0.5,
1017  2.5);
1018  fHistoList.push_back(fh_nof_rec_pi0);
1019 }
1020 
1022  cout << "InitStatus CbmAnaDielectronTask::Init" << endl;
1023 
1024  FairRootManager* ioman = FairRootManager::Instance();
1025  if (NULL == ioman) {
1026  Fatal("CbmAnaDielectronTask::Init", "No FairRootManager!");
1027  }
1028 
1029  fMCEventHeader = (FairMCEventHeader*) ioman->GetObject("MCEventHeader.");
1030  if (NULL == fMCEventHeader) {
1031  Fatal("CbmAnaDielectronTask::Init", "No MCEventHeader array!");
1032  }
1033 
1034  fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
1035  if (NULL == fMCTracks) {
1036  Fatal("CbmAnaDielectronTask::Init", "No MCTrack array!");
1037  }
1038 
1039  if (fUseRich == true) {
1040  fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
1041  if (NULL == fRichHits) {
1042  Fatal("CbmAnaDielectronTask::Init", "No RichHit array!");
1043  }
1044 
1045  fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
1046  if (NULL == fRichRings) {
1047  Fatal("CbmAnaDielectronTask::Init", "No RichRing array!");
1048  }
1049 
1050  fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
1051  if (NULL == fRichPoints) {
1052  Fatal("CbmAnaDielectronTask::Init", "No RichPoint array!");
1053  }
1054 
1055  fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
1056  if (NULL == fRichRingMatches) {
1057  Fatal("CbmAnaDielectronTask::Init", "No RichRingMatch array!");
1058  }
1059 
1060  fRichProj = (TClonesArray*) ioman->GetObject("RichProjection");
1061  if (NULL == fRichProj) {
1062  Fatal("CbmAnaDielectronTask::Init", "No RichProjection array!");
1063  }
1064  } //fUseRich
1065 
1066  fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
1067  if (NULL == fStsTrackMatches) {
1068  Fatal("CbmAnaDielectronTask::Init", "No StsTrackMatch array!");
1069  }
1070 
1071  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
1072  if (NULL == fStsTracks) {
1073  Fatal("CbmAnaDielectronTask::Init", "No StsTrack array!");
1074  }
1075 
1076  fStsHits = (TClonesArray*) ioman->GetObject("StsHit");
1077  if (NULL == fStsHits) {
1078  Fatal("CbmAnaDielectronTask::Init", "No StsHit array!");
1079  }
1080 
1081  if (fUseMvd) {
1082  fMvdHits = (TClonesArray*) ioman->GetObject("MvdHit");
1083  if (NULL == fMvdHits) {
1084  Fatal("CbmAnaDielectronTask::Init", "No MvdHit array!");
1085  }
1086 
1087  fMvdPoints = (TClonesArray*) ioman->GetObject("MvdPoint");
1088  if (NULL == fMvdPoints) {
1089  Fatal("CbmAnaDielectronTask::Init", ": No MvdPoint array!");
1090  }
1091 
1092  fMvdHitMatches = (TClonesArray*) ioman->GetObject("MvdHitMatch");
1093  if (NULL == fMvdHitMatches) {
1094  Fatal("CbmAnaDielectronTask::Init", ": No MvdHitMatch array!");
1095  }
1096  }
1097 
1098  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
1099  if (NULL == fGlobalTracks) {
1100  Fatal("CbmAnaDielectronTask::Init", "No GlobalTrack array!");
1101  }
1102 
1103  if (fUseTrd == true) {
1104  fTrdTracks = (TClonesArray*) ioman->GetObject("TrdTrack");
1105  if (NULL == fTrdTracks) {
1106  Fatal("CbmAnaDielectronTask::Init", "No TrdTrack array!");
1107  }
1108 
1109  fTrdTrackMatches = (TClonesArray*) ioman->GetObject("TrdTrackMatch");
1110  if (NULL == fTrdTrackMatches) {
1111  Fatal("CbmAnaDielectronTask::Init", "No TrdTrackMatch array!");
1112  }
1113  } //fUseTrd
1114 
1115  if (fUseTof == true) {
1116  fTofPoints = (TClonesArray*) ioman->GetObject("TofPoint");
1117  if (NULL == fTofPoints) {
1118  Fatal("CbmAnaDielectronTask::Init", "No TofPoint array!");
1119  }
1120 
1121  fTofHits = (TClonesArray*) ioman->GetObject("TofHit");
1122  if (NULL == fTofHits) {
1123  Fatal("CbmAnaDielectronTask::Init", "No TofHit array!");
1124  }
1125 
1126  fTofHitsMatches = (TClonesArray*) ioman->GetObject("TofHitMatch");
1127  if (NULL == fTofHitsMatches) {
1128  Fatal("CbmAnaDielectronTask::Init", "No TofHitMatch Array! ");
1129  }
1130  } //fUseTof
1131 
1132 
1133  // Get pointer to PrimaryVertex object from IOManager if it exists
1134  // The old name for the object is "PrimaryVertex" the new one
1135  // "PrimaryVertex." Check first for the new name
1136  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
1137  if (nullptr == fPrimVertex) {
1138  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex"));
1139  }
1140  if (nullptr == fPrimVertex) { LOG(fatal) << "No PrimaryVertex array!"; }
1141 
1142  InitHists();
1143 
1144  fKFFitter.Init();
1145 
1147 
1148  // if TRD detector us not used the momentum cut at 5.5GeV/c are used
1149  if (!fUseTrd) { fCuts.fMomentumCut = 5.5; }
1150 
1151  // CbmLitMCTrackCreator::Instance()->CreateMC();
1152 
1153  return kSUCCESS;
1154 }
1155 
1157  fh_event_number->Fill(0.5);
1158 
1159  Bool_t useMbias = false; // false for 40% central agag collisions (b<7.7fm)
1160 
1161  Bool_t isCentralCollision = false;
1162 
1163  if (!useMbias) {
1164  Double_t impactPar = fMCEventHeader->GetB();
1165  if (impactPar <= 7.7) isCentralCollision = true;
1166  }
1167 
1168  cout << "-I- CbmAnaDielectronTask, event number "
1169  << fh_event_number->GetEntries() << endl;
1170  cout << "fPionMisidLevel = " << fPionMisidLevel << endl;
1171  fCuts.Print();
1172  cout << "fWeight = " << fWeight << endl;
1173 
1174  if (fPrimVertex != NULL) {
1176  } else {
1177  Fatal("CbmAnaDielectronTask::Exec", "No PrimaryVertex array!");
1178  }
1179  // cout << "I'm here" << endl;
1180  // CbmLitMCTrackCreator::Instance()->CreateReco();
1181  //
1182  if (useMbias || (!useMbias && isCentralCollision)) {
1184  MCPairs();
1185  RichPmtXY();
1189  FillCandidates();
1193  SignalAndBgReco();
1194  FillElPiMomHist();
1196  }
1197 } // Exec
1198 
1200  fNofHitsInRingMap.clear();
1201  Int_t nofRichHits = fRichHits->GetEntriesFast();
1202  for (Int_t iHit = 0; iHit < nofRichHits; iHit++) {
1203  CbmRichHit* hit = static_cast<CbmRichHit*>(fRichHits->At(iHit));
1204  if (NULL == hit) continue;
1205 
1206  Int_t iPoint = hit->GetRefId();
1207  if (iPoint < 0) continue;
1208 
1209  FairMCPoint* point = static_cast<FairMCPoint*>(fRichPoints->At(iPoint));
1210  if (NULL == point) continue;
1211 
1212  Int_t iMCTrack = point->GetTrackID();
1213  CbmMCTrack* track = static_cast<CbmMCTrack*>(fMCTracks->At(iMCTrack));
1214  if (NULL == track) continue;
1215 
1216  Int_t iMother = track->GetMotherId();
1217  if (iMother == -1) continue;
1218 
1219  fNofHitsInRingMap[iMother]++;
1220  }
1221 }
1222 
1223 
1225  Int_t nMcTracks = fMCTracks->GetEntries();
1226  for (Int_t i = 0; i < nMcTracks; i++) {
1227  CbmMCTrack* mctrack = (CbmMCTrack*) fMCTracks->At(i);
1228  Int_t motherId = mctrack->GetMotherId();
1229  Int_t pdg = TMath::Abs(mctrack->GetPdgCode());
1230  Double_t mom = mctrack->GetP();
1231 
1232  Bool_t isMcSignalElectron = CbmLmvmUtils::IsMcSignalElectron(mctrack);
1233  Bool_t isMcGammaElectron =
1235  if (isMcSignalElectron) {
1236  fh_source_mom[kSignal][kMc]->Fill(mom, fWeight);
1237  for (Int_t iMc2 = 0; iMc2 < nMcTracks; iMc2++) {
1238  if (i == iMc2) continue;
1239  CbmMCTrack* mctrack2 = (CbmMCTrack*) fMCTracks->At(iMc2);
1240  Int_t motherIdMc2 = mctrack2->GetMotherId();
1241  if (motherId == motherIdMc2
1242  && CbmLmvmUtils::IsMcSignalElectron(mctrack2)) {
1243  CbmLmvmKinematicParams pKin =
1245  mctrack2);
1246  Double_t angle = pKin.fAngle;
1247  Double_t pMc = mctrack->GetP();
1248  Double_t pMc2 = mctrack2->GetP();
1249  Double_t sqrtPMc = TMath::Sqrt(pMc * pMc2);
1250  fh_mc_signal_mom_angle->Fill(sqrtPMc, angle);
1251  }
1252  }
1253  for (Int_t iMc2 = 0; iMc2 < nMcTracks; iMc2++) {
1254  if (i == iMc2) continue;
1255  CbmMCTrack* mctrack2 = (CbmMCTrack*) fMCTracks->At(iMc2);
1256  Int_t motherIdMc2 = mctrack2->GetMotherId();
1257  if (motherId == motherIdMc2
1258  && CbmLmvmUtils::IsMcSignalElectron(mctrack2)) {
1259  CbmLmvmKinematicParams pKin =
1261  mctrack2);
1262  Double_t angle = pKin.fAngle;
1263  Double_t pMc = mctrack->GetP();
1264  Double_t pMc2 = mctrack2->GetP();
1265  Double_t sqrtPMc = TMath::Sqrt(pMc * pMc2);
1266  fh_mc_signal_mom_angle->Fill(sqrtPMc, angle);
1267  }
1268  }
1269  }
1270  if (isMcGammaElectron) {
1271  TVector3 v;
1272  mctrack->GetStartVertex(v);
1273  fh_vertex_el_gamma_xz[kMc]->Fill(v.Z(), v.X());
1274  fh_vertex_el_gamma_yz[kMc]->Fill(v.Z(), v.Y());
1275  fh_vertex_el_gamma_xy[kMc]->Fill(v.X(), v.Y());
1276  fh_vertex_el_gamma_rz[kMc]->Fill(v.Z(),
1277  sqrt(v.X() * v.X() + v.Y() * v.Y()));
1278  }
1279 
1280  // mother pdg of e-/e+
1281  Int_t mcMotherPdg = 0;
1282  if (pdg == 11) {
1283  if (motherId != -1) {
1284  CbmMCTrack* mother = (CbmMCTrack*) fMCTracks->At(motherId);
1285  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1286  } else {
1287  mcMotherPdg = 0;
1288  }
1289  fh_mc_mother_pdg->Fill(mcMotherPdg);
1290  }
1291  } // nMcTracks
1292 } //MC Pairs
1293 
1295  Int_t nofRichHits = fRichHits->GetEntriesFast();
1296  for (Int_t iH = 0; iH < nofRichHits; iH++) {
1297  CbmRichHit* richHit = static_cast<CbmRichHit*>(fRichHits->At(iH));
1298  if (richHit == NULL) continue;
1299  Int_t pointInd = richHit->GetRefId();
1300  if (pointInd < 0) continue;
1301 
1302  FairMCPoint* pointPhoton =
1303  static_cast<FairMCPoint*>(fRichPoints->At(pointInd));
1304  if (NULL == pointPhoton) continue;
1305 
1306  Int_t iMCTrackPhoton = pointPhoton->GetTrackID();
1307  CbmMCTrack* trackPhoton =
1308  static_cast<CbmMCTrack*>(fMCTracks->At(iMCTrackPhoton));
1309  if (NULL == trackPhoton) continue;
1310 
1311  Int_t iMCTrack = trackPhoton->GetMotherId();
1312  if (iMCTrack == -1) continue;
1313 
1314  CbmMCTrack* mctrack = static_cast<CbmMCTrack*>(fMCTracks->At(iMCTrack));
1315  if (NULL == mctrack) continue;
1316 
1317  TVector3 v;
1318  mctrack->GetStartVertex(v);
1319  Bool_t isPrim = (v.Z() < 2.);
1320 
1321  Bool_t isMcSignalElectron = CbmLmvmUtils::IsMcSignalElectron(mctrack);
1322  Bool_t isMcGammaElectron =
1324  Bool_t isMcPi0Electron = CbmLmvmUtils::IsMcPi0Electron(mctrack, fMCTracks);
1325 
1326  if (isMcSignalElectron) {
1327  fh_signal_pmtXY->Fill(richHit->GetX(), richHit->GetY(), fWeight);
1328  }
1329  if (isMcGammaElectron && isPrim) {
1330  fh_gamma_pmtXY->Fill(richHit->GetX(), richHit->GetY());
1331  }
1332  if (isMcPi0Electron && isPrim) {
1333  fh_pi0_pmtXY->Fill(richHit->GetX(), richHit->GetY());
1334  }
1335  }
1336 }
1337 
1339  Int_t nofMcTracks = fMCTracks->GetEntries();
1340  Int_t nofChargedUrqmdParticles = 0;
1341  Int_t nofChargedUrqmdParticlesAcc = 0;
1342  for (Int_t i = 0; i < nofMcTracks; i++) {
1343  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(i);
1344  Bool_t isMcTrackCharged = false;
1345  if (mcTrack->GetCharge() != 0) isMcTrackCharged = true;
1346  Bool_t isMcSignalElectron = CbmLmvmUtils::IsMcSignalElectron(mcTrack);
1347  Bool_t isMcTrackAccepted = false;
1348  if (mcTrack->GetNPoints(ECbmModuleId::kSts) >= 4) isMcTrackAccepted = true;
1349  Bool_t isPrimary = false;
1350  Int_t motherId = mcTrack->GetMotherId();
1351  if (motherId == -1) isPrimary = true;
1352  if (!isMcSignalElectron && isMcTrackCharged && isPrimary)
1353  nofChargedUrqmdParticles++;
1354  if (!isMcSignalElectron && isMcTrackCharged && isMcTrackAccepted
1355  && isPrimary)
1356  nofChargedUrqmdParticlesAcc++;
1357  }
1358  fh_nof_charged_particles->Fill(nofChargedUrqmdParticles);
1359  fh_nof_charged_particles_acc->Fill(nofChargedUrqmdParticlesAcc);
1360 }
1361 
1362 
1364  CbmMCTrack* tr = (CbmMCTrack*) fMCTracks->At(mcTrackInd);
1365  if (tr == NULL) return false;
1366  Int_t nRichPoints = fNofHitsInRingMap[mcTrackInd];
1367  return (
1369  && nRichPoints >= 7 && tr->GetNPoints(ECbmModuleId::kTrd) >= 2
1370  && tr->GetNPoints(ECbmModuleId::kTof) > 0);
1371 }
1372 
1374  Int_t nMcTracks = fMCTracks->GetEntries();
1375  for (Int_t i = 0; i < nMcTracks; i++) {
1376  CbmMCTrack* mctrack = (CbmMCTrack*) fMCTracks->At(i);
1377  Int_t motherId = mctrack->GetMotherId();
1378  Int_t pdg = TMath::Abs(mctrack->GetPdgCode());
1379  Int_t nMvdPoints = mctrack->GetNPoints(ECbmModuleId::kMvd);
1380  Int_t nStsPoints = mctrack->GetNPoints(ECbmModuleId::kSts);
1381  Int_t nRichPoints = fNofHitsInRingMap[i];
1382 
1383  Bool_t isAcc = (nMvdPoints + nStsPoints >= 4 && nRichPoints >= 7);
1384  Bool_t isMcGammaElectron =
1386 
1387  if (isMcGammaElectron) {
1388  TVector3 v;
1389  mctrack->GetStartVertex(v);
1390  fh_vertex_el_gamma_xz[kAcc]->Fill(v.Z(), v.X());
1391  fh_vertex_el_gamma_yz[kAcc]->Fill(v.Z(), v.Y());
1392  fh_vertex_el_gamma_xy[kAcc]->Fill(v.X(), v.Y());
1393  fh_vertex_el_gamma_rz[kAcc]->Fill(v.Z(),
1394  sqrt(v.X() * v.X() + v.Y() * v.Y()));
1395  }
1396 
1397  Int_t mcMotherPdg = 0;
1398  if (pdg == 11 && isAcc) {
1399  if (motherId != -1) {
1400  CbmMCTrack* mother = (CbmMCTrack*) fMCTracks->At(motherId);
1401  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1402  } else {
1403  mcMotherPdg = 0;
1404  }
1405  fh_acc_mother_pdg->Fill(mcMotherPdg);
1406  }
1407  }
1408 }
1409 
1411  Int_t nMcTracks = fMCTracks->GetEntries();
1412  for (Int_t iP = 0; iP < nMcTracks; iP++) {
1413  CbmMCTrack* mctrackP = (CbmMCTrack*) fMCTracks->At(iP);
1414  // Int_t motherIdP = mctrackP->GetMotherId();
1415  Int_t pdgP = mctrackP->GetPdgCode();
1416  if (pdgP != 11) continue;
1417  Bool_t isAccP = IsMcTrackAccepted(iP);
1418  for (Int_t iM = 0; iM < nMcTracks; iM++) {
1419  if (iP == iM) continue;
1420  CbmMCTrack* mctrackM = (CbmMCTrack*) fMCTracks->At(iM);
1421  // Int_t motherIdM = mctrackM->GetMotherId();
1422  Int_t pdgM = mctrackM->GetPdgCode();
1423  if (pdgM != -11) continue;
1424  Bool_t isAccM = IsMcTrackAccepted(iM);
1427  Bool_t isMcSignal = CbmLmvmUtils::IsMcSignalElectron(mctrackM)
1428  && CbmLmvmUtils::IsMcSignalElectron(mctrackP);
1429  Bool_t isMcPi0 = (mctrackM->GetMotherId() == mctrackP->GetMotherId())
1432  Bool_t isMcEta = (mctrackM->GetMotherId() == mctrackP->GetMotherId())
1435 
1436  if (isMcSignal) {
1437  fh_signal_pty[kMc]->Fill(p.fRapidity, p.fPt, fWeight);
1439  fh_signal_minv[kMc]->Fill(p.fMinv, fWeight);
1440 
1441  if (isAccP && isAccM) {
1442  fh_signal_pty[kAcc]->Fill(p.fRapidity, p.fPt, fWeight);
1444  fh_signal_minv[kAcc]->Fill(p.fMinv, fWeight);
1445  }
1446  }
1447 
1448  if (isMcPi0) {
1449  fh_pi0_minv[kMc]->Fill(p.fMinv);
1450  if (isAccP && isAccM) fh_pi0_minv[kAcc]->Fill(p.fMinv);
1451  }
1452 
1453  if (isMcEta) {
1454  fh_eta_minv[kMc]->Fill(p.fMinv);
1455  if (isAccP && isAccM) fh_eta_minv[kAcc]->Fill(p.fMinv);
1456  }
1457  } //iM
1458  } //iP
1459 } // PairsAcceptance
1460 
1461 
1463  Int_t nMcTracks = fMCTracks->GetEntries();
1464  for (Int_t i = 0; i < nMcTracks; i++) {
1465  CbmMCTrack* mctrack = (CbmMCTrack*) fMCTracks->At(i);
1466  // Int_t motherId = mctrack->GetMotherId();
1467  Int_t pdg = TMath::Abs(mctrack->GetPdgCode());
1468  double momentum = mctrack->GetP();
1469  double rapidity = mctrack->GetRapidity();
1470  Int_t nMvdPoints = mctrack->GetNPoints(ECbmModuleId::kMvd);
1471  Int_t nStsPoints = mctrack->GetNPoints(ECbmModuleId::kSts);
1472  Bool_t isAcc = (nMvdPoints + nStsPoints >= 4);
1473  TVector3 vertex;
1474  mctrack->GetStartVertex(vertex);
1475 
1476  if (pdg == 211) {
1477  fh_pi_mom_mc->Fill(momentum);
1478  fh_pi_rapidity_mc->Fill(rapidity);
1479  if (isAcc) fh_pi_mom_acc->Fill(momentum);
1480 
1481  if (vertex.Mag() < 0.1) {
1482  fh_piprim_mom_mc->Fill(momentum);
1483  if (mctrack->GetPdgCode() == 211)
1484  fh_piprim_plus_rapidity_mc->Fill(rapidity);
1485  if (mctrack->GetPdgCode() == -211)
1486  fh_piprim_minus_rapidity_mc->Fill(rapidity);
1487  if (isAcc) fh_piprim_mom_acc->Fill(momentum);
1488  }
1489  }
1490 
1491  if (pdg == 111 && vertex.Mag() < 0.1) {
1492  fh_pi0prim_rapidity_mc->Fill(rapidity);
1493  }
1494 
1495  if (pdg == 221 && vertex.Mag() < 0.1) {
1496  fh_etaprim_rapidity_mc->Fill(rapidity);
1497  }
1498  }
1499 
1500  Int_t ngTracks = fGlobalTracks->GetEntriesFast();
1501  for (Int_t i = 0; i < ngTracks; i++) {
1502  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(i);
1503  if (NULL == gTrack) continue;
1504  int stsInd = gTrack->GetStsTrackIndex();
1505  int richInd = gTrack->GetRichRingIndex();
1506  int trdInd = gTrack->GetTrdTrackIndex();
1507  int tofInd = gTrack->GetTofHitIndex();
1508 
1509  if (stsInd < 0) continue;
1510  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsInd);
1511  if (stsTrack == NULL) continue;
1512  CbmTrackMatchNew* stsMatch =
1513  (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
1514  if (stsMatch == NULL) continue;
1515  if (stsMatch->GetNofLinks() == 0) continue;
1516  int stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
1517  if (stsMcTrackId < 0) continue;
1518  CbmMCTrack* mcTrack1 = (CbmMCTrack*) fMCTracks->At(stsMcTrackId);
1519  if (mcTrack1 == NULL) continue;
1520  int pdg = TMath::Abs(mcTrack1->GetPdgCode());
1521  // int motherId = mcTrack1->GetMotherId();
1522  double momentum = mcTrack1->GetP();
1523 
1524  TVector3 vertex;
1525  mcTrack1->GetStartVertex(vertex);
1526 
1527  if (pdg == 211) {
1528  fh_pi_mom_rec->Fill(momentum);
1529  if (richInd < 0 && trdInd < 0 && tofInd < 0) {
1530  fh_pi_mom_rec_only_sts->Fill(momentum);
1531  }
1532  if (richInd >= 0 && trdInd >= 0) {
1533  fh_pi_mom_rec_sts_rich_trd->Fill(momentum);
1534  }
1535  if (richInd >= 0 && trdInd >= 0 && tofInd >= 0) {
1536  fh_pi_mom_rec_sts_rich_trd_tof->Fill(momentum);
1537  }
1538 
1539  if (vertex.Mag() < 0.1) {
1540  fh_piprim_mom_rec->Fill(momentum);
1541  if (richInd < 0 && trdInd < 0 && tofInd < 0) {
1542  fh_piprim_mom_rec_only_sts->Fill(momentum);
1543  }
1544  if (richInd >= 0 && trdInd >= 0) {
1545  fh_piprim_mom_rec_sts_rich_trd->Fill(momentum);
1546  }
1547  if (richInd >= 0 && trdInd >= 0 && tofInd >= 0) {
1548  fh_piprim_mom_rec_sts_rich_trd_tof->Fill(momentum);
1549  }
1550  }
1551  }
1552  } //gTracks
1553 }
1554 
1555 
1557  fSTCandidates.clear();
1558  fRTCandidates.clear();
1559  Int_t ngTracks = fGlobalTracks->GetEntriesFast();
1560 
1561  for (Int_t iGTrack = 0; iGTrack < ngTracks; iGTrack++) {
1562  CbmLmvmCandidate cand;
1563 
1564  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iGTrack);
1565  if (NULL == gTrack) continue;
1566 
1567  cand.fStsInd = gTrack->GetStsTrackIndex();
1568  if (cand.fStsInd < 0) continue;
1569  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(cand.fStsInd);
1570  if (stsTrack == NULL) continue;
1571 
1572  cand.fRichInd = gTrack->GetRichRingIndex();
1573  cand.fTrdInd = gTrack->GetTrdTrackIndex();
1574  cand.fTofInd = gTrack->GetTofHitIndex();
1575 
1577  &cand, stsTrack, fKFVertex);
1578 
1579  // select tracks from vertex
1580  if (cand.fChi2Prim > fCuts.fChiPrimCut) continue;
1581 
1582  // ST cut candidates, only STS
1583  if (cand.fRichInd < 0 && cand.fTrdInd < 0 && cand.fTofInd < 0)
1584  fSTCandidates.push_back(cand);
1585 
1586  // RT cut candidates, STS + at least one detector (RICH, TRD, TOF) but not all
1587  // Candidates must be identified as electron in registered detectors:
1588  // if it is registered in RICH it must be identified in the RICH as electron
1589  // RICH
1590  Bool_t isRichRT = (cand.fRichInd < 0) ? false : true;
1591  if (isRichRT) {
1592  CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(cand.fRichInd);
1593  if (richRing == NULL) isRichRT = false;
1594  if (isRichRT)
1596  iGTrack, cand.fMomentum.Mag());
1597  }
1598 
1599  // TRD
1600  Bool_t isTrdRT = (cand.fTrdInd < 0) ? false : true;
1601  if (isTrdRT) isTrdRT = fUseTrd;
1602  if (isTrdRT) {
1603  CbmTrdTrack* trdTrack = (CbmTrdTrack*) fTrdTracks->At(cand.fTrdInd);
1604  if (trdTrack == NULL) isTrdRT = false;
1605  if (isTrdRT)
1607  iGTrack, cand.fMomentum.Mag());
1608  }
1609 
1610  // ToF
1611  Bool_t isTofRT = (cand.fTofInd < 0) ? false : true;
1612  if (isTofRT) {
1613  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(cand.fTofInd);
1614  if (tofHit == NULL) isTofRT = false;
1615  if (isTofRT)
1617  iGTrack, cand.fMomentum.Mag());
1618  }
1619 
1620  if (isRichRT || isTrdRT || isTofRT) {
1621  if (!(cand.fRichInd >= 0 && cand.fTrdInd >= 0 && cand.fTofInd >= 0)) {
1622  fRTCandidates.push_back(cand);
1623  }
1624  }
1625  } //gTracks
1626  cout << "fSTCandidates.size() = " << fSTCandidates.size() << endl;
1627  cout << "fRTCandidates.size() = " << fRTCandidates.size() << endl;
1628 
1631 }
1632 
1634  fCandidates.clear();
1635  fTTCandidates.clear();
1636  Int_t nGTracks = fGlobalTracks->GetEntriesFast();
1637  fCandidates.reserve(nGTracks);
1638 
1639  for (Int_t iGTrack = 0; iGTrack < nGTracks; iGTrack++) {
1640  CbmLmvmCandidate cand;
1641  cand.fIsElectron = false;
1642  cand.fIsGamma = false;
1643  cand.fIsStCutElectron = false;
1644  cand.fIsTtCutElectron = false;
1645  cand.fIsRtCutElectron = false;
1646  cand.fIsMvd1CutElectron = true;
1647  cand.fIsMvd2CutElectron = true;
1648 
1649  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iGTrack);
1650  if (NULL == gTrack) continue;
1651  // STS
1652  cand.fStsInd = gTrack->GetStsTrackIndex();
1653  if (cand.fStsInd < 0) continue;
1654  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(cand.fStsInd);
1655  if (stsTrack == NULL) continue;
1656 
1658  &cand, stsTrack, fKFVertex);
1659 
1660  // Add all pions from STS for pion misidentification level study
1661  if (fPionMisidLevel >= 0.0) {
1662  CbmTrackMatchNew* stsMatch =
1664  if (stsMatch == NULL) continue;
1665  if (stsMatch->GetNofLinks() == 0) continue;
1666  cand.fStsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
1667  if (cand.fStsMcTrackId < 0) continue;
1668  CbmMCTrack* mcTrack1 = (CbmMCTrack*) fMCTracks->At(cand.fStsMcTrackId);
1669  if (mcTrack1 == NULL) continue;
1670  Int_t pdg = TMath::Abs(mcTrack1->GetPdgCode());
1671 
1672  //check that pion track has track projection onto the photodetector plane
1673  const FairTrackParam* richProjection =
1674  (FairTrackParam*) (fRichProj->At(iGTrack));
1675  if (richProjection == NULL || richProjection->GetX() == 0
1676  || richProjection->GetY() == 0)
1677  continue;
1678 
1679  if (pdg == 211) {
1680  IsElectron(iGTrack, cand.fMomentum.Mag(), &cand);
1681  fCandidates.push_back(cand);
1682  continue;
1683  }
1684  }
1685 
1686  // RICH
1687  cand.fRichInd = gTrack->GetRichRingIndex();
1688  if (cand.fRichInd < 0) continue;
1689  // CbmRichRing* richRing = (CbmRichRing*) fRichRings->At(cand.fRichInd); (FU) unused
1690 
1691  // TRD
1692  CbmTrdTrack* trdTrack = NULL;
1693  if (fUseTrd == true) {
1694  cand.fTrdInd = gTrack->GetTrdTrackIndex();
1695  if (cand.fTrdInd < 0) continue;
1696  trdTrack = (CbmTrdTrack*) fTrdTracks->At(cand.fTrdInd);
1697  if (trdTrack == NULL) continue;
1698  }
1699 
1700  // ToF
1701  cand.fTofInd = gTrack->GetTofHitIndex();
1702  if (cand.fTofInd < 0) continue;
1703  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(cand.fTofInd);
1704  if (tofHit == NULL) continue;
1705 
1706  IsElectron(iGTrack, cand.fMomentum.Mag(), &cand);
1707 
1708  fCandidates.push_back(cand);
1709  if (!cand.fIsElectron && cand.fChi2Prim < fCuts.fChiPrimCut)
1710  fTTCandidates.push_back(cand);
1711 
1712  } // global tracks
1713  cout << "fCandidates.size() = " << fCandidates.size() << endl;
1714  cout << "fTTCandidates.size() = " << fTTCandidates.size() << endl;
1715 
1718 }
1719 
1721  int nCand = fCandidates.size();
1722  for (int i = 0; i < nCand; i++) {
1723  fCandidates[i].ResetMcParams();
1724 
1725  //STS
1726  //MCTrackId of the candidate is defined by STS track
1727  int stsInd = fCandidates[i].fStsInd;
1728  CbmTrackMatchNew* stsMatch =
1729  (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
1730  if (stsMatch == NULL) continue;
1731  if (stsMatch->GetNofLinks() == 0) continue;
1732  fCandidates[i].fStsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
1733  if (fCandidates[i].fStsMcTrackId < 0) continue;
1734  CbmMCTrack* mcTrack1 =
1735  (CbmMCTrack*) fMCTracks->At(fCandidates[i].fStsMcTrackId);
1736  if (mcTrack1 == NULL) continue;
1737  int pdg = TMath::Abs(mcTrack1->GetPdgCode());
1738  int motherId = mcTrack1->GetMotherId();
1739  fCandidates[i].fMcMotherId = motherId;
1740  fCandidates[i].fMcPdg = pdg;
1741 
1742  if (pdg == 211 && fPionMisidLevel >= 0.) continue;
1743 
1744  // RICH
1745  int richInd = fCandidates[i].fRichInd;
1746  CbmTrackMatchNew* richMatch =
1747  (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
1748  if (richMatch == NULL) continue;
1749  fCandidates[i].fRichMcTrackId = richMatch->GetMatchedLink().GetIndex();
1750 
1751  fCandidates[i].fIsMcSignalElectron =
1753  fCandidates[i].fIsMcPi0Electron =
1755  fCandidates[i].fIsMcGammaElectron =
1757  fCandidates[i].fIsMcEtaElectron =
1759 
1760  // TRD
1761  // CbmTrdTrack* trdTrack = NULL;
1762  if (fUseTrd == true) {
1763  int trdInd = fCandidates[i].fTrdInd;
1764  CbmTrackMatchNew* trdMatch =
1765  (CbmTrackMatchNew*) fTrdTrackMatches->At(trdInd);
1766  if (trdMatch == NULL) continue;
1767  fCandidates[i].fTrdMcTrackId = trdMatch->GetMatchedLink().GetIndex();
1768  }
1769 
1770  // ToF
1771  int tofInd = fCandidates[i].fTofInd;
1772  if (tofInd < 0) continue;
1773  CbmTofHit* tofHit = (CbmTofHit*) fTofHits->At(tofInd);
1774  if (tofHit == NULL) continue;
1775  CbmMatch* tofHitMatch = static_cast<CbmMatch*>(fTofHitsMatches->At(tofInd));
1776  if (tofHitMatch == NULL) continue;
1777  Int_t tofPointIndex = tofHitMatch->GetMatchedLink().GetIndex();
1778  if (tofPointIndex < 0) continue;
1779  FairMCPoint* tofPoint = (FairMCPoint*) fTofPoints->At(tofPointIndex);
1780  if (tofPoint == NULL) continue;
1781  fCandidates[i].fTofMcTrackId = tofPoint->GetTrackID();
1782  } // candidates
1783 }
1784 
1786  vector<CbmLmvmCandidate>& cutCandidates) {
1787  int nCand = cutCandidates.size();
1788  for (int i = 0; i < nCand; i++) {
1789  cutCandidates[i].ResetMcParams();
1790 
1791  int stsInd = cutCandidates[i].fStsInd;
1792  if (stsInd < 0) continue;
1793  CbmTrackMatchNew* stsMatch =
1794  (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
1795  if (stsMatch == NULL) continue;
1796  if (stsMatch->GetNofLinks() == 0) continue;
1797  int stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
1798  cutCandidates[i].fStsMcTrackId = stsMcTrackId;
1799  if (stsMcTrackId < 0) continue;
1800  CbmMCTrack* mcTrack1 = (CbmMCTrack*) fMCTracks->At(stsMcTrackId);
1801  if (mcTrack1 == NULL) continue;
1802 
1803  int pdg = TMath::Abs(mcTrack1->GetPdgCode());
1804  int motherId = mcTrack1->GetMotherId();
1805  cutCandidates[i].fMcMotherId = motherId;
1806  cutCandidates[i].fMcPdg = pdg;
1807 
1808  cutCandidates[i].fIsMcSignalElectron =
1810  cutCandidates[i].fIsMcPi0Electron =
1812  cutCandidates[i].fIsMcGammaElectron =
1814  cutCandidates[i].fIsMcEtaElectron =
1816  }
1817 }
1818 
1820  CbmLmvmCandidate* candM,
1821  CbmLmvmAnalysisSteps step,
1822  CbmLmvmKinematicParams* parRec) {
1823  Bool_t isSignal = candP->fIsMcSignalElectron && candM->fIsMcSignalElectron;
1824  Bool_t isPi0 = (candP->fIsMcPi0Electron && candM->fIsMcPi0Electron
1825  && candP->fMcMotherId == candM->fMcMotherId);
1826  Bool_t isEta = (candP->fIsMcEtaElectron && candM->fIsMcEtaElectron
1827  && candP->fMcMotherId == candM->fMcMotherId);
1828  Bool_t isGamma = (candP->fIsMcGammaElectron && candM->fIsMcGammaElectron
1829  && candP->fMcMotherId == candM->fMcMotherId);
1830  Bool_t isBg =
1831  (!isEta) && (!isGamma) && (!isPi0)
1832  && (!(candP->fIsMcSignalElectron || candM->fIsMcSignalElectron));
1833 
1834 
1835  if (isSignal) fh_opening_angle[kSignal][step]->Fill(parRec->fAngle, fWeight);
1836  if (isBg) fh_opening_angle[kBg][step]->Fill(parRec->fAngle);
1837  if (isPi0) fh_opening_angle[kPi0][step]->Fill(parRec->fAngle);
1838  if (isGamma) fh_opening_angle[kGamma][step]->Fill(parRec->fAngle);
1839 
1840 
1841  int binNum = (double) step + 0.5;
1842  // Fill BG source pair histograms
1843  if (isBg) {
1844  TH2D* hsp = fh_source_pairs_epem[step];
1845  if (candM->fIsMcGammaElectron) {
1846  if (candP->fIsMcGammaElectron
1847  && candP->fMcMotherId != candM->fMcMotherId) {
1848  hsp->Fill(0.5, 0.5);
1849  fh_source_bg_minv[0][step]->Fill(parRec->fMinv); //g-g
1850  fh_source_pairs->Fill(binNum, 0.5);
1851  } else if (candP->fIsMcPi0Electron) {
1852  hsp->Fill(1.5, 0.5);
1853  fh_source_bg_minv[3][step]->Fill(parRec->fMinv); //g-p
1854  fh_source_pairs->Fill(binNum, 3.5);
1855  } else {
1856  hsp->Fill(2.5, 0.5);
1857  fh_source_bg_minv[4][step]->Fill(parRec->fMinv); //g-o
1858  fh_source_pairs->Fill(binNum, 4.5);
1859  }
1860  } else if (candM->fIsMcPi0Electron) {
1861  if (candP->fIsMcGammaElectron) {
1862  hsp->Fill(0.5, 1.5);
1863  fh_source_bg_minv[3][step]->Fill(parRec->fMinv); //g-p
1864  fh_source_pairs->Fill(binNum, 3.5);
1865  } else if (candP->fIsMcPi0Electron
1866  && candP->fMcMotherId != candM->fMcMotherId) {
1867  hsp->Fill(1.5, 1.5);
1868  fh_source_bg_minv[1][step]->Fill(parRec->fMinv); //p-p
1869  fh_source_pairs->Fill(binNum, 1.5);
1870  } else {
1871  hsp->Fill(2.5, 1.5);
1872  fh_source_bg_minv[5][step]->Fill(parRec->fMinv); //p-o
1873  fh_source_pairs->Fill(binNum, 5.5);
1874  }
1875  } else {
1876  if (candP->fIsMcGammaElectron) {
1877  hsp->Fill(0.5, 2.5);
1878  fh_source_bg_minv[4][step]->Fill(parRec->fMinv); //g-o
1879  fh_source_pairs->Fill(binNum, 4.5);
1880  } else if (candP->fIsMcPi0Electron) {
1881  hsp->Fill(1.5, 2.5);
1882  fh_source_bg_minv[5][step]->Fill(parRec->fMinv); //p-o
1883  fh_source_pairs->Fill(binNum, 5.5);
1884  } else {
1885  hsp->Fill(2.5, 2.5);
1886  fh_source_bg_minv[2][step]->Fill(parRec->fMinv); //o-o
1887  fh_source_pairs->Fill(binNum, 2.5);
1888  }
1889  }
1890  }
1891 }
1892 
1894  CbmLmvmAnalysisSteps step,
1895  Int_t pdg) {
1896  int binNum = (double) step + 0.5;
1897  Double_t mom = cand->fMomentum.Mag();
1898  Double_t pt = cand->fMomentum.Perp();
1899  if (cand->fIsMcSignalElectron) {
1900  fh_nof_el_tracks->Fill(binNum, fWeight);
1901  fh_source_mom[kSignal][step]->Fill(mom, fWeight);
1902  fh_source_pt[kSignal][step]->Fill(pt, fWeight);
1903  } else {
1904  if (IsMismatch(cand)) fh_nof_mismatches->Fill(binNum);
1905  if (cand->fStsMcTrackId != cand->fRichMcTrackId)
1906  fh_nof_mismatches_rich->Fill(binNum);
1907  if (fUseTrd && cand->fStsMcTrackId != cand->fTrdMcTrackId)
1908  fh_nof_mismatches_trd->Fill(binNum);
1909  if (cand->fStsMcTrackId != cand->fTofMcTrackId)
1910  fh_nof_mismatches_tof->Fill(binNum);
1911  if (IsGhost(cand)) fh_nof_ghosts->Fill(binNum);
1912  fh_nof_bg_tracks->Fill(binNum);
1913  fh_source_mom[kBg][step]->Fill(mom);
1914  fh_source_pt[kBg][step]->Fill(pt);
1915  if (cand->fIsMcGammaElectron) {
1916  fh_source_tracks->Fill(binNum, 0.5);
1917  fh_source_mom[kGamma][step]->Fill(mom);
1918  fh_source_pt[kGamma][step]->Fill(pt);
1919 
1920  // e+/- from gamma conversion vertex
1921  int mcTrackId = cand->fStsMcTrackId;
1922  CbmMCTrack* mctrack = (CbmMCTrack*) fMCTracks->At(mcTrackId);
1923  if (NULL != mctrack) {
1924  TVector3 v;
1925  mctrack->GetStartVertex(v);
1926  fh_vertex_el_gamma_xz[step]->Fill(v.Z(), v.X());
1927  fh_vertex_el_gamma_yz[step]->Fill(v.Z(), v.Y());
1928  fh_vertex_el_gamma_xy[step]->Fill(v.X(), v.Y());
1929  fh_vertex_el_gamma_rz[step]->Fill(v.Z(),
1930  sqrt(v.X() * v.X() + v.Y() * v.Y()));
1931  }
1932  } else if (cand->fIsMcPi0Electron) {
1933  fh_source_tracks->Fill(binNum, 1.5);
1934  fh_source_mom[kPi0][step]->Fill(mom);
1935  fh_source_pt[kPi0][step]->Fill(pt);
1936  } else if (pdg == 211 || pdg == -211) {
1937  fh_source_tracks->Fill(binNum, 2.5);
1938  } else if (pdg == 2212) {
1939  fh_source_tracks->Fill(binNum, 3.5);
1940  } else if (pdg == 321 || pdg == -321) {
1941  fh_source_tracks->Fill(binNum, 4.5);
1942  } else if ((pdg == 11 || pdg == -11) && !cand->fIsMcGammaElectron
1943  && !cand->fIsMcPi0Electron && !cand->fIsMcSignalElectron) {
1944  fh_source_tracks->Fill(binNum, 5.5);
1945  } else {
1946  fh_source_tracks->Fill(binNum, 6.5);
1947  }
1948  }
1949 }
1950 
1952  CbmLmvmCandidate* candM,
1953  CbmLmvmKinematicParams* parMc,
1954  CbmLmvmKinematicParams* parRec,
1955  CbmLmvmAnalysisSteps step) {
1956  Bool_t isSignal = candP->fIsMcSignalElectron && candM->fIsMcSignalElectron;
1957  Bool_t isPi0 = (candP->fIsMcPi0Electron && candM->fIsMcPi0Electron
1958  && candP->fMcMotherId == candM->fMcMotherId);
1959  Bool_t isEta = (candP->fIsMcEtaElectron && candM->fIsMcEtaElectron
1960  && candP->fMcMotherId == candM->fMcMotherId);
1961  Bool_t isGamma = (candP->fIsMcGammaElectron && candM->fIsMcGammaElectron
1962  && candP->fMcMotherId == candM->fMcMotherId);
1963  Bool_t isBG =
1964  (!isEta) && (!isGamma) && (!isPi0)
1965  && (!(candP->fIsMcSignalElectron || candM->fIsMcSignalElectron));
1966  Bool_t isMismatch = (IsMismatch(candP) || IsMismatch(candM));
1967 
1968  if (isSignal)
1969  fh_signal_pty[step]->Fill(parMc->fRapidity, parMc->fPt, fWeight);
1970  if (isSignal) fh_signal_mom[step]->Fill(parMc->fMomentumMag, fWeight);
1971  if (isSignal) fh_signal_minv[step]->Fill(parRec->fMinv, fWeight);
1972  if (isSignal)
1973  fh_signal_minv_pt[step]->Fill(parRec->fMinv, parMc->fPt, fWeight);
1974  if (isBG) fh_bg_minv[step]->Fill(parRec->fMinv);
1975  PairSource(candP, candM, step, parRec);
1976  if (isPi0) fh_pi0_minv[step]->Fill(parRec->fMinv);
1977  if (isEta) fh_eta_minv[step]->Fill(parRec->fMinv);
1978  if (isPi0) fh_pi0_minv_pt[step]->Fill(parRec->fMinv, parMc->fPt);
1979  if (isEta) fh_eta_minv_pt[step]->Fill(parRec->fMinv, parMc->fPt);
1980  if (isGamma) fh_gamma_minv[step]->Fill(parRec->fMinv);
1981  if (isBG && isMismatch) fh_bg_mismatch_minv[step]->Fill(parRec->fMinv);
1982  if (isBG && !isMismatch) {
1983  fh_bg_truematch_minv[step]->Fill(parRec->fMinv);
1984  if (candP->fMcPdg == 11 && candM->fMcPdg == 11)
1985  fh_bg_truematch_el_minv[step]->Fill(parRec->fMinv);
1986  if (candP->fMcPdg != 11 || candM->fMcPdg != 11)
1987  fh_bg_truematch_notel_minv[step]->Fill(parRec->fMinv);
1988  }
1989 }
1990 
1993  CheckTopologyCut("ST",
1994  fSTCandidates,
1995  fh_stcut,
1996  fh_stcut_pion,
1999  fCuts.fStCutPP);
2000  CheckTopologyCut("TT",
2001  fTTCandidates,
2002  fh_ttcut,
2003  fh_ttcut_pion,
2006  fCuts.fTtCutPP);
2007  CheckTopologyCut("RT",
2008  fRTCandidates,
2009  fh_rtcut,
2010  fh_rtcut_pion,
2013  fCuts.fRtCutPP);
2014  if (fUseMvd) {
2017  }
2018 
2019  Int_t ncand = fCandidates.size();
2020  for (Int_t i = 0; i < ncand; i++) {
2021  Int_t pdg = 0;
2022  if (fCandidates[i].fStsMcTrackId > 0) {
2023  CbmMCTrack* mcTrack =
2024  (CbmMCTrack*) fMCTracks->At(fCandidates[i].fStsMcTrackId);
2025  if (NULL != mcTrack) pdg = mcTrack->GetPdgCode();
2026  }
2027 
2028  Bool_t isChi2Prim = (fCandidates[i].fChi2Prim < fCuts.fChiPrimCut);
2029  Bool_t isEl = (fCandidates[i].fIsElectron);
2030  Bool_t isGammaCut = (!fCandidates[i].fIsGamma);
2031  Bool_t isMvd1Cut = fCandidates[i].fIsMvd1CutElectron;
2032  Bool_t isMvd2Cut = fCandidates[i].fIsMvd2CutElectron;
2033  Bool_t isStCut = (fCandidates[i].fIsStCutElectron);
2034  Bool_t isRtCut = (fCandidates[i].fIsRtCutElectron);
2035  Bool_t isTtCut = (fCandidates[i].fIsTtCutElectron);
2036  Bool_t isPtCut = (fCandidates[i].fMomentum.Perp() > fCuts.fPtCut);
2037  if (!fUseMvd) isMvd1Cut = true;
2038  if (!fUseMvd) isMvd2Cut = true;
2039 
2040  TrackSource(&fCandidates[i], kReco, pdg);
2041  if (isChi2Prim) TrackSource(&fCandidates[i], kChi2Prim, pdg);
2042  if (isChi2Prim && isEl) TrackSource(&fCandidates[i], kElId, pdg);
2043  if (isChi2Prim && isEl && isGammaCut)
2045  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut)
2046  TrackSource(&fCandidates[i], kMvd1Cut, pdg);
2047  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut && isMvd2Cut)
2048  TrackSource(&fCandidates[i], kMvd2Cut, pdg);
2049  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut && isMvd2Cut && isStCut)
2050  TrackSource(&fCandidates[i], kStCut, pdg);
2051  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut && isMvd2Cut && isStCut
2052  && isRtCut)
2053  TrackSource(&fCandidates[i], kRtCut, pdg);
2054  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut && isMvd2Cut && isStCut
2055  && isRtCut && isTtCut)
2056  TrackSource(&fCandidates[i], kTtCut, pdg);
2057  if (isChi2Prim && isEl && isGammaCut && isMvd1Cut && isMvd2Cut && isStCut
2058  && isRtCut && isTtCut && isPtCut)
2059  TrackSource(&fCandidates[i], kPtCut, pdg);
2060  }
2061 
2062  for (Int_t iP = 0; iP < ncand; iP++) {
2063  if (fCandidates[iP].fCharge < 0) continue;
2064  CbmMCTrack* mctrackP = NULL;
2065  if (fCandidates[iP].fStsMcTrackId >= 0)
2066  mctrackP = (CbmMCTrack*) fMCTracks->At(fCandidates[iP].fStsMcTrackId);
2067  for (Int_t iM = 0; iM < ncand; iM++) {
2068  if (fCandidates[iM].fCharge > 0) continue;
2069  CbmMCTrack* mctrackM = NULL;
2070  if (fCandidates[iM].fStsMcTrackId >= 0)
2071  mctrackM = (CbmMCTrack*) fMCTracks->At(fCandidates[iM].fStsMcTrackId);
2072  if (iM == iP) continue;
2073 
2075  if (mctrackP != NULL && mctrackM != NULL)
2077  mctrackM);
2078 
2079  CbmLmvmKinematicParams pRec =
2081  &fCandidates[iM]);
2082 
2083  Bool_t isChiPrimary = (fCandidates[iP].fChi2Prim < fCuts.fChiPrimCut
2084  && fCandidates[iM].fChi2Prim < fCuts.fChiPrimCut);
2085  Bool_t isEl =
2086  (fCandidates[iP].fIsElectron && fCandidates[iM].fIsElectron);
2087  Bool_t isGammaCut =
2088  (!fCandidates[iP].fIsGamma && !fCandidates[iM].fIsGamma);
2089  Bool_t isStCut =
2090  (fCandidates[iP].fIsStCutElectron && fCandidates[iM].fIsStCutElectron);
2091  Bool_t isRtCut =
2092  (fCandidates[iP].fIsRtCutElectron && fCandidates[iM].fIsRtCutElectron);
2093  Bool_t isTtCut =
2094  (fCandidates[iP].fIsTtCutElectron && fCandidates[iM].fIsTtCutElectron);
2095  Bool_t isPtCut = (fCandidates[iP].fMomentum.Perp() > fCuts.fPtCut
2096  && fCandidates[iM].fMomentum.Perp() > fCuts.fPtCut);
2097  // Bool_t isAngleCut = (pRec.fAngle > fCuts.fAngleCut);
2098  Bool_t isMvd1Cut = (fCandidates[iP].fIsMvd1CutElectron
2099  && fCandidates[iM].fIsMvd1CutElectron);
2100  Bool_t isMvd2Cut = (fCandidates[iP].fIsMvd2CutElectron
2101  && fCandidates[iM].fIsMvd2CutElectron);
2102  if (!fUseMvd) isMvd1Cut = true;
2103  if (!fUseMvd) isMvd2Cut = true;
2104 
2105  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kReco);
2106  if (isChiPrimary) {
2107  FillPairHists(
2108  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kChi2Prim);
2109  }
2110  if (isChiPrimary && isEl) {
2111  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kElId);
2112  }
2113  if (isChiPrimary && isEl && isGammaCut) {
2114  FillPairHists(
2115  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kGammaCut);
2116  }
2117  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut) {
2118  FillPairHists(
2119  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kMvd1Cut);
2120  }
2121  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut && isMvd2Cut) {
2122  FillPairHists(
2123  &fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kMvd2Cut);
2124  }
2125  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut && isMvd2Cut
2126  && isStCut) {
2127  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kStCut);
2128  }
2129  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut && isMvd2Cut
2130  && isStCut && isRtCut) {
2131  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kRtCut);
2132  }
2133  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut && isMvd2Cut
2134  && isStCut && isRtCut && isTtCut) {
2135  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kTtCut);
2136  }
2137  if (isChiPrimary && isEl && isGammaCut && isMvd1Cut && isMvd2Cut
2138  && isStCut && isRtCut && isTtCut && isPtCut) {
2139  FillPairHists(&fCandidates[iP], &fCandidates[iM], &pMC, &pRec, kPtCut);
2140  }
2141  } // iM
2142  } // iP
2143 }
2144 
2146  Int_t ncand = fCandidates.size();
2147  for (Int_t iP = 0; iP < ncand; iP++) {
2148  if (fCandidates[iP].fCharge < 0) continue;
2149  for (Int_t iM = 0; iM < ncand; iM++) {
2150  if (fCandidates[iM].fCharge > 0) continue;
2151  if (iM == iP) continue;
2152  if ((fCandidates[iP].fChi2Prim < fCuts.fChiPrimCut
2153  && fCandidates[iP].fIsElectron)
2154  && (fCandidates[iM].fChi2Prim < fCuts.fChiPrimCut
2155  && fCandidates[iM].fIsElectron)) {
2156  CbmLmvmKinematicParams pRec =
2158  &fCandidates[iP], &fCandidates[iM]);
2159  if (pRec.fMinv < fCuts.fGammaCut) {
2160  fCandidates[iM].fIsGamma = true;
2161  fCandidates[iP].fIsGamma = true;
2162  }
2163  }
2164  }
2165  }
2166 }
2167 
2169  const string& cutName,
2170  const vector<CbmLmvmCandidate>& cutCandidates,
2171  const vector<TH2D*>& hcut,
2172  const vector<TH2D*>& hcutPion,
2173  const vector<TH2D*>& hcutTruepair,
2174  Double_t angleCut,
2175  Double_t ppCut) {
2176  vector<Double_t> angles, mom, candInd;
2177  Int_t nCand = fCandidates.size();
2178  Int_t nCutCand = cutCandidates.size();
2179  for (Int_t iP = 0; iP < nCand; iP++) {
2180 
2181  if (fCandidates[iP].fChi2Prim < fCuts.fChiPrimCut
2182  && fCandidates[iP].fIsElectron) {
2183  angles.clear();
2184  mom.clear();
2185  candInd.clear();
2186  for (Int_t iM = 0; iM < nCutCand; iM++) {
2187  // different charges, charge Im != charge iP
2188  if (cutCandidates[iM].fCharge != fCandidates[iP].fCharge) {
2189  CbmLmvmKinematicParams pRec =
2191  &fCandidates[iP], &cutCandidates[iM]);
2192  angles.push_back(pRec.fAngle);
2193  mom.push_back(cutCandidates[iM].fMomentum.Mag());
2194  candInd.push_back(iM);
2195  } // if
2196  } // iM
2197  //find min opening angle
2198  Double_t minAng = 360.;
2199  Int_t minInd = -1;
2200  for (UInt_t i = 0; i < angles.size(); i++) {
2201  if (minAng > angles[i]) {
2202  minAng = angles[i];
2203  minInd = i;
2204  }
2205  }
2206  if (minInd == -1) {
2207  if (cutName == "TT") fCandidates[iP].fIsTtCutElectron = true;
2208  if (cutName == "ST") fCandidates[iP].fIsStCutElectron = true;
2209  if (cutName == "RT") fCandidates[iP].fIsRtCutElectron = true;
2210  continue;
2211  }
2212  Double_t sqrt_mom =
2213  TMath::Sqrt(fCandidates[iP].fMomentum.Mag() * mom[minInd]);
2214  Double_t val = -1. * (angleCut / ppCut) * sqrt_mom + angleCut;
2215  if (!(sqrt_mom < ppCut && val > minAng)) {
2216  if (cutName == "TT") fCandidates[iP].fIsTtCutElectron = true;
2217  if (cutName == "ST") fCandidates[iP].fIsStCutElectron = true;
2218  if (cutName == "RT") fCandidates[iP].fIsRtCutElectron = true;
2219  }
2220 
2221  int stsInd = cutCandidates[candInd[minInd]].fStsInd;
2222  if (stsInd < 0) continue;
2223  int pdg = TMath::Abs(cutCandidates[candInd[minInd]].fMcPdg);
2224  int motherId = cutCandidates[candInd[minInd]].fMcMotherId;
2225 
2226  if (fCandidates[iP].fIsMcSignalElectron) {
2227  hcut[kSignal]->Fill(sqrt_mom, minAng, fWeight);
2228  if (pdg == 211) hcutPion[kSignal]->Fill(sqrt_mom, minAng, fWeight);
2229  if (motherId == fCandidates[iP].fMcMotherId)
2230  hcutTruepair[kSignal]->Fill(sqrt_mom, minAng, fWeight);
2231  } else {
2232  hcut[kBg]->Fill(sqrt_mom, minAng);
2233  if (pdg == 211) hcutPion[kBg]->Fill(sqrt_mom, minAng);
2234  ;
2235  if (motherId != -1 && motherId == fCandidates[iP].fMcMotherId)
2236  hcutTruepair[kBg]->Fill(sqrt_mom, minAng);
2237  ;
2238  }
2239  if (fCandidates[iP].fIsMcPi0Electron) {
2240  hcut[kPi0]->Fill(sqrt_mom, minAng);
2241  if (pdg == 211) hcutPion[kPi0]->Fill(sqrt_mom, minAng);
2242  ;
2243  if (motherId != -1 && motherId == fCandidates[iP].fMcMotherId)
2244  hcutTruepair[kPi0]->Fill(sqrt_mom, minAng);
2245  ;
2246  }
2247  if (fCandidates[iP].fIsMcGammaElectron) {
2248  hcut[kGamma]->Fill(sqrt_mom, minAng);
2249  if (pdg == 211) hcutPion[kGamma]->Fill(sqrt_mom, minAng);
2250  ;
2251  if (motherId != -1 && motherId == fCandidates[iP].fMcMotherId)
2252  hcutTruepair[kGamma]->Fill(sqrt_mom, minAng);
2253  ;
2254  }
2255  } //if electron
2256  } //iP
2257  /*
2258  cout << "Opening angles between cand and cutCand: " << endl;
2259  for(int i = 0; i < angles.size(); i++){
2260  cout << angles[i] << ", ";
2261  }
2262  cout << endl;
2263 */
2264 }
2265 
2267  const string& source) {
2268  UInt_t nCand = fCandidates.size();
2269  vector<bool> isAdded;
2270  isAdded.resize(nCand);
2271  for (UInt_t iP = 0; iP < nCand; iP++) {
2272  isAdded[iP] = false;
2273  }
2274  for (UInt_t iP = 0; iP < nCand; iP++) {
2275  if (fCandidates[iP].fMcMotherId == -1) continue;
2276  if (source == "pi0" && !fCandidates[iP].fIsMcPi0Electron) continue;
2277  if (source == "gamma" && !fCandidates[iP].fIsMcGammaElectron) continue;
2278 
2279  if (!(fCandidates[iP].fChi2Prim < fCuts.fChiPrimCut
2280  && fCandidates[iP].fIsElectron))
2281  continue;
2282 
2283  if (isAdded[iP]) continue;
2284 
2285  for (UInt_t iM = 0; iM < fSTCandidates.size(); iM++) {
2286  if (fSTCandidates[iM].fMcMotherId == fCandidates[iP].fMcMotherId) {
2287  h_nof_pairs->Fill(4.5);
2288  isAdded[iP] = true;
2289  break;
2290  }
2291  }
2292  if (isAdded[iP]) continue;
2293 
2294  for (UInt_t iM = 0; iM < fRTCandidates.size(); iM++) {
2295  if (fRTCandidates[iM].fMcMotherId == fCandidates[iP].fMcMotherId) {
2296  h_nof_pairs->Fill(5.5);
2297  isAdded[iP] = true;
2298  break;
2299  }
2300  }
2301  if (isAdded[iP]) continue;
2302 
2303  for (UInt_t iM = 0; iM < fTTCandidates.size(); iM++) {
2304  if (fTTCandidates[iM].fMcMotherId == fCandidates[iP].fMcMotherId) {
2305  h_nof_pairs->Fill(6.5);
2306  isAdded[iP] = true;
2307  break;
2308  }
2309  }
2310  if (isAdded[iP]) continue;
2311 
2312  for (UInt_t iM = 0; iM < fCandidates.size(); iM++) {
2313  if (iM != iP && fCandidates[iM].fMcMotherId == fCandidates[iP].fMcMotherId
2314  && fCandidates[iM].fChi2Prim < fCuts.fChiPrimCut
2315  && fCandidates[iM].fIsElectron) {
2316  h_nof_pairs->Fill(7.5);
2317  isAdded[iP] = true;
2318  isAdded[iM] = true;
2319  break;
2320  }
2321  }
2322 
2323  if (isAdded[iP]) continue;
2324  Int_t nofPointsSts = 0;
2325  Int_t nofMcTracks = fMCTracks->GetEntriesFast();
2326  for (Int_t iMCTrack = 0; iMCTrack < nofMcTracks; iMCTrack++) {
2327  const CbmMCTrack* mcTrack =
2328  static_cast<const CbmMCTrack*>(fMCTracks->At(iMCTrack));
2329  if (mcTrack->GetMotherId() != fCandidates[iP].fMcMotherId) continue;
2330  if (iMCTrack == fCandidates[iP].fStsMcTrackId) continue;
2331 
2333  FairRun::Instance()->GetEventHeader()->GetMCEntryNumber(),
2334  iMCTrack))
2335  continue;
2336  const CbmLitMCTrack& litMCTrack =
2338  FairRun::Instance()->GetEventHeader()->GetMCEntryNumber(), iMCTrack);
2339  nofPointsSts =
2341  break;
2342  }
2343  if (nofPointsSts == 0) h_nof_pairs->Fill(0.5);
2344  if (nofPointsSts >= 1 && nofPointsSts <= 3) h_nof_pairs->Fill(1.5);
2345  if (nofPointsSts >= 4 && nofPointsSts <= 5) h_nof_pairs->Fill(2.5);
2346  if (nofPointsSts >= 6) h_nof_pairs->Fill(3.5);
2347  }
2348 }
2349 
2351  bool isTrdOk =
2352  (fUseTrd) ? (cand->fStsMcTrackId == cand->fTrdMcTrackId) : true;
2353  if (cand->fStsMcTrackId == cand->fRichMcTrackId && isTrdOk
2354  && cand->fStsMcTrackId == cand->fTofMcTrackId
2355  && cand->fStsMcTrackId != -1)
2356  return false;
2357  return true;
2358 }
2359 
2361  if (cand->fStsMcTrackId == -1 || cand->fRichMcTrackId == -1
2362  || cand->fTrdMcTrackId == -1 || cand->fTofMcTrackId == -1)
2363  return true;
2364  return false;
2365 }
2366 
2367 void CbmAnaDielectronTask::IsElectron(Int_t globalTrackIndex,
2368  Double_t momentum,
2369  CbmLmvmCandidate* cand) {
2370  if (fPionMisidLevel < 0.) {
2372  globalTrackIndex, momentum);
2374  globalTrackIndex, momentum);
2375 
2377  globalTrackIndex, momentum);
2379  globalTrackIndex, momentum);
2380 
2382  globalTrackIndex, momentum);
2383  //cout << "tof momentum: " << momentum << endl;
2384  Bool_t momCut =
2385  (fCuts.fMomentumCut > 0.) ? (momentum < fCuts.fMomentumCut) : true;
2386 
2387  if (richEl && trdEl && tofEl && momCut) {
2388  cand->fIsElectron = true;
2389  } else {
2390  cand->fIsElectron = false;
2391  }
2392  } else {
2393  // PID using MC information, a certain pi supression level can be set
2394  if (cand->fStsMcTrackId < 0
2395  || cand->fStsMcTrackId >= fMCTracks->GetEntries()) {
2396  cand->fIsElectron = false;
2397  } else {
2398  CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(cand->fStsMcTrackId);
2399  Int_t pdg = mcTrack->GetPdgCode();
2400  if (pdg == 11 || pdg == -11) {
2401  cand->fIsElectron = true;
2402  } else {
2403  Double_t r = fRandom3->Rndm();
2404  if (r < fPionMisidLevel) {
2405  cand->fIsElectron = true;
2406  } else {
2407  cand->fIsElectron = false;
2408  }
2409  }
2410  }
2411  }
2412 }
2413 
2414 
2416  //ID cuts
2417  Int_t nCand = fCandidates.size();
2418  for (Int_t i = 0; i < nCand; i++) {
2419  if (fCandidates[i].fIsMcSignalElectron) {
2420  fh_chi2prim[kSignal]->Fill(fCandidates[i].fChi2Prim, fWeight);
2421  } else {
2422  fh_chi2prim[kBg]->Fill(fCandidates[i].fChi2Prim);
2423  }
2424  if (fCandidates[i].fIsMcGammaElectron) {
2425  fh_chi2prim[kGamma]->Fill(fCandidates[i].fChi2Prim);
2426  }
2427  if (fCandidates[i].fIsMcPi0Electron)
2428  fh_chi2prim[kPi0]->Fill(fCandidates[i].fChi2Prim);
2429 
2430  if (fCandidates[i].fChi2Prim > fCuts.fChiPrimCut) continue;
2431 
2432  if (fCandidates[i].fIsMcSignalElectron) {
2433  fh_richann[kSignal]->Fill(fCandidates[i].fRichAnn, fWeight);
2434  fh_trdann[kSignal]->Fill(fCandidates[i].fTrdAnn, fWeight);
2435  fh_tofm2[kSignal]->Fill(
2436  fCandidates[i].fMomentum.Mag(), fCandidates[i].fMass2, fWeight);
2437  //cout << "tof m2: " << fCandidates[i].fMass2 << endl;
2438  //cout << "Signal tofm2: " << fCandidates[i].fMass2 << ", fWeight: " << fWeight << endl;
2439  } else {
2440  fh_richann[kBg]->Fill(fCandidates[i].fRichAnn);
2441  fh_trdann[kBg]->Fill(fCandidates[i].fTrdAnn);
2442  fh_tofm2[kBg]->Fill(fCandidates[i].fMomentum.Mag(),
2443  fCandidates[i].fMass2);
2444  //cout << "Bg tofm2: " << fCandidates[i].fMass2 << endl;
2445  }
2446  if (fCandidates[i].fIsMcGammaElectron) {
2447  fh_richann[kGamma]->Fill(fCandidates[i].fRichAnn);
2448  fh_trdann[kGamma]->Fill(fCandidates[i].fTrdAnn);
2449  fh_tofm2[kGamma]->Fill(fCandidates[i].fMomentum.Mag(),
2450  fCandidates[i].fMass2);
2451  //cout << "Gamma tofm2: " << fCandidates[i].fMass2 << endl;
2452  }
2453  if (fCandidates[i].fIsMcPi0Electron) {
2454  fh_richann[kPi0]->Fill(fCandidates[i].fRichAnn);
2455  fh_trdann[kPi0]->Fill(fCandidates[i].fTrdAnn);
2456  fh_tofm2[kPi0]->Fill(fCandidates[i].fMomentum.Mag(),
2457  fCandidates[i].fMass2);
2458  //cout << "Pi0Elec tofm2: " << fCandidates[i].fMass2 << endl;
2459  }
2460  } // loop over candidates
2461 
2462  for (Int_t i = 0; i < nCand; i++) {
2463  if (!(fCandidates[i].fChi2Prim < fCuts.fChiPrimCut
2464  && fCandidates[i].fIsElectron))
2465  continue;
2466 
2467  if (fCandidates[i].fIsMcSignalElectron) {
2468  fh_pt[kSignal]->Fill(fCandidates[i].fMomentum.Perp(), fWeight);
2469  fh_mom[kSignal]->Fill(fCandidates[i].fMomentum.Mag(), fWeight);
2470  fh_chi2sts[kSignal]->Fill(fCandidates[i].fChi2sts, fWeight);
2471  } else {
2472  fh_pt[kBg]->Fill(fCandidates[i].fMomentum.Perp());
2473  fh_mom[kBg]->Fill(fCandidates[i].fMomentum.Mag());
2474  fh_chi2sts[kBg]->Fill(fCandidates[i].fChi2sts);
2475  }
2476  if (fCandidates[i].fIsMcGammaElectron) {
2477  fh_pt[kGamma]->Fill(fCandidates[i].fMomentum.Perp());
2478  fh_mom[kGamma]->Fill(fCandidates[i].fMomentum.Mag());
2479  fh_chi2sts[kGamma]->Fill(fCandidates[i].fChi2sts);
2480  }
2481  if (fCandidates[i].fIsMcPi0Electron) {
2482  fh_pt[kPi0]->Fill(fCandidates[i].fMomentum.Perp());
2483  fh_mom[kPi0]->Fill(fCandidates[i].fMomentum.Mag());
2484  fh_chi2sts[kPi0]->Fill(fCandidates[i].fChi2sts);
2485  }
2486  } // loop over candidates
2487 
2488  if (fUseMvd) {
2489  //number of STS and MVD hits and distributions for the MVD
2490  for (int i = 0; i < nCand; i++) {
2491  if (!(fCandidates[i].fChi2Prim < fCuts.fChiPrimCut
2492  && fCandidates[i].fIsElectron))
2493  continue;
2494 
2495  CbmStsTrack* track =
2496  (CbmStsTrack*) fStsTracks->At(fCandidates[i].fStsInd);
2497  if (NULL == track) continue;
2498  int nofMvdHits = track->GetNofMvdHits();
2499  int nofStsHits = track->GetNofHits();
2500  double mvd1x = 0., mvd1y = 0., mvd2x = 0., mvd2y = 0.;
2501 
2502  for (Int_t ith = 0; ith < nofMvdHits; ith++) {
2503  Int_t iHit = track->GetMvdHitIndex(ith);
2504  CbmMvdHit* pmh = (CbmMvdHit*) fMvdHits->At(iHit);
2505  Int_t stationNum = pmh->GetStationNr();
2506  if (NULL == pmh) continue;
2507  if (stationNum == 1) {
2508  mvd1x = pmh->GetX();
2509  mvd1y = pmh->GetY();
2510  } else if (stationNum == 2) {
2511  mvd2x = pmh->GetX();
2512  mvd2y = pmh->GetY();
2513  }
2514  }
2515  double mvd1r = sqrt(mvd1x * mvd1x + mvd1y * mvd1y);
2516  double mvd2r = sqrt(mvd2x * mvd2x + mvd2y * mvd2y);
2517 
2518  if (fCandidates[i].fIsMcSignalElectron) {
2519  fh_nofMvdHits[kSignal]->Fill(nofMvdHits, fWeight);
2520  fh_nofStsHits[kSignal]->Fill(nofStsHits, fWeight);
2521  fh_mvd1xy[kSignal]->Fill(mvd1x, mvd1y, fWeight);
2522  fh_mvd1r[kSignal]->Fill(mvd1r, fWeight);
2523  fh_mvd2xy[kSignal]->Fill(mvd2x, mvd2y, fWeight);
2524  fh_mvd2r[kSignal]->Fill(mvd2r, fWeight);
2525  } else {
2526  fh_nofMvdHits[kBg]->Fill(nofMvdHits);
2527  fh_nofStsHits[kBg]->Fill(nofStsHits);
2528  fh_mvd1xy[kBg]->Fill(mvd1x, mvd1y);
2529  fh_mvd1r[kBg]->Fill(mvd1r);
2530  fh_mvd2xy[kBg]->Fill(mvd2x, mvd2y);
2531  fh_mvd2r[kBg]->Fill(mvd2r);
2532  }
2533  if (fCandidates[i].fIsMcGammaElectron) {
2534  fh_nofMvdHits[kGamma]->Fill(nofMvdHits);
2535  fh_nofStsHits[kGamma]->Fill(nofStsHits);
2536  fh_mvd1xy[kGamma]->Fill(mvd1x, mvd1y);
2537  fh_mvd1r[kGamma]->Fill(mvd1r);
2538  fh_mvd2xy[kGamma]->Fill(mvd2x, mvd2y);
2539  fh_mvd2r[kGamma]->Fill(mvd2r);
2540  }
2541  if (fCandidates[i].fIsMcPi0Electron) {
2542  fh_nofMvdHits[kPi0]->Fill(nofMvdHits);
2543  fh_nofStsHits[kPi0]->Fill(nofStsHits);
2544  fh_mvd1xy[kPi0]->Fill(mvd1x, mvd1y);
2545  fh_mvd1r[kPi0]->Fill(mvd1r);
2546  fh_mvd2xy[kPi0]->Fill(mvd2x, mvd2y);
2547  fh_mvd2r[kPi0]->Fill(mvd2r);
2548  }
2549  }
2550  }
2551 }
2552 
2554  vector<TH2D*>& hist,
2555  vector<TH1D*>& histQa) {
2556  vector<float> mvdX;
2557  vector<float> mvdY;
2558  vector<int> mvdInd;
2559  vector<float> candX;
2560  vector<float> candY;
2561  vector<int> candInd;
2562 
2563  // CbmKF *KF = CbmKF::Instance();
2564 
2565  Int_t nMvdHit = fMvdHits->GetEntriesFast();
2566  for (Int_t iHit = 0; iHit < nMvdHit; iHit++) {
2567  CbmMvdHit* pmh = (CbmMvdHit*) fMvdHits->At(iHit);
2568  if (NULL == pmh) continue;
2569  Int_t stationNum = pmh->GetStationNr();
2570  if (stationNum == mvdStationNum) {
2571  mvdX.push_back(pmh->GetX());
2572  mvdY.push_back(pmh->GetY());
2573  mvdInd.push_back(iHit);
2574  }
2575  }
2576 
2577  Int_t nCand = fCandidates.size();
2578  for (Int_t i = 0; i < nCand; i++) {
2579  if (fCandidates[i].fChi2Prim < fCuts.fChiPrimCut
2580  && fCandidates[i].fIsElectron) {
2581  CbmStsTrack* track =
2582  (CbmStsTrack*) fStsTracks->At(fCandidates[i].fStsInd);
2583  if (NULL == track) continue;
2584  Int_t nhits = track->GetNofMvdHits();
2585  for (Int_t ith = 0; ith < nhits; ith++) {
2586  Int_t iHit = track->GetMvdHitIndex(ith);
2587  CbmMvdHit* pmh = (CbmMvdHit*) fMvdHits->At(iHit);
2588  Int_t stationNum = pmh->GetStationNr();
2589  if (NULL == pmh) continue;
2590  if (stationNum == mvdStationNum) {
2591  candX.push_back(pmh->GetX());
2592  candY.push_back(pmh->GetY());
2593  candInd.push_back(i);
2594  }
2595  }
2596  }
2597  } // iCand
2598 
2599  for (UInt_t iT = 0; iT < candInd.size(); iT++) {
2600  Float_t mind = 9999999.;
2601  Int_t minMvdInd = -1;
2602  for (UInt_t iH = 0; iH < mvdX.size(); iH++) {
2603  Float_t dx = mvdX[iH] - candX[iT];
2604  Float_t dy = mvdY[iH] - candY[iT];
2605  Float_t d2 = dx * dx + dy * dy;
2606  if (d2 < 1.e-9) continue;
2607  if (d2 < mind) {
2608  minMvdInd = mvdInd[iH];
2609  mind = d2;
2610  }
2611  } // iHit
2612  Double_t dmvd = sqrt(mind);
2613 
2614  // Check MVD cut quality
2615  double bin = -1.;
2616  const CbmMatch* hitMatch =
2617  static_cast<const CbmMatch*>(fMvdHitMatches->At(minMvdInd));
2618  if (NULL != hitMatch) {
2619  int mcMvdHitId = hitMatch->GetMatchedLink().GetIndex();
2620  CbmMCTrack* mct1 = (CbmMCTrack*) fMCTracks->At(mcMvdHitId);
2621  int mcMvdHitPdg = TMath::Abs(mct1->GetPdgCode());
2622  int mvdMotherId = mct1->GetMotherId();
2623 
2624  int stsMcTrackId = fCandidates[candInd[iT]].fStsMcTrackId;
2625  int stsMotherId = -2;
2626  if (stsMcTrackId >= 0) {
2627  CbmMCTrack* mct2 = (CbmMCTrack*) fMCTracks->At(stsMcTrackId);
2628  stsMotherId = mct2->GetMotherId();
2629  }
2630 
2631  //cout << mvdStationNum << " " << mvdMotherId << " " << stsMotherId << endl;
2632  if (mvdMotherId != -1 && mvdMotherId == stsMotherId) {
2633  bin = 0.5; // correct assignment
2634  } else {
2635  bin = 1.5; // not correct assignment
2636  }
2637 
2638  if (fCandidates[candInd[iT]].fIsMcSignalElectron) {
2639  if (mvdMotherId == stsMotherId && mcMvdHitPdg == 11) {
2640  bin = 0.5; // correct assignment
2641  } else {
2642  bin = 1.5;
2643  }
2644  }
2645  }
2646  //cout << "MVD cut correctness " << bin << endl;
2647 
2648  // Fill histograms
2649  fCandidates[candInd[iT]].fDSts = dmvd;
2650  if (fCandidates[candInd[iT]].fIsMcSignalElectron) {
2651  hist[kSignal]->Fill(
2652  dmvd, fCandidates[candInd[iT]].fMomentum.Mag(), fWeight);
2653  histQa[kSignal]->Fill(bin, fWeight);
2654  } else {
2655  hist[kBg]->Fill(dmvd, fCandidates[candInd[iT]].fMomentum.Mag());
2656  histQa[kBg]->Fill(bin);
2657  }
2658  if (fCandidates[candInd[iT]].fIsMcGammaElectron) {
2659  hist[kGamma]->Fill(dmvd, fCandidates[candInd[iT]].fMomentum.Mag());
2660  histQa[kGamma]->Fill(bin);
2661  }
2662  if (fCandidates[candInd[iT]].fIsMcPi0Electron) {
2663  hist[kPi0]->Fill(dmvd, fCandidates[candInd[iT]].fMomentum.Mag());
2664  histQa[kPi0]->Fill(bin);
2665  }
2666 
2667  // Apply MVD cut
2668  if (mvdStationNum == 1) {
2669  Double_t mom = fCandidates[candInd[iT]].fMomentum.Mag();
2670  Double_t val =
2671  -1. * (fCuts.fMvd1CutP / fCuts.fMvd1CutD) * dmvd + fCuts.fMvd1CutP;
2672  if (!(dmvd < fCuts.fMvd1CutD && val > mom)) {
2673  fCandidates[candInd[iT]].fIsMvd1CutElectron = true;
2674  } else {
2675  fCandidates[candInd[iT]].fIsMvd1CutElectron = false;
2676  }
2677  }
2678  if (mvdStationNum == 2) {
2679  Double_t mom = fCandidates[candInd[iT]].fMomentum.Mag();
2680  Double_t val =
2681  -1. * (fCuts.fMvd2CutP / fCuts.fMvd2CutD) * dmvd + fCuts.fMvd2CutP;
2682  if (!(dmvd < fCuts.fMvd2CutD && val > mom)) {
2683  fCandidates[candInd[iT]].fIsMvd2CutElectron = true;
2684  } else {
2685  fCandidates[candInd[iT]].fIsMvd2CutElectron = false;
2686  }
2687  }
2688  } // iTrack
2689 }
2690 
2692  if (!fUseMvd) return;
2693  Int_t nCand = fCandidates.size();
2694  for (Int_t i = 0; i < nCand; i++) {
2695  if (fCandidates[i].fChi2Prim < fCuts.fChiPrimCut
2696  && fCandidates[i].fIsElectron) {
2697  CbmStsTrack* track =
2698  (CbmStsTrack*) fStsTracks->At(fCandidates[i].fStsInd);
2699  if (NULL == track) continue;
2700  int stsMcTrackId = fCandidates[i].fStsMcTrackId;
2701  Int_t nhits = track->GetNofMvdHits();
2702  for (Int_t ith = 0; ith < nhits; ith++) {
2703  Int_t iHit = track->GetMvdHitIndex(ith);
2704  CbmMvdHit* pmh1 = (CbmMvdHit*) fMvdHits->At(iHit);
2705  if (NULL == pmh1) continue;
2706  Int_t stationNum = pmh1->GetStationNr();
2707 
2708  int nofMvdHits = fMvdHitMatches->GetEntriesFast();
2709  for (int iMvd = 0; iMvd < nofMvdHits; iMvd++) {
2710  const CbmMatch* hitMatch =
2711  static_cast<const CbmMatch*>(fMvdHitMatches->At(iMvd));
2712  if (NULL == hitMatch) continue;
2713  int mcMvdHitId = hitMatch->GetMatchedLink().GetIndex();
2714  if (stsMcTrackId != mcMvdHitId) continue;
2715  CbmMvdHit* pmh2 = (CbmMvdHit*) fMvdHits->At(iMvd);
2716  if (pmh2->GetStationNr() != stationNum) continue;
2717  double dx = pmh1->GetX() - pmh2->GetX();
2718  double dy = pmh1->GetY() - pmh2->GetY();
2719  double d = sqrt(dx * dx + dy * dy);
2720  if (stationNum == 1) {
2721  if (fCandidates[i].fIsMcGammaElectron)
2722  fh_mvd1cut_mc_dist_gamma->Fill(d);
2723  if (fCandidates[i].fIsMcPi0Electron)
2724  fh_mvd1cut_mc_dist_pi0->Fill(d);
2725  } else if (stationNum == 1) {
2726  if (fCandidates[i].fIsMcGammaElectron)
2727  fh_mvd2cut_mc_dist_gamma->Fill(d);
2728  if (fCandidates[i].fIsMcPi0Electron)
2729  fh_mvd2cut_mc_dist_pi0->Fill(d);
2730  }
2731  }
2732  }
2733  }
2734  } // iCan
2735 }
2736 
2738  TDirectory* oldir = gDirectory;
2739  TFile* outFile = FairRootManager::Instance()->GetOutFile();
2740  if (outFile != NULL) {
2741  outFile->cd();
2742  // Write histograms to a file
2743  for (UInt_t i = 0; i < fHistoList.size(); i++) {
2744  fHistoList[i]->Write();
2745  }
2746  }
2747  gDirectory->cd(oldir->GetPath());
2748 }
2749 
2751  const string& particle) {
2752 
2753  // Au+Au centr old scaling factors
2754  /* if (energy == "8gev" || energy == "10gev") {
2755  // weight rho0 = Multiplicity * Branching Ratio = 9 * 4.7e-5 for 10 AGeV beam energy
2756  if (particle == "rho0") this->SetWeight(9 * 4.7e-5);
2757  // weight omega = Multiplicity * Branching Ratio = 19 * 7.28e-5 for 10 AGeV beam energy
2758  if (particle == "omegaepem" ) this->SetWeight(19 * 7.28e-5);
2759  // weight omega = Multiplicity * Branching Ratio = 19 * 7.7e-4 for 10 AGeV beam energy
2760  if (particle == "omegadalitz") this->SetWeight(19 * 7.7e-4);
2761  // weight phi = Multipli0city * Branching Ratio = 0.12 * 2.97e-4 for 10 AGeV beam energy
2762  if (particle == "phi") this->SetWeight(0.12 * 2.97e-4);
2763  // weight in medium rho. 0.5 is a scaling factor for 8AGev from 25AGeV
2764  if (particle == "inmed") this->SetWeight(0.5 * 4.45e-2);
2765  // weight qgp radiation 0.5 is a scaling factor for 8AGev from 25AGeV
2766  if (particle == "qgp") this->SetWeight(0.5 * 1.15e-2);
2767  //either old or new!!!
2768  // Au+Au centr new scaling factors
2769  }*/
2770  if (energy == "8gev") {
2771  // weight omega = Multiplicity * Branching Ratio = 19 * 7.28e-5 for 8 AGeV beam energy
2772  if (particle == "omegaepem") this->SetWeight(2.5 * 7.28e-5);
2773  // weight omega = Multiplicity * Branching Ratio = 19 * 7.7e-4 for 8 AGeV beam energy
2774  if (particle == "omegadalitz") this->SetWeight(2.5 * 7.7e-4);
2775  // weight phi = Multipli0city * Branching Ratio = 0.12 * 2.97e-4 for 8 AGeV beam energy
2776  if (particle == "phi") this->SetWeight(0.365 * 2.97e-4);
2777  // weight in medium rho. 0.5 is a scaling factor for 8AGev from 25AGeV
2778  if (particle == "inmed") this->SetWeight(0.5 * 4.45e-2);
2779  // weight qgp radiation 0.5 is a scaling factor for 8AGev from 25AGeV
2780  if (particle == "qgp") this->SetWeight(0.5 * 1.15e-2);
2781  } else if (energy == "25gev") {
2782  // weight rho0 = Multiplicity * Branching Ratio = 23 * 4.7e-5 for 25 AGeV beam energy
2783  if (particle == "rho0") this->SetWeight(23 * 4.7e-5);
2784  // weight omega = Multiplicity * Branching Ratio = 38 * 7.28e-5 for 25 AGeV beam energy
2785  if (particle == "omegaepem") this->SetWeight(38 * 7.28e-5);
2786  // weight omega = Multiplicity * Branching Ratio = 38 * 7.7e-4 for 25 AGeV beam energy
2787  if (particle == "omegadalitz") this->SetWeight(38 * 7.7e-4);
2788  // weight phi = Multiplicity * Branching Ratio = 1.28 * 2.97e-4 for 25 AGeV beam energy
2789  if (particle == "phi") this->SetWeight(1.28 * 2.97e-4);
2790  // weight in medium rho.
2791  if (particle == "inmed") this->SetWeight(4.45e-2);
2792  // weight qgp radiation
2793  if (particle == "qgp") this->SetWeight(1.15e-2);
2794  } else if (energy == "3.5gev") {
2795  // weight rho0 = Multiplicity * Branching Ratio = 1.0 * 4.7e-5 for 25 AGeV beam energy
2796  if (particle == "rho0") this->SetWeight(1.0 * 4.7e-5);
2797  // weight omega = Multiplicity * Branching Ratio = 1.2 * 7.28e-5 for 25 AGeV beam energy
2798  if (particle == "omegaepem") this->SetWeight(1.2 * 7.28e-5);
2799  // weight omega = Multiplicity * Branching Ratio = 1.2 * 5.9e-4 for 25 AGeV beam energy
2800  if (particle == "omegadalitz") this->SetWeight(1.2 * 7.7e-5);
2801  // weight phi = Multiplicity * Branching Ratio = 0.1 * 2.97e-4 for 25 AGeV beam energy
2802  if (particle == "phi") this->SetWeight(0.1 * 2.97e-4);
2803 
2804  //Ag+Ag mbias!!
2805  /* } else if (energy == "4.5gev"){
2806  // weight omegadalitz = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2807  if(particle == "omegadalitz") this->SetWeight(5.8*7.7e-6);
2808  // weight omegaepem = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2809  if(particle == "omegaepem") this->SetWeight(5.8*7.28e-7);
2810  // weight pi0 = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2811  if(particle == "phi") this->SetWeight(5.8*2.97e-7);
2812  // weight inmed = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2813  if(particle == "inmed") this->SetWeight(8.2*10e-4);
2814 */
2815  //Ag+Ag 40% either mbias or 40%!!!
2816  } else if (energy == "4.5gev") {
2817  // weight omegadalitz = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2818  if (particle == "omegadalitz") this->SetWeight(1.2 * 7.7e-5);
2819  // weight omegaepem = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2820  if (particle == "omegaepem") this->SetWeight(1.2 * 7.28e-6);
2821  // weight pi0 = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2822  if (particle == "phi") this->SetWeight(1.2 * 2.97e-6);
2823  // weight inmed = Multiplicity * Branching Ratio = for 4.5 AGeV beam energy
2824  if (particle == "inmed") this->SetWeight(2.4 * 10e-3);
2825  } else {
2826  cout << "-ERROR- CbmAnaDielectronTask::SetEnergyAndParticle energy or "
2827  "particle is not correct, energy:"
2828  << energy << " particle:" << particle << endl;
2829  }
2830 }
CbmRichPoint.h
kMc
@ kMc
Definition: CbmLmvmHist.h:16
CbmAnaDielectronTask::fSTCandidates
std::vector< CbmLmvmCandidate > fSTCandidates
Definition: CbmAnaDielectronTask.h:293
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmAnaDielectronTask::fh_mvd1cut_mc_dist_pi0
TH1D * fh_mvd1cut_mc_dist_pi0
Definition: CbmAnaDielectronTask.h:397
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmLmvmUtils::IsMcEtaElectron
static Bool_t IsMcEtaElectron(CbmMCTrack *mctrack, TClonesArray *mcTracks)
Definition: CbmLmvmUtils.h:141
CbmLmvmCuts::fMomentumCut
Double_t fMomentumCut
Definition: CbmLmvmCuts.h:107
CbmAnaDielectronTask::fRichRings
TClonesArray * fRichRings
Definition: CbmAnaDielectronTask.h:262
CbmLmvmCandidate::fTrdAnn
Double_t fTrdAnn
Definition: CbmLmvmCandidate.h:94
CbmMatch
Definition: CbmMatch.h:22
CbmAnaDielectronTask::fh_nof_rec_pairs_pi0
TH1D * fh_nof_rec_pairs_pi0
Definition: CbmAnaDielectronTask.h:427
CbmVertex.h
CbmAnaDielectronTask::fUseMvd
Bool_t fUseMvd
Definition: CbmAnaDielectronTask.h:286
CbmAnaDielectronTask::fh_signal_pty
std::vector< TH2D * > fh_signal_pty
Definition: CbmAnaDielectronTask.h:345
CbmAnaDielectronTask::fh_nof_rec_pi0
TH1D * fh_nof_rec_pi0
Definition: CbmAnaDielectronTask.h:431
CbmLmvmCandidate::fIsMvd2CutElectron
Bool_t fIsMvd2CutElectron
Definition: CbmLmvmCandidate.h:92
CbmAnaDielectronTask::fh_source_pairs_epem
std::vector< TH2D * > fh_source_pairs_epem
Definition: CbmAnaDielectronTask.h:408
kElId
@ kElId
Definition: CbmLmvmHist.h:20
CbmLmvmCandidate
Definition: CbmLmvmCandidate.h:11
CbmAnaDielectronTask::fh_nof_mismatches
TH1D * fh_nof_mismatches
Definition: CbmAnaDielectronTask.h:433
CbmAnaDielectronTask::fh_nof_topology_pairs_gamma
TH1D * fh_nof_topology_pairs_gamma
Definition: CbmAnaDielectronTask.h:422
CbmAnaDielectronTask::fh_piprim_mom_mc
TH1D * fh_piprim_mom_mc
Definition: CbmAnaDielectronTask.h:461
CbmLmvmCandidate::fStsMcTrackId
Int_t fStsMcTrackId
Definition: CbmLmvmCandidate.h:71
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmAnaDielectronTask::PairMcAndAcceptance
void PairMcAndAcceptance()
Definition: CbmAnaDielectronTask.cxx:1410
CbmAnaDielectronTask::fh_mvd1r
std::vector< TH1D * > fh_mvd1r
Definition: CbmAnaDielectronTask.h:391
kTtCut
@ kTtCut
Definition: CbmLmvmHist.h:26
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmAnaDielectronTask::IsMismatch
Bool_t IsMismatch(CbmLmvmCandidate *cand)
Definition: CbmAnaDielectronTask.cxx:2350
CbmKF.h
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmAnaDielectronTask::fh_pi_mom_rec_sts_rich_trd_tof
TH1D * fh_pi_mom_rec_sts_rich_trd_tof
Definition: CbmAnaDielectronTask.h:457
CbmAnaDielectronTask::fh_piprim_minus_rapidity_mc
TH1D * fh_piprim_minus_rapidity_mc
Definition: CbmAnaDielectronTask.h:469
L1Field.h
CbmLmvmUtils.h
CbmAnaDielectronTask::fKFVertex
CbmKFVertex fKFVertex
Definition: CbmAnaDielectronTask.h:281
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
CbmAnaDielectronTask::fh_pi0_minv
std::vector< TH1D * > fh_pi0_minv
Definition: CbmAnaDielectronTask.h:341
CbmAnaDielectronTask::fMvdHitMatches
TClonesArray * fMvdHitMatches
Definition: CbmAnaDielectronTask.h:273
CbmAnaDielectronTask::AssignMcToCandidates
void AssignMcToCandidates()
Definition: CbmAnaDielectronTask.cxx:1720
CbmAnaDielectronTask::fh_signal_pmtXY
TH2D * fh_signal_pmtXY
Definition: CbmAnaDielectronTask.h:323
CbmAnaDielectronTask::MCPairs
void MCPairs()
Definition: CbmAnaDielectronTask.cxx:1224
CbmLmvmUtils::CalculateAndSetTrackParamsToCandidate
static void CalculateAndSetTrackParamsToCandidate(CbmLmvmCandidate *cand, CbmStsTrack *stsTrack, CbmKFVertex &kfVertex)
Definition: CbmLmvmUtils.h:24
CbmLmvmHist::fNofAnaSteps
static const int fNofAnaSteps
Definition: CbmLmvmHist.h:49
CbmLmvmCandidate::fIsTtCutElectron
Bool_t fIsTtCutElectron
Definition: CbmLmvmCandidate.h:88
CbmAnaDielectronTask::fh_pi_mom_rec_sts_rich_trd
TH1D * fh_pi_mom_rec_sts_rich_trd
Definition: CbmAnaDielectronTask.h:456
CbmAnaDielectronTask::fh_mvd1cut
std::vector< TH2D * > fh_mvd1cut
Definition: CbmAnaDielectronTask.h:376
CbmAnaDielectronTask::fh_source_pt
std::vector< std::vector< TH1D * > > fh_source_pt
Definition: CbmAnaDielectronTask.h:447
CbmAnaDielectronTask::fh_bg_truematch_minv
std::vector< TH1D * > fh_bg_truematch_minv
Definition: CbmAnaDielectronTask.h:352
CbmLmvmCandidate::fIsMvd1CutElectron
Bool_t fIsMvd1CutElectron
Definition: CbmLmvmCandidate.h:91
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
CbmAnaDielectronTask::RichPmtXY
void RichPmtXY()
Definition: CbmAnaDielectronTask.cxx:1294
CbmAnaDielectronTask::FillCandidates
void FillCandidates()
Definition: CbmAnaDielectronTask.cxx:1633
CbmAnaDielectronTask::fh_gamma_pmtXY
TH2D * fh_gamma_pmtXY
Definition: CbmAnaDielectronTask.h:325
CbmAnaDielectronTask::MvdCutMcDistance
void MvdCutMcDistance()
Definition: CbmAnaDielectronTask.cxx:2691
CbmAnaDielectronTask::fRichPoints
TClonesArray * fRichPoints
Definition: CbmAnaDielectronTask.h:264
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
kPtCut
@ kPtCut
Definition: CbmLmvmHist.h:27
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmAnaDielectronTask::fUseTof
Bool_t fUseTof
Definition: CbmAnaDielectronTask.h:289
CbmLitMCTrackCreator::Instance
static CbmLitMCTrackCreator * Instance()
Singleton instance.
Definition: CbmLitMCTrackCreator.cxx:63
CbmMvdHit::GetStationNr
virtual Int_t GetStationNr() const
Definition: CbmMvdHit.h:61
CbmAnaDielectronTask::SignalAndBgReco
void SignalAndBgReco()
Definition: CbmAnaDielectronTask.cxx:1991
kBg
@ kBg
Definition: CbmLmvmHist.h:10
CbmLmvmCandidate::fRichInd
Int_t fRichInd
Definition: CbmLmvmCandidate.h:76
CbmAnaDielectronTask::CheckClosestMvdHit
void CheckClosestMvdHit(Int_t mvdStationNum, std::vector< TH2D * > &hist, std::vector< TH1D * > &histQa)
Definition: CbmAnaDielectronTask.cxx:2553
CbmLmvmCandidate::fRichAnn
Double_t fRichAnn
Definition: CbmLmvmCandidate.h:93
CbmAnaDielectronTask::fh_vertex_el_gamma_xy
std::vector< TH2D * > fh_vertex_el_gamma_xy
Definition: CbmAnaDielectronTask.h:332
CbmAnaDielectronTask::fh_mvd1xy
std::vector< TH2D * > fh_mvd1xy
Definition: CbmAnaDielectronTask.h:390
CbmLitMCTrackCreator::GetTrack
const CbmLitMCTrack & GetTrack(int mcEventId, int mcId) const
Return CbmLitMCTrack by its index.
Definition: CbmLitMCTrackCreator.h:74
CbmLitGlobalElectronId::GetRichAnn
Double_t GetRichAnn(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:125
CbmAnaDielectronTask::fh_acc_mother_pdg
TH1D * fh_acc_mother_pdg
Definition: CbmAnaDielectronTask.h:320
CbmAnaDielectronTask::fTofHits
TClonesArray * fTofHits
Definition: CbmAnaDielectronTask.h:277
CbmGlobalTrack.h
CbmLitGlobalElectronId::IsTrdElectron
Bool_t IsTrdElectron(Int_t globalTrackindex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:82
CbmAnaDielectronTask::fMvdPoints
TClonesArray * fMvdPoints
Definition: CbmAnaDielectronTask.h:272
ECbmModuleId::kMvd
@ kMvd
Micro-Vertex Detector.
CbmAnaDielectronTask::fTrdTrackMatches
TClonesArray * fTrdTrackMatches
Definition: CbmAnaDielectronTask.h:276
CbmRichRing
Definition: CbmRichRing.h:17
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmAnaDielectronTask::fTTCandidates
std::vector< CbmLmvmCandidate > fTTCandidates
Definition: CbmAnaDielectronTask.h:295
CbmAnaDielectronTask::fh_source_tracks
TH2D * fh_source_tracks
Definition: CbmAnaDielectronTask.h:420
CbmLmvmUtils::IsMcGammaElectron
static Bool_t IsMcGammaElectron(CbmMCTrack *mctrack, TClonesArray *mcTracks)
Definition: CbmLmvmUtils.h:102
CbmAnaDielectronTask::fh_source_bg_minv
std::vector< std::vector< TH1D * > > fh_source_bg_minv
Definition: CbmAnaDielectronTask.h:364
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
CbmAnaDielectronTask::TrackSource
void TrackSource(CbmLmvmCandidate *cand, CbmLmvmAnalysisSteps step, Int_t pdg)
Definition: CbmAnaDielectronTask.cxx:1893
CbmAnaDielectronTask::fMCTracks
TClonesArray * fMCTracks
Definition: CbmAnaDielectronTask.h:261
CbmAnaDielectronTask::fh_piprim_plus_rapidity_mc
TH1D * fh_piprim_plus_rapidity_mc
Definition: CbmAnaDielectronTask.h:468
CbmLmvmCandidate::fTrdMcTrackId
Int_t fTrdMcTrackId
Definition: CbmLmvmCandidate.h:73
CbmRichRing.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmAnaDielectronTask::fCandidates
std::vector< CbmLmvmCandidate > fCandidates
Definition: CbmAnaDielectronTask.h:291
CbmLmvmCuts::fTtCutAngle
Double_t fTtCutAngle
Definition: CbmLmvmCuts.h:116
CbmMatch.h
CbmAnaDielectronTask::fh_pi_mom_rec
TH1D * fh_pi_mom_rec
Definition: CbmAnaDielectronTask.h:454
CbmLmvmKinematicParams::fMinv
Double_t fMinv
Definition: CbmLmvmKinematicParams.h:22
CbmAnaDielectronTask::fh_opening_angle
std::vector< std::vector< TH1D * > > fh_opening_angle
Definition: CbmAnaDielectronTask.h:449
CbmLmvmCandidate::fIsMcPi0Electron
Bool_t fIsMcPi0Electron
Definition: CbmLmvmCandidate.h:81
kRtCut
@ kRtCut
Definition: CbmLmvmHist.h:25
CbmAnaDielectronTask::fh_rtcut_pion
std::vector< TH2D * > fh_rtcut_pion
Definition: CbmAnaDielectronTask.h:385
CbmLmvmCuts::fChiPrimCut
Double_t fChiPrimCut
Definition: CbmLmvmCuts.h:110
CbmLmvmCuts::SetDefaultCuts
void SetDefaultCuts()
Definition: CbmLmvmCuts.h:39
CbmLmvmHist::fNofBgPairSources
static const int fNofBgPairSources
Definition: CbmLmvmHist.h:56
CbmLmvmCuts::fMvd2CutP
Double_t fMvd2CutP
Definition: CbmLmvmCuts.h:122
CbmStsTrack::GetNofHits
virtual Int_t GetNofHits() const
Definition: CbmStsTrack.h:76
CbmMvdHit
Definition: CbmMvdHit.h:29
CbmAnaDielectronTask::fMCEventHeader
FairMCEventHeader * fMCEventHeader
Definition: CbmAnaDielectronTask.h:260
CbmAnaDielectronTask::CheckGammaConvAndPi0
void CheckGammaConvAndPi0()
Definition: CbmAnaDielectronTask.cxx:2145
CbmAnaDielectronTask::SetEnergyAndPlutoParticle
void SetEnergyAndPlutoParticle(const string &energy, const string &particle)
Definition: CbmAnaDielectronTask.cxx:2750
CbmMCTrack::GetCharge
Double_t GetCharge() const
Charge of the associated particle.
Definition: CbmMCTrack.cxx:146
CbmAnaDielectronTask::fh_bg_truematch_notel_minv
std::vector< TH1D * > fh_bg_truematch_notel_minv
Definition: CbmAnaDielectronTask.h:356
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmLmvmCandidate::fTofMcTrackId
Int_t fTofMcTrackId
Definition: CbmLmvmCandidate.h:74
CbmAnaDielectronTask::IsGhost
Bool_t IsGhost(CbmLmvmCandidate *cand)
Definition: CbmAnaDielectronTask.cxx:2360
CbmLitGlobalElectronId::IsRichElectron
Bool_t IsRichElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:52
CbmLmvmHist::fAnaSteps
static const std::vector< std::string > fAnaSteps
Definition: CbmLmvmHist.h:50
CbmLmvmCuts::fRtCutAngle
Double_t fRtCutAngle
Definition: CbmLmvmCuts.h:118
CbmAnaDielectronTask::fh_ttcut_truepair
std::vector< TH2D * > fh_ttcut_truepair
Definition: CbmAnaDielectronTask.h:382
CbmStsTrack::GetNofMvdHits
Int_t GetNofMvdHits() const
Definition: CbmStsTrack.h:84
CbmAnaDielectronTask::fh_nof_charged_particles_acc
TH1D * fh_nof_charged_particles_acc
Definition: CbmAnaDielectronTask.h:317
CbmAnaDielectronTask::CalculateNofTopologyPairs
void CalculateNofTopologyPairs(TH1D *h_nof_pairs, const std::string &source)
Definition: CbmAnaDielectronTask.cxx:2266
CbmAnaDielectronTask::fh_vertex_el_gamma_xz
std::vector< TH2D * > fh_vertex_el_gamma_xz
Definition: CbmAnaDielectronTask.h:330
CbmAnaDielectronTask::fCuts
CbmLmvmCuts fCuts
Definition: CbmAnaDielectronTask.h:307
CbmAnaDielectronTask::CreateAnalysisStepsH1
void CreateAnalysisStepsH1(std::vector< TH1D * > &hist, const std::string &name, const std::string &axisX, const std::string &axisY, double nBins, double min, double max)
Definition: CbmAnaDielectronTask.cxx:79
CbmAnaDielectronTask::fh_source_pairs
TH2D * fh_source_pairs
Definition: CbmAnaDielectronTask.h:412
CbmAnaDielectronTask::fh_mvd1cut_qa
std::vector< TH1D * > fh_mvd1cut_qa
Definition: CbmAnaDielectronTask.h:401
CbmAnaDielectronTask::FillPairHists
void FillPairHists(CbmLmvmCandidate *candP, CbmLmvmCandidate *candM, CbmLmvmKinematicParams *parMc, CbmLmvmKinematicParams *parRec, CbmLmvmAnalysisSteps step)
Definition: CbmAnaDielectronTask.cxx:1951
CbmAnaDielectronTask::fh_ttcut
std::vector< TH2D * > fh_ttcut
Definition: CbmAnaDielectronTask.h:373
CbmLmvmKinematicParams::KinematicParamsWithMcTracks
static CbmLmvmKinematicParams KinematicParamsWithMcTracks(const CbmMCTrack *mctrackP, const CbmMCTrack *mctrackM)
Definition: CbmLmvmKinematicParams.h:29
CbmAnaDielectronTask::fh_piprim_mom_rec_sts_rich_trd_tof
TH1D * fh_piprim_mom_rec_sts_rich_trd_tof
Definition: CbmAnaDielectronTask.h:466
CbmLmvmCuts::fMvd1CutP
Double_t fMvd1CutP
Definition: CbmLmvmCuts.h:120
CbmAnaDielectronTask::fh_tofm2
std::vector< TH2D * > fh_tofm2
Definition: CbmAnaDielectronTask.h:380
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmAnaDielectronTask::fh_nof_rec_pairs_gamma
TH1D * fh_nof_rec_pairs_gamma
Definition: CbmAnaDielectronTask.h:426
CbmAnaDielectronTask::fh_mc_mother_pdg
TH1D * fh_mc_mother_pdg
Definition: CbmAnaDielectronTask.h:319
CbmAnaDielectronTask::fh_piprim_mom_acc
TH1D * fh_piprim_mom_acc
Definition: CbmAnaDielectronTask.h:462
CbmAnaDielectronTask::fh_bg_mismatch_minv
std::vector< TH1D * > fh_bg_mismatch_minv
Definition: CbmAnaDielectronTask.h:358
CbmAnaDielectronTask::PairSource
void PairSource(CbmLmvmCandidate *candP, CbmLmvmCandidate *candM, CbmLmvmAnalysisSteps step, CbmLmvmKinematicParams *parRec)
Definition: CbmAnaDielectronTask.cxx:1819
CbmAnaDielectronTask::fh_mvd2cut_mc_dist_gamma
TH1D * fh_mvd2cut_mc_dist_gamma
Definition: CbmAnaDielectronTask.h:398
CbmAnaDielectronTask::fRTCandidates
std::vector< CbmLmvmCandidate > fRTCandidates
Definition: CbmAnaDielectronTask.h:297
CbmAnaDielectronTask::fh_pi_mom_mc
TH1D * fh_pi_mom_mc
Definition: CbmAnaDielectronTask.h:452
CbmLmvmCuts::fGammaCut
Double_t fGammaCut
Definition: CbmLmvmCuts.h:113
CbmAnaDielectronTask::fh_mvd2cut_qa
std::vector< TH1D * > fh_mvd2cut_qa
Definition: CbmAnaDielectronTask.h:402
CbmAnaDielectronTask::fh_bg_truematch_el_minv
std::vector< TH1D * > fh_bg_truematch_el_minv
Definition: CbmAnaDielectronTask.h:354
CbmAnaDielectronTask::FillNofChargedParticlesPerEvent
void FillNofChargedParticlesPerEvent()
Definition: CbmAnaDielectronTask.cxx:1338
CbmAnaDielectronTask::fh_mvd2cut_mc_dist_pi0
TH1D * fh_mvd2cut_mc_dist_pi0
Definition: CbmAnaDielectronTask.h:399
CbmMCTrack::GetNPoints
Int_t GetNPoints(ECbmModuleId detId) const
Definition: CbmMCTrack.cxx:186
d
double d
Definition: P4_F64vec2.h:24
CbmAnaDielectronTask::IsMcTrackAccepted
Bool_t IsMcTrackAccepted(Int_t mcTrackInd)
Definition: CbmAnaDielectronTask.cxx:1363
CbmAnaDielectronTask::fh_stcut
std::vector< TH2D * > fh_stcut
Definition: CbmAnaDielectronTask.h:374
CbmLmvmCandidate::fTrdInd
Int_t fTrdInd
Definition: CbmLmvmCandidate.h:77
CbmAnaDielectronTask::DifferenceSignalAndBg
void DifferenceSignalAndBg()
Definition: CbmAnaDielectronTask.cxx:2415
CbmAnaDielectronTask::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmAnaDielectronTask.h:269
CbmLmvmCuts::fMvd2CutD
Double_t fMvd2CutD
Definition: CbmLmvmCuts.h:123
CbmAnaDielectronTask::fh_event_number
TH1D * fh_event_number
Definition: CbmAnaDielectronTask.h:415
CbmAnaDielectronTask::SingleParticleAcceptance
void SingleParticleAcceptance()
Definition: CbmAnaDielectronTask.cxx:1373
CbmAnaDielectronTask::fh_eta_minv_pt
std::vector< TH2D * > fh_eta_minv_pt
Definition: CbmAnaDielectronTask.h:347
CbmAnaDielectronTask::fh_source_mom
std::vector< std::vector< TH1D * > > fh_source_mom
Definition: CbmAnaDielectronTask.h:445
CbmAnaDielectronTask::fh_vertex_el_gamma_rz
std::vector< TH2D * > fh_vertex_el_gamma_rz
Definition: CbmAnaDielectronTask.h:333
CbmLmvmCandidate::fIsGamma
Bool_t fIsGamma
Definition: CbmLmvmCandidate.h:86
CbmAnaDielectronTask::fh_mvd1cut_mc_dist_gamma
TH1D * fh_mvd1cut_mc_dist_gamma
Definition: CbmAnaDielectronTask.h:396
CbmLmvmCandidate::fIsStCutElectron
Bool_t fIsStCutElectron
Definition: CbmLmvmCandidate.h:89
CbmAnaDielectronTask::FillRichRingNofHits
void FillRichRingNofHits()
Definition: CbmAnaDielectronTask.cxx:1199
CbmAnaDielectronTask::fh_signal_minv
std::vector< TH1D * > fh_signal_minv
Definition: CbmAnaDielectronTask.h:339
CbmGlobalTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: CbmGlobalTrack.h:39
CbmTrackMatchNew.h
CbmAnaDielectronTask::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmAnaDielectronTask.h:267
CbmVertex
Definition: CbmVertex.h:26
CbmAnaDielectronTask::Finish
virtual void Finish()
Definition: CbmAnaDielectronTask.cxx:2737
CbmAnaDielectronTask::InitHists
void InitHists()
Definition: CbmAnaDielectronTask.cxx:311
CbmAnaDielectronTask::fh_ttcut_pion
std::vector< TH2D * > fh_ttcut_pion
Definition: CbmAnaDielectronTask.h:381
CbmL1PFFitter.h
CbmAnaDielectronTask::fh_mom
std::vector< TH1D * > fh_mom
Definition: CbmAnaDielectronTask.h:370
CbmLmvmCandidate::fIsMcGammaElectron
Bool_t fIsMcGammaElectron
Definition: CbmLmvmCandidate.h:82
CbmAnaDielectronTask::fRichProj
TClonesArray * fRichProj
Definition: CbmAnaDielectronTask.h:263
CbmAnaDielectronTask::fh_trdann
std::vector< TH1D * > fh_trdann
Definition: CbmAnaDielectronTask.h:379
CbmLmvmCandidate::fRichMcTrackId
Int_t fRichMcTrackId
Definition: CbmLmvmCandidate.h:72
CbmAnaDielectronTask::fh_pt
std::vector< TH1D * > fh_pt
Definition: CbmAnaDielectronTask.h:369
CbmAnaDielectronTask::CreateSourceTypesH1
void CreateSourceTypesH1(std::vector< TH1D * > &hist, const std::string &name, const std::string &axisX, const std::string &axisY, double nBins, double min, double max)
Definition: CbmAnaDielectronTask.cxx:121
CbmAnaDielectronTask::fh_piprim_mom_rec
TH1D * fh_piprim_mom_rec
Definition: CbmAnaDielectronTask.h:463
CbmLmvmHist::fSourceTypes
static const std::vector< std::string > fSourceTypes
Definition: CbmLmvmHist.h:45
CbmTrdHit.h
Class for hits in TRD detector.
CbmAnaDielectronTask::fh_nof_mismatches_trd
TH1D * fh_nof_mismatches_trd
Definition: CbmAnaDielectronTask.h:435
CbmAnaDielectronTask::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmAnaDielectronTask.h:280
CbmAnaDielectronTask::fh_mvd2xy
std::vector< TH2D * > fh_mvd2xy
Definition: CbmAnaDielectronTask.h:392
CbmLmvmKinematicParams::fRapidity
Double_t fRapidity
Definition: CbmLmvmKinematicParams.h:21
CbmAnaDielectronTask::fh_nofStsHits
std::vector< TH1D * > fh_nofStsHits
Definition: CbmAnaDielectronTask.h:389
CbmAnaDielectronTask::fh_rtcut
std::vector< TH2D * > fh_rtcut
Definition: CbmAnaDielectronTask.h:375
CbmAnaDielectronTask::fTrdTracks
TClonesArray * fTrdTracks
Definition: CbmAnaDielectronTask.h:274
CbmAnaDielectronTask::fUseTrd
Bool_t fUseTrd
Definition: CbmAnaDielectronTask.h:288
CbmAnaDielectronTask::fh_pi_mom_rec_only_sts
TH1D * fh_pi_mom_rec_only_sts
Definition: CbmAnaDielectronTask.h:455
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
CbmLmvmCuts::fMvd1CutD
Double_t fMvd1CutD
Definition: CbmLmvmCuts.h:121
CbmAnaDielectronTask::fStsHits
TClonesArray * fStsHits
Definition: CbmAnaDielectronTask.h:270
kGamma
@ kGamma
Definition: CbmLmvmHist.h:10
CbmAnaDielectronTask::fh_pi_rapidity_mc
TH1D * fh_pi_rapidity_mc
Definition: CbmAnaDielectronTask.h:458
CbmAnaDielectronTask::fTofHitsMatches
TClonesArray * fTofHitsMatches
Definition: CbmAnaDielectronTask.h:278
CbmAnaDielectronTask::fh_pi0_minv_pt
std::vector< TH2D * > fh_pi0_minv_pt
Definition: CbmAnaDielectronTask.h:348
CbmAnaDielectronTask::fh_nof_mismatches_rich
TH1D * fh_nof_mismatches_rich
Definition: CbmAnaDielectronTask.h:434
CbmLmvmCuts::fPtCut
Double_t fPtCut
Definition: CbmLmvmCuts.h:111
CbmAnaDielectronTask::fh_rtcut_truepair
std::vector< TH2D * > fh_rtcut_truepair
Definition: CbmAnaDielectronTask.h:386
CbmAnaDielectronTask::CheckTopologyCut
void CheckTopologyCut(const std::string &cutName, const std::vector< CbmLmvmCandidate > &cutCandidates, const std::vector< TH2D * > &hcut, const std::vector< TH2D * > &hcutPion, const std::vector< TH2D * > &hcutTruepair, Double_t angleCut, Double_t ppCut)
Definition: CbmAnaDielectronTask.cxx:2168
kReco
@ kReco
Definition: CbmLmvmHist.h:18
CbmLmvmCuts::fRtCutPP
Double_t fRtCutPP
Definition: CbmLmvmCuts.h:119
CbmLmvmCandidate::fMcPdg
Int_t fMcPdg
Definition: CbmLmvmCandidate.h:85
CbmAnaDielectronTask.h
CbmAnaDielectronTask::fWeight
Double_t fWeight
Definition: CbmAnaDielectronTask.h:299
CbmLitGlobalElectronId::IsTofElectron
Bool_t IsTofElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
Definition: CbmLitGlobalElectronId.cxx:99
CbmStsKFTrackFitter::Init
void Init()
Definition: CbmStsKFTrackFitter.cxx:29
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
CbmAnaDielectronTask::FillElPiMomHist
void FillElPiMomHist()
Definition: CbmAnaDielectronTask.cxx:1462
CbmTrdTrack
Definition: CbmTrdTrack.h:22
CbmAnaDielectronTask::CreateAnalysisStepsH2
void CreateAnalysisStepsH2(std::vector< TH2D * > &hist, const std::string &name, const std::string &axisX, const std::string &axisY, const std::string &axisZ, double nBinsX, double minX, double maxX, double nBinsY, double minY, double maxY)
Definition: CbmAnaDielectronTask.cxx:97
ClassImp
ClassImp(CbmAnaDielectronTask)
CbmLmvmCandidate::fChi2Prim
Double_t fChi2Prim
Definition: CbmLmvmCandidate.h:67
CbmLmvmCandidate::fIsMcEtaElectron
Bool_t fIsMcEtaElectron
Definition: CbmLmvmCandidate.h:83
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: CbmMCTrack.cxx:177
CbmLmvmCandidate::fMomentum
TVector3 fMomentum
Definition: CbmLmvmCandidate.h:62
CbmAnaDielectronTask::Init
virtual InitStatus Init()
Definition: CbmAnaDielectronTask.cxx:1021
kMvd1Cut
@ kMvd1Cut
Definition: CbmLmvmHist.h:22
CbmAnaDielectronTask::fh_eta_minv
std::vector< TH1D * > fh_eta_minv
Definition: CbmAnaDielectronTask.h:342
CbmAnaDielectronTask::SetWeight
void SetWeight(Double_t weight)
Definition: CbmAnaDielectronTask.h:478
CbmLitMCTrack
Monte-Carlo track.
Definition: CbmLitMCTrack.h:30
CbmAnaDielectronTask::fh_mvd2cut
std::vector< TH2D * > fh_mvd2cut
Definition: CbmAnaDielectronTask.h:377
CbmMCTrack.h
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
CbmAnaDielectronTask::fh_pi0_pmtXY
TH2D * fh_pi0_pmtXY
Definition: CbmAnaDielectronTask.h:324
CbmAnaDielectronTask::fRandom3
TRandom3 * fRandom3
Definition: CbmAnaDielectronTask.h:303
CbmAnaDielectronTask::CbmAnaDielectronTask
CbmAnaDielectronTask()
Definition: CbmAnaDielectronTask.cxx:163
CbmAnaDielectronTask::fh_mvd2r
std::vector< TH1D * > fh_mvd2r
Definition: CbmAnaDielectronTask.h:393
kMvd2Cut
@ kMvd2Cut
Definition: CbmLmvmHist.h:23
CbmLitMCTrackCreator::TrackExists
bool TrackExists(int mcEventId, int mcId) const
Check whether a track exists in the array.
Definition: CbmLitMCTrackCreator.h:64
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmAnaDielectronTask::fh_nofMvdHits
std::vector< TH1D * > fh_nofMvdHits
Definition: CbmAnaDielectronTask.h:388
CbmLmvmUtils::IsMcSignalElectron
static Bool_t IsMcSignalElectron(CbmMCTrack *mctrack)
Definition: CbmLmvmUtils.h:92
CbmAnaDielectronTask::fh_piprim_mom_rec_sts_rich_trd
TH1D * fh_piprim_mom_rec_sts_rich_trd
Definition: CbmAnaDielectronTask.h:465
CbmAnaDielectronTask::fNofHitsInRingMap
std::map< Int_t, Int_t > fNofHitsInRingMap
Definition: CbmAnaDielectronTask.h:312
CbmLmvmUtils::IsMcPi0Electron
static Bool_t IsMcPi0Electron(CbmMCTrack *mctrack, TClonesArray *mcTracks)
Definition: CbmLmvmUtils.h:120
CbmMvdHit.h
CbmLmvmKinematicParams::KinematicParamsWithCandidates
static CbmLmvmKinematicParams KinematicParamsWithCandidates(const CbmLmvmCandidate *candP, const CbmLmvmCandidate *candM)
Definition: CbmLmvmKinematicParams.h:66
CbmAnaDielectronTask::fKFFitter
CbmStsKFTrackFitter fKFFitter
Definition: CbmAnaDielectronTask.h:282
CbmTofPoint.h
CbmAnaDielectronTask::fh_nof_topology_pairs_pi0
TH1D * fh_nof_topology_pairs_pi0
Definition: CbmAnaDielectronTask.h:423
CbmLmvmCandidate::fIsRtCutElectron
Bool_t fIsRtCutElectron
Definition: CbmLmvmCandidate.h:90
CbmAnaDielectronTask::fh_nof_bg_tracks
TH1D * fh_nof_bg_tracks
Definition: CbmAnaDielectronTask.h:418
CbmAnaDielectronTask::AssignMcToTopologyCandidates
void AssignMcToTopologyCandidates(std::vector< CbmLmvmCandidate > &cutCandidates)
Definition: CbmAnaDielectronTask.cxx:1785
CbmLmvmHist::fNofSourceTypes
static const int fNofSourceTypes
Definition: CbmLmvmHist.h:44
CbmLmvmCandidate::fMcMotherId
Int_t fMcMotherId
Definition: CbmLmvmCandidate.h:70
CbmStsTrack::GetMvdHitIndex
Int_t GetMvdHitIndex(Int_t iHit) const
Definition: CbmStsTrack.h:70
CbmAnaDielectronTask::~CbmAnaDielectronTask
virtual ~CbmAnaDielectronTask()
Definition: CbmAnaDielectronTask.cxx:309
CbmLmvmCuts::fStCutAngle
Double_t fStCutAngle
Definition: CbmLmvmCuts.h:114
CbmAnaDielectronTask::fh_piprim_mom_rec_only_sts
TH1D * fh_piprim_mom_rec_only_sts
Definition: CbmAnaDielectronTask.h:464
kChi2Prim
@ kChi2Prim
Definition: CbmLmvmHist.h:19
CbmLmvmKinematicParams::fMomentumMag
Double_t fMomentumMag
Definition: CbmLmvmKinematicParams.h:19
CbmAnaDielectronTask::fh_bg_minv
std::vector< TH1D * > fh_bg_minv
Definition: CbmAnaDielectronTask.h:340
CbmAnaDielectronTask::fh_chi2prim
std::vector< TH1D * > fh_chi2prim
Definition: CbmAnaDielectronTask.h:372
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmAnaDielectronTask::fh_richann
std::vector< TH1D * > fh_richann
Definition: CbmAnaDielectronTask.h:378
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmAnaDielectronTask::fh_nof_charged_particles
TH1D * fh_nof_charged_particles
Definition: CbmAnaDielectronTask.h:316
CbmLmvmCuts::fStCutPP
Double_t fStCutPP
Definition: CbmLmvmCuts.h:115
CbmLitGlobalElectronId.h
CbmGlobalTrack::GetTofHitIndex
Int_t GetTofHitIndex() const
Definition: CbmGlobalTrack.h:42
CbmAnaDielectronTask::fh_etaprim_rapidity_mc
TH1D * fh_etaprim_rapidity_mc
Definition: CbmAnaDielectronTask.h:471
CbmAnaDielectronTask::Exec
virtual void Exec(Option_t *option)
Definition: CbmAnaDielectronTask.cxx:1156
CbmLmvmCandidate::fIsElectron
Bool_t fIsElectron
Definition: CbmLmvmCandidate.h:79
CbmRichHit.h
CbmTrdTrack.h
CbmAnaDielectronTask::fMvdHits
TClonesArray * fMvdHits
Definition: CbmAnaDielectronTask.h:271
CbmAnaDielectronTask::fh_nof_mismatches_tof
TH1D * fh_nof_mismatches_tof
Definition: CbmAnaDielectronTask.h:436
CbmAnaDielectronTask
Definition: CbmAnaDielectronTask.h:39
CbmAnaDielectronTask::fHistoList
std::vector< TH1 * > fHistoList
Definition: CbmAnaDielectronTask.h:309
CbmAnaDielectronTask::fh_signal_mom
std::vector< TH1D * > fh_signal_mom
Definition: CbmAnaDielectronTask.h:344
CbmAnaDielectronTask::fUseRich
Bool_t fUseRich
Definition: CbmAnaDielectronTask.h:287
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmAnaDielectronTask::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmAnaDielectronTask.h:265
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmAnaDielectronTask::fh_pi0prim_rapidity_mc
TH1D * fh_pi0prim_rapidity_mc
Definition: CbmAnaDielectronTask.h:470
CbmLmvmCandidate::fIsMcSignalElectron
Bool_t fIsMcSignalElectron
Definition: CbmLmvmCandidate.h:80
CbmAnaDielectronTask::fh_nof_ghosts
TH1D * fh_nof_ghosts
Definition: CbmAnaDielectronTask.h:437
CbmAnaDielectronTask::fh_signal_minv_pt
std::vector< TH2D * > fh_signal_minv_pt
Definition: CbmAnaDielectronTask.h:346
CbmAnaDielectronTask::fStsTracks
TClonesArray * fStsTracks
Definition: CbmAnaDielectronTask.h:268
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
kStCut
@ kStCut
Definition: CbmLmvmHist.h:24
kSignal
@ kSignal
Definition: CbmLmvmHist.h:10
CbmAnaDielectronTask::fh_stcut_truepair
std::vector< TH2D * > fh_stcut_truepair
Definition: CbmAnaDielectronTask.h:384
CbmLmvmCandidate::fTofInd
Int_t fTofInd
Definition: CbmLmvmCandidate.h:78
CbmAnaDielectronTask::CreateSourceTypesH2
void CreateSourceTypesH2(std::vector< TH2D * > &hist, const std::string &name, const std::string &axisX, const std::string &axisY, const std::string &axisZ, double nBinsX, double minX, double maxX, double nBinsY, double minY, double maxY)
Definition: CbmAnaDielectronTask.cxx:139
kAcc
@ kAcc
Definition: CbmLmvmHist.h:17
CbmLitGlobalElectronId::GetInstance
static CbmLitGlobalElectronId & GetInstance()
Definition: CbmLitGlobalElectronId.h:32
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmAnaDielectronTask::fh_gamma_minv
std::vector< TH1D * > fh_gamma_minv
Definition: CbmAnaDielectronTask.h:343
CbmAnaDielectronTask::fh_vertex_el_gamma_yz
std::vector< TH2D * > fh_vertex_el_gamma_yz
Definition: CbmAnaDielectronTask.h:331
CbmLmvmCandidate::fStsInd
Int_t fStsInd
Definition: CbmLmvmCandidate.h:75
CbmAnaDielectronTask::IsElectron
void IsElectron(Int_t globalTrackIndex, Double_t momentum, CbmLmvmCandidate *cand)
Definition: CbmAnaDielectronTask.cxx:2367
CbmLmvmKinematicParams
Definition: CbmLmvmKinematicParams.h:17
CbmLmvmKinematicParams::fPt
Double_t fPt
Definition: CbmLmvmKinematicParams.h:20
CbmAnaDielectronTask::fh_chi2sts
std::vector< TH1D * > fh_chi2sts
Definition: CbmAnaDielectronTask.h:371
CbmStsKFTrackFitter.h
CbmRichHit
Definition: CbmRichHit.h:19
CbmLmvmAnalysisSteps
CbmLmvmAnalysisSteps
Definition: CbmLmvmHist.h:15
CbmAnaDielectronTask::fh_mc_signal_mom_angle
TH2D * fh_mc_signal_mom_angle
Definition: CbmAnaDielectronTask.h:314
CbmAnaDielectronTask::fPionMisidLevel
Double_t fPionMisidLevel
Definition: CbmAnaDielectronTask.h:302
CbmLmvmCuts::fTtCutPP
Double_t fTtCutPP
Definition: CbmLmvmCuts.h:117
CbmLmvmCuts::Print
void Print()
Definition: CbmLmvmCuts.h:86
CbmAnaDielectronTask::fh_pi_mom_acc
TH1D * fh_pi_mom_acc
Definition: CbmAnaDielectronTask.h:453
CbmAnaDielectronTask::fh_nof_el_tracks
TH1D * fh_nof_el_tracks
Definition: CbmAnaDielectronTask.h:419
CbmKFVertex
Definition: CbmKFVertex.h:6
CbmStsHit.h
Data class for a reconstructed hit in the STS.
kGammaCut
@ kGammaCut
Definition: CbmLmvmHist.h:21
CbmAnaDielectronTask::fh_stcut_pion
std::vector< TH2D * > fh_stcut_pion
Definition: CbmAnaDielectronTask.h:383
CbmLmvmKinematicParams::fAngle
Double_t fAngle
Definition: CbmLmvmKinematicParams.h:23
CbmAnaDielectronTask::FillTopologyCandidates
void FillTopologyCandidates()
Definition: CbmAnaDielectronTask.cxx:1556
kPi0
@ kPi0
Definition: CbmLmvmHist.h:10
CbmAnaDielectronTask::fRichHits
TClonesArray * fRichHits
Definition: CbmAnaDielectronTask.h:266
CbmAnaDielectronTask::fTofPoints
TClonesArray * fTofPoints
Definition: CbmAnaDielectronTask.h:279
CbmAnaDielectronTask::fh_nof_rec_gamma
TH1D * fh_nof_rec_gamma
Definition: CbmAnaDielectronTask.h:430