CbmRoot
CbmAnaConversion.cxx
Go to the documentation of this file.
1 
10 #include "CbmAnaConversion.h"
11 
12 // includes of CBMROOT classes
13 #include "CbmDrawHist.h"
14 #include "CbmGlobalTrack.h"
15 #include "CbmMCTrack.h"
16 #include "CbmRichHit.h"
17 #include "CbmRichPoint.h"
18 #include "CbmRichRing.h"
19 #include "CbmStsTrack.h"
20 #include "CbmTrackMatchNew.h"
21 #include "FairLogger.h"
22 #include "FairMCPoint.h"
23 #include "FairTrackParam.h"
24 
25 #include "CbmUtils.h"
26 
27 #include "CbmL1PFFitter.h"
28 #include "CbmStsKFTrackFitter.h"
29 #include "L1Field.h"
30 
31 #include "CbmKFParticleFinder.h"
32 #include "CbmKFParticleFinderQA.h"
33 #include "KFParticleTopoReconstructor.h"
34 
35 
36 // includes of standard c++ classes or ROOT classes
37 #include "TCanvas.h"
38 #include "TClonesArray.h"
39 #include "TH1.h"
40 #include "TH1D.h"
41 #include "TH2D.h"
42 #include "TH3.h"
43 #include "TRandom3.h"
44 #include <boost/assign/list_of.hpp>
45 #include <iomanip>
46 #include <iostream>
47 #include <string>
48 
49 
50 // includes of further conversion classes
52 #include "CbmAnaConversionKF.h"
55 #include "CbmAnaConversionReco.h"
57 #include "CbmAnaConversionRich.h"
58 #include "CbmAnaConversionTest.h"
59 #include "CbmAnaConversionTest2.h"
61 
62 
63 #define M2E 2.6112004954086e-7
64 
65 using namespace std;
66 using boost::assign::list_of;
67 
69  : FairTask("CbmAnaConversion")
70  , DoTomography(0)
71  , DoRichAnalysis(0)
72  , DoKFAnalysis(0)
73  , DoReconstruction(0)
74  , DoPhotons(0)
75  , DoPhotons2(0)
76  , DoRecoFull(0)
77  , DoTest(0)
78  , fhPdgCodes(NULL)
79  , fhNofElPrim(NULL)
80  , fhNofElSec(NULL)
81  , fhNofElAll(NULL)
82  , fhElectronSources(NULL)
83  , fhNofPi0_perEvent(NULL)
84  , fhNofPi0_perEvent_cut(NULL)
85  , fhNofPi0_perEvent_cut2(NULL)
86  , fhNofPi0_perEvent_cut3(NULL)
87  , fhNofEta_perEvent(NULL)
88  , fhNofEta_perEvent_cut(NULL)
89  , fhNofEta_perEvent_cut2(NULL)
90  , fhPi0_z(NULL)
91  , fhPi0_z_cut(NULL)
92  , fhPi0_pt(NULL)
93  , fhPi0_pt_vs_rap(NULL)
94  , fhPi0_theta(NULL)
95  , fhPi0_theta_vs_rap(NULL)
96  , fhEta_pt(NULL)
97  , fhEta_pt_vs_rap(NULL)
98  , fhEta_theta(NULL)
99  , fhEta_theta_vs_rap(NULL)
100  , fhRho_pt(NULL)
101  , fhRho_pt_vs_rap(NULL)
102  , fhRho_theta(NULL)
103  , fhRho_theta_vs_rap(NULL)
104  , fhOmega_pt(NULL)
105  , fhOmega_pt_vs_rap(NULL)
106  , fhOmega_theta(NULL)
107  , fhOmega_theta_vs_rap(NULL)
108  , fhElectronsFromPi0_z(NULL)
109  , fhNofTracks_mctrack(NULL)
110  , fhNofTracks_globaltrack(NULL)
111  , fhInvariantMass_test(NULL)
112  , fhInvariantMass_test2(NULL)
113  , fhInvariantMass_test3(NULL)
114  , fhInvariantMassReco_test(NULL)
115  , fhInvariantMassReco_test2(NULL)
116  , fhInvariantMassReco_test3(NULL)
117  , fhInvariantMassReco_pi0(NULL)
118  , fhMomentum_MCvsReco(NULL)
119  , fhMomentum_MCvsReco_diff(NULL)
120  , fhSearchGammas(NULL)
121  , fPrimVertex(NULL)
122  , fKFVertex()
123  , fRichPoints(NULL)
124  , fRichRings(NULL)
125  , fRichRingMatches(NULL)
126  , fMcTracks(NULL)
127  , fStsTracks(NULL)
128  , fStsTrackMatches(NULL)
129  , fGlobalTracks(NULL)
130  , fhANN_output_electrons(NULL)
131  , fhANN_output_electrons2(NULL)
132  , fhANN_output_electrons_chiCut(NULL)
133  , fhANN_output_electrons_vs_p(NULL)
134  , fhANN_output_else(NULL)
135  , fhANN_output_else2(NULL)
136  , fhANN_output_else_chiCut(NULL)
137  , fhANN_output_else_vs_p(NULL)
138  , fEventNum(0)
139  , test(0)
140  , testint(0)
141  , fAnalyseMode(0)
142  , fKFparticle(NULL)
143  , fKFparticleFinderQA(NULL)
144  , fKFtopo(NULL)
145  , trackindexarray()
146  , particlecounter(0)
147  , particlecounter_2daughters(0)
148  , particlecounter_3daughters(0)
149  , particlecounter_4daughters(0)
150  , particlecounter_all(0)
151  , fNofGeneratedPi0_allEvents(0)
152  , fNofPi0_kfparticle_allEvents(0)
153  , fNofGeneratedPi0(0)
154  , fNofPi0_kfparticle(0)
155  , fhPi0Ratio(NULL)
156  , fhPi0_mass(NULL)
157  , fhPi0_NDaughters(NULL)
158  , fHistoList()
159  , fHistoList_MC()
160  , fHistoList_tomography()
161  , fHistoList_reco()
162  , fHistoList_reco_mom()
163  , fHistoList_kfparticle()
164  , fHistoList_richrings()
165  , fHistoList_furtherAnalyses()
166  , fMCTracklist()
167  , fMCTracklist_all()
168  , fRecoTracklist()
169  , fRecoTracklistEPEM()
170  , fRecoTracklistEPEM_id()
171  , fRecoTracklistEPEM_chi()
172  , fRecoTracklistEPEM_gtid()
173  , fTestTracklist()
174  , fTestTracklist_momentum()
175  , fTestTracklist_chi()
176  , fTestTracklist_richInd()
177  , fTestTracklist_ndf()
178  , fTestTracklist_nofhits()
179  , fTestTracklist_noRichInd()
180  , fTestTracklist_noRichInd_MCindex()
181  , fTestTracklist_noRichInd_momentum()
182  , fTestTracklist_noRichInd_chi()
183  , fTestTracklist_noRichInd_richInd()
184  , fTestTracklist_noRichInd_gTrackId()
185  , fTestTracklist_noRichInd_ndf()
186  , fTestTracklist_noRichInd_nofhits()
187  , fRecoMomentum()
188  , fRecoRefittedMomentum()
189  , fhNofElectrons_4epem(NULL)
190  , fhPi0_MC_occurence(NULL)
191  , fhPi0_MC_occurence2(NULL)
192  , fhPi0_Reco_occurence(NULL)
193  , fhPi0_Reco_occurence2(NULL)
194  , fhPi0_Reco_angles(NULL)
195  , fhPi0_Reco_chi(NULL)
196  , fhPi0_Reco_ndf(NULL)
197  , fhPi0_Reco_ndf_vs_chi(NULL)
198  , fhPi0_Reco_ndf_vs_startvertex(NULL)
199  , fhPi0_Reco_startvertex_vs_chi(NULL)
200  , fhPi0_Reco_startvertex_vs_nofhits(NULL)
201  , fhPi0_noRichInd_diffPhi(NULL)
202  , fhPi0_noRichInd_diffTheta(NULL)
203  , fhPi0_Reco_invmass_cases(NULL)
204  , fhPi0_Reco_noRichInd_invmass_cases(NULL)
205  , fhPi0_Reco_invmass(NULL)
206  , fhPi0_Reco_invmass_mc(NULL)
207  , fhPi0_Reco_noRichInd_invmass(NULL)
208  , fhPi0_Reco_noRichInd_invmass_mc(NULL)
209  , fhPi0_Reco_noRichInd_ndf_vs_nofhits(NULL)
210  , fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi(NULL)
211  , fhPi0_Reco_ndf_vs_nofhits(NULL)
212  , fhPi0_Reco_ndf_vs_nofhits_withChi(NULL)
213  , fhPi0_Reco_noRichInd_chi_vs_momentum(NULL)
214  , fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0(NULL)
215  , fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0_Target(NULL)
216  , fhPi0_Reco_noRichInd_chi_vs_momentum_eRest(NULL)
217  , fhPi0_Reco_noRichInd_chi_vs_pt(NULL)
218  , fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0(NULL)
219  , fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0_Target(NULL)
220  , fhPi0_Reco_noRichInd_chi_vs_pt_eRest(NULL)
221  , fhPi0_Reco_chi_vs_momentum(NULL)
222  , fhPi0_Reco_chi_vs_momentum_eFromPi0(NULL)
223  , fhPi0_Reco_chi_vs_momentum_eFromPi0_Target(NULL)
224  , fhPi0_Reco_chi_vs_pt(NULL)
225  , fhPi0_Reco_chi_vs_pt_eFromPi0(NULL)
226  , fhPi0_Reco_chi_vs_pt_eFromPi0_Target(NULL)
227  , timer_all()
228  , fTime_all(0.)
229  , timer_exec()
230  , fTime_exec(0.)
231  , timer_mc()
232  , fTime_mc(0.)
233  , timer_rec()
234  , fTime_rec(0.)
235  , fAnaTomography(NULL)
236  , fAnaRich(NULL)
237  , fAnaKF(NULL)
238  , fAnaReco(NULL)
239  , fAnaPhotons(NULL)
240  , fAnaPhotons2(NULL)
241  , fAnaRecoFull(NULL)
242  , fAnaTest(NULL)
243  , fAnaTest2(NULL) {}
244 
246 
248  //timer_all.Reset();
249  timer_all.Start();
250 
251  cout << "CbmAnaConversion::Init" << endl;
252  FairRootManager* ioman = FairRootManager::Instance();
253  if (NULL == ioman) {
254  Fatal("CbmAnaConversion::Init", "RootManager not instantised!");
255  }
256 
257  fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
258  if (NULL == fRichPoints) {
259  Fatal("CbmAnaConversion::Init", "No RichPoint array!");
260  }
261 
262  fMcTracks = (TClonesArray*) ioman->GetObject("MCTrack");
263  if (NULL == fMcTracks) {
264  Fatal("CbmAnaConversion::Init", "No MCTrack array!");
265  }
266 
267  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
268  if (NULL == fStsTracks) {
269  Fatal("CbmAnaConversion::Init", "No StsTrack array!");
270  }
271 
272  fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
273  if (NULL == fStsTrackMatches) {
274  Fatal("CbmAnaConversion::Init", "No StsTrackMatch array!");
275  }
276 
277  fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
278  if (NULL == fGlobalTracks) {
279  Fatal("CbmAnaConversion::Init", "No GlobalTrack array!");
280  }
281 
282  // Get pointer to PrimaryVertex object from IOManager if it exists
283  // The old name for the object is "PrimaryVertex" the new one
284  // "PrimaryVertex." Check first for the new name
285  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex."));
286  if (nullptr == fPrimVertex) {
287  fPrimVertex = dynamic_cast<CbmVertex*>(ioman->GetObject("PrimaryVertex"));
288  }
289  if (nullptr == fPrimVertex) { LOG(fatal) << "No PrimaryVertex array!"; }
290 
291  fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
292  if (NULL == fRichRings) {
293  Fatal("CbmAnaConversion::Init", "No RichRing array!");
294  }
295 
296  fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
297  if (NULL == fRichRingMatches) {
298  Fatal("CbmAnaConversion::Init", "No RichRingMatch array!");
299  }
300 
301  InitHistograms();
302 
303  particlecounter = 0;
304 
305  testint = 0;
306  test = 0;
307 
310 
311 
312  DoTomography = 1;
313  DoRichAnalysis = 1;
314  DoKFAnalysis = 0;
315  DoReconstruction = 1;
316  DoPhotons = 1;
317  DoPhotons2 = 1;
318  DoRecoFull = 1;
319  DoTest = 1;
320 
321  if (DoTomography) {
323  fAnaTomography->Init();
324  }
325  if (DoRichAnalysis) {
327  fAnaRich->Init();
328  }
329  if (DoKFAnalysis) {
330  fAnaKF = new CbmAnaConversionKF();
332  fAnaKF->Init();
333  }
334  if (DoReconstruction) {
336  fAnaReco->Init();
337  }
338  if (DoPhotons) {
340  fAnaPhotons->Init();
341  }
342  if (DoPhotons2) {
344  fAnaPhotons2->Init();
345  }
346  if (DoRecoFull) {
348  fAnaRecoFull->Init();
349  }
350  if (DoTest) {
352  fAnaTest->Init();
354  fAnaTest2->Init();
355  }
356 
357  timer_all.Stop();
358  fTime_all += timer_all.RealTime();
359 
360  return kSUCCESS;
361 }
362 
364  fHistoList.clear();
365  fHistoList_kfparticle.clear();
367 
368 
369  fhPdgCodes = new TH1D("fhPdfCodes", "fhPdgCodes;pdg code;#", 1000, 0, 1000);
370  fhNofElPrim =
371  new TH1D("fhNofElPrim", "fhNofElPrim;Nof prim El;Entries", 10., -0.5, 9.5);
372  fhNofElSec =
373  new TH1D("fhNofElSec", "fhNofElSec;Nof Sec El;Entries", 20., -0.5, 19.5);
374  fhNofElAll =
375  new TH1D("fhNofElAll", "fhNofElAll;Nof All El;Entries", 30., -0.5, 29.5);
376  fhNofPi0_perEvent = new TH1D("fhNofPi0_perEvent",
377  "fhNofPi0_perEvent;Nof pi0;Entries",
378  1000.,
379  -0.5,
380  999.5);
382  new TH1D("fhNofPi0_perEvent_cut",
383  "fhNofPi0_perEvent_cut (Z<10cm);Nof pi0;Entries",
384  800.,
385  -0.5,
386  799.5);
388  new TH1D("fhNofPi0_perEvent_cut2",
389  "fhNofPi0_perEvent_cut2 (motherId = -1);Nof pi0;Entries",
390  800.,
391  -0.5,
392  799.5);
394  new TH1D("fhNofPi0_perEvent_cut3",
395  "fhNofPi0_perEvent_cut3 (conversion before 70cm);Nof pi0;Entries",
396  100.,
397  -0.5,
398  99.5);
399  fhNofEta_perEvent = new TH1D(
400  "fhNofEta_perEvent", "fhNofEta_perEvent;Nof eta;Entries", 100., -0.5, 99.5);
402  new TH1D("fhNofEta_perEvent_cut",
403  "fhNofEta_perEvent_cut (Z<4cm);Nof eta;Entries",
404  100.,
405  -0.5,
406  99.5);
408  new TH1D("fhNofEta_perEvent_cut2",
409  "fhNofEta_perEvent_cut2 (motherId = -1);Nof eta;Entries",
410  100.,
411  -0.5,
412  99.5);
413  fhPi0_z = new TH1D("fhPi0_z", "fhPi0_z;z in cm;Entries", 600., -0.5, 599.5);
414  fhPi0_z_cut =
415  new TH1D("fhPi0_z_cut", "fhPi0_z_cut;z in cm;Entries", 600., -0.5, 599.5);
416  fhPi0_pt =
417  new TH1D("fhPi0_pt", "fhPi0_pt;p_{t} in GeV/c;Entries", 200., 0., 10.);
418  fhPi0_pt_vs_rap = new TH2D("fhPi0_pt_vs_rap",
419  "fhPi0_pt_vs_rap;p_{t} in GeV/c; rapidity y",
420  240,
421  -2.,
422  10.,
423  270,
424  -2.,
425  7.);
426  fhPi0_theta = new TH1D("fhPi0_theta",
427  "fhPi0_theta;emission angle #theta in deg;Entries",
428  180.,
429  0.,
430  180.);
431  fhPi0_theta_vs_rap = new TH2D("fhPi0_theta_vs_rap",
432  "fhPi0_theta_vs_rap;theta in deg;rapidity y",
433  180.,
434  0.,
435  180.,
436  270,
437  -2.,
438  7.);
439  fhEta_pt =
440  new TH1D("fhEta_pt", "fhEta_pt;p_{t} in GeV;Entries", 200., 0., 10.);
441  fhEta_pt_vs_rap = new TH2D("fhEta_pt_vs_rap",
442  "fhEta_pt_vs_rap;p_{t} in GeV; rapidity y",
443  240,
444  -2.,
445  10.,
446  270,
447  -2.,
448  7.);
449  fhEta_theta = new TH1D("fhEta_theta",
450  "fhEta_theta;emission angle #theta in deg;Entries",
451  180.,
452  0.,
453  180.);
455  new TH2D("fhEta_theta_vs_rap",
456  "fhEta_theta_vs_rap;emission angle #theta in deg;rapidity y",
457  180.,
458  0.,
459  180.,
460  270,
461  -2.,
462  7.);
463  fhRho_pt =
464  new TH1D("fhRho_pt", "fhRho_pt;p_{t} in GeV/c;Entries", 200., 0., 10.);
465  fhRho_pt_vs_rap = new TH2D("fhRho_pt_vs_rap",
466  "fhRho_pt_vs_rap;p_{t} in GeV/c; rapidity y",
467  240,
468  -2.,
469  10.,
470  270,
471  -2.,
472  7.);
473  fhRho_theta = new TH1D("fhRho_theta",
474  "fhRho_theta;emission angle #theta in deg;Entries",
475  180.,
476  0.,
477  180.);
479  new TH2D("fhRho_theta_vs_rap",
480  "fhRho_theta_vs_rap;emission angle #theta in deg;rapidity y",
481  180.,
482  0.,
483  180.,
484  270,
485  -2.,
486  7.);
487  fhOmega_pt =
488  new TH1D("fhOmega_pt", "fhOmega_pt;p_{t} in GeV/c;Entries", 200., 0., 10.);
489  fhOmega_pt_vs_rap = new TH2D("fhOmega_pt_vs_rap",
490  "fhOmega_pt_vs_rap;p_{t} in GeV; rapidity y",
491  240,
492  -2.,
493  10.,
494  270,
495  -2.,
496  7.);
497  fhOmega_theta = new TH1D("fhOmega_theta",
498  "fhOmega_theta;emission angle #theta in deg;Entries",
499  180.,
500  0.,
501  180.);
503  new TH2D("fhOmega_theta_vs_rap",
504  "fhOmega_theta_vs_rap;emission angle #theta in deg;rapidity y",
505  180.,
506  0.,
507  180.,
508  270,
509  -2.,
510  7.);
511 
512 
513  fhElectronSources = new TH1D(
514  "fhElectronSources", "fhElectronSources;Source;Entries", 6., 0., 6.);
516  new TH1D("fhElectronsFromPi0_z",
517  "fhElectronsFromPi0_z (= pos. of gamma conversion);z [cm];Entries",
518  600.,
519  -0.5,
520  599.5);
521  fHistoList.push_back(fhPdgCodes);
522  fHistoList.push_back(fhNofPi0_perEvent);
526  fHistoList.push_back(fhNofEta_perEvent);
529  fHistoList.push_back(fhPi0_z);
530  fHistoList.push_back(fhPi0_z_cut);
531  fHistoList.push_back(fhPi0_pt);
532  fHistoList.push_back(fhPi0_pt_vs_rap);
533  fHistoList.push_back(fhPi0_theta);
534  fHistoList.push_back(fhPi0_theta_vs_rap);
535  fHistoList.push_back(fhEta_pt);
536  fHistoList.push_back(fhEta_pt_vs_rap);
537  fHistoList.push_back(fhEta_theta);
538  fHistoList.push_back(fhEta_theta_vs_rap);
539  fHistoList.push_back(fhRho_pt);
540  fHistoList.push_back(fhRho_pt_vs_rap);
541  fHistoList.push_back(fhRho_theta);
542  fHistoList.push_back(fhRho_theta_vs_rap);
543  fHistoList.push_back(fhOmega_pt);
544  fHistoList.push_back(fhOmega_pt_vs_rap);
545  fHistoList.push_back(fhOmega_theta);
546  fHistoList.push_back(fhOmega_theta_vs_rap);
547  fHistoList.push_back(fhElectronSources);
548  fHistoList.push_back(fhElectronsFromPi0_z);
549 
550  fhElectronSources->GetXaxis()->SetBinLabel(1, "gamma");
551  fhElectronSources->GetXaxis()->SetBinLabel(2, "pi0");
552  fhElectronSources->GetXaxis()->SetBinLabel(3, "eta");
553  fhElectronSources->GetXaxis()->SetBinLabel(4, "else");
554  fhElectronSources->GetXaxis()->SetBinLabel(5, "gamma from pi0");
555  fhElectronSources->GetXaxis()->SetBinLabel(6, "gamma from eta");
556 
557 
558  fhNofTracks_mctrack = new TH1D(
559  "fhNofTracks_mctrack", "fhNofTracks_mctrack;nof;#", 1000., 0., 1000.);
560  fHistoList.push_back(fhNofTracks_mctrack);
561  fhNofTracks_globaltrack = new TH1D("fhNofTracks_globaltrack",
562  "fhNofTracks_globaltrack;nof;#",
563  1000.,
564  0.,
565  1000.);
567 
568 
569  // for UrQMD events (invariant mass from pi0 -> gamma + gamma
571  new TH1D("fhInvariant", "fhInvariant;mass in GeV/c^{2}];#", 2000, 0., 2.);
573  new TH1D("fhInvariant2", "fhInvariant2;mass in GeV/c^{2}];#", 2000, 0., 2.);
575  new TH1D("fhInvariant3", "fhInvariant3;mass in GeV/c^{2}];#", 2000, 0., 2.);
576  fHistoList.push_back(fhInvariantMass_test);
579 
580  fhInvariantMassReco_test = new TH1D(
581  "fhInvariantReco", "fhInvariantReco;mass [GeV/c^2];#", 2000, 0., 2.);
582  fhInvariantMassReco_test2 = new TH1D(
583  "fhInvariantReco2", "fhInvariantReco2;mass [GeV/c^2];#", 2000, 0., 2.);
584  fhInvariantMassReco_test3 = new TH1D(
585  "fhInvariantReco3", "fhInvariantReco3;mass [GeV/c^2];#", 2000, 0., 2.);
589 
590  fhInvariantMassReco_pi0 = new TH1D("fhInvariantReco_pi0",
591  "fhInvariantReco_pi0;mass [GeV/c^2];#",
592  2000,
593  0.,
594  2.);
596 
597 
598  // for reconstructed tracks
599  fhMomentum_MCvsReco = new TH2D("fhMomentum_MCvsReco",
600  "fhMomentum_MCvsReco;MC;Reco",
601  400,
602  0.,
603  40.,
604  400,
605  0.,
606  40.);
607  fhMomentum_MCvsReco_diff = new TH1D("fhMomentum_MCvsReco_diff",
608  "fhMomentum_MCvsReco_diff;(MC-Reco)/MC",
609  500,
610  -0.01,
611  4.);
612  fHistoList.push_back(fhMomentum_MCvsReco);
614 
615 
617  new TH1D("fhSearchGammas", "fhSearchGammas;mass;#", 100, -0.005, 0.995);
618  fHistoList.push_back(fhSearchGammas);
619 
620 
621  fhANN_output_electrons = new TH1D(
622  "fhANN_output_electrons", "fhANN_output_electrons;ann output", 400, -2, 2.);
623  fhANN_output_electrons2 = new TH1D("fhANN_output_electrons2",
624  "fhANN_output_electrons2;ann output",
625  400,
626  -2,
627  2.);
629  new TH1D("fhANN_output_electrons_chiCut",
630  "fhANN_output_electrons_chiCut;ann output",
631  400,
632  -2,
633  2.);
635  new TH2D("fhANN_output_electrons_vs_p",
636  "fhANN_output_electrons_vs_p;momentum in GeV/c; ann output",
637  100,
638  0.,
639  10.,
640  400,
641  -2,
642  2.);
644  new TH1D("fhANN_output_else", "fhANN_output_else;ann output", 400, -2, 2.);
645  fhANN_output_else2 = new TH1D(
646  "fhANN_output_else2", "fhANN_output_else2;ann output", 400, -2, 2.);
647  fhANN_output_else_chiCut = new TH1D("fhANN_output_else_chiCut",
648  "fhANN_output_else_chiCut;ann output",
649  400,
650  -2,
651  2.);
653  new TH2D("fhANN_output_else_vs_p",
654  "fhANN_output_else_vs_p;momentum in GeV/c; ann output",
655  100,
656  0.,
657  10.,
658  400,
659  -2,
660  2.);
665  fHistoList.push_back(fhANN_output_else);
666  fHistoList.push_back(fhANN_output_else2);
669 
670 
671  // #############################################
672  // Histograms related to KFParticle results
673  fhPi0_NDaughters = new TH1D(
674  "fhPi0_NDaughters", "fhPi0_NDaughters;number of daughers;#", 4, 0.5, 4.5);
675  fhPi0Ratio = new TH1D("fhPi0Ratio", "fhPi0Ratio; ratio;#", 1000, 0., 0.02);
676  fhPi0_mass = new TH1D("fhPi0_mass", "fhPi0_mass;mass;#", 500, 0., 0.5);
680 
681 
683  new TH1D("fhNofElectrons_4epem",
684  "fhNofElectrons_4epem;number of electrons per event;#",
685  101,
686  -0.5,
687  100.5);
688  fHistoList.push_back(fhNofElectrons_4epem);
689 
691  new TH1D("fhPi0_MC_occurence", "fhPi0_MC_occurence;;#", 20, 0, 20);
693  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(1, "== -1: all pi0 from target");
694  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(2, "all pi0 -> gg");
695  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(3, "all g -> e+e-");
696  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(4, "both conv before 70cm");
697  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(5, "both conv in target");
698  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(6, "...");
699  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(7,
700  "!= -1: all pi0 not from target");
701  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(8, "all pi0 -> gg");
702  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(9, "all g -> e+e-");
703  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(10, "both conv before 70cm");
704  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(11, "both conv in target");
705  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(12, "...");
706  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(13, "daughters == 0");
707  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(14, "daughters == 1");
708  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(15, "daughters == 2");
709  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(16, "daughters == 3");
710  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(17, "daughters == 4");
711  fhPi0_MC_occurence->GetXaxis()->SetBinLabel(18, "daughters > 4");
712 
714  new TH1D("fhPi0_MC_occurence2", "fhPi0_MC_occurence2;;#", 20, 0, 20);
716  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(
717  1, "!= -1: all pi0 not from target");
718  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(2, "all pi0 -> gg");
719  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(3, "all g -> e+e-");
720  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(4, "both conv before 70cm");
721  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(5, "both conv in target");
722  fhPi0_MC_occurence2->GetXaxis()->SetBinLabel(6, "...");
723 
725  new TH1D("fhPi0_Reco_occurence", "fhPi0_Reco_occurence;;#", 16, 0, 16);
727  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(1, "4 e from pi0 (not same)");
728  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(2, "test");
729  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(3, "x 1 e from same pi0");
730  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(4, "x 2 e from same pi0");
731  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(5, "x 3 e from same pi0");
732  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(6, "x 4 e from same pi0");
733  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(7, "x >4 e from same pi0");
734  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(8, "...");
735  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(9, "==4, within cuts");
736  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(10, "==4, chi-check");
737  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(11, "==4, chi+cuts");
738  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(12, "richInd: ==1");
739  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(13, "richInd: ==2");
740  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(14, "richInd: ==3");
741  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(15, "richInd: ==4");
742  fhPi0_Reco_occurence->GetXaxis()->SetBinLabel(16, "richInd: >4");
743 
745  new TH1D("fhPi0_Reco_occurence2", "fhPi0_Reco_occurence2;;#", 16, 0, 16);
747  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(1, "4 e from pi0 (not same)");
748  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(2, "test");
749  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(3, "x 1 e from same pi0");
750  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(4, "x 2 e from same pi0");
751  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(5, "x 3 e from same pi0");
752  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(6, "x 4 e from same pi0");
753  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(7, "x >4 e from same pi0");
754  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(8, "...");
755  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(9, "==4, within cuts");
756  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(10, "==4, chi-check");
757  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(11, "==4, chi+cuts");
758  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(12, "...");
759  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(13, "...");
760  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(14, "...");
761  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(15, "...");
762  fhPi0_Reco_occurence2->GetXaxis()->SetBinLabel(16, "...");
763 
764 
766  new TH1D("fhPi0_Reco_angles", "fhPi0_Reco_angles;angle;#", 500, 0, 50);
769  new TH1D("fhPi0_Reco_chi", "fhPi0_Reco_chi;chi;#", 500, 0, 500);
772  new TH1D("fhPi0_Reco_ndf", "fhPi0_Reco_ndf;ndf;#", 500, 0, 50);
774  fhPi0_Reco_ndf_vs_chi = new TH2D("fhPi0_Reco_ndf_vs_chi",
775  "fhPi0_Reco_ndf_vs_chi;ndf;chi",
776  51,
777  -0.5,
778  50.5,
779  500,
780  0,
781  50);
784  new TH2D("fhPi0_Reco_ndf_vs_startvertex",
785  "fhPi0_Reco_ndf_vs_startvertex;ndf;startvertex",
786  51,
787  -0.5,
788  50.5,
789  101,
790  -0.5,
791  100.5);
794  new TH2D("fhPi0_Reco_startvertex_vs_chi",
795  "fhPi0_Reco_startvertex_vs_chi;startvertex;chi",
796  101,
797  -0.5,
798  100.5,
799  100,
800  0,
801  100);
804  new TH2D("fhPi0_Reco_startvertex_vs_nofhits",
805  "fhPi0_Reco_startvertex_vs_nofhits;startvertex;nofhits",
806  101,
807  -0.5,
808  100.5,
809  21,
810  -0.5,
811  20.5);
813  fhPi0_noRichInd_diffPhi = new TH1D("fhPi0_noRichInd_diffPhi",
814  "fhPi0_noRichInd_diffPhi;phi difference;#",
815  150,
816  0,
817  150);
820  new TH1D("fhPi0_noRichInd_diffTheta",
821  "fhPi0_noRichInd_diffTheta;theta difference;#",
822  150,
823  0,
824  150);
826 
828  new TH2D("fhPi0_Reco_invmass_cases",
829  "fhPi0_Reco_invmass_cases;cases;invmass [GeV]",
830  6,
831  0,
832  6,
833  300,
834  0,
835  3);
837  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(1, "..");
838  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(2, "no cuts");
839  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(3, "only chi");
840  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(4, "only cuts");
841  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(5, "both");
842  fhPi0_Reco_invmass_cases->GetXaxis()->SetBinLabel(6, "mc-true");
844  new TH2D("fhPi0_Reco_noRichInd_invmass_cases",
845  "fhPi0_Reco_noRichInd_invmass_cases;cases;invmass in GeV^{2}",
846  11,
847  0,
848  11,
849  300,
850  0,
851  3);
853  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(1, "..");
854  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(2, "no cuts");
855  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(3, "only chi");
856  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(4, "only cuts");
857  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(5, "both");
858  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(6, "mc-true");
859  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(
860  7, "richInd-no cuts");
861  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(8, "richInd-chi");
862  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(9,
863  "richInd-cuts");
864  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(10,
865  "richInd-both");
866  fhPi0_Reco_noRichInd_invmass_cases->GetXaxis()->SetBinLabel(11,
867  "richInd-mctrue");
868 
869  fhPi0_Reco_invmass = new TH1D(
870  "fhPi0_Reco_invmass", "fhPi0_Reco_invmass;invmass [GeV];#", 300, 0, 3);
872  fhPi0_Reco_invmass_mc = new TH1D("fhPi0_Reco_invmass_mc",
873  "fhPi0_Reco_invmass_mc;invmass_mc [GeV];#",
874  300,
875  0,
876  3);
879  new TH1D("fhPi0_Reco_noRichInd_invmass",
880  "fhPi0_Reco_noRichInd_invmass;invmass_noRichInd [GeV];#",
881  300,
882  0,
883  3);
886  new TH1D("fhPi0_Reco_noRichInd_invmass_mc",
887  "fhPi0_Reco_noRichInd_invmass_mc;invmass_noRichInd_mc [GeV];#",
888  300,
889  0,
890  3);
892 
894  new TH2D("fhPi0_Reco_noRichInd_ndf_vs_nofhits",
895  "fhPi0_Reco_noRichInd_ndf_vs_nofhits;ndf;nofhits",
896  31,
897  -0.5,
898  30.5,
899  21,
900  -0.5,
901  20.5);
903  fhPi0_Reco_ndf_vs_nofhits = new TH2D("fhPi0_Reco_ndf_vs_nofhits",
904  "fhPi0_Reco_ndf_vs_nofhits;ndf;nofhits",
905  31,
906  -0.5,
907  30.5,
908  21,
909  -0.5,
910  20.5);
913  new TH2D("fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi",
914  "fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi;ndf;nofhits",
915  31,
916  -0.5,
917  30.5,
918  21,
919  -0.5,
920  20.5);
921  fHistoList_furtherAnalyses.push_back(
924  new TH2D("fhPi0_Reco_ndf_vs_nofhits_withChi",
925  "fhPi0_Reco_ndf_vs_nofhits_withChi;ndf;nofhits",
926  31,
927  -0.5,
928  30.5,
929  21,
930  -0.5,
931  20.5);
933 
934 
935  // ################################################
936 
938  new TH2D("fhPi0_Reco_noRichInd_chi_vs_momentum",
939  "fhPi0_Reco_noRichInd_chi_vs_momentum;momentum [GeV];#chi^{2} of "
940  "momentum fit",
941  200,
942  0.,
943  10.,
944  1000,
945  0.,
946  100.);
949  new TH2D("fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0",
950  "fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0;momentum "
951  "[GeV];#chi^{2} of momentum fit",
952  200,
953  0.,
954  10.,
955  1000,
956  0.,
957  100.);
958  fHistoList_furtherAnalyses.push_back(
961  new TH2D("fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0_Target",
962  "fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0_Target;momentum "
963  "[GeV];#chi^{2} of momentum fit",
964  200,
965  0.,
966  10.,
967  1000,
968  0.,
969  100.);
970  fHistoList_furtherAnalyses.push_back(
973  new TH2D("fhPi0_Reco_noRichInd_chi_vs_momentum_eRest",
974  "fhPi0_Reco_noRichInd_chi_vs_momentum_eRest;momentum "
975  "[GeV];#chi^{2} of momentum fit",
976  200,
977  0.,
978  10.,
979  1000,
980  0.,
981  100.);
982  fHistoList_furtherAnalyses.push_back(
984 
986  new TH2D("fhPi0_Reco_noRichInd_chi_vs_pt",
987  "fhPi0_Reco_noRichInd_chi_vs_pt;pt [GeV];#chi^{2} of momentum fit",
988  200,
989  0.,
990  10.,
991  1000,
992  0.,
993  100.);
996  "fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0",
997  "fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0;pt [GeV];#chi^{2} of momentum fit",
998  200,
999  0.,
1000  10.,
1001  1000,
1002  0.,
1003  100.);
1006  new TH2D("fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0_Target",
1007  "fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0_Target;pt [GeV];#chi^{2} "
1008  "of momentum fit",
1009  200,
1010  0.,
1011  10.,
1012  1000,
1013  0.,
1014  100.);
1015  fHistoList_furtherAnalyses.push_back(
1018  "fhPi0_Reco_noRichInd_chi_vs_pt_eRest",
1019  "fhPi0_Reco_noRichInd_chi_vs_pt_eRest;pt [GeV];#chi^{2} of momentum fit",
1020  200,
1021  0.,
1022  10.,
1023  1000,
1024  0.,
1025  100.);
1027 
1028 
1029  // ################################################
1030 
1031  fhPi0_Reco_chi_vs_momentum = new TH2D(
1032  "fhPi0_Reco_chi_vs_momentum",
1033  "fhPi0_Reco_chi_vs_momentum;momentum [GeV];#chi^{2} of momentum fit",
1034  200,
1035  0.,
1036  10.,
1037  1000,
1038  0.,
1039  100.);
1042  new TH2D("fhPi0_Reco_chi_vs_momentum_eFromPi0",
1043  "fhPi0_Reco_chi_vs_momentum_eFromPi0;momentum [GeV];#chi^{2} of "
1044  "momentum fit",
1045  200,
1046  0.,
1047  10.,
1048  1000,
1049  0.,
1050  100.);
1053  new TH2D("fhPi0_Reco_chi_vs_momentum_eFromPi0_Target",
1054  "fhPi0_Reco_chi_vs_momentum_eFromPi0_Target;momentum "
1055  "[GeV];#chi^{2} of momentum fit",
1056  200,
1057  0.,
1058  10.,
1059  1000,
1060  0.,
1061  100.);
1062  fHistoList_furtherAnalyses.push_back(
1064 
1066  new TH2D("fhPi0_Reco_chi_vs_pt",
1067  "fhPi0_Reco_chi_vs_pt;pt [GeV];#chi^{2} of momentum fit",
1068  200,
1069  0.,
1070  10.,
1071  1000,
1072  0.,
1073  100.);
1076  new TH2D("fhPi0_Reco_chi_vs_pt_eFromPi0",
1077  "fhPi0_Reco_chi_vs_pt_eFromPi0;pt [GeV];#chi^{2} of momentum fit",
1078  200,
1079  0.,
1080  10.,
1081  1000,
1082  0.,
1083  100.);
1086  "fhPi0_Reco_chi_vs_pt_eFromPi0_Target",
1087  "fhPi0_Reco_chi_vs_pt_eFromPi0_Target;pt [GeV];#chi^{2} of momentum fit",
1088  200,
1089  0.,
1090  10.,
1091  1000,
1092  0.,
1093  100.);
1095 }
1096 
1097 
1098 void CbmAnaConversion::Exec(Option_t*) {
1099  timer_exec.Start();
1100  timer_all.Start();
1101 
1102 
1103  cout
1104  << "======================================================================="
1105  << endl;
1106  cout << "========== CbmAnaConversion, event No. " << fEventNum << endl;
1107  cout
1108  << "======================================================================="
1109  << endl;
1110 
1111  fEventNum++;
1112 
1113  fNofGeneratedPi0 = 0;
1114  fNofPi0_kfparticle = 0;
1115 
1116 
1117  // arrays of tracks
1118  fMCTracklist.clear();
1119  fMCTracklist_all.clear();
1120  fRecoTracklist.clear();
1121  fRecoTracklistEPEM.clear();
1122  fRecoTracklistEPEM_id.clear();
1123  fRecoTracklistEPEM_chi.clear();
1124  fRecoTracklistEPEM_gtid.clear();
1125  fRecoMomentum.clear();
1126  fRecoRefittedMomentum.clear();
1127 
1128  fTestTracklist.clear();
1129  fTestTracklist_momentum.clear();
1130  fTestTracklist_chi.clear();
1131  fTestTracklist_richInd.clear();
1132  fTestTracklist_ndf.clear();
1133  fTestTracklist_nofhits.clear();
1134 
1135  fTestTracklist_noRichInd.clear();
1143 
1144  // several counters
1145  int countPrimEl = 0;
1146  int countSecEl = 0;
1147  int countAllEl = 0;
1148  // int countGammaEl = 0;
1149  // int countMothers = 0;
1150  int countPrimPart = 0;
1151  int countPi0MC = 0;
1152  int countPi0MC_cut = 0;
1153  int countPi0MC_fromPrimary = 0;
1154  int countPi0MC_reconstructible = 0;
1155  int countEtaMC = 0;
1156  int countEtaMC_cut = 0;
1157  int countEtaMC_fromPrimary = 0;
1158 
1159  if (fPrimVertex != NULL) {
1161  } else {
1162  Fatal("CbmAnaConversion::Exec", "No PrimaryVertex array!");
1163  }
1164 
1165  if (DoKFAnalysis) {
1166  // fAnaKF->SetSignalIds(fKFparticleFinderQA->GetSignalIds());
1167  // fAnaKF->SetGhostIds(fKFparticleFinderQA->GetGhostIds());
1168  fAnaKF->Exec();
1169  }
1170 
1172 
1173  if (DoPhotons) { fAnaPhotons->Exec(); }
1174 
1175  if (DoPhotons2) { fAnaPhotons2->Exec(); }
1176 
1177  if (DoRecoFull) { fAnaRecoFull->Exec(); }
1178 
1179  if (DoTomography) {
1180  fAnaTomography->Exec(); // analyse gamma-conversions with MC data
1181  }
1182 
1183  if (DoTest) {
1184  fAnaTest->Exec();
1185  fAnaTest2->Exec();
1186  }
1187 
1188  // ========================================================================================
1189  // START - Analyse MC tracks
1190  timer_mc.Start();
1191 
1192  Int_t nofMcTracks = fMcTracks->GetEntriesFast();
1193  fhNofTracks_mctrack->Fill(nofMcTracks);
1194  for (int i = 0; i < nofMcTracks; i++) {
1195  CbmMCTrack* mctrack = (CbmMCTrack*) fMcTracks->At(i);
1196  if (mctrack == NULL) continue;
1197 
1198  FillMCTracklists(mctrack, i); // fill tracklists for further analyses
1199 
1200  fhPdgCodes->Fill(TMath::Abs(mctrack->GetPdgCode()));
1201 
1202  if (mctrack->GetMotherId() == -1) { countPrimPart++; }
1203  if (mctrack->GetMotherId() == -1
1204  && TMath::Abs(mctrack->GetPdgCode()) == 11) {
1205  countPrimEl++;
1206  }
1207  if (mctrack->GetMotherId() != -1
1208  && TMath::Abs(mctrack->GetPdgCode()) == 11) {
1209  countSecEl++;
1210  }
1211  if (TMath::Abs(mctrack->GetPdgCode()) == 11) { countAllEl++; }
1212 
1213 
1214  if (mctrack->GetPdgCode() == 111) { // particle is pi0
1215  countPi0MC++;
1216  TVector3 v;
1217  mctrack->GetStartVertex(v);
1218  if (v.Z() <= 4) { countPi0MC_cut++; }
1219  fhPi0_z->Fill(v.Z());
1220  //Double_t r2 = v.Z()*v.Z() * tan(25./180*TMath::Pi()) * tan(25./180*TMath::Pi());
1221  //if( (v.X()*v.X() + v.Y()*v.Y()) <= r2) {
1222  // fhPi0_z_cut->Fill(v.Z());
1223  //}
1224 
1225 
1226  TVector3 momentum;
1227  mctrack->GetMomentum(momentum);
1228 
1229  int motherId = mctrack->GetMotherId();
1230  if (motherId == -1) {
1231  countPi0MC_fromPrimary++;
1232  fhPi0_pt->Fill(mctrack->GetPt());
1233  fhPi0_pt_vs_rap->Fill(mctrack->GetPt(), mctrack->GetRapidity());
1234  fhPi0_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
1235  fhPi0_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(),
1236  mctrack->GetRapidity());
1237  fhPi0_z_cut->Fill(v.Z());
1238  }
1239 
1240  Bool_t reconstructible = AnalysePi0_MC(mctrack, i);
1241  if (reconstructible) countPi0MC_reconstructible++;
1242  }
1243 
1244 
1245  if (TMath::Abs(mctrack->GetPdgCode()) == 221) { // particle is eta
1246  countEtaMC++;
1247  TVector3 v, momentum;
1248  mctrack->GetStartVertex(v);
1249  mctrack->GetMomentum(momentum);
1250 
1251  if (v.Z() <= 4) { countEtaMC_cut++; }
1252  int motherId = mctrack->GetMotherId();
1253  if (motherId == -1) {
1254  countEtaMC_fromPrimary++;
1255  fhEta_pt->Fill(mctrack->GetPt());
1256  fhEta_pt_vs_rap->Fill(mctrack->GetPt(), mctrack->GetRapidity());
1257  fhEta_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
1258  fhEta_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(),
1259  mctrack->GetRapidity());
1260  }
1261  }
1262 
1263 
1264  if (TMath::Abs(mctrack->GetPdgCode()) == 113
1265  || TMath::Abs(mctrack->GetPdgCode())
1266  == 213) { // particle is rho(770)^0 or rho^+/-
1267  TVector3 v, momentum;
1268  mctrack->GetStartVertex(v);
1269  mctrack->GetMomentum(momentum);
1270 
1271  //if (v.Z() <= 1) {
1272  fhRho_pt->Fill(mctrack->GetPt());
1273  fhRho_pt_vs_rap->Fill(mctrack->GetPt(), mctrack->GetRapidity());
1274  fhRho_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
1275  fhRho_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(),
1276  mctrack->GetRapidity());
1277  //}
1278  }
1279 
1280 
1281  if (TMath::Abs(mctrack->GetPdgCode()) == 223
1282  || TMath::Abs(mctrack->GetPdgCode())
1283  == 3334) { // particle is omega(782)^0 or omega^+/-
1284  TVector3 v, momentum;
1285  mctrack->GetStartVertex(v);
1286  mctrack->GetMomentum(momentum);
1287 
1288  //if (v.Z() <= 1) {
1289  fhOmega_pt->Fill(mctrack->GetPt());
1290  fhOmega_pt_vs_rap->Fill(mctrack->GetPt(), mctrack->GetRapidity());
1291  fhOmega_theta->Fill(momentum.Theta() * 180. / TMath::Pi());
1292  fhOmega_theta_vs_rap->Fill(momentum.Theta() * 180. / TMath::Pi(),
1293  mctrack->GetRapidity());
1294  //}
1295  }
1296 
1297  if (TMath::Abs(mctrack->GetPdgCode()) == 11) { // particle is electron
1298  AnalyseElectrons(mctrack);
1299  }
1300  }
1301 
1302 
1303  cout << "CbmAnaConversion::Exec - Number of pi0 in MC sample: " << countPi0MC
1304  << endl;
1305  cout << "CbmAnaConversion::Exec - Number of pi0 from primary: "
1306  << countPi0MC_fromPrimary << endl;
1307  fhNofPi0_perEvent->Fill(countPi0MC);
1308  fhNofPi0_perEvent_cut->Fill(countPi0MC_cut);
1309  fhNofPi0_perEvent_cut2->Fill(countPi0MC_fromPrimary);
1310  fhNofPi0_perEvent_cut3->Fill(countPi0MC_reconstructible);
1311  fhNofEta_perEvent->Fill(countEtaMC);
1312  fhNofEta_perEvent_cut->Fill(countEtaMC_cut);
1313  fhNofEta_perEvent_cut2->Fill(countEtaMC_fromPrimary);
1314 
1315  fNofGeneratedPi0 = countPi0MC_fromPrimary;
1319 
1321 
1322  if (DoReconstruction) {
1324  //fAnaReco->InvariantMassMC_all();
1325  }
1326 
1327  ReconstructGamma();
1328 
1329 
1330  fhNofElPrim->Fill(countPrimEl);
1331  fhNofElSec->Fill(countSecEl);
1332  fhNofElAll->Fill(countAllEl);
1333 
1334 
1335  // END - Analyse MC tracks
1336  // ========================================================================================
1337  timer_mc.Stop();
1338  fTime_mc += timer_mc.RealTime();
1339 
1340 
1341  // ========================================================================================
1342  // START - Analyse reconstructed tracks
1343  timer_rec.Start();
1344 
1345  Int_t nofElectrons4epem = 0;
1346 
1347  Int_t ngTracks = fGlobalTracks->GetEntriesFast();
1348  fhNofTracks_globaltrack->Fill(ngTracks);
1349  for (Int_t iGTrack = 0; iGTrack < ngTracks; iGTrack++) {
1350  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(iGTrack);
1351  if (NULL == gTrack) continue;
1352  int stsInd = gTrack->GetStsTrackIndex();
1353  int richInd = gTrack->GetRichRingIndex();
1354  // int trdInd = gTrack->GetTrdTrackIndex();
1355  // int tofInd = gTrack->GetTofHitIndex();
1356 
1357  if (stsInd < 0) continue;
1358  CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsInd);
1359  if (stsTrack == NULL) continue;
1360  CbmTrackMatchNew* stsMatch =
1361  (CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
1362  if (stsMatch == NULL) continue;
1363  if (stsMatch->GetNofLinks() <= 0) continue;
1364  int stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
1365  if (stsMcTrackId < 0) continue;
1366  CbmMCTrack* mcTrack1 = (CbmMCTrack*) fMcTracks->At(stsMcTrackId);
1367  if (mcTrack1 == NULL) continue;
1368 
1369 
1370  // calculate refitted momenta at primary vertex
1371  TVector3 refittedMomentum;
1372  CbmL1PFFitter fPFFitter;
1373  vector<CbmStsTrack> stsTracks;
1374  stsTracks.resize(1);
1375  stsTracks[0] = *stsTrack;
1376  vector<L1FieldRegion> vField;
1377  vector<float> chiPrim;
1378  fPFFitter.GetChiToVertex(stsTracks, vField, chiPrim, fKFVertex, 3e6);
1379  //cand.chi2sts = stsTracks[0].GetChiSq() / stsTracks[0].GetNDF();
1380  //cand.chi2Prim = chiPrim[0];
1381  const FairTrackParam* vtxTrack = stsTracks[0].GetParamFirst();
1382  vtxTrack->Momentum(refittedMomentum);
1383  float result_chi = chiPrim[0];
1384 
1385 
1386  // Doing refit of momenta with electron assumption
1387  CbmL1PFFitter fPFFitter_electron;
1388  vector<CbmStsTrack> stsTracks_electron;
1389  stsTracks_electron.resize(1);
1390  stsTracks_electron[0] = *stsTrack;
1391  vector<L1FieldRegion> vField_electron;
1392  vector<float> chiPrim_electron;
1393  vector<int> pidHypo_electron;
1394  pidHypo_electron.push_back(11);
1395  fPFFitter_electron.Fit(stsTracks_electron, pidHypo_electron);
1396  fPFFitter_electron.GetChiToVertex(
1397  stsTracks_electron, vField_electron, chiPrim_electron, fKFVertex, 3e6);
1398 
1399  TVector3 refittedMomentum_electron;
1400  const FairTrackParam* vtxTrack_electron =
1401  stsTracks_electron[0].GetParamFirst();
1402  vtxTrack_electron->Momentum(refittedMomentum_electron);
1403  float result_chi_electron = chiPrim_electron[0];
1404  float result_ndf_electron = stsTracks_electron[0].GetNDF();
1405 
1406 
1407  Double_t startvertexZ = vtxTrack_electron->GetZ();
1408  fhPi0_Reco_ndf->Fill(result_ndf_electron);
1409  fhPi0_Reco_chi->Fill(result_chi_electron);
1410  fhPi0_Reco_ndf_vs_chi->Fill(result_ndf_electron, result_chi_electron);
1411  fhPi0_Reco_ndf_vs_startvertex->Fill(result_ndf_electron, startvertexZ);
1412  fhPi0_Reco_startvertex_vs_chi->Fill(startvertexZ, result_chi_electron);
1413 
1414  Double_t nofhits_sts = stsTrack->GetNofHits();
1415  fhPi0_Reco_startvertex_vs_nofhits->Fill(startvertexZ, nofhits_sts);
1416 
1417  fhPi0_Reco_noRichInd_chi_vs_momentum->Fill(refittedMomentum_electron.Mag(),
1418  result_chi_electron);
1419  fhPi0_Reco_noRichInd_chi_vs_pt->Fill(refittedMomentum_electron.Perp(),
1420  result_chi_electron);
1421 
1422  fTestTracklist_noRichInd.push_back(mcTrack1);
1423  fTestTracklist_noRichInd_MCindex.push_back(stsMcTrackId);
1424  fTestTracklist_noRichInd_momentum.push_back(refittedMomentum_electron);
1425  fTestTracklist_noRichInd_chi.push_back(result_chi_electron);
1426  fTestTracklist_noRichInd_richInd.push_back(richInd);
1427  fTestTracklist_noRichInd_gTrackId.push_back(iGTrack);
1428  fTestTracklist_noRichInd_ndf.push_back(result_ndf_electron);
1429  fTestTracklist_noRichInd_nofhits.push_back(nofhits_sts);
1430 
1431 
1432  if (richInd < 0) continue;
1433 
1434  // ANN output for rings
1435  Int_t pdg = mcTrack1->GetPdgCode();
1436  CbmRichRing* ring = static_cast<CbmRichRing*>(fRichRings->At(richInd));
1437  if (NULL != ring) {
1439  iGTrack, refittedMomentum_electron.Mag());
1440 
1441  if (TMath::Abs(pdg) == 11) {
1442  fhANN_output_electrons->Fill(ann);
1443  if (result_chi_electron <= CbmAnaConversionCutSettings::CalcChiCut(
1444  refittedMomentum_electron.Perp())) {
1445  fhANN_output_electrons_chiCut->Fill(ann);
1446  }
1447  }
1448  if (TMath::Abs(pdg) != 11) {
1449  fhANN_output_else->Fill(ann);
1450  if (result_chi_electron <= CbmAnaConversionCutSettings::CalcChiCut(
1451  refittedMomentum_electron.Perp())) {
1452  fhANN_output_else_chiCut->Fill(ann);
1453  }
1454  }
1455  }
1456 
1457 
1458  TVector3 stsMomentumVec; // momenta as measured by STS
1459  stsTrack->GetParamFirst()->Momentum(stsMomentumVec);
1460  Double_t stsMomentum = stsMomentumVec.Mag();
1461 
1462  TVector3 mcMomentumVec; // momenta from true-MC data
1463  mcTrack1->GetMomentum(mcMomentumVec);
1464  Double_t mcMomentum = mcMomentumVec.Mag();
1465  fhMomentum_MCvsReco->Fill(mcMomentum, stsMomentum);
1466  fhMomentum_MCvsReco_diff->Fill(TMath::Abs(mcMomentum - stsMomentum)
1467  / mcMomentum);
1468 
1469  TVector3
1470  bothtogether; // combination of measured (STS) momenta and MC momenta
1471  bothtogether.SetX(mcMomentumVec.X());
1472  bothtogether.SetY(stsMomentumVec.Y());
1473  bothtogether.SetZ(stsMomentumVec.Z());
1474 
1475 
1476  // Fill tracklists containing momenta from mc-true, measured in sts, refitted at primary
1477  Bool_t isFilled = FillRecoTracklistEPEM(mcTrack1,
1478  stsMomentumVec,
1479  refittedMomentum,
1480  stsMcTrackId,
1481  result_chi,
1482  iGTrack);
1483  if (isFilled) nofElectrons4epem++;
1484 
1485 
1486  CbmTrackMatchNew* richMatch =
1487  (CbmTrackMatchNew*) fRichRingMatches->At(richInd);
1488  if (richMatch == NULL) continue;
1489  int richMcTrackId = richMatch->GetMatchedLink().GetIndex();
1490  if (richMcTrackId < 0) continue;
1491  CbmMCTrack* mcTrack2 = (CbmMCTrack*) fMcTracks->At(richMcTrackId);
1492  if (mcTrack2 == NULL) continue;
1493 
1494  //if(stsMcTrackId != richMcTrackId) continue;
1495 
1496 
1497  if (stsMcTrackId == richMcTrackId) {
1498  //CbmRichRing* ring = static_cast<CbmRichRing*> (fRichRings->At(richInd));
1499  if (NULL != ring) {
1501  iGTrack, refittedMomentum_electron.Mag());
1502  if (TMath::Abs(pdg) == 11) {
1503  fhANN_output_electrons2->Fill(ann);
1504  fhANN_output_electrons_vs_p->Fill(refittedMomentum_electron.Mag(),
1505  ann);
1506  }
1507  if (TMath::Abs(pdg) != 11) {
1508  fhANN_output_else2->Fill(ann);
1509  fhANN_output_else_vs_p->Fill(refittedMomentum_electron.Mag(), ann);
1510  }
1511  }
1512  }
1513 
1514 
1515  //int pdg = TMath::Abs(mcTrack1->GetPdgCode());
1516  //int motherId = mcTrack1->GetMotherId();
1517  //double momentum = mcTrack1->GetP();
1518  stsMatch->GetTrueOverAllHitsRatio();
1519 
1520 
1521  if (DoTomography) { fAnaTomography->TomographyReco(mcTrack1); }
1522  FillRecoTracklist(mcTrack1);
1523 
1524 
1525  fTestTracklist.push_back(mcTrack1);
1526  fTestTracklist_momentum.push_back(refittedMomentum_electron);
1527  fTestTracklist_chi.push_back(result_chi_electron);
1528  fTestTracklist_richInd.push_back(richInd);
1529  fTestTracklist_ndf.push_back(result_ndf_electron);
1530  fTestTracklist_nofhits.push_back(nofhits_sts);
1531 
1532  fhPi0_Reco_chi_vs_pt->Fill(refittedMomentum_electron.Perp(),
1533  result_chi_electron);
1534  fhPi0_Reco_chi_vs_momentum->Fill(refittedMomentum_electron.Mag(),
1535  result_chi_electron);
1536  }
1537 
1538  AnalysePi0_Reco();
1540 
1541 
1542  fhNofElectrons_4epem->Fill(nofElectrons4epem);
1543 
1544 
1545  // InvariantMassTestReco();
1546 
1547  if (DoReconstruction) {
1549  fRecoMomentum,
1556  }
1557 
1558  // END - analyse reconstructed tracks
1559  // ========================================================================================
1560  timer_rec.Stop();
1561  fTime_rec += timer_rec.RealTime();
1562 
1563 
1564  // =========================================================================================================================
1565  // ============================================== END - EXEC function ======================================================
1566  // =========================================================================================================================
1567  timer_exec.Stop();
1568  fTime_exec += timer_exec.RealTime();
1569  timer_all.Stop();
1570  fTime_all += timer_all.RealTime();
1571 }
1572 
1573 
1575  timer_all.Start();
1576 
1577  cout << "\n\n############### CALLING FINISH ROUTINES... ############" << endl;
1578 
1579 
1580  // Write histograms to a file
1581  gDirectory->mkdir("analysis-conversion");
1582  gDirectory->cd("analysis-conversion");
1583 
1584 
1585  gDirectory->mkdir("KFParticle");
1586  gDirectory->cd("KFParticle");
1587  for (UInt_t i = 0; i < fHistoList_kfparticle.size(); i++) {
1588  fHistoList_kfparticle[i]->Write();
1589  }
1590  gDirectory->cd("..");
1591 
1592 
1593  if (DoTomography) { fAnaTomography->Finish(); }
1594  if (DoRichAnalysis) { fAnaRich->Finish(); }
1595  if (DoKFAnalysis) { fAnaKF->Finish(); }
1596  if (DoReconstruction) { fAnaReco->Finish(); }
1597  if (DoRecoFull) { fAnaRecoFull->Finish(); }
1598  if (DoPhotons) { fAnaPhotons->Finish(); }
1599  if (DoPhotons2) { fAnaPhotons2->Finish(); }
1600  if (DoTest) { fAnaTest->Finish(); }
1601  if (DoTest) { fAnaTest2->Finish(); }
1602 
1603 
1604  gDirectory->mkdir("further analyses");
1605  gDirectory->cd("further analyses");
1606  for (UInt_t i = 0; i < fHistoList_furtherAnalyses.size(); i++) {
1607  fHistoList_furtherAnalyses[i]->Write();
1608  }
1609  gDirectory->cd("..");
1610 
1611  for (UInt_t i = 0; i < fHistoList.size(); i++) {
1612  fHistoList[i]->Write();
1613  }
1614  gDirectory->cd("..");
1615 
1616 
1617  timer_all.Stop();
1618  fTime_all += timer_all.RealTime();
1619 
1620  cout << endl;
1621  cout << "############### FINISHED MAIN TASK ##############" << endl;
1622  cout << "Particlecounter: " << particlecounter << endl;
1623  cout << "Particlecounter (2 daughters): " << particlecounter_2daughters
1624  << endl;
1625  cout << "Particlecounter (3 daughters): " << particlecounter_3daughters
1626  << endl;
1627  cout << "Particlecounter (4 daughters): " << particlecounter_4daughters
1628  << endl;
1629  cout << "Particlecounter_all: " << particlecounter_all << endl;
1630  cout << "#####################################" << endl;
1631  cout << "Number of generated pi0 (all events): " << fNofGeneratedPi0_allEvents
1632  << endl;
1633  cout << "Number of reconstructed pi0 (all events): "
1634  << fNofPi0_kfparticle_allEvents << "\t - fraction: "
1636  << endl;
1637  cout << "#####################################" << endl;
1638  cout << "############### OVERALL TIMERS ###############" << endl;
1639  cout << std::fixed;
1640  cout << std::setprecision(1);
1641  cout << "Complete time: " << fTime_all << endl;
1642  cout << "Exec time: " << fTime_exec << endl;
1643  cout << "MC time: " << fTime_mc << "\t RECO time: " << fTime_rec << endl;
1644  cout << "############### ############## ###############" << endl;
1645  cout << "Number of events in fhNofPi0_perEvent histogram: "
1646  << fhNofPi0_perEvent->GetEntries() << endl;
1647  cout << "############### ############## ###############" << endl;
1648  // =========================================================================================================================
1649  // ============================================== END - FINISH function ====================================================
1650  // =========================================================================================================================
1651 }
1652 
1653 
1655  int motherId = mctrack->GetMotherId();
1656  if (motherId == -1) return;
1657  CbmMCTrack* mother = (CbmMCTrack*) fMcTracks->At(motherId);
1658  int mcMotherPdg = -1;
1659  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1660  //cout << mcMotherPdg << endl;
1661 
1662  if (mcMotherPdg == 22) {
1663  fhElectronSources->Fill(0);
1664  int grandmotherId = mother->GetMotherId();
1665  if (grandmotherId == -1) return;
1666  CbmMCTrack* grandmother = (CbmMCTrack*) fMcTracks->At(grandmotherId);
1667  int mcGrandmotherPdg = -1;
1668  if (NULL != grandmother) mcGrandmotherPdg = grandmother->GetPdgCode();
1669  if (mcGrandmotherPdg == 111) fhElectronSources->Fill(4);
1670  if (mcGrandmotherPdg == 221) fhElectronSources->Fill(5);
1671 
1672  if (mcGrandmotherPdg == 111) {
1673  TVector3 v;
1674  mctrack->GetStartVertex(v);
1675  fhElectronsFromPi0_z->Fill(v.Z());
1676  }
1677  }
1678  if (mcMotherPdg == 111) fhElectronSources->Fill(1);
1679  if (mcMotherPdg == 221) fhElectronSources->Fill(2);
1680  if (mcMotherPdg != 22 && mcMotherPdg != 111 && mcMotherPdg != 221)
1681  fhElectronSources->Fill(3);
1682 
1683  if (mcMotherPdg == 22) {
1684  TVector3 v;
1685  mctrack->GetStartVertex(v);
1686  // fhGammaZ->Fill(v.Z());
1687  // countGammaEl++;
1688  }
1689 }
1690 
1691 
1694  const CbmMCTrack* mctrackM) {
1695  CbmLmvmKinematicParams params;
1696 
1697  TVector3 momP; //momentum e+
1698  mctrackP->GetMomentum(momP);
1699  Double_t energyP = TMath::Sqrt(momP.Mag2() + M2E);
1700  TLorentzVector lorVecP(momP, energyP);
1701 
1702  TVector3 momM; //momentum e-
1703  mctrackM->GetMomentum(momM);
1704  Double_t energyM = TMath::Sqrt(momM.Mag2() + M2E);
1705  TLorentzVector lorVecM(momM, energyM);
1706 
1707  TVector3 momPair = momP + momM;
1708  Double_t energyPair = energyP + energyM;
1709  Double_t ptPair = momPair.Perp();
1710  Double_t pzPair = momPair.Pz();
1711  Double_t yPair =
1712  0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
1713  Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
1714  Double_t theta = 180. * anglePair / TMath::Pi();
1715  Double_t minv =
1716  2. * TMath::Sin(anglePair / 2.) * TMath::Sqrt(momM.Mag() * momP.Mag());
1717 
1718  params.fMomentumMag = momPair.Mag();
1719  params.fPt = ptPair;
1720  params.fRapidity = yPair;
1721  params.fMinv = minv;
1722  params.fAngle = theta;
1723  return params;
1724 }
1725 
1727  const CbmMCTrack* mctrack2)
1728 // calculation of invariant mass from two gammas (m=0)
1729 {
1730  TVector3 mom1;
1731  mctrack1->GetMomentum(mom1);
1732  Double_t energy1 = TMath::Sqrt(mom1.Mag2());
1733  TLorentzVector lorVec1(mom1, energy1);
1734 
1735  TVector3 mom2;
1736  mctrack2->GetMomentum(mom2);
1737  Double_t energy2 = TMath::Sqrt(mom2.Mag2());
1738  TLorentzVector lorVec2(mom2, energy2);
1739 
1740  TLorentzVector sum = lorVec1 + lorVec2;
1741  return sum.Mag();
1742 }
1743 
1744 
1746  const CbmMCTrack* mctrack2)
1747 // calculation of invariant mass from two electrons/positrons
1748 {
1749  TVector3 mom1;
1750  mctrack1->GetMomentum(mom1);
1751  Double_t energy1 = TMath::Sqrt(mom1.Mag2() + M2E);
1752  TLorentzVector lorVec1(mom1, energy1);
1753 
1754  TVector3 mom2;
1755  mctrack2->GetMomentum(mom2);
1756  Double_t energy2 = TMath::Sqrt(mom2.Mag2() + M2E);
1757  TLorentzVector lorVec2(mom2, energy2);
1758 
1759  TLorentzVector sum = lorVec1 + lorVec2;
1760  return sum.Mag();
1761 }
1762 
1763 
1765  const CbmMCTrack* mctrack2,
1766  const CbmMCTrack* mctrack3,
1767  const CbmMCTrack* mctrack4)
1768 // calculation of invariant mass from four electrons/positrons
1769 {
1770  /* TVector3 mom1;
1771  mctrack1->GetMomentum(mom1);
1772  TVector3 tempmom1;
1773  tempmom1.SetX(SmearValue(mom1.X()));
1774  tempmom1.SetY(SmearValue(mom1.Y()));
1775  tempmom1.SetZ(SmearValue(mom1.Z()));
1776  Double_t energy1 = TMath::Sqrt(tempmom1.Mag2() + M2E);
1777  TLorentzVector lorVec1(tempmom1, energy1);
1778 
1779  TVector3 mom2;
1780  mctrack2->GetMomentum(mom2);
1781  TVector3 tempmom2;
1782  tempmom2.SetX(SmearValue(mom2.X()));
1783  tempmom2.SetY(SmearValue(mom2.Y()));
1784  tempmom2.SetZ(SmearValue(mom2.Z()));
1785  Double_t energy2 = TMath::Sqrt(tempmom2.Mag2() + M2E);
1786  TLorentzVector lorVec2(tempmom2, energy2);
1787 
1788  TVector3 mom3;
1789  mctrack3->GetMomentum(mom3);
1790  TVector3 tempmom3;
1791  tempmom3.SetX(SmearValue(mom3.X()));
1792  tempmom3.SetY(SmearValue(mom3.Y()));
1793  tempmom3.SetZ(SmearValue(mom3.Z()));
1794  Double_t energy3 = TMath::Sqrt(tempmom3.Mag2() + M2E);
1795  TLorentzVector lorVec3(tempmom3, energy3);
1796 
1797  TVector3 mom4;
1798  mctrack4->GetMomentum(mom4);
1799  TVector3 tempmom4;
1800  tempmom4.SetX(SmearValue(mom4.X()));
1801  tempmom4.SetY(SmearValue(mom4.Y()));
1802  tempmom4.SetZ(SmearValue(mom4.Z()));
1803  Double_t energy4 = TMath::Sqrt(tempmom4.Mag2() + M2E);
1804  TLorentzVector lorVec4(tempmom4, energy4);
1805 */
1806  TLorentzVector lorVec1;
1807  mctrack1->Get4Momentum(lorVec1);
1808 
1809  TLorentzVector lorVec2;
1810  mctrack2->Get4Momentum(lorVec2);
1811 
1812  TLorentzVector lorVec3;
1813  mctrack3->Get4Momentum(lorVec3);
1814 
1815  TLorentzVector lorVec4;
1816  mctrack4->Get4Momentum(lorVec4);
1817 
1818 
1819  TLorentzVector sum;
1820  sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
1821  cout << "mc: \t" << sum.Px() << " / " << sum.Py() << " / " << sum.Pz()
1822  << " / " << sum.E() << "\t => mag = " << sum.Mag() << endl;
1823  return sum.Mag();
1824 }
1825 
1826 
1827 Double_t CbmAnaConversion::Invmass_4particlesRECO(const TVector3 part1,
1828  const TVector3 part2,
1829  const TVector3 part3,
1830  const TVector3 part4)
1831 // calculation of invariant mass from four electrons/positrons
1832 {
1833  Double_t energy1 = TMath::Sqrt(part1.Mag2() + M2E);
1834  TLorentzVector lorVec1(part1, energy1);
1835 
1836  Double_t energy2 = TMath::Sqrt(part2.Mag2() + M2E);
1837  TLorentzVector lorVec2(part2, energy2);
1838 
1839  Double_t energy3 = TMath::Sqrt(part3.Mag2() + M2E);
1840  TLorentzVector lorVec3(part3, energy3);
1841 
1842  Double_t energy4 = TMath::Sqrt(part4.Mag2() + M2E);
1843  TLorentzVector lorVec4(part4, energy4);
1844 
1845  TLorentzVector sum;
1846  sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
1847 
1848  return sum.Mag();
1849 }
1850 
1851 
1852 // =========================================================================================================================
1853 // ============================================== UP TO HERE: Invariant mass calculation ===================================
1854 // =========================================================================================================================
1855 
1856 
1858 // fill all relevant tracklists containing MC tracks
1859 {
1860  Bool_t electrons = true;
1861  Bool_t gammas = true;
1862 
1863  // fill gamma tracklist
1864  if (TMath::Abs(mctrack->GetPdgCode()) == 22 && gammas) {
1865  int motherId = mctrack->GetMotherId();
1866  if (motherId != -1) {
1867  CbmMCTrack* mother = (CbmMCTrack*) fMcTracks->At(motherId);
1868  int mcMotherPdg = -1;
1869  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1870  if (mcMotherPdg == 111) { // pdg code 111 = pi0
1871  fMCTracklist.push_back(mctrack);
1872  }
1873  }
1874  }
1875 
1876  // fill electron tracklists
1877  if (TMath::Abs(mctrack->GetPdgCode()) == 11 && electrons) {
1878  TVector3 v;
1879  mctrack->GetStartVertex(v);
1880  if (v.Z() <= 70) {
1881  int motherId = mctrack->GetMotherId();
1882  if (motherId != -1 || motherId == -1) {
1883  CbmMCTrack* mother = (CbmMCTrack*) fMcTracks->At(motherId);
1884  int mcMotherPdg = -1;
1885  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1886  if (mcMotherPdg == 22 || mcMotherPdg == 111 || mcMotherPdg == 221) {
1887  int grandmotherId = mother->GetMotherId();
1888  if (grandmotherId != -1 || grandmotherId == -1) {
1889  // CbmMCTrack* grandmother = (CbmMCTrack*) fMcTracks->At(grandmotherId);
1890  // int mcGrandmotherPdg = -1;
1891  // if (NULL != grandmother) mcGrandmotherPdg = grandmother->GetPdgCode();
1892  // if(mcGrandmotherPdg == 111) {
1893  fMCTracklist_all.push_back(mctrack);
1894  // }
1895  }
1896  }
1897  }
1898  }
1899  }
1900 }
1901 
1902 
1904  if (TMath::Abs(mctrack->GetPdgCode()) == 11) {
1905  int motherId = mctrack->GetMotherId();
1906  if (motherId != -1) {
1907  CbmMCTrack* mother = (CbmMCTrack*) fMcTracks->At(motherId);
1908  int mcMotherPdg = -1;
1909  if (NULL != mother) mcMotherPdg = mother->GetPdgCode();
1910  if (mcMotherPdg == 111
1911  || mcMotherPdg == 22) { // pdg code 111 = pi0, 22 = gamma
1912  fRecoTracklist.push_back(mctrack);
1913  // cout << "pdg " << mctrack->GetPdgCode() << "\t motherid " << motherId << endl;
1914  test++;
1915  }
1916  }
1917  }
1918 }
1919 
1920 
1922  TVector3 stsMomentum,
1923  TVector3 refittedMom,
1924  int i,
1925  Double_t chi,
1926  Int_t GlobalTrackId) {
1927  Bool_t isFilled = false;
1928  if (TMath::Abs(mctrack->GetPdgCode()) == 11) {
1929  int motherId = mctrack->GetMotherId();
1930  if (motherId != -1) {
1931  fRecoTracklistEPEM.push_back(mctrack);
1932  fRecoTracklistEPEM_id.push_back(i);
1933  fRecoTracklistEPEM_chi.push_back(chi);
1934  fRecoTracklistEPEM_gtid.push_back(GlobalTrackId);
1935  fRecoMomentum.push_back(stsMomentum);
1936  fRecoRefittedMomentum.push_back(refittedMom);
1937  isFilled = true;
1938  }
1939  }
1940  return isFilled;
1941 }
1942 
1943 
1945  for (unsigned int i = 0; i < fMCTracklist_all.size(); i++) {
1946  for (unsigned int j = i + 1; j < fMCTracklist_all.size(); j++) {
1947  // Double_t invmass = Invmass_2particles(fMCTracklist_all[i],fMCTracklist_all[j]);
1948 
1949  int motherId_i = fMCTracklist_all[i]->GetMotherId();
1950  int motherId_j = fMCTracklist_all[j]->GetMotherId();
1951 
1952  CbmMCTrack* mother_i = (CbmMCTrack*) fMcTracks->At(motherId_i);
1953  int mcMotherPdg_i = -1;
1954  if (NULL != mother_i) mcMotherPdg_i = mother_i->GetPdgCode();
1955 
1956  // CbmMCTrack* mother_j = (CbmMCTrack*) fMcTracks->At(motherId_j);
1957  // int mcMotherPdg_j = -1;
1958  // if (NULL != mother_j) mcMotherPdg_j = mother_j->GetPdgCode();
1959 
1960  if (motherId_i == motherId_j
1961  && ((fMCTracklist_all[i]->GetPdgCode() == 11
1962  && fMCTracklist_all[j]->GetPdgCode() == -11)
1963  || (fMCTracklist_all[i]->GetPdgCode() == -11
1964  && fMCTracklist_all[j]->GetPdgCode() == 11))) {
1965  // fhInvariantMass_MC_all->Fill(invmass);
1966  //cout << "e+e- decay detected! MotherId " << motherId_i << "\t invariant mass: " << invmass << endl;
1967 
1968  if (mcMotherPdg_i == 111) {
1969  //fhInvariantMass_MC_pi0->Fill(invmass);
1970  cout << "-- mother particle of decay: pi0" << endl;
1971  }
1972  }
1973  }
1974  }
1975 }
1976 
1977 
1979 // calculation of invariant mass via pi0-> gamma gamma, ONLY FROM MC DATA!
1980 {
1981  for (unsigned int i = 0; i < fMCTracklist.size(); i++) {
1982  for (unsigned int j = i + 1; j < fMCTracklist.size(); j++) {
1983 
1984  //if(fMCTracklist[i]->GetPx() != fMCTracklist[j]->GetPx() && fMCTracklist[i]->GetPy() != fMCTracklist[j]->GetPy()) {
1985  Double_t invmass = Invmass_2gammas(fMCTracklist[i], fMCTracklist[j]);
1986  fhInvariantMass_test->Fill(invmass);
1987  TVector3 vi;
1988  fMCTracklist[i]->GetStartVertex(vi);
1989  TVector3 vj;
1990  fMCTracklist[j]->GetStartVertex(vj);
1991 
1992  int motherId_i = fMCTracklist[i]->GetMotherId();
1993  int motherId_j = fMCTracklist[j]->GetMotherId();
1994 
1995  if (motherId_i == motherId_j) {
1996  fhInvariantMass_test2->Fill(invmass);
1997 
1998  if (invmass < 0.001) {
1999  // cout << "gamma1 " << fMCTracklist[i]->GetPx() << "\t" << fMCTracklist[i]->GetPy() << "\t" << fMCTracklist[i]->GetPz() << endl;
2000  // cout << "gamma2 " << fMCTracklist[j]->GetPx() << "\t" << fMCTracklist[j]->GetPy() << "\t" << fMCTracklist[j]->GetPz() << endl;
2001  }
2002  }
2003  if (vi.Z() == vj.Z() && vi.Y() == vj.Y() && vi.X() == vj.X()) {
2004  fhInvariantMass_test3->Fill(invmass);
2005  }
2006  //}
2007  }
2008  }
2009 }
2010 
2011 
2013 // calculation of invariant mass via pi0 -> .. -> e+ e- e+ e-, ONLY FROM RECONSTRUCTED TRACKS!
2014 {
2015  // cout << "InvariantMassTestReco - Start..." << endl;
2016  // cout << "InvariantMassTestReco - Size of fRecoTracklist:\t " << fRecoTracklist.size() << endl;
2017  if (fRecoTracklist.size() >= 4) {
2018  for (unsigned int i = 0; i < fRecoTracklist.size(); i++) {
2019  for (unsigned int j = i + 1; j < fRecoTracklist.size(); j++) {
2020  for (unsigned int k = j + 1; k < fRecoTracklist.size(); k++) {
2021  for (unsigned int l = k + 1; l < fRecoTracklist.size(); l++) {
2022 
2023  if (fRecoTracklist[i]->GetPdgCode()
2024  + fRecoTracklist[j]->GetPdgCode()
2025  + fRecoTracklist[k]->GetPdgCode()
2026  + fRecoTracklist[l]->GetPdgCode()
2027  != 0)
2028  continue;
2029 
2030  int motherId1 = fRecoTracklist[i]->GetMotherId();
2031  int motherId2 = fRecoTracklist[j]->GetMotherId();
2032  int motherId3 = fRecoTracklist[k]->GetMotherId();
2033  int motherId4 = fRecoTracklist[l]->GetMotherId();
2034  int grandmotherId1 = -1;
2035  int grandmotherId2 = -1;
2036  int grandmotherId3 = -1;
2037  int grandmotherId4 = -1;
2038 
2039  int mcMotherPdg1 = -1;
2040  int mcMotherPdg2 = -1;
2041  int mcMotherPdg3 = -1;
2042  /*
2043  int mcMotherPdg4 = -1;
2044  int mcGrandmotherPdg1 = -1;
2045  int mcGrandmotherPdg2 = -1;
2046  int mcGrandmotherPdg3 = -1;
2047  int mcGrandmotherPdg4 = -1;
2048 */
2049 
2050  if (motherId1 != -1) {
2051  CbmMCTrack* mother1 = (CbmMCTrack*) fMcTracks->At(motherId1);
2052  if (NULL != mother1) mcMotherPdg1 = mother1->GetPdgCode();
2053  grandmotherId1 = mother1->GetMotherId();
2054  if (grandmotherId1 != -1) {
2055  // CbmMCTrack* grandmother1 = (CbmMCTrack*) fMcTracks->At(grandmotherId1);
2056  // if (NULL != grandmother1) mcGrandmotherPdg1 = grandmother1->GetPdgCode();
2057  }
2058  }
2059  if (motherId2 != -1) {
2060  CbmMCTrack* mother2 = (CbmMCTrack*) fMcTracks->At(motherId2);
2061  if (NULL != mother2) mcMotherPdg2 = mother2->GetPdgCode();
2062  grandmotherId2 = mother2->GetMotherId();
2063  if (grandmotherId2 != -1) {
2064  // CbmMCTrack* grandmother2 = (CbmMCTrack*) fMcTracks->At(grandmotherId2);
2065  // if (NULL != grandmother2) mcGrandmotherPdg2 = grandmother2->GetPdgCode();
2066  }
2067  }
2068  if (motherId3 != -1) {
2069  CbmMCTrack* mother3 = (CbmMCTrack*) fMcTracks->At(motherId3);
2070  if (NULL != mother3) mcMotherPdg3 = mother3->GetPdgCode();
2071  grandmotherId3 = mother3->GetMotherId();
2072  if (grandmotherId3 != -1) {
2073  // CbmMCTrack* grandmother3 = (CbmMCTrack*) fMcTracks->At(grandmotherId3);
2074  // if (NULL != grandmother3) mcGrandmotherPdg3 = grandmother3->GetPdgCode();
2075  }
2076  }
2077  if (motherId4 != -1) {
2078  CbmMCTrack* mother4 = (CbmMCTrack*) fMcTracks->At(motherId4);
2079  // if (NULL != mother4) mcMotherPdg4 = mother4->GetPdgCode();
2080  grandmotherId4 = mother4->GetMotherId();
2081  if (grandmotherId4 != -1) {
2082  // CbmMCTrack* grandmother4 = (CbmMCTrack*) fMcTracks->At(grandmotherId4);
2083  // if (NULL != grandmother4) mcGrandmotherPdg4 = grandmother4->GetPdgCode();
2084  }
2085  }
2086 
2087 
2088  if (motherId1 == motherId2 && motherId2 == motherId3
2089  && motherId3 == motherId4) {
2090  Double_t invmass = Invmass_4particles(fRecoTracklist[i],
2091  fRecoTracklist[j],
2092  fRecoTracklist[k],
2093  fRecoTracklist[l]);
2094  fhInvariantMassReco_pi0->Fill(invmass);
2095  // cout << "Decay pi0 -> e+ e- e+ e- detected!" << endl;
2096  }
2097 
2098  if (motherId1 == motherId2 && motherId1 == motherId3) {}
2099  if (motherId1 == motherId2 && motherId1 == motherId4) {}
2100  if (motherId1 == motherId3 && motherId1 == motherId4) {}
2101  if (motherId2 == motherId3 && motherId2 == motherId4) {}
2102 
2103  // if( ((motherId1 == motherId2 && motherId3 == motherId4) && (mcMotherPdg1 == 22 || mcMotherPdg1 == 111) && (mcMotherPdg3 == 22 || mcMotherPdg3 == 111))
2104  // || ((motherId1 == motherId3 && motherId2 == motherId4) && (mcMotherPdg1 == 22 || mcMotherPdg1 == 111) && (mcMotherPdg2 == 22 || mcMotherPdg2 == 111))
2105  // || ((motherId1 == motherId4 && motherId2 == motherId3) && (mcMotherPdg1 == 22 || mcMotherPdg1 == 111) && (mcMotherPdg2 == 22 || mcMotherPdg2 == 111))) {
2106  if (((motherId1 == motherId2 && motherId3 == motherId4)
2107  && (mcMotherPdg1 == 22) && (mcMotherPdg3 == 22)
2108  && grandmotherId1 == grandmotherId3)
2109  || ((motherId1 == motherId3 && motherId2 == motherId4)
2110  && (mcMotherPdg1 == 22) && (mcMotherPdg2 == 22)
2111  && grandmotherId1 == grandmotherId2)
2112  || ((motherId1 == motherId4 && motherId2 == motherId3)
2113  && (mcMotherPdg1 == 22) && (mcMotherPdg2 == 22)
2114  && grandmotherId1 == grandmotherId2)) {
2115  Double_t invmass = Invmass_4particles(fRecoTracklist[i],
2116  fRecoTracklist[j],
2117  fRecoTracklist[k],
2118  fRecoTracklist[l]);
2119  fhInvariantMassReco_pi0->Fill(invmass);
2120  // cout << "Decay pi0 -> 2gamma -> e+ e-! \t MotherId " << motherId1 << "\t" << motherId2 << "\t" << motherId3 << "\t" << motherId4 <<
2121  // "\t GrandmotherId " << grandmotherId1 << "\t" << grandmotherId2 << "\t" << grandmotherId3 << "\t" << grandmotherId4 << endl;
2122  }
2123  }
2124  }
2125  }
2126  }
2127  }
2128  // cout << "InvariantMassTestReco - End!" << endl;
2129 }
2130 
2131 
2133 
2134 
2136 
2137 
2138 void CbmAnaConversion::SetMode(int mode = 0)
2139 // mode 1 = tomography
2140 // mode 2 = urqmd
2141 // mode 3 = pluto
2142 {
2143  fAnalyseMode = mode;
2144 }
2145 
2146 
2148  if (fMCTracklist_all.size() >= 2) {
2149  for (unsigned int i = 0; i < fMCTracklist_all.size(); i++) {
2150  for (unsigned int j = i + 1; j < fMCTracklist_all.size(); j++) {
2151  if (fMCTracklist_all[i]->GetPdgCode()
2152  + fMCTracklist_all[j]->GetPdgCode()
2153  != 0)
2154  continue;
2155 
2156  int motherId1 = fMCTracklist_all[i]->GetMotherId();
2157  int motherId2 = fMCTracklist_all[j]->GetMotherId();
2158 
2159  if (motherId1 == motherId2) {
2160  Double_t invmass =
2162  fhSearchGammas->Fill(invmass);
2163  }
2164  }
2165  }
2166  }
2167 }
2168 
2169 
2171  CbmKFParticleFinderQA* kfparticleQA) {
2172 
2173  fKFparticle = kfparticle;
2174  fKFparticleFinderQA = kfparticleQA;
2175  if (fKFparticle) {
2176  cout << "kf works" << endl;
2177  } else {
2178  cout << "kf works not" << endl;
2179  }
2180 }
2181 
2182 
2183 Bool_t CbmAnaConversion::AnalysePi0_MC(CbmMCTrack* mctrack, int trackid) {
2184  Bool_t reconstructible = false;
2185  if (mctrack->GetMotherId() == -1) {
2186  fhPi0_MC_occurence->Fill(0);
2187 
2188  Int_t daughters = 0;
2189  Int_t gammaDaughters = 0;
2190  Int_t electronDaughters = 0;
2191  Int_t electronDaughtersBeforeRICH = 0;
2192  Int_t electronDaughtersInTarget = 0;
2193  vector<int> gammaDaughterIDs;
2194  gammaDaughterIDs.clear();
2195  vector<int> electronDaughterIDs;
2196  electronDaughterIDs.clear();
2197 
2198  Int_t nofMcTracks = fMcTracks->GetEntriesFast();
2199  for (int i = 0; i < nofMcTracks; i++) {
2200  CbmMCTrack* mctrack_switch = (CbmMCTrack*) fMcTracks->At(i);
2201  if (mctrack_switch == NULL) continue;
2202  Int_t motherID = mctrack_switch->GetMotherId();
2203  Int_t pdg = mctrack_switch->GetPdgCode();
2204  if (motherID == trackid && pdg == 22) {
2205  gammaDaughters++;
2206  gammaDaughterIDs.push_back(i);
2207  }
2208  if (motherID == trackid) { daughters++; }
2209  }
2210 
2211 
2212  if (daughters == 0) fhPi0_MC_occurence->Fill(12);
2213  if (daughters == 1) fhPi0_MC_occurence->Fill(13);
2214  if (daughters == 2) fhPi0_MC_occurence->Fill(14);
2215  if (daughters == 3) fhPi0_MC_occurence->Fill(15);
2216  if (daughters == 4) fhPi0_MC_occurence->Fill(16);
2217  if (daughters > 4) fhPi0_MC_occurence->Fill(17);
2218 
2219 
2220  if (gammaDaughters == 2) {
2221  fhPi0_MC_occurence->Fill(1);
2222 
2223  for (int i = 0; i < nofMcTracks; i++) {
2224  CbmMCTrack* mctrack_switch = (CbmMCTrack*) fMcTracks->At(i);
2225  if (mctrack_switch == NULL) continue;
2226  Int_t motherID = mctrack_switch->GetMotherId();
2227  Int_t pdg = mctrack_switch->GetPdgCode();
2228  if (TMath::Abs(pdg) == 11
2229  && (motherID == gammaDaughterIDs[0]
2230  || motherID == gammaDaughterIDs[1])) {
2231  electronDaughters++;
2232  electronDaughterIDs.push_back(i);
2233 
2234  TVector3 startvertex;
2235  mctrack_switch->GetStartVertex(startvertex);
2236  if (startvertex.Z() <= 70) { electronDaughtersBeforeRICH++; }
2237  if (startvertex.Z() <= 4) { electronDaughtersInTarget++; }
2238  }
2239  }
2240 
2241  if (electronDaughters == 4) { fhPi0_MC_occurence->Fill(2); }
2242  if (electronDaughtersBeforeRICH == 4) {
2243  fhPi0_MC_occurence->Fill(3);
2244  reconstructible = true;
2245  }
2246  if (electronDaughtersInTarget == 4) { fhPi0_MC_occurence->Fill(4); }
2247  }
2248  } else {
2249  fhPi0_MC_occurence2->Fill(0);
2250  Int_t daughters = 0;
2251  Int_t gammaDaughters = 0;
2252  Int_t electronDaughters = 0;
2253  Int_t electronDaughtersBeforeRICH = 0;
2254  Int_t electronDaughtersInTarget = 0;
2255  vector<int> gammaDaughterIDs;
2256  gammaDaughterIDs.clear();
2257  vector<int> electronDaughterIDs;
2258  electronDaughterIDs.clear();
2259 
2260  Int_t nofMcTracks = fMcTracks->GetEntriesFast();
2261  for (int i = 0; i < nofMcTracks; i++) {
2262  CbmMCTrack* mctrack_switch = (CbmMCTrack*) fMcTracks->At(i);
2263  if (mctrack_switch == NULL) continue;
2264  Int_t motherID = mctrack_switch->GetMotherId();
2265  Int_t pdg = mctrack_switch->GetPdgCode();
2266  if (motherID == trackid && pdg == 22) {
2267  gammaDaughters++;
2268  gammaDaughterIDs.push_back(i);
2269  }
2270  if (motherID == trackid) { daughters++; }
2271  }
2272 
2273  if (gammaDaughters == 2) {
2274  fhPi0_MC_occurence2->Fill(1);
2275  for (int i = 0; i < nofMcTracks; i++) {
2276  CbmMCTrack* mctrack_switch = (CbmMCTrack*) fMcTracks->At(i);
2277  if (mctrack_switch == NULL) continue;
2278  Int_t motherID = mctrack_switch->GetMotherId();
2279  Int_t pdg = mctrack_switch->GetPdgCode();
2280  if (TMath::Abs(pdg) == 11
2281  && (motherID == gammaDaughterIDs[0]
2282  || motherID == gammaDaughterIDs[1])) {
2283  electronDaughters++;
2284  electronDaughterIDs.push_back(i);
2285 
2286  TVector3 startvertex;
2287  mctrack_switch->GetStartVertex(startvertex);
2288  if (startvertex.Z() <= 70) { electronDaughtersBeforeRICH++; }
2289  if (startvertex.Z() <= 4) { electronDaughtersInTarget++; }
2290  }
2291  }
2292  if (electronDaughters == 4) { fhPi0_MC_occurence2->Fill(2); }
2293  if (electronDaughtersBeforeRICH == 4) { fhPi0_MC_occurence2->Fill(3); }
2294  if (electronDaughtersInTarget == 4) { fhPi0_MC_occurence2->Fill(4); }
2295  }
2296  }
2297 
2298  return reconstructible;
2299 }
2300 
2301 
2303  Int_t electrons = 0;
2304  std::multimap<int, int>
2305  electronPi0ID_map; // contains all IDs of pi0, from which an electron has been detected
2306  std::multimap<int, int> electronPi0ID_map_richInd;
2307 
2308  Int_t nof = fTestTracklist.size();
2309  for (int i = 0; i < nof; i++) {
2310  Int_t motherID = fTestTracklist[i]->GetMotherId();
2311  Int_t pdg = fTestTracklist[i]->GetPdgCode();
2312 
2313  if (TMath::Abs(pdg) == 11 && motherID != -1) {
2314  CbmMCTrack* mctrack_mother = (CbmMCTrack*) fMcTracks->At(motherID);
2315  if (mctrack_mother == NULL) continue;
2316  Int_t grandmotherID = mctrack_mother->GetMotherId();
2317  Int_t motherPdg = mctrack_mother->GetPdgCode();
2318 
2319  if (motherPdg == 22 && grandmotherID != -1) {
2320  CbmMCTrack* mctrack_grandmother =
2321  (CbmMCTrack*) fMcTracks->At(grandmotherID);
2322  if (mctrack_grandmother == NULL) continue;
2323  Int_t grandmotherPdg = mctrack_grandmother->GetPdgCode();
2324 
2325  if (grandmotherPdg == 111) {
2326  electrons++;
2327  electronPi0ID_map.insert(std::pair<int, int>(grandmotherID, i));
2328  if (!(fTestTracklist_richInd[i] < 0)) {
2329  electronPi0ID_map_richInd.insert(
2330  std::pair<int, int>(grandmotherID, i));
2331  }
2336 
2337  TVector3 startvertex;
2338  fTestTracklist[i]->GetStartVertex(startvertex);
2339  if (startvertex.Z() < 1) {
2344  }
2345  }
2346  }
2347  }
2348  }
2349 
2350  if (
2351  electrons
2352  >= 4) { // at least 4 electrons from pi0 (NOT from the same one) have been detected
2353  fhPi0_Reco_occurence->Fill(0);
2354  }
2355 
2356 
2357  int samePi0counter = 0;
2358  int check = 0;
2359  for (std::map<int, int>::iterator it = electronPi0ID_map.begin();
2360  it != electronPi0ID_map.end();
2361  ++it) {
2362  if (it == electronPi0ID_map.begin()) check = 1;
2363  if (it != electronPi0ID_map.begin()) {
2364  std::map<int, int>::iterator zwischen = it;
2365  zwischen--;
2366  int id = it->first;
2367  int id_old = zwischen->first;
2368  if (id == id_old) {
2369  check++;
2370  if (check > 3) {
2371  fhPi0_Reco_occurence->Fill(1);
2372  samePi0counter++;
2373  }
2374  } else {
2375  if (check == 1) fhPi0_Reco_occurence->Fill(2);
2376  if (check == 2) fhPi0_Reco_occurence->Fill(3);
2377  if (check == 3) fhPi0_Reco_occurence->Fill(4);
2378  if (check == 4) fhPi0_Reco_occurence->Fill(5);
2379  if (check > 4) fhPi0_Reco_occurence->Fill(6);
2380 
2381  if (check == 4) {
2382  std::map<int, int>::iterator alt3 = zwischen;
2383  alt3--;
2384  std::map<int, int>::iterator alt4 = alt3;
2385  alt4--;
2386  std::map<int, int>::iterator alt5 = alt4;
2387  alt5--;
2388  cout << "CbmAnaConversion: AnalysePi0_Reco: " << alt5->first << "/"
2389  << zwischen->first << "/" << alt3->first << "/" << alt4->first
2390  << endl;
2391  cout << "CbmAnaConversion: AnalysePi0_Reco: " << alt5->second << "/"
2392  << zwischen->second << "/" << alt3->second << "/" << alt4->second
2393  << endl;
2394  Bool_t IsWithinCuts = AnalysePi0_Reco_calc(
2395  alt5->second, zwischen->second, alt3->second, alt4->second);
2396 
2397  Double_t chi_e1 = fTestTracklist_chi[alt5->second];
2398  Double_t chi_e2 = fTestTracklist_chi[zwischen->second];
2399  Double_t chi_e3 = fTestTracklist_chi[alt3->second];
2400  Double_t chi_e4 = fTestTracklist_chi[alt4->second];
2401 
2402 
2403  Double_t invmass =
2405  fTestTracklist_momentum[zwischen->second],
2406  fTestTracklist_momentum[alt3->second],
2407  fTestTracklist_momentum[alt4->second]);
2408  fhPi0_Reco_invmass->Fill(invmass);
2409  fhPi0_Reco_invmass_cases->Fill(1, invmass);
2410  Double_t invmass_mc =
2411  Invmass_4particles(fTestTracklist[alt5->second],
2412  fTestTracklist[zwischen->second],
2413  fTestTracklist[alt3->second],
2414  fTestTracklist[alt4->second]);
2415  fhPi0_Reco_invmass_mc->Fill(invmass_mc);
2416  fhPi0_Reco_invmass_cases->Fill(5, invmass_mc);
2417 
2418 
2419  std::map<int, int>::iterator temp = zwischen;
2420  for (int i = 0; i < 4; i++) {
2421  int ndf = fTestTracklist_ndf[temp->second];
2422  int nofhits = fTestTracklist_nofhits[temp->second];
2423  fhPi0_Reco_ndf_vs_nofhits->Fill(ndf, nofhits);
2424  temp--;
2425  }
2426 
2427 
2428  if (chi_e1 <= 3 && chi_e2 <= 3 && chi_e3 <= 3 && chi_e4 <= 3) {
2429  fhPi0_Reco_occurence->Fill(9);
2430  fhPi0_Reco_invmass_cases->Fill(2, invmass);
2431  if (IsWithinCuts) {
2432  fhPi0_Reco_occurence->Fill(10);
2433  fhPi0_Reco_invmass_cases->Fill(4, invmass);
2434  }
2435 
2436  std::map<int, int>::iterator temp2 = zwischen;
2437  for (int i = 0; i < 4; i++) {
2438  int ndf = fTestTracklist_ndf[temp2->second];
2439  int nofhits = fTestTracklist_nofhits[temp2->second];
2440  fhPi0_Reco_ndf_vs_nofhits_withChi->Fill(ndf, nofhits);
2441  temp2--;
2442  }
2443  }
2444  if (IsWithinCuts) fhPi0_Reco_invmass_cases->Fill(3, invmass);
2445 
2446  fhPi0_Reco_chi->Fill(chi_e1);
2447  fhPi0_Reco_chi->Fill(chi_e2);
2448  fhPi0_Reco_chi->Fill(chi_e3);
2449  fhPi0_Reco_chi->Fill(chi_e4);
2450  }
2451 
2452  check = 1;
2453  }
2454  }
2455  }
2456 
2457  if (samePi0counter >= 4) {
2458  //fhPi0_MC_occurence->Fill(13);
2459  }
2460 
2461 
2462  int samePi0counter2 = 0;
2463  int check2 = 0;
2464  cout << "CbmAnaConversion: RecoPi0: electronmapsize: "
2465  << electronPi0ID_map_richInd.size() << endl;
2466  for (std::map<int, int>::iterator it = electronPi0ID_map_richInd.begin();
2467  it != electronPi0ID_map_richInd.end();
2468  ++it) {
2469  if (it == electronPi0ID_map_richInd.begin()) check = 1;
2470  if (it != electronPi0ID_map_richInd.begin()) {
2471  std::map<int, int>::iterator zwischen = it;
2472  zwischen--;
2473  int id = it->first;
2474  int id_old = zwischen->first;
2475  if (id == id_old) {
2476  check2++;
2477  if (check2 > 3) {
2478  //fhPi0_Reco_occurence->Fill(1);
2479  samePi0counter2++;
2480  }
2481  } else {
2482  if (check2 == 1) fhPi0_Reco_occurence->Fill(11);
2483  if (check2 == 2) fhPi0_Reco_occurence->Fill(12);
2484  if (check2 == 3) fhPi0_Reco_occurence->Fill(13);
2485  if (check2 == 4) fhPi0_Reco_occurence->Fill(14);
2486  if (check2 > 4) fhPi0_Reco_occurence->Fill(15);
2487  /*
2488  if(check == 4) {
2489  std::map<int,int>::iterator alt3 = zwischen;
2490  alt3--;
2491  std::map<int,int>::iterator alt4 = alt3;
2492  alt4--;
2493  std::map<int,int>::iterator alt5 = alt4;
2494  alt5--;
2495  cout << "CbmAnaConversion: AnalysePi0_Reco: " << alt5->first << "/" << zwischen->first << "/" << alt3->first << "/" << alt4->first << endl;
2496  cout << "CbmAnaConversion: AnalysePi0_Reco: " << alt5->second << "/" << zwischen->second << "/" << alt3->second << "/" << alt4->second << endl;
2497  AnalysePi0_Reco_calc(alt5->second, zwischen->second, alt3->second, alt4->second);
2498 
2499  }
2500  */
2501  check2 = 1;
2502  }
2503  }
2504  }
2505 }
2506 
2507 
2508 Bool_t CbmAnaConversion::AnalysePi0_Reco_calc(int e1, int e2, int e3, int e4) {
2509  CbmMCTrack* mctrack_e1 = fTestTracklist[e1];
2510  CbmMCTrack* mctrack_e2 = fTestTracklist[e2];
2511  CbmMCTrack* mctrack_e3 = fTestTracklist[e3];
2512  CbmMCTrack* mctrack_e4 = fTestTracklist[e4];
2513 
2514  Int_t motherID_e1 = mctrack_e1->GetMotherId();
2515  Int_t motherID_e2 = mctrack_e2->GetMotherId();
2516  Int_t motherID_e3 = mctrack_e3->GetMotherId();
2517  Int_t motherID_e4 = mctrack_e4->GetMotherId();
2518 
2519 
2520  Double_t energy1 = TMath::Sqrt(fTestTracklist_momentum[e1].Mag2() + M2E);
2521  TLorentzVector lorVec1(fTestTracklist_momentum[e1], energy1);
2522 
2523  Double_t energy2 = TMath::Sqrt(fTestTracklist_momentum[e2].Mag2() + M2E);
2524  TLorentzVector lorVec2(fTestTracklist_momentum[e2], energy2);
2525 
2526  Double_t energy3 = TMath::Sqrt(fTestTracklist_momentum[e3].Mag2() + M2E);
2527  TLorentzVector lorVec3(fTestTracklist_momentum[e3], energy3);
2528 
2529  Double_t energy4 = TMath::Sqrt(fTestTracklist_momentum[e4].Mag2() + M2E);
2530  TLorentzVector lorVec4(fTestTracklist_momentum[e4], energy4);
2531 
2532 
2533  Bool_t IsWithinCuts = false;
2534  Double_t OpeningAngleCut = 1.5;
2535 
2536  if (motherID_e1 == motherID_e2 && motherID_e3 == motherID_e4) {
2537  Double_t anglePair1 = lorVec1.Angle(lorVec2.Vect());
2538  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2539 
2540  Double_t anglePair2 = lorVec3.Angle(lorVec4.Vect());
2541  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2542 
2543  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2544  IsWithinCuts = true;
2545  fhPi0_Reco_angles->Fill(theta1);
2546  fhPi0_Reco_angles->Fill(theta2);
2547  cout << "CbmAnaConversion: AnalysePi0_Reco_calc: " << theta1 << "/"
2548  << theta2 << endl;
2549  }
2550 
2551  if (motherID_e1 == motherID_e3 && motherID_e2 == motherID_e4) {
2552  Double_t anglePair1 = lorVec1.Angle(lorVec3.Vect());
2553  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2554 
2555  Double_t anglePair2 = lorVec2.Angle(lorVec4.Vect());
2556  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2557 
2558  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2559  IsWithinCuts = true;
2560  fhPi0_Reco_angles->Fill(theta1);
2561  fhPi0_Reco_angles->Fill(theta2);
2562  cout << "CbmAnaConversion: AnalysePi0_Reco_calc: " << theta1 << "/"
2563  << theta2 << endl;
2564  }
2565 
2566  if (motherID_e1 == motherID_e4 && motherID_e2 == motherID_e3) {
2567  Double_t anglePair1 = lorVec1.Angle(lorVec4.Vect());
2568  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2569 
2570  Double_t anglePair2 = lorVec2.Angle(lorVec3.Vect());
2571  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2572 
2573  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2574  IsWithinCuts = true;
2575  fhPi0_Reco_angles->Fill(theta1);
2576  fhPi0_Reco_angles->Fill(theta2);
2577  cout << "CbmAnaConversion: AnalysePi0_Reco_calc: " << theta1 << "/"
2578  << theta2 << endl;
2579  }
2580 
2581  if (IsWithinCuts == true) { fhPi0_Reco_occurence->Fill(8); }
2582 
2583  return IsWithinCuts;
2584 }
2585 
2586 
2588  Int_t electrons = 0;
2589  std::multimap<int, int>
2590  electronPi0ID_map; // contains all IDs of pi0, from which an electron has been detected
2591  std::multimap<int, int>
2592  electronPi0ID_map_richInd; // contains all IDs of pi0, from which an electron has been detected
2593 
2594  Int_t nof = fTestTracklist_noRichInd.size();
2595  for (int i = 0; i < nof; i++) {
2596  Int_t motherID = fTestTracklist_noRichInd[i]->GetMotherId();
2597  Int_t pdg = fTestTracklist_noRichInd[i]->GetPdgCode();
2598 
2599  if (TMath::Abs(pdg) == 11 && motherID != -1) {
2600  CbmMCTrack* mctrack_mother = (CbmMCTrack*) fMcTracks->At(motherID);
2601  if (mctrack_mother == NULL) continue;
2602  Int_t grandmotherID = mctrack_mother->GetMotherId();
2603  Int_t motherPdg = mctrack_mother->GetPdgCode();
2604 
2605  if (motherPdg == 22 && grandmotherID != -1) {
2606  CbmMCTrack* mctrack_grandmother =
2607  (CbmMCTrack*) fMcTracks->At(grandmotherID);
2608  if (mctrack_grandmother == NULL) continue;
2609  Int_t grandmotherPdg = mctrack_grandmother->GetPdgCode();
2610 
2611  if (grandmotherPdg == 111) {
2612  electrons++;
2613  electronPi0ID_map.insert(std::pair<int, int>(grandmotherID, i));
2614  if (!(fTestTracklist_noRichInd_richInd[i] < 0)) {
2615  electronPi0ID_map_richInd.insert(
2616  std::pair<int, int>(grandmotherID, i));
2617  }
2624 
2625  TVector3 startvertex;
2626  fTestTracklist_noRichInd[i]->GetStartVertex(startvertex);
2627  if (startvertex.Z() < 1) {
2634  }
2635  } else {
2642  }
2643  } else {
2650  }
2651  } else {
2652  if (TMath::Abs(pdg) != 11) continue;
2659  }
2660  }
2661 
2662  if (
2663  electrons
2664  >= 4) { // at least 4 electrons from pi0 (NOT from the same one) have been detected
2665  fhPi0_Reco_occurence2->Fill(0);
2666  }
2667 
2668 
2669  int samePi0counter = 0;
2670  int check = 0;
2671  int check_withRichInd = 0;
2672  for (std::map<int, int>::iterator it = electronPi0ID_map.begin();
2673  it != electronPi0ID_map.end();
2674  ++it) {
2675  if (it == electronPi0ID_map.begin()) check = 1;
2676  if (it != electronPi0ID_map.begin()) {
2677  std::map<int, int>::iterator zwischen = it;
2678  zwischen--;
2679  int id = it->first;
2680  int id_old = zwischen->first;
2681  if (id == id_old) {
2682  check++;
2683  if (check > 3) {
2684  //fhPi0_Reco_occurence->Fill(1);
2685  samePi0counter++;
2686  }
2687  if (fTestTracklist_noRichInd_richInd[it->second] >= 0) {
2688  check_withRichInd++;
2689  }
2690  } else {
2691  if (check == 1) fhPi0_Reco_occurence2->Fill(2);
2692  if (check == 2) fhPi0_Reco_occurence2->Fill(3);
2693  if (check == 3) fhPi0_Reco_occurence2->Fill(4);
2694  if (check == 4) fhPi0_Reco_occurence2->Fill(5);
2695  if (check > 4) fhPi0_Reco_occurence2->Fill(6);
2696 
2697  if (check == 4) {
2698  std::map<int, int>::iterator alt3 = zwischen;
2699  alt3--;
2700  std::map<int, int>::iterator alt4 = alt3;
2701  alt4--;
2702  std::map<int, int>::iterator alt5 = alt4;
2703  alt5--;
2704  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd: " << alt5->first
2705  << "/" << zwischen->first << "/" << alt3->first << "/"
2706  << alt4->first << endl;
2707  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd: "
2708  << alt5->second << "/" << zwischen->second << "/" << alt3->second
2709  << "/" << alt4->second << endl;
2710  Bool_t IsWithinCuts = AnalysePi0_Reco_noRichInd_calc(
2711  alt5->second, zwischen->second, alt3->second, alt4->second);
2712 
2713  Double_t chi_e1 = fTestTracklist_noRichInd_chi[alt5->second];
2714  Double_t chi_e2 = fTestTracklist_noRichInd_chi[zwischen->second];
2715  Double_t chi_e3 = fTestTracklist_noRichInd_chi[alt3->second];
2716  Double_t chi_e4 = fTestTracklist_noRichInd_chi[alt4->second];
2717 
2718  Int_t richInd_e1 = fTestTracklist_noRichInd_richInd[alt5->second];
2719  Int_t richInd_e2 = fTestTracklist_noRichInd_richInd[zwischen->second];
2720  Int_t richInd_e3 = fTestTracklist_noRichInd_richInd[alt3->second];
2721  Int_t richInd_e4 = fTestTracklist_noRichInd_richInd[alt4->second];
2722 
2723 
2724  Double_t invmass = Invmass_4particlesRECO(
2725  fTestTracklist_noRichInd_momentum[alt5->second],
2726  fTestTracklist_noRichInd_momentum[zwischen->second],
2727  fTestTracklist_noRichInd_momentum[alt3->second],
2728  fTestTracklist_noRichInd_momentum[alt4->second]);
2729  fhPi0_Reco_noRichInd_invmass->Fill(invmass);
2730  fhPi0_Reco_noRichInd_invmass_cases->Fill(1, invmass);
2731  Double_t invmass_mc =
2733  fTestTracklist_noRichInd[zwischen->second],
2734  fTestTracklist_noRichInd[alt3->second],
2735  fTestTracklist_noRichInd[alt4->second]);
2736  fhPi0_Reco_noRichInd_invmass_mc->Fill(invmass_mc);
2737  fhPi0_Reco_noRichInd_invmass_cases->Fill(5, invmass_mc);
2738 
2739 
2740  std::map<int, int>::iterator temp = zwischen;
2741  for (int i = 0; i < 4; i++) {
2742  int ndf = fTestTracklist_noRichInd_ndf[temp->second];
2743  int nofhits = fTestTracklist_noRichInd_nofhits[temp->second];
2744  fhPi0_Reco_noRichInd_ndf_vs_nofhits->Fill(ndf, nofhits);
2745  temp--;
2746  }
2747 
2748  if (chi_e1 <= 3 && chi_e2 <= 3 && chi_e3 <= 3 && chi_e4 <= 3) {
2749  fhPi0_Reco_occurence2->Fill(9);
2750  fhPi0_Reco_noRichInd_invmass_cases->Fill(2, invmass);
2751  if (IsWithinCuts) {
2752  fhPi0_Reco_occurence2->Fill(10);
2753  fhPi0_Reco_noRichInd_invmass_cases->Fill(4, invmass);
2754  }
2755 
2756  std::map<int, int>::iterator temp2 = zwischen;
2757  for (int i = 0; i < 4; i++) {
2758  int ndf = fTestTracklist_noRichInd_ndf[temp2->second];
2759  int nofhits = fTestTracklist_noRichInd_nofhits[temp2->second];
2760  fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi->Fill(ndf, nofhits);
2761  temp2--;
2762  }
2763  }
2764 
2765  if (IsWithinCuts) {
2766  fhPi0_Reco_noRichInd_invmass_cases->Fill(3, invmass);
2767  }
2768 
2769  if (richInd_e1 >= 0 && richInd_e2 >= 0 && richInd_e3 >= 0
2770  && richInd_e4 >= 0) {
2771  fhPi0_Reco_noRichInd_invmass_cases->Fill(6, invmass);
2772  fhPi0_Reco_noRichInd_invmass_cases->Fill(10, invmass_mc);
2773  if (IsWithinCuts) {
2774  fhPi0_Reco_noRichInd_invmass_cases->Fill(8, invmass);
2775  }
2776  if (chi_e1 <= 3 && chi_e2 <= 3 && chi_e3 <= 3 && chi_e4 <= 3) {
2777  fhPi0_Reco_noRichInd_invmass_cases->Fill(7, invmass);
2778  if (IsWithinCuts) {
2779  fhPi0_Reco_noRichInd_invmass_cases->Fill(9, invmass);
2780  }
2781  }
2782  }
2783  }
2784 
2785  if (check > 4) {
2786  std::map<int, int>::iterator temp = zwischen;
2787  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd, check>4: ";
2788  for (int i = 0; i < check; i++) {
2789  TVector3 momentum_mc;
2790  fTestTracklist_noRichInd[temp->second]->GetMomentum(momentum_mc);
2791  Double_t theta_mc = 180.0 * momentum_mc.Theta() / TMath::Pi();
2792  Double_t phi_mc = 180.0 * momentum_mc.Phi() / TMath::Pi();
2793  TVector3 momentum_reco =
2794  fTestTracklist_noRichInd_momentum[temp->second];
2795  Double_t theta_reco = 180.0 * momentum_reco.Theta() / TMath::Pi();
2796  Double_t phi_reco = 180.0 * momentum_reco.Phi() / TMath::Pi();
2797  cout << "(" << temp->first << "/" << temp->second << "/"
2798  << fTestTracklist_noRichInd_MCindex[temp->second] << "/"
2799  << momentum_reco.Mag() << "/" << theta_mc << "-" << phi_mc
2800  << "/" << theta_reco << "-" << phi_reco << ") \t";
2801  temp--;
2802  fhPi0_noRichInd_diffPhi->Fill(TMath::Abs(phi_mc - phi_reco));
2803  fhPi0_noRichInd_diffTheta->Fill(TMath::Abs(theta_mc - theta_reco));
2804  }
2805  cout << endl;
2806  }
2807 
2808 
2809  if (check_withRichInd == 1) fhPi0_Reco_occurence2->Fill(11);
2810  if (check_withRichInd == 2) fhPi0_Reco_occurence2->Fill(12);
2811  if (check_withRichInd == 3) fhPi0_Reco_occurence2->Fill(13);
2812  if (check_withRichInd == 4) fhPi0_Reco_occurence2->Fill(14);
2813  if (check_withRichInd > 4) fhPi0_Reco_occurence2->Fill(15);
2814 
2815 
2816  // reset of check-parameters for next loop
2817  check = 1;
2818  if (fTestTracklist_noRichInd_richInd[it->second] >= 0) {
2819  check_withRichInd = 1;
2820  } else {
2821  check_withRichInd = 0;
2822  }
2823  }
2824  }
2825  }
2826 
2827  if (samePi0counter >= 4) {
2828  //fhPi0_MC_occurence->Fill(13);
2829  }
2830 }
2831 
2832 
2834  int e2,
2835  int e3,
2836  int e4) {
2837  CbmMCTrack* mctrack_e1 = fTestTracklist_noRichInd[e1];
2838  CbmMCTrack* mctrack_e2 = fTestTracklist_noRichInd[e2];
2839  CbmMCTrack* mctrack_e3 = fTestTracklist_noRichInd[e3];
2840  CbmMCTrack* mctrack_e4 = fTestTracklist_noRichInd[e4];
2841 
2842  Int_t motherID_e1 = mctrack_e1->GetMotherId();
2843  Int_t motherID_e2 = mctrack_e2->GetMotherId();
2844  Int_t motherID_e3 = mctrack_e3->GetMotherId();
2845  Int_t motherID_e4 = mctrack_e4->GetMotherId();
2846 
2847 
2848  Double_t energy1 =
2849  TMath::Sqrt(fTestTracklist_noRichInd_momentum[e1].Mag2() + M2E);
2850  TLorentzVector lorVec1(fTestTracklist_noRichInd_momentum[e1], energy1);
2851 
2852  Double_t energy2 =
2853  TMath::Sqrt(fTestTracklist_noRichInd_momentum[e2].Mag2() + M2E);
2854  TLorentzVector lorVec2(fTestTracklist_noRichInd_momentum[e2], energy2);
2855 
2856  Double_t energy3 =
2857  TMath::Sqrt(fTestTracklist_noRichInd_momentum[e3].Mag2() + M2E);
2858  TLorentzVector lorVec3(fTestTracklist_noRichInd_momentum[e3], energy3);
2859 
2860  Double_t energy4 =
2861  TMath::Sqrt(fTestTracklist_noRichInd_momentum[e4].Mag2() + M2E);
2862  TLorentzVector lorVec4(fTestTracklist_noRichInd_momentum[e4], energy4);
2863 
2864 
2865  Bool_t IsWithinCuts = false;
2866  Double_t OpeningAngleCut = 1.5;
2867 
2868  if (motherID_e1 == motherID_e2 && motherID_e3 == motherID_e4) {
2869  Double_t anglePair1 = lorVec1.Angle(lorVec2.Vect());
2870  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2871 
2872  Double_t anglePair2 = lorVec3.Angle(lorVec4.Vect());
2873  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2874 
2875  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2876  IsWithinCuts = true;
2877  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd_calc: " << theta1
2878  << "/" << theta2 << endl;
2879  }
2880 
2881  if (motherID_e1 == motherID_e3 && motherID_e2 == motherID_e4) {
2882  Double_t anglePair1 = lorVec1.Angle(lorVec3.Vect());
2883  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2884 
2885  Double_t anglePair2 = lorVec2.Angle(lorVec4.Vect());
2886  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2887 
2888  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2889  IsWithinCuts = true;
2890  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd_calc: " << theta1
2891  << "/" << theta2 << endl;
2892  }
2893 
2894  if (motherID_e1 == motherID_e4 && motherID_e2 == motherID_e3) {
2895  Double_t anglePair1 = lorVec1.Angle(lorVec4.Vect());
2896  Double_t theta1 = 180. * anglePair1 / TMath::Pi();
2897 
2898  Double_t anglePair2 = lorVec2.Angle(lorVec3.Vect());
2899  Double_t theta2 = 180. * anglePair2 / TMath::Pi();
2900 
2901  if (theta1 <= OpeningAngleCut && theta2 <= OpeningAngleCut)
2902  IsWithinCuts = true;
2903  cout << "CbmAnaConversion: AnalysePi0_Reco_noRichInd_calc: " << theta1
2904  << "/" << theta2 << endl;
2905  }
2906 
2907  if (IsWithinCuts == true) { fhPi0_Reco_occurence2->Fill(8); }
2908 
2909  return IsWithinCuts;
2910 }
2911 
2912 
CbmAnaConversion::fTime_mc
Double_t fTime_mc
Definition: CbmAnaConversion.h:351
CbmRichPoint.h
CbmAnaConversion::fhNofElSec
TH1D * fhNofElSec
Definition: CbmAnaConversion.h:146
CbmAnaConversion::fAnaRich
CbmAnaConversionRich * fAnaRich
Definition: CbmAnaConversion.h:357
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmMCTrack::GetMomentum
void GetMomentum(TVector3 &momentum) const
Definition: CbmMCTrack.h:172
CbmAnaConversion::fhPi0_Reco_ndf_vs_chi
TH2D * fhPi0_Reco_ndf_vs_chi
Definition: CbmAnaConversion.h:310
CbmAnaConversion::fKFparticleFinderQA
CbmKFParticleFinderQA * fKFparticleFinderQA
Definition: CbmAnaConversion.h:227
CbmAnaConversion::fTime_all
Double_t fTime_all
Definition: CbmAnaConversion.h:346
CbmAnaConversion::fhNofElAll
TH1D * fhNofElAll
Definition: CbmAnaConversion.h:147
CbmAnaConversionPhotons2.h
CbmAnaConversion::fhPi0_Reco_chi_vs_pt_eFromPi0
TH2D * fhPi0_Reco_chi_vs_pt_eFromPi0
Definition: CbmAnaConversion.h:340
CbmAnaConversion::fhANN_output_else_chiCut
TH1D * fhANN_output_else_chiCut
Definition: CbmAnaConversion.h:214
CbmAnaConversion::ReconstructGamma
void ReconstructGamma()
Definition: CbmAnaConversion.cxx:2147
CbmAnaConversion::testint
int testint
Definition: CbmAnaConversion.h:221
CbmAnaConversionTomography.h
CbmAnaConversionPhotons.h
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_momentum_eRest
TH2D * fhPi0_Reco_noRichInd_chi_vs_momentum_eRest
Definition: CbmAnaConversion.h:329
CbmAnaConversionPhotons::Exec
void Exec()
Definition: CbmAnaConversionPhotons.cxx:1165
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0_Target
TH2D * fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0_Target
Definition: CbmAnaConversion.h:328
CbmAnaConversion::fhPi0_Reco_noRichInd_ndf_vs_nofhits
TH2D * fhPi0_Reco_noRichInd_ndf_vs_nofhits
Definition: CbmAnaConversion.h:322
CbmAnaConversion::fTestTracklist_ndf
std::vector< int > fTestTracklist_ndf
Definition: CbmAnaConversion.h:285
CbmKFParticleFinder.h
CbmTrackMatchNew::GetTrueOverAllHitsRatio
Double_t GetTrueOverAllHitsRatio() const
Definition: CbmTrackMatchNew.h:35
CbmAnaConversion::Finish
virtual void Finish()
Inherited from FairTask.
Definition: CbmAnaConversion.cxx:1574
CbmAnaConversion::fhInvariantMass_test2
TH1D * fhInvariantMass_test2
Definition: CbmAnaConversion.h:184
CbmMatch::GetNofLinks
Int_t GetNofLinks() const
Definition: CbmMatch.h:38
CbmAnaConversion::fhANN_output_else
TH1D * fhANN_output_else
Definition: CbmAnaConversion.h:212
CbmAnaConversionTest::Exec
void Exec()
Definition: CbmAnaConversionTest.cxx:409
CbmKFParticleFinder
Definition: CbmKFParticleFinder.h:26
CbmAnaConversion::fhPi0_Reco_chi_vs_pt_eFromPi0_Target
TH2D * fhPi0_Reco_chi_vs_pt_eFromPi0_Target
Definition: CbmAnaConversion.h:341
CbmAnaConversion::fhPi0_Reco_occurence
TH1D * fhPi0_Reco_occurence
Definition: CbmAnaConversion.h:305
CbmAnaConversion::SetKF
void SetKF(CbmKFParticleFinder *kfparticle, CbmKFParticleFinderQA *kfparticleQA)
Definition: CbmAnaConversion.cxx:2170
CbmAnaConversion::Invmass_2gammas
Double_t Invmass_2gammas(const CbmMCTrack *gamma1, const CbmMCTrack *gamma2)
Definition: CbmAnaConversion.cxx:1726
CbmAnaConversion::fhNofPi0_perEvent_cut
TH1D * fhNofPi0_perEvent_cut
Definition: CbmAnaConversion.h:151
CbmAnaConversion::fTestTracklist_noRichInd_nofhits
std::vector< int > fTestTracklist_noRichInd_nofhits
Definition: CbmAnaConversion.h:295
CbmAnaConversion::AnalysePi0_Reco_calc
Bool_t AnalysePi0_Reco_calc(int e1, int e2, int e3, int e4)
Definition: CbmAnaConversion.cxx:2508
L1Field.h
CbmL1PFFitter
Definition: CbmL1PFFitter.h:31
CbmAnaConversion::fAnaTomography
CbmAnaConversionTomography * fAnaTomography
Definition: CbmAnaConversion.h:356
CbmAnaConversion::fhPi0Ratio
TH1D * fhPi0Ratio
Definition: CbmAnaConversion.h:244
CbmAnaConversion::fhPi0_Reco_ndf
TH1D * fhPi0_Reco_ndf
Definition: CbmAnaConversion.h:309
CbmAnaConversion::fhPi0_theta_vs_rap
TH2D * fhPi0_theta_vs_rap
Definition: CbmAnaConversion.h:165
CbmL1PFFitter::Fit
void Fit(std::vector< CbmStsTrack > &Tracks, std::vector< int > &pidHypo)
Definition: CbmL1PFFitter.cxx:81
CbmAnaConversion::fAnaRecoFull
CbmAnaConversionRecoFull * fAnaRecoFull
Definition: CbmAnaConversion.h:362
CbmAnaConversionTest.h
CbmAnaConversion::fhPi0_z
TH1D * fhPi0_z
Definition: CbmAnaConversion.h:159
CbmAnaConversion::fhInvariantMassReco_test
TH1D * fhInvariantMassReco_test
Definition: CbmAnaConversion.h:186
CbmAnaConversion::fNofGeneratedPi0_allEvents
Int_t fNofGeneratedPi0_allEvents
Definition: CbmAnaConversion.h:239
CbmAnaConversion::fhOmega_pt_vs_rap
TH2D * fhOmega_pt_vs_rap
Definition: CbmAnaConversion.h:175
CbmAnaConversionPhotons2
Definition: CbmAnaConversionPhotons2.h:27
CbmAnaConversion::fhANN_output_electrons_chiCut
TH1D * fhANN_output_electrons_chiCut
Definition: CbmAnaConversion.h:210
CbmAnaConversion::fhANN_output_else2
TH1D * fhANN_output_else2
Definition: CbmAnaConversion.h:213
CbmAnaConversion::fhMomentum_MCvsReco_diff
TH1D * fhMomentum_MCvsReco_diff
Definition: CbmAnaConversion.h:193
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
CbmAnaConversion::InvariantMassTest
void InvariantMassTest()
Definition: CbmAnaConversion.cxx:1978
CbmAnaConversion::fhRho_pt
TH1D * fhRho_pt
Definition: CbmAnaConversion.h:170
CbmAnaConversion::DoPhotons
Int_t DoPhotons
Definition: CbmAnaConversion.h:139
CbmKFParticleFinderQA
Definition: CbmKFParticleFinderQA.h:21
CbmAnaConversion::fhNofEta_perEvent_cut
TH1D * fhNofEta_perEvent_cut
Definition: CbmAnaConversion.h:157
CbmAnaConversion::fTestTracklist_nofhits
std::vector< int > fTestTracklist_nofhits
Definition: CbmAnaConversion.h:286
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmAnaConversionPhotons2::Finish
void Finish()
Definition: CbmAnaConversionPhotons2.cxx:901
CbmAnaConversion::fhPi0_Reco_invmass_cases
TH2D * fhPi0_Reco_invmass_cases
Definition: CbmAnaConversion.h:316
CbmAnaConversionTest::Init
void Init()
Definition: CbmAnaConversionTest.cxx:105
CbmAnaConversion::fRecoTracklistEPEM_chi
std::vector< Double_t > fRecoTracklistEPEM_chi
Definition: CbmAnaConversion.h:277
CbmAnaConversion::FillRecoTracklistEPEM
Bool_t FillRecoTracklistEPEM(CbmMCTrack *mctrack, TVector3 stsMomentum, TVector3 refittedMom, int i, Double_t chi, Int_t GlobalTrackId)
Definition: CbmAnaConversion.cxx:1921
CbmAnaConversion::fhPi0_MC_occurence
TH1D * fhPi0_MC_occurence
Definition: CbmAnaConversion.h:303
CbmAnaConversion::fhPi0_Reco_startvertex_vs_chi
TH2D * fhPi0_Reco_startvertex_vs_chi
Definition: CbmAnaConversion.h:312
CbmAnaConversion::fKFVertex
CbmKFVertex fKFVertex
Definition: CbmAnaConversion.h:199
CbmAnaConversionTomography
Definition: CbmAnaConversionTomography.h:28
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0
TH2D * fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0
Definition: CbmAnaConversion.h:331
CbmAnaConversion::fhPi0_Reco_noRichInd_invmass_mc
TH1D * fhPi0_Reco_noRichInd_invmass_mc
Definition: CbmAnaConversion.h:321
CbmAnaConversion::timer_exec
TStopwatch timer_exec
Definition: CbmAnaConversion.h:347
CbmAnaConversionTest2.h
CbmAnaConversion::fNofPi0_kfparticle_allEvents
Int_t fNofPi0_kfparticle_allEvents
Definition: CbmAnaConversion.h:241
CbmAnaConversion::fhPi0_Reco_chi_vs_momentum
TH2D * fhPi0_Reco_chi_vs_momentum
Definition: CbmAnaConversion.h:336
CbmAnaConversion::DoKFAnalysis
Int_t DoKFAnalysis
Definition: CbmAnaConversion.h:137
CbmAnaConversion::fTime_rec
Double_t fTime_rec
Definition: CbmAnaConversion.h:353
CbmGlobalTrack.h
CbmAnaConversion::fhPi0_pt_vs_rap
TH2D * fhPi0_pt_vs_rap
Definition: CbmAnaConversion.h:163
CbmAnaConversion::fAnalyseMode
Int_t fAnalyseMode
Definition: CbmAnaConversion.h:223
CbmAnaConversion::fhMomentum_MCvsReco
TH2D * fhMomentum_MCvsReco
Definition: CbmAnaConversion.h:192
CbmAnaConversion::AnalysePi0_Reco_noRichInd_calc
Bool_t AnalysePi0_Reco_noRichInd_calc(int e1, int e2, int e3, int e4)
Definition: CbmAnaConversion.cxx:2833
CbmAnaConversion::fAnaTest2
CbmAnaConversionTest2 * fAnaTest2
Definition: CbmAnaConversion.h:364
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_pt
TH2D * fhPi0_Reco_noRichInd_chi_vs_pt
Definition: CbmAnaConversion.h:330
CbmAnaConversion.h
CbmAnaConversion::fhInvariantMass_test
TH1D * fhInvariantMass_test
Definition: CbmAnaConversion.h:183
CbmAnaConversion::DoReconstruction
Int_t DoReconstruction
Definition: CbmAnaConversion.h:138
CbmAnaConversion::GetTest
int GetTest()
Definition: CbmAnaConversion.cxx:2132
CbmRichRing
Definition: CbmRichRing.h:17
CbmAnaConversion
Definition: CbmAnaConversion.h:59
CbmAnaConversion::DoRichAnalysis
Int_t DoRichAnalysis
Definition: CbmAnaConversion.h:136
CbmAnaConversion::fhElectronSources
TH1D * fhElectronSources
Definition: CbmAnaConversion.h:148
CbmAnaConversion::particlecounter
Int_t particlecounter
Definition: CbmAnaConversion.h:230
CbmRichRing.h
CbmAnaConversion::fhNofPi0_perEvent_cut3
TH1D * fhNofPi0_perEvent_cut3
Definition: CbmAnaConversion.h:154
CbmAnaConversion::fhSearchGammas
TH1D * fhSearchGammas
Definition: CbmAnaConversion.h:196
CbmAnaConversion::fhPi0_noRichInd_diffTheta
TH1D * fhPi0_noRichInd_diffTheta
Definition: CbmAnaConversion.h:315
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmAnaConversionKF::Finish
void Finish()
Definition: CbmAnaConversionKF.cxx:167
CbmAnaConversion::fhPi0_Reco_chi
TH1D * fhPi0_Reco_chi
Definition: CbmAnaConversion.h:308
CbmAnaConversionKF.h
CbmLmvmKinematicParams::fMinv
Double_t fMinv
Definition: CbmLmvmKinematicParams.h:22
CbmAnaConversion::fhPi0_Reco_startvertex_vs_nofhits
TH2D * fhPi0_Reco_startvertex_vs_nofhits
Definition: CbmAnaConversion.h:313
CbmAnaConversionRich
Definition: CbmAnaConversionRich.h:25
CbmAnaConversion::Init
virtual InitStatus Init()
Inherited from FairTask.
Definition: CbmAnaConversion.cxx:247
CbmAnaConversion::CalculateKinematicParams
CbmLmvmKinematicParams CalculateKinematicParams(const CbmMCTrack *mctrackP, const CbmMCTrack *mctrackM)
Definition: CbmAnaConversion.cxx:1693
CbmAnaConversionKF::Init
void Init()
Definition: CbmAnaConversionKF.cxx:76
CbmAnaConversion::InitHistograms
void InitHistograms()
Initialize histograms.
Definition: CbmAnaConversion.cxx:363
CbmStsTrack::GetNofHits
virtual Int_t GetNofHits() const
Definition: CbmStsTrack.h:76
CbmAnaConversion::fAnaPhotons
CbmAnaConversionPhotons * fAnaPhotons
Definition: CbmAnaConversion.h:360
CbmAnaConversion::fhPi0_Reco_occurence2
TH1D * fhPi0_Reco_occurence2
Definition: CbmAnaConversion.h:306
CbmAnaConversion::fRecoTracklistEPEM
std::vector< CbmMCTrack * > fRecoTracklistEPEM
Definition: CbmAnaConversion.h:273
CbmAnaConversion::fhNofPi0_perEvent
TH1D * fhNofPi0_perEvent
Definition: CbmAnaConversion.h:149
CbmAnaConversion::fNofPi0_kfparticle
Int_t fNofPi0_kfparticle
Definition: CbmAnaConversion.h:243
CbmAnaConversionCutSettings.h
CbmAnaConversion::fAnaKF
CbmAnaConversionKF * fAnaKF
Definition: CbmAnaConversion.h:358
CbmAnaConversion::timer_mc
TStopwatch timer_mc
Definition: CbmAnaConversion.h:350
CbmAnaConversion::SetMode
void SetMode(int mode)
Definition: CbmAnaConversion.cxx:2138
CbmAnaConversionReco::Init
void Init()
Definition: CbmAnaConversionReco.cxx:165
CbmAnaConversion::InvariantMassTestReco
void InvariantMassTestReco()
Definition: CbmAnaConversion.cxx:2012
CbmAnaConversion::fRecoTracklistEPEM_gtid
std::vector< Int_t > fRecoTracklistEPEM_gtid
Definition: CbmAnaConversion.h:279
CbmAnaConversion::CbmAnaConversion
CbmAnaConversion()
Standard constructor.
Definition: CbmAnaConversion.cxx:68
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0_Target
TH2D * fhPi0_Reco_noRichInd_chi_vs_pt_eFromPi0_Target
Definition: CbmAnaConversion.h:332
CbmAnaConversion::DoTest
Int_t DoTest
Definition: CbmAnaConversion.h:142
CbmAnaConversionTest2::Finish
void Finish()
Definition: CbmAnaConversionTest2.cxx:429
CbmAnaConversion::fTestTracklist_chi
std::vector< float > fTestTracklist_chi
Definition: CbmAnaConversion.h:283
CbmAnaConversion::fhNofEta_perEvent
TH1D * fhNofEta_perEvent
Definition: CbmAnaConversion.h:155
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmAnaConversion::fhNofElPrim
TH1D * fhNofElPrim
Definition: CbmAnaConversion.h:145
CbmAnaConversionReco::Finish
void Finish()
Definition: CbmAnaConversionReco.cxx:1039
CbmAnaConversionKF::Exec
void Exec()
Definition: CbmAnaConversionKF.cxx:180
CbmAnaConversion::fhPi0_pt
TH1D * fhPi0_pt
Definition: CbmAnaConversion.h:162
CbmAnaConversion::fAnaPhotons2
CbmAnaConversionPhotons2 * fAnaPhotons2
Definition: CbmAnaConversion.h:361
CbmAnaConversionTest2::Exec
void Exec()
Definition: CbmAnaConversionTest2.cxx:440
CbmAnaConversion::fHistoList_kfparticle
std::vector< TH1 * > fHistoList_kfparticle
Definition: CbmAnaConversion.h:264
CbmAnaConversion::fhPi0_MC_occurence2
TH1D * fhPi0_MC_occurence2
Definition: CbmAnaConversion.h:304
CbmAnaConversion::Exec
virtual void Exec(Option_t *option)
Inherited from FairTask.
Definition: CbmAnaConversion.cxx:1098
CbmAnaConversion::fhRho_pt_vs_rap
TH2D * fhRho_pt_vs_rap
Definition: CbmAnaConversion.h:171
CbmL1PFFitter::GetChiToVertex
void GetChiToVertex(std::vector< CbmStsTrack > &Tracks, std::vector< L1FieldRegion > &field, std::vector< float > &chiToVtx, CbmKFVertex &primVtx, float chiPrim=-1)
Definition: CbmL1PFFitter.cxx:403
CbmAnaConversion::DoRecoFull
Int_t DoRecoFull
Definition: CbmAnaConversion.h:141
CbmAnaConversion::fhPi0_Reco_chi_vs_momentum_eFromPi0
TH2D * fhPi0_Reco_chi_vs_momentum_eFromPi0
Definition: CbmAnaConversion.h:337
CbmAnaConversion::fhPi0_NDaughters
TH1D * fhPi0_NDaughters
Definition: CbmAnaConversion.h:246
CbmAnaConversion::fhEta_pt
TH1D * fhEta_pt
Definition: CbmAnaConversion.h:166
CbmAnaConversion::fhPi0_noRichInd_diffPhi
TH1D * fhPi0_noRichInd_diffPhi
Definition: CbmAnaConversion.h:314
CbmAnaConversionRich::Finish
void Finish()
Definition: CbmAnaConversionRich.cxx:411
CbmAnaConversion::AnalyseElectrons
void AnalyseElectrons(CbmMCTrack *mctrack)
Definition: CbmAnaConversion.cxx:1654
CbmAnaConversion::Invmass_2particles
Double_t Invmass_2particles(const CbmMCTrack *mctrack1, const CbmMCTrack *mctrack2)
Definition: CbmAnaConversion.cxx:1745
CbmAnaConversionTomography::Init
void Init()
Definition: CbmAnaConversionTomography.cxx:63
CbmAnaConversion::fRecoMomentum
std::vector< TVector3 > fRecoMomentum
Definition: CbmAnaConversion.h:297
CbmAnaConversion::fTestTracklist_noRichInd_chi
std::vector< float > fTestTracklist_noRichInd_chi
Definition: CbmAnaConversion.h:291
CbmAnaConversion::fhANN_output_electrons_vs_p
TH2D * fhANN_output_electrons_vs_p
Definition: CbmAnaConversion.h:211
CbmAnaConversionReco::CalculateInvMassWithFullRecoCuts
void CalculateInvMassWithFullRecoCuts()
Definition: CbmAnaConversionReco.cxx:3198
CbmAnaConversion::AnalysePi0_Reco_noRichInd
void AnalysePi0_Reco_noRichInd()
Definition: CbmAnaConversion.cxx:2587
CbmAnaConversionCutSettings::CalcChiCut
static Double_t CalcChiCut(Double_t pt)
Definition: CbmAnaConversionCutSettings.h:69
CbmAnaConversion::AnalysePi0_Reco
void AnalysePi0_Reco()
Definition: CbmAnaConversion.cxx:2302
CbmTrackMatchNew.h
CbmVertex
Definition: CbmVertex.h:26
CbmAnaConversion::fhPi0_Reco_angles
TH1D * fhPi0_Reco_angles
Definition: CbmAnaConversion.h:307
CbmAnaConversion::fStsTrackMatches
TClonesArray * fStsTrackMatches
Definition: CbmAnaConversion.h:205
CbmAnaConversion::fTestTracklist_noRichInd_gTrackId
std::vector< int > fTestTracklist_noRichInd_gTrackId
Definition: CbmAnaConversion.h:293
CbmAnaConversion::fTestTracklist_richInd
std::vector< int > fTestTracklist_richInd
Definition: CbmAnaConversion.h:284
CbmAnaConversion::FillRecoTracklist
void FillRecoTracklist(CbmMCTrack *mtrack)
Definition: CbmAnaConversion.cxx:1903
CbmL1PFFitter.h
CbmAnaConversion::fPrimVertex
CbmVertex * fPrimVertex
Definition: CbmAnaConversion.h:198
CbmAnaConversion::DoTomography
Int_t DoTomography
Definition: CbmAnaConversion.h:135
CbmAnaConversionKF::SetKF
void SetKF(CbmKFParticleFinder *kfparticle, CbmKFParticleFinderQA *kfparticleQA)
Definition: CbmAnaConversionKF.cxx:201
CbmAnaConversion::fhPi0_Reco_invmass
TH1D * fhPi0_Reco_invmass
Definition: CbmAnaConversion.h:318
CbmAnaConversion::fhInvariantMassReco_test2
TH1D * fhInvariantMassReco_test2
Definition: CbmAnaConversion.h:187
CbmAnaConversion::fhANN_output_electrons
TH1D * fhANN_output_electrons
Definition: CbmAnaConversion.h:208
CbmAnaConversion::fhOmega_theta
TH1D * fhOmega_theta
Definition: CbmAnaConversion.h:176
CbmAnaConversion::fhEta_pt_vs_rap
TH2D * fhEta_pt_vs_rap
Definition: CbmAnaConversion.h:167
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmAnaConversion::fhPi0_Reco_chi_vs_pt
TH2D * fhPi0_Reco_chi_vs_pt
Definition: CbmAnaConversion.h:339
CbmAnaConversionRich::Init
void Init()
Definition: CbmAnaConversionRich.cxx:80
CbmAnaConversionTest::Finish
void Finish()
Definition: CbmAnaConversionTest.cxx:398
CbmAnaConversion::fhPi0_mass
TH1D * fhPi0_mass
Definition: CbmAnaConversion.h:245
CbmAnaConversion::fhOmega_pt
TH1D * fhOmega_pt
Definition: CbmAnaConversion.h:174
CbmLmvmKinematicParams::fRapidity
Double_t fRapidity
Definition: CbmLmvmKinematicParams.h:21
CbmAnaConversion::particlecounter_4daughters
Int_t particlecounter_4daughters
Definition: CbmAnaConversion.h:233
CbmAnaConversion::timer_all
TStopwatch timer_all
Definition: CbmAnaConversion.h:345
CbmAnaConversion::fMCTracklist
std::vector< CbmMCTrack * > fMCTracklist
Definition: CbmAnaConversion.h:270
CbmAnaConversionReco.h
CbmAnaConversion::~CbmAnaConversion
virtual ~CbmAnaConversion()
Standard destructor.
Definition: CbmAnaConversion.cxx:245
CbmMCTrack::GetStartVertex
void GetStartVertex(TVector3 &vertex) const
Definition: CbmMCTrack.h:182
xMath::Pi
double Pi()
Definition: xMath.h:5
CbmAnaConversion::fHistoList_furtherAnalyses
std::vector< TH1 * > fHistoList_furtherAnalyses
Definition: CbmAnaConversion.h:268
CbmAnaConversion::fStsTracks
TClonesArray * fStsTracks
Definition: CbmAnaConversion.h:204
CbmAnaConversion::fhPi0_Reco_noRichInd_invmass_cases
TH2D * fhPi0_Reco_noRichInd_invmass_cases
Definition: CbmAnaConversion.h:317
CbmAnaConversion::fRichPoints
TClonesArray * fRichPoints
Definition: CbmAnaConversion.h:200
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmAnaConversionPhotons::Init
void Init()
Definition: CbmAnaConversionPhotons.cxx:184
CbmAnaConversionTomography::Exec
void Exec()
Definition: CbmAnaConversionTomography.cxx:317
CbmAnaConversion::fRecoRefittedMomentum
std::vector< TVector3 > fRecoRefittedMomentum
Definition: CbmAnaConversion.h:298
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_momentum
TH2D * fhPi0_Reco_noRichInd_chi_vs_momentum
Definition: CbmAnaConversion.h:326
CbmAnaConversion::fhPi0_Reco_noRichInd_invmass
TH1D * fhPi0_Reco_noRichInd_invmass
Definition: CbmAnaConversion.h:320
CbmUtils.h
CbmAnaConversion::fhInvariantMass_test3
TH1D * fhInvariantMass_test3
Definition: CbmAnaConversion.h:185
CbmAnaConversion::fhPi0_Reco_ndf_vs_nofhits_withChi
TH2D * fhPi0_Reco_ndf_vs_nofhits_withChi
Definition: CbmAnaConversion.h:325
CbmAnaConversion::FillMCTracklists
void FillMCTracklists(CbmMCTrack *mctrack, int i)
Definition: CbmAnaConversion.cxx:1857
CbmMCTrack::GetPt
Double_t GetPt() const
Definition: CbmMCTrack.h:99
CbmAnaConversion::timer_rec
TStopwatch timer_rec
Definition: CbmAnaConversion.h:352
CbmAnaConversionPhotons::Finish
void Finish()
Definition: CbmAnaConversionPhotons.cxx:1098
CbmAnaConversion::particlecounter_all
Int_t particlecounter_all
Definition: CbmAnaConversion.h:234
CbmAnaConversion::fMcTracks
TClonesArray * fMcTracks
Definition: CbmAnaConversion.h:203
CbmKFParticleFinderQA.h
CbmAnaConversionReco::InvariantMassTest_4epem
void InvariantMassTest_4epem()
Definition: CbmAnaConversionReco.cxx:1521
CbmAnaConversion::fTime_exec
Double_t fTime_exec
Definition: CbmAnaConversion.h:348
CbmAnaConversionPhotons2::Exec
void Exec()
Definition: CbmAnaConversionPhotons2.cxx:937
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmMCTrack::GetRapidity
Double_t GetRapidity() const
Definition: CbmMCTrack.cxx:177
CbmRichElectronIdAnn::GetInstance
static CbmRichElectronIdAnn & GetInstance()
Definition: CbmRichElectronIdAnn.h:43
CbmAnaConversionKF
Definition: CbmAnaConversionKF.h:31
CbmAnaConversion::fhANN_output_else_vs_p
TH2D * fhANN_output_else_vs_p
Definition: CbmAnaConversion.h:215
CbmAnaConversion::fhInvariantMassReco_pi0
TH1D * fhInvariantMassReco_pi0
Definition: CbmAnaConversion.h:190
CbmAnaConversionTest2
Definition: CbmAnaConversionTest2.h:29
CbmAnaConversionPhotons2::Init
void Init()
Definition: CbmAnaConversionPhotons2.cxx:131
CbmAnaConversion::fEventNum
Int_t fEventNum
Definition: CbmAnaConversion.h:217
CbmAnaConversion::fNofGeneratedPi0
Int_t fNofGeneratedPi0
Definition: CbmAnaConversion.h:242
CbmMCTrack.h
CbmAnaConversion::fhPi0_Reco_chi_vs_momentum_eFromPi0_Target
TH2D * fhPi0_Reco_chi_vs_momentum_eFromPi0_Target
Definition: CbmAnaConversion.h:338
v
__m128 v
Definition: L1/vectors/P4_F32vec4.h:1
CbmAnaConversionTomography::TomographyReco
void TomographyReco(CbmMCTrack *mctrack)
Definition: CbmAnaConversionTomography.cxx:541
CbmAnaConversionRecoFull::Finish
void Finish()
Definition: CbmAnaConversionRecoFull.cxx:1414
CbmAnaConversion::fhEta_theta_vs_rap
TH2D * fhEta_theta_vs_rap
Definition: CbmAnaConversion.h:169
CbmAnaConversion::fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi
TH2D * fhPi0_Reco_noRichInd_ndf_vs_nofhits_withChi
Definition: CbmAnaConversion.h:323
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0
TH2D * fhPi0_Reco_noRichInd_chi_vs_momentum_eFromPi0
Definition: CbmAnaConversion.h:327
CbmAnaConversion::fhRho_theta
TH1D * fhRho_theta
Definition: CbmAnaConversion.h:172
CbmAnaConversionRich::AnalyseRICHdata
void AnalyseRICHdata()
Definition: CbmAnaConversionRich.cxx:425
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmAnaConversion::fhNofTracks_globaltrack
TH1D * fhNofTracks_globaltrack
Definition: CbmAnaConversion.h:181
CbmAnaConversion::fRecoTracklist
std::vector< CbmMCTrack * > fRecoTracklist
Definition: CbmAnaConversion.h:272
CbmAnaConversion::fhElectronsFromPi0_z
TH1D * fhElectronsFromPi0_z
Definition: CbmAnaConversion.h:178
CbmAnaConversion::fTestTracklist_momentum
std::vector< TVector3 > fTestTracklist_momentum
Definition: CbmAnaConversion.h:282
CbmAnaConversion::fhNofEta_perEvent_cut2
TH1D * fhNofEta_perEvent_cut2
Definition: CbmAnaConversion.h:158
CbmAnaConversion::fTestTracklist_noRichInd_ndf
std::vector< int > fTestTracklist_noRichInd_ndf
Definition: CbmAnaConversion.h:294
CbmAnaConversion::CalculateInvMass_MC_2particles
void CalculateInvMass_MC_2particles()
Definition: CbmAnaConversion.cxx:1944
CbmAnaConversion::fhPi0_Reco_invmass_mc
TH1D * fhPi0_Reco_invmass_mc
Definition: CbmAnaConversion.h:319
CbmAnaConversionReco::SetTracklistReco
void SetTracklistReco(std::vector< CbmMCTrack * > MCTracklist, std::vector< TVector3 > RecoTracklist1, std::vector< TVector3 > RecoTracklist2, std::vector< int > ids, std::vector< Double_t > chi, std::vector< Int_t > GlobalTrackId)
Definition: CbmAnaConversionReco.cxx:1106
CbmRichElectronIdAnn::CalculateAnnValue
double CalculateAnnValue(int globalTrackIndex, double momentum)
Calculate output value of the ANN.
Definition: CbmRichElectronIdAnn.cxx:84
CbmAnaConversion::fhEta_theta
TH1D * fhEta_theta
Definition: CbmAnaConversion.h:168
CbmAnaConversion::fKFparticle
CbmKFParticleFinder * fKFparticle
Definition: CbmAnaConversion.h:226
CbmAnaConversion::fhNofElectrons_4epem
TH1D * fhNofElectrons_4epem
Definition: CbmAnaConversion.h:301
CbmAnaConversion::fTestTracklist_noRichInd_MCindex
std::vector< int > fTestTracklist_noRichInd_MCindex
Definition: CbmAnaConversion.h:289
CbmAnaConversion::fGlobalTracks
TClonesArray * fGlobalTracks
Definition: CbmAnaConversion.h:206
CbmLmvmKinematicParams::fMomentumMag
Double_t fMomentumMag
Definition: CbmLmvmKinematicParams.h:19
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmAnaConversion::fhANN_output_electrons2
TH1D * fhANN_output_electrons2
Definition: CbmAnaConversion.h:209
CbmAnaConversion::GetNofEvents
int GetNofEvents()
Definition: CbmAnaConversion.cxx:2135
CbmMCTrack::Get4Momentum
void Get4Momentum(TLorentzVector &momentum) const
Definition: CbmMCTrack.h:177
CbmAnaConversionTomography::Finish
void Finish()
Definition: CbmAnaConversionTomography.cxx:304
CbmAnaConversion::fhPi0_Reco_noRichInd_chi_vs_pt_eRest
TH2D * fhPi0_Reco_noRichInd_chi_vs_pt_eRest
Definition: CbmAnaConversion.h:333
CbmAnaConversionRecoFull::Init
void Init()
Definition: CbmAnaConversionRecoFull.cxx:242
CbmAnaConversionTest2::Init
void Init()
Definition: CbmAnaConversionTest2.cxx:84
CbmRichHit.h
CbmAnaConversion::fhRho_theta_vs_rap
TH2D * fhRho_theta_vs_rap
Definition: CbmAnaConversion.h:173
CbmAnaConversion::fRichRings
TClonesArray * fRichRings
Definition: CbmAnaConversion.h:201
CbmAnaConversion::fTestTracklist_noRichInd_momentum
std::vector< TVector3 > fTestTracklist_noRichInd_momentum
Definition: CbmAnaConversion.h:290
CbmAnaConversionReco::SetTracklistMC
void SetTracklistMC(std::vector< CbmMCTrack * > MCTracklist)
Definition: CbmAnaConversionReco.cxx:1101
CbmAnaConversion::DoPhotons2
Int_t DoPhotons2
Definition: CbmAnaConversion.h:140
CbmAnaConversion::fhOmega_theta_vs_rap
TH2D * fhOmega_theta_vs_rap
Definition: CbmAnaConversion.h:177
CbmAnaConversionRich.h
CbmAnaConversionRecoFull::Exec
void Exec()
Definition: CbmAnaConversionRecoFull.cxx:1465
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmAnaConversion::fhPi0_theta
TH1D * fhPi0_theta
Definition: CbmAnaConversion.h:164
CbmAnaConversionPhotons
Definition: CbmAnaConversionPhotons.h:40
CbmAnaConversion::fhPi0_z_cut
TH1D * fhPi0_z_cut
Definition: CbmAnaConversion.h:161
CbmAnaConversion::fMCTracklist_all
std::vector< CbmMCTrack * > fMCTracklist_all
Definition: CbmAnaConversion.h:271
CbmAnaConversion::particlecounter_3daughters
Int_t particlecounter_3daughters
Definition: CbmAnaConversion.h:232
CbmAnaConversionTest
Definition: CbmAnaConversionTest.h:29
CbmAnaConversion::particlecounter_2daughters
Int_t particlecounter_2daughters
Definition: CbmAnaConversion.h:231
CbmAnaConversionRecoFull.h
CbmAnaConversionRecoFull
Definition: CbmAnaConversionRecoFull.h:29
CbmAnaConversion::fRecoTracklistEPEM_id
std::vector< int > fRecoTracklistEPEM_id
Definition: CbmAnaConversion.h:275
CbmAnaConversion::fTestTracklist
std::vector< CbmMCTrack * > fTestTracklist
Definition: CbmAnaConversion.h:281
CbmLmvmKinematicParams
Definition: CbmLmvmKinematicParams.h:17
CbmLmvmKinematicParams::fPt
Double_t fPt
Definition: CbmLmvmKinematicParams.h:20
CbmAnaConversionReco
Definition: CbmAnaConversionReco.h:28
CbmAnaConversion::fhPi0_Reco_ndf_vs_startvertex
TH2D * fhPi0_Reco_ndf_vs_startvertex
Definition: CbmAnaConversion.h:311
M2E
#define M2E
Definition: CbmAnaConversion.cxx:63
CbmAnaConversion::test
Int_t test
Definition: CbmAnaConversion.h:219
CbmAnaConversion::Invmass_4particles
Double_t Invmass_4particles(const CbmMCTrack *mctrack1, const CbmMCTrack *mctrack2, const CbmMCTrack *mctrack3, const CbmMCTrack *mctrack4)
Definition: CbmAnaConversion.cxx:1764
CbmStsKFTrackFitter.h
CbmAnaConversion::fAnaReco
CbmAnaConversionReco * fAnaReco
Definition: CbmAnaConversion.h:359
CbmAnaConversion::Invmass_4particlesRECO
Double_t Invmass_4particlesRECO(const TVector3 part1, const TVector3 part2, const TVector3 part3, const TVector3 part4)
Definition: CbmAnaConversion.cxx:1827
CbmAnaConversion::fTestTracklist_noRichInd_richInd
std::vector< int > fTestTracklist_noRichInd_richInd
Definition: CbmAnaConversion.h:292
CbmAnaConversion::fHistoList
std::vector< TH1 * > fHistoList
Definition: CbmAnaConversion.h:254
CbmAnaConversion::fTestTracklist_noRichInd
std::vector< CbmMCTrack * > fTestTracklist_noRichInd
Definition: CbmAnaConversion.h:288
CbmAnaConversion::AnalysePi0_MC
Bool_t AnalysePi0_MC(CbmMCTrack *mctrack, int i)
Definition: CbmAnaConversion.cxx:2183
CbmAnaConversion::fRichRingMatches
TClonesArray * fRichRingMatches
Definition: CbmAnaConversion.h:202
CbmKFVertex
Definition: CbmKFVertex.h:6
CbmAnaConversion::fhNofTracks_mctrack
TH1D * fhNofTracks_mctrack
Definition: CbmAnaConversion.h:180
CbmAnaConversion::fhInvariantMassReco_test3
TH1D * fhInvariantMassReco_test3
Definition: CbmAnaConversion.h:188
CbmAnaConversion::fhPdgCodes
TH1D * fhPdgCodes
Definition: CbmAnaConversion.h:144
CbmAnaConversion::fhNofPi0_perEvent_cut2
TH1D * fhNofPi0_perEvent_cut2
Definition: CbmAnaConversion.h:152
CbmLmvmKinematicParams::fAngle
Double_t fAngle
Definition: CbmLmvmKinematicParams.h:23
CbmAnaConversion::fAnaTest
CbmAnaConversionTest * fAnaTest
Definition: CbmAnaConversion.h:363
CbmAnaConversion::fhPi0_Reco_ndf_vs_nofhits
TH2D * fhPi0_Reco_ndf_vs_nofhits
Definition: CbmAnaConversion.h:324