32 #include "FairLogger.h"
33 #include "FairRootManager.h"
37 #define M2E 2.6112004954086e-7
44 , fRichRingMatches(NULL)
47 , fStsTrackMatches(NULL)
51 , fHistoList_recofull()
52 , fHistoList_recofull_1()
53 , fHistoList_recofull_2()
54 , fHistoList_recofull_3()
55 , fHistoList_recofull_4()
56 , fHistoList_recofull_new()
58 , fhMomentumFits(NULL)
59 , fhMomentumFits_electronRich(NULL)
60 , fhMomentumFits_pi0reco(NULL)
62 , fElectrons_momenta()
63 , fElectrons_momentaChi()
64 , fElectrons_mctrackID()
65 , fElectrons_track_1()
66 , fElectrons_momenta_1()
67 , fElectrons_momentaChi_1()
68 , fElectrons_mctrackID_1()
69 , fVector_photons_pairs_1()
70 , fElectrons_track_2()
71 , fElectrons_momenta_2()
72 , fElectrons_momentaChi_2()
73 , fElectrons_mctrackID_2()
74 , fVector_photons_pairs_2()
75 , fElectrons_track_3()
76 , fElectrons_momenta_3()
77 , fElectrons_momentaChi_3()
78 , fElectrons_mctrackID_3()
79 , fVector_photons_pairs_3()
80 , fElectrons_track_4()
81 , fElectrons_momenta_4()
82 , fElectrons_momentaChi_4()
83 , fElectrons_mctrackID_4()
84 , fVector_photons_pairs_4()
85 , fElectrons_track_new()
86 , fElectrons_momenta_new()
87 , fElectrons_momentaChi_new()
88 , fElectrons_mctrackID_new()
89 , fElectrons_globaltrackID_new()
90 , fVector_photons_pairs_new()
91 , fhElectrons_invmass(NULL)
92 , fhElectrons_invmass_cut(NULL)
93 , fhElectrons_nofPerEvent(NULL)
94 , fhPhotons_nofPerEvent(NULL)
95 , fVector_photons_pairs()
96 , fVector_photons_momenta()
97 , fhPhotons_invmass(NULL)
98 , fhPhotons_invmass_cut(NULL)
99 , fhPhotons_invmass_cut_chi1(NULL)
100 , fhPhotons_invmass_cut_chi3(NULL)
101 , fhPhotons_invmass_cut_chi5(NULL)
102 , fhPhotons_invmass_cut_chi10(NULL)
103 , fhPhotons_invmass_cut_chi25(NULL)
104 , fhPhotons_invmass_cut_chi40(NULL)
105 , fhPhotons_invmass_cut_chi65(NULL)
106 , fhPhotons_invmass_cut_chi80(NULL)
107 , fhPhotons_invmass_cut_ptBin1(NULL)
108 , fhPhotons_invmass_cut_ptBin2(NULL)
109 , fhPhotons_invmass_cut_ptBin3(NULL)
110 , fhPhotons_invmass_cut_ptBin4(NULL)
111 , fhPhotons_invmass_vs_chi(NULL)
112 , fhPhotons_startvertex_vs_chi(NULL)
113 , fhPhotons_angleBetween(NULL)
114 , fhPhotons_invmass_vs_pt(NULL)
115 , fhPhotons_rapidity_vs_pt(NULL)
116 , fhPhotons_invmass_vs_openingAngle(NULL)
117 , fhPhotons_openingAngle_vs_momentum(NULL)
118 , fhPhotons_MC_motherpdg(NULL)
119 , fhPhotons_MC_invmass1(NULL)
120 , fhPhotons_MC_invmass2(NULL)
121 , fhPhotons_MC_invmass3(NULL)
122 , fhPhotons_MC_invmass4(NULL)
123 , fhPhotons_MC_startvertexZ(NULL)
124 , fhPhotons_MC_motherIdCut(NULL)
125 , fhPhotons_Refit_chiDiff(NULL)
126 , fhPhotons_Refit_momentumDiff(NULL)
127 , fhPhotons_Refit_chiDistribution(NULL)
128 , fhPhotons_RefitPion_chiDistribution(NULL)
129 , fElectrons_track_refit()
130 , fElectrons_momenta_refit()
131 , fVector_photons_pairs_refit()
132 , fhPhotons_invmass_refit(NULL)
133 , fhPhotons_invmass_refit_cut(NULL)
134 , fVector_photons_pairs_direction()
135 , fhPhotons_invmass_direction(NULL)
136 , fhPhotons_invmass_direction_cut(NULL)
137 , fhPhotons_boostAngle(NULL)
138 , fhPhotons_boostAngleMC(NULL)
139 , fhPhotons_boostAngleTest(NULL)
142 , fhElectrons_nofPerEvent_1(NULL)
143 , fhPhotons_nofPerEvent_1(NULL)
144 , fhPhotons_invmass_1(NULL)
145 , fhPhotons_invmass_ptBin1_1(NULL)
146 , fhPhotons_invmass_ptBin2_1(NULL)
147 , fhPhotons_invmass_ptBin3_1(NULL)
148 , fhPhotons_invmass_ptBin4_1(NULL)
149 , fhElectrons_invmass_1(NULL)
150 , fhPhotons_invmass_vs_pt_1(NULL)
151 , fhElectrons_nofPerEvent_2(NULL)
152 , fhPhotons_nofPerEvent_2(NULL)
153 , fhPhotons_invmass_2(NULL)
154 , fhPhotons_invmass_ptBin1_2(NULL)
155 , fhPhotons_invmass_ptBin2_2(NULL)
156 , fhPhotons_invmass_ptBin3_2(NULL)
157 , fhPhotons_invmass_ptBin4_2(NULL)
158 , fhElectrons_invmass_2(NULL)
159 , fhPhotons_invmass_vs_pt_2(NULL)
160 , fhElectrons_nofPerEvent_3(NULL)
161 , fhPhotons_nofPerEvent_3(NULL)
162 , fhPhotons_invmass_3(NULL)
163 , fhPhotons_invmass_ptBin1_3(NULL)
164 , fhPhotons_invmass_ptBin2_3(NULL)
165 , fhPhotons_invmass_ptBin3_3(NULL)
166 , fhPhotons_invmass_ptBin4_3(NULL)
167 , fhElectrons_invmass_3(NULL)
168 , fhPhotons_invmass_vs_pt_3(NULL)
169 , fhElectrons_nofPerEvent_4(NULL)
170 , fhPhotons_nofPerEvent_4(NULL)
171 , fhPhotons_invmass_4(NULL)
172 , fhPhotons_invmass_ptBin1_4(NULL)
173 , fhPhotons_invmass_ptBin2_4(NULL)
174 , fhPhotons_invmass_ptBin3_4(NULL)
175 , fhPhotons_invmass_ptBin4_4(NULL)
176 , fhElectrons_invmass_4(NULL)
177 , fhPhotons_invmass_vs_pt_4(NULL)
178 , fhElectrons_nofPerEvent_new()
179 , fhPhotons_nofPerEvent_new()
180 , fhPhotons_nofPerEventAfter_new()
181 , fhPhotons_invmass_new()
182 , fhPhotons_invmass_ann0_new()
183 , fhPhotons_invmass_ptBin1_new()
184 , fhPhotons_invmass_ptBin2_new()
185 , fhPhotons_invmass_ptBin3_new()
186 , fhPhotons_invmass_ptBin4_new()
187 , fhElectrons_invmass_new()
188 , fhPhotons_invmass_vs_pt_new()
189 , fhPhotons_invmass_MCcut1_new()
190 , fhPhotons_invmass_MCcut2_new()
191 , fhPhotons_invmass_MCcut3_new()
192 , fhPhotons_invmass_MCcut4_new()
193 , fhPhotons_invmass_MCcut5_new()
194 , fhPhotons_invmass_MCcut6_new()
195 , fhPhotons_invmass_MCcut7_new()
196 , fhPhotons_invmass_MCcutTest_new()
197 , fhPhotons_invmass_MCcutTest2_new()
198 , fhPhotons_invmass_MCcutTest3_new()
199 , fhPhotons_invmass_MCcutAll_new()
200 , fhPhotons_pt_vs_rap_new()
201 , fhElectrons_openingAngle_sameSign_new()
203 , fhPhotons_MCtrue_pdgCodes()
204 , fhPhotons_peakCheck1()
205 , fhPhotons_peakCheck2()
206 , fhPhotons_invmass_ANNcuts_new()
207 , fhPhotons_phaseSpace_pi0()
208 , fhPhotons_phaseSpace_eta()
209 , fMixedEventsElectrons_list1()
210 , fMixedEventsElectrons_list2()
211 , fMixedEventsElectrons_list3()
212 , fMixedEventsElectrons_list4()
213 , fMixedEventsElectrons_list1_gtrack()
214 , fMixedEventsElectrons_list2_gtrack()
215 , fMixedEventsElectrons_list3_gtrack()
216 , fMixedEventsElectrons_list4_gtrack()
217 , fhMixedEventsTest2_invmass(NULL)
218 , fMixedTest3_momenta()
219 , fMixedTest3_gtrack()
220 , fMixedTest3_eventno()
222 , fhMixedEventsTest3_invmass(NULL)
223 , fMixedTest4_photons()
224 , fMixedTest4_mctracks()
225 , fMixedTest4_isRichElectronAnn0()
226 , fMixedTest4_ElectronAnns()
227 , fMixedTest4_eventno()
228 , fhMixedEventsTest4_invmass(NULL)
229 , fhMixedEventsTest4_invmass_ann0(NULL)
230 , fhMixedEventsTest4_pt_vs_rap(NULL)
231 , fhMixedEventsTest4_invmass_ptBin1(NULL)
232 , fhMixedEventsTest4_invmass_ptBin2(NULL)
233 , fhMixedEventsTest4_invmass_ptBin3(NULL)
234 , fhMixedEventsTest4_invmass_ptBin4(NULL)
235 , fhMixedEventsTest4_invmass_ANNcuts(NULL)
243 FairRootManager* ioman = FairRootManager::Instance();
245 Fatal(
"CbmAnaConversion::Init",
"RootManager not instantised!");
248 fRichPoints = (TClonesArray*) ioman->GetObject(
"RichPoint");
250 Fatal(
"CbmAnaConversion::Init",
"No RichPoint array!");
253 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
255 Fatal(
"CbmAnaConversion::Init",
"No MCTrack array!");
258 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
260 Fatal(
"CbmAnaConversion::Init",
"No StsTrack array!");
265 Fatal(
"CbmAnaConversion::Init",
"No StsTrackMatch array!");
268 fGlobalTracks = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
270 Fatal(
"CbmAnaConversion::Init",
"No GlobalTrack array!");
280 if (
nullptr ==
fPrimVertex) { LOG(fatal) <<
"No PrimaryVertex array!"; }
282 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
284 Fatal(
"CbmAnaConversion::Init",
"No RichRing array!");
289 Fatal(
"CbmAnaConversion::Init",
"No RichRingMatch array!");
307 for (
int i = 1;
i <= 4;
i++) {
311 Double_t invmassSpectra_nof = 800;
312 Double_t invmassSpectra_start = -0.00125;
313 Double_t invmassSpectra_end = 1.99875;
316 fhElectrons =
new TH1I(
"fhElectrons",
"fhElectrons;; #", 8, 0., 8.);
318 fhElectrons->GetXaxis()->SetBinLabel(1,
"electrons rich");
319 fhElectrons->GetXaxis()->SetBinLabel(2,
"electrons trd");
320 fhElectrons->GetXaxis()->SetBinLabel(3,
"electrons tof");
321 fhElectrons->GetXaxis()->SetBinLabel(4,
"electrons rich+trd");
322 fhElectrons->GetXaxis()->SetBinLabel(5,
"electrons rich+tof");
323 fhElectrons->GetXaxis()->SetBinLabel(6,
"electrons trd+tof");
324 fhElectrons->GetXaxis()->SetBinLabel(7,
"electrons rich+trd+tof");
325 fhElectrons->GetXaxis()->SetBinLabel(8,
"electrons 2 out of 3");
329 new TH1D(
"fhMomentumFits",
"fhMomentumFits; chi; #", 10000, 0., 1000.);
332 "fhMomentumFits_electronRich; chi; #",
338 "fhMomentumFits_pi0reco; chi; #",
346 "fhElectrons_invmass; invariant mass; #",
348 invmassSpectra_start,
351 new TH1D(
"fhElectrons_invmass_cut",
352 "fhElectrons_invmass_cut; invariant mass; #",
354 invmassSpectra_start,
360 new TH1D(
"fhElectrons_nofPerEvent",
361 "fhElectrons_nofPerEvent; nof electrons per event; #",
367 new TH1D(
"fhPhotons_nofPerEvent",
368 "fhPhotons_nofPerEvent; nof photons per event; #",
375 "fhPhotons_invmass; invariant mass; #",
377 invmassSpectra_start,
381 "fhPhotons_invmass_cut; invariant mass; #",
383 invmassSpectra_start,
389 new TH1D(
"fhPhotons_invmass_cut_ptBin1",
390 "fhPhotons_invmass_cut_ptBin1; invariant mass; #",
392 invmassSpectra_start,
396 new TH1D(
"fhPhotons_invmass_cut_ptBin2",
397 "fhPhotons_invmass_cut_ptBin2; invariant mass; #",
399 invmassSpectra_start,
403 new TH1D(
"fhPhotons_invmass_cut_ptBin3",
404 "fhPhotons_invmass_cut_ptBin3; invariant mass; #",
406 invmassSpectra_start,
410 new TH1D(
"fhPhotons_invmass_cut_ptBin4",
411 "fhPhotons_invmass_cut_ptBin4; invariant mass; #",
413 invmassSpectra_start,
419 new TH1D(
"fhPhotons_angleBetween",
420 "fhPhotons_angleBetween; opening angle [deg]; #",
428 new TH1D(
"fhPhotons_invmass_cut_chi1",
429 "fhPhotons_invmass_cut_chi1; invariant mass; #",
431 invmassSpectra_start,
435 new TH1D(
"fhPhotons_invmass_cut_chi3",
436 "fhPhotons_invmass_cut_chi3; invariant mass; #",
438 invmassSpectra_start,
442 new TH1D(
"fhPhotons_invmass_cut_chi5",
443 "fhPhotons_invmass_cut_chi5; invariant mass; #",
445 invmassSpectra_start,
449 new TH1D(
"fhPhotons_invmass_cut_chi10",
450 "fhPhotons_invmass_cut_chi10; invariant mass; #",
452 invmassSpectra_start,
456 new TH1D(
"fhPhotons_invmass_cut_chi25",
457 "fhPhotons_invmass_cut_chi25; invariant mass; #",
459 invmassSpectra_start,
463 new TH1D(
"fhPhotons_invmass_cut_chi40",
464 "fhPhotons_invmass_cut_chi40; invariant mass; #",
466 invmassSpectra_start,
470 new TH1D(
"fhPhotons_invmass_cut_chi65",
471 "fhPhotons_invmass_cut_chi65; invariant mass; #",
473 invmassSpectra_start,
477 new TH1D(
"fhPhotons_invmass_cut_chi80",
478 "fhPhotons_invmass_cut_chi80; invariant mass; #",
480 invmassSpectra_start,
485 new TH2D(
"fhPhotons_invmass_vs_chi",
486 "fhPhotons_invmass_vs_chi; invariant mass; chi",
495 new TH2D(
"fhPhotons_startvertex_vs_chi",
496 "fhPhotons_startvertex_vs_chi; startvertex; chi",
505 "fhPhotons_invmass_vs_pt; invmass; pt",
514 new TH2D(
"fhPhotons_rapidity_vs_pt",
515 "fhPhotons_rapidity_vs_pt; pt [GeV]; rap [GeV]",
525 new TH2D(
"fhPhotons_invmass_vs_openingAngle",
526 "fhPhotons_invmass_vs_openingAngle; invmass; openingAngle",
535 new TH2D(
"fhPhotons_openingAngle_vs_momentum",
536 "fhPhotons_openingAngle_vs_momentum; openingAngle; momentum",
547 "fhPhotons_MC_motherpdg; pdg; #",
553 new TH1D(
"fhPhotons_MC_invmass1",
554 "fhPhotons_MC_minvmass1 (MC-true cut: at least gamma correct "
555 "reconstructed); invariant mass; #",
557 invmassSpectra_start,
561 "fhPhotons_MC_minvmass2 (MC-true cut: gamma "
562 "from same mother); invariant mass; #",
564 invmassSpectra_start,
568 "fhPhotons_MC_minvmass3 (MC-true cut: gamma "
569 "from different mother); invariant mass; #",
571 invmassSpectra_start,
575 new TH1D(
"fhPhotons_MC_invmass4",
576 "fhPhotons_MC_minvmass4 (MC-true cut: wrong combination of "
577 "electrons); invariant mass; #",
579 invmassSpectra_start,
584 new TH1D(
"fhPhotons_MC_startvertexZ",
585 "fhPhotons_MC_startvertexZ; startvertexZ [cm]; #",
592 new TH1D(
"fhPhotons_MC_motherIdCut",
593 "fhPhotons_MC_motherIdCut; invariant mass; #",
595 invmassSpectra_start,
600 new TH1D(
"fhPhotons_Refit_chiDiff",
601 "fhPhotons_Refit_chiDiff; difference of chi; #",
608 new TH1D(
"fhPhotons_Refit_momentumDiff",
609 "fhPhotons_Refit_momentumDiff; difference of momentum mag; #",
616 new TH1D(
"fhPhotons_Refit_chiDistribution",
617 "fhPhotons_Refit_chiDistribution; chi value; #",
624 new TH1D(
"fhPhotons_RefitPion_chiDistribution",
625 "fhPhotons_RefitPion_chiDistribution; chi value; #",
632 new TH1D(
"fhPhotons_invmass_refit",
633 "fhPhotons_invmass_refit; invariant mass; #",
635 invmassSpectra_start,
639 new TH1D(
"fhPhotons_invmass_refit_cut",
640 "fhPhotons_invmass_refit_cut; invariant mass; #",
642 invmassSpectra_start,
648 new TH1D(
"fhPhotons_invmass_direction",
649 "fhPhotons_invmass_direction; invariant mass; #",
651 invmassSpectra_start,
655 new TH1D(
"fhPhotons_invmass_direction_cut",
656 "fhPhotons_invmass_direction_cut; invariant mass; #",
658 invmassSpectra_start,
662 "fhPhotons_boostAngle; boostAngle; #",
668 "fhPhotons_boostAngleMC; boostAngle; #",
674 "fhPhotons_boostAngleTest; boostAngle; #",
682 new TH1D(
"fhPhotons_tX",
"fhPhotons_tX; tX; #", 201, -1.005, 1.005);
685 new TH1D(
"fhPhotons_tY",
"fhPhotons_tY; tY; #", 201, -1.005, 1.005);
691 new TH1D(
"fhElectrons_nofPerEvent_1",
692 "fhElectrons_nofPerEvent_1; nof electrons per event; #",
698 new TH1D(
"fhPhotons_nofPerEvent_1",
699 "fhPhotons_nofPerEvent_1; nof photons per event; #",
706 "fhPhotons_invmass_1; invariant mass; #",
713 new TH1D(
"fhPhotons_invmass_ptBin1_1",
714 "fhPhotons_invmass_ptBin1_1; invariant mass; #",
720 new TH1D(
"fhPhotons_invmass_ptBin2_1",
721 "fhPhotons_invmass_ptBin2_1; invariant mass; #",
727 new TH1D(
"fhPhotons_invmass_ptBin3_1",
728 "fhPhotons_invmass_ptBin3_1; invariant mass; #",
734 new TH1D(
"fhPhotons_invmass_ptBin4_1",
735 "fhPhotons_invmass_ptBin4_1; invariant mass; #",
742 "fhElectrons_invmass_1; invariant mass; #",
748 "fhPhotons_invmass_vs_pt_1; invmass; pt",
760 new TH1D(
"fhElectrons_nofPerEvent_2",
761 "fhElectrons_nofPerEvent_2; nof electrons per event; #",
767 new TH1D(
"fhPhotons_nofPerEvent_2",
768 "fhPhotons_nofPerEvent_2; nof photons per event; #",
775 "fhPhotons_invmass_2; invariant mass; #",
782 new TH1D(
"fhPhotons_invmass_ptBin1_2",
783 "fhPhotons_invmass_ptBin1_2; invariant mass; #",
789 new TH1D(
"fhPhotons_invmass_ptBin2_2",
790 "fhPhotons_invmass_ptBin2_2; invariant mass; #",
796 new TH1D(
"fhPhotons_invmass_ptBin3_2",
797 "fhPhotons_invmass_ptBin3_2; invariant mass; #",
803 new TH1D(
"fhPhotons_invmass_ptBin4_2",
804 "fhPhotons_invmass_ptBin4_2; invariant mass; #",
811 "fhElectrons_invmass_2; invariant mass; #",
817 "fhPhotons_invmass_vs_pt_2; invmass; pt",
829 new TH1D(
"fhElectrons_nofPerEvent_3",
830 "fhElectrons_nofPerEvent_3; nof electrons per event; #",
836 new TH1D(
"fhPhotons_nofPerEvent_3",
837 "fhPhotons_nofPerEvent_3; nof photons per event; #",
844 "fhPhotons_invmass_3; invariant mass; #",
851 new TH1D(
"fhPhotons_invmass_ptBin1_3",
852 "fhPhotons_invmass_ptBin1_3; invariant mass; #",
858 new TH1D(
"fhPhotons_invmass_ptBin2_3",
859 "fhPhotons_invmass_ptBin2_3; invariant mass; #",
865 new TH1D(
"fhPhotons_invmass_ptBin3_3",
866 "fhPhotons_invmass_ptBin3_3; invariant mass; #",
872 new TH1D(
"fhPhotons_invmass_ptBin4_3",
873 "fhPhotons_invmass_ptBin4_3; invariant mass; #",
880 "fhElectrons_invmass_3; invariant mass; #",
886 "fhPhotons_invmass_vs_pt_3; invmass; pt",
898 new TH1D(
"fhElectrons_nofPerEvent_4",
899 "fhElectrons_nofPerEvent_4; nof electrons per event; #",
905 new TH1D(
"fhPhotons_nofPerEvent_4",
906 "fhPhotons_nofPerEvent_4; nof photons per event; #",
913 "fhPhotons_invmass_4; invariant mass; #",
920 new TH1D(
"fhPhotons_invmass_ptBin1_4",
921 "fhPhotons_invmass_ptBin1_4; invariant mass; #",
927 new TH1D(
"fhPhotons_invmass_ptBin2_4",
928 "fhPhotons_invmass_ptBin2_4; invariant mass; #",
934 new TH1D(
"fhPhotons_invmass_ptBin3_4",
935 "fhPhotons_invmass_ptBin3_4; invariant mass; #",
941 new TH1D(
"fhPhotons_invmass_ptBin4_4",
942 "fhPhotons_invmass_ptBin4_4; invariant mass; #",
949 "fhElectrons_invmass_4; invariant mass; #",
955 "fhPhotons_invmass_vs_pt_4; invmass; pt",
965 for (
int i = 1;
i <= 4;
i++) {
967 Form(
"fhElectrons_nofPerEvent_new_%i",
i),
968 Form(
"fhElectrons_nofPerEvent_new_%i; nof electrons per event; #",
i),
974 Form(
"fhPhotons_nofPerEvent_new_%i",
i),
975 Form(
"fhPhotons_nofPerEvent_new_%i; nof photons per event; #",
i),
981 Form(
"fhPhotons_nofPerEventAfter_new_%i",
i),
982 Form(
"fhPhotons_nofPerEventAfter_new_%i; nof photons per event; #",
i),
988 new TH1D(Form(
"fhPi0_nofPerEvent_new_%i",
i),
989 Form(
"fhPi0_nofPerEvent_new_%i; nof pi0 per event; #",
i),
996 Form(
"fhPhotons_invmass_new_%i",
i),
998 "fhPhotons_invmass_new_%i; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1001 invmassSpectra_start,
1002 invmassSpectra_end);
1005 new TH1D(Form(
"fhPhotons_invmass_ann0_new_%i",
i),
1006 Form(
"fhPhotons_invmass_ann0_new_%i; invariant mass of 4 "
1007 "e^{#pm} in GeV/c^{2}; #",
1010 invmassSpectra_start,
1011 invmassSpectra_end);
1015 new TH1D(Form(
"fhPhotons_invmass_ptBin1_new_%i",
i),
1016 Form(
"fhPhotons_invmass_ptBin1_new_%i; invariant mass of 4 "
1017 "e^{#pm} in GeV/c^{2}; #",
1020 invmassSpectra_start,
1021 invmassSpectra_end);
1024 new TH1D(Form(
"fhPhotons_invmass_ptBin2_new_%i",
i),
1025 Form(
"fhPhotons_invmass_ptBin2_new_%i; invariant mass of 4 "
1026 "e^{#pm} in GeV/c^{2}; #",
1029 invmassSpectra_start,
1030 invmassSpectra_end);
1033 new TH1D(Form(
"fhPhotons_invmass_ptBin3_new_%i",
i),
1034 Form(
"fhPhotons_invmass_ptBin3_new_%i; invariant mass of 4 "
1035 "e^{#pm} in GeV/c^{2}; #",
1038 invmassSpectra_start,
1039 invmassSpectra_end);
1042 new TH1D(Form(
"fhPhotons_invmass_ptBin4_new_%i",
i),
1043 Form(
"fhPhotons_invmass_ptBin4_new_%i; invariant mass of 4 "
1044 "e^{#pm} in GeV/c^{2}; #",
1047 invmassSpectra_start,
1048 invmassSpectra_end);
1051 new TH1D(Form(
"fhPhotons_invmass_ptBin5_new_%i",
i),
1052 Form(
"fhPhotons_invmass_ptBin5_new_%i; invariant mass of 4 "
1053 "e^{#pm} in GeV/c^{2}; #",
1056 invmassSpectra_start,
1057 invmassSpectra_end);
1060 new TH1D(Form(
"fhPhotons_invmass_ptBin6_new_%i",
i),
1061 Form(
"fhPhotons_invmass_ptBin6_new_%i; invariant mass of 4 "
1062 "e^{#pm} in GeV/c^{2}; #",
1065 invmassSpectra_start,
1066 invmassSpectra_end);
1070 new TH1D(Form(
"fhElectrons_invmass_new_%i",
i),
1071 Form(
"fhElectrons_invmass_new_%i; invariant mass of 4 e^{#pm} "
1075 invmassSpectra_start,
1076 invmassSpectra_end);
1080 new TH2D(Form(
"fhPhotons_invmass_vs_pt_new_%i",
i),
1081 Form(
"fhPhotons_invmass_vs_pt_new_%i; invariant mass of 4 "
1082 "e^{#pm} in GeV/c^{2}; pt",
1093 Form(
"fhPhotons_invmass_MCcut1_new_%i",
i),
1095 "fhPhotons_invmass_MCcut1_new_%i (MC-true cut: at least gamma correct "
1096 "reconstructed); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1099 invmassSpectra_start,
1100 invmassSpectra_end);
1103 new TH1D(Form(
"fhPhotons_invmass_MCcut2_new_%i",
i),
1104 Form(
"fhPhotons_invmass_MCcut2_new_%i (MC-true cut: gamma from "
1105 "same mother); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1108 invmassSpectra_start,
1109 invmassSpectra_end);
1112 Form(
"fhPhotons_invmass_MCcut3_new_%i",
i),
1113 Form(
"fhPhotons_invmass_MCcut3_new_%i (MC-true cut: gamma from different "
1114 "mother); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1117 invmassSpectra_start,
1118 invmassSpectra_end);
1121 Form(
"fhPhotons_invmass_MCcut4_new_%i",
i),
1122 Form(
"fhPhotons_invmass_MCcut4_new_%i (MC-true cut: wrong combination of "
1123 "electrons); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1126 invmassSpectra_start,
1127 invmassSpectra_end);
1130 Form(
"fhPhotons_invmass_MCcut5_new_%i",
i),
1131 Form(
"fhPhotons_invmass_MCcut5_new_%i (MC-true cut: wrong combination of "
1132 "electrons); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1135 invmassSpectra_start,
1136 invmassSpectra_end);
1139 Form(
"fhPhotons_invmass_MCcut6_new_%i",
i),
1140 Form(
"fhPhotons_invmass_MCcut6_new_%i (MC-true cut: wrong combination of "
1141 "electrons); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1144 invmassSpectra_start,
1145 invmassSpectra_end);
1148 Form(
"fhPhotons_invmass_MCcut7_new_%i",
i),
1149 Form(
"fhPhotons_invmass_MCcut7_new_%i (MC-true cut: wrong combination of "
1150 "electrons); invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1153 invmassSpectra_start,
1154 invmassSpectra_end);
1158 new TH2D(Form(
"fhPhotons_invmass_MCcutAll_new_%i",
i),
1159 Form(
"fhPhotons_invmass_MCcutAll_new_%i; case; invmass",
i),
1164 invmassSpectra_start,
1165 invmassSpectra_end);
1169 new TH1D(Form(
"fhPhotons_invmass_MCcutTest_new_%i",
i),
1170 Form(
"fhPhotons_invmass_MCcutTest_new_%i (MC-true cut: test); "
1171 "invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1174 invmassSpectra_start,
1175 invmassSpectra_end);
1178 new TH1D(Form(
"fhPhotons_invmass_MCcutTest2_new_%i",
i),
1179 Form(
"fhPhotons_invmass_MCcutTest2_new_%i (MC-true cut: test); "
1180 "invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1183 invmassSpectra_start,
1184 invmassSpectra_end);
1187 new TH1D(Form(
"fhPhotons_invmass_MCcutTest3_new_%i",
i),
1188 Form(
"fhPhotons_invmass_MCcutTest3_new_%i (MC-true cut: test); "
1189 "invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
1192 invmassSpectra_start,
1193 invmassSpectra_end);
1197 Form(
"fhPhotons_pt_vs_rap_new_%i",
i),
1198 Form(
"fhPhotons_pt_vs_rap_new_%i; p_{t} in GeV/c; rapidity y",
i),
1208 Form(
"fhElectrons_openingAngle_sameSign_new_%i",
i),
1209 Form(
"fhElectrons_openingAngle_sameSign_new_%i; opening angle; #",
i),
1218 new TH1D(Form(
"fhMixedEventsTest_invmass_%i",
i),
1219 Form(
"fhMixedEventsTest_invmass_%i; invariant mass of 4 e^{#pm} "
1223 invmassSpectra_start,
1224 invmassSpectra_end);
1228 Form(
"fhPhotons_stats_%i; ; #",
i),
1251 new TH1D(Form(
"fhPhotons_peakCheck1_%i",
i),
1252 Form(
"fhPhotons_peakCheck1_%i; sum; #",
i),
1257 new TH1D(Form(
"fhPhotons_peakCheck2_%i",
i),
1258 Form(
"fhPhotons_peakCheck2_%i; sum; #",
i),
1266 new TH2D(Form(
"fhPhotons_invmass_ANNcuts_new_%i",
i),
1267 Form(
"fhPhotons_invmass_ANNcuts_new_%i;ann;invariant mass of 4 "
1268 "e^{#pm} in GeV/c^{2}",
1274 invmassSpectra_start,
1275 invmassSpectra_end);
1280 Form(
"fhPhotons_phaseSpace_pi0_%i",
i),
1281 Form(
"fhPhotons_phaseSpace_pi0_%i; p_{t} in GeV/c;rapidity y",
i),
1289 Form(
"fhPhotons_phaseSpace_eta_%i",
i),
1290 Form(
"fhPhotons_phaseSpace_eta_%i; p_{t} in GeV/c;rapidity y",
i),
1303 new TH1D(Form(
"fhPhotons_MCtrue_pdgCodes_%i", 4),
1304 Form(
"fhPhotons_MCtrue_pdgCodes_%i; pdg code; #", 4),
1314 new TH1D(Form(
"fhMixedEventsTest2_invmass_%i", 4),
1315 Form(
"fhMixedEventsTest2_invmass_%i; invariant mass of 4 e^{#pm} "
1319 invmassSpectra_start,
1320 invmassSpectra_end);
1323 new TH1D(Form(
"fhMixedEventsTest3_invmass_%i", 4),
1324 Form(
"fhMixedEventsTest3_invmass_%i; invariant mass of 4 e^{#pm} "
1328 invmassSpectra_start,
1329 invmassSpectra_end);
1333 new TH1D(Form(
"fhMixedEventsTest4_invmass_%i", 4),
1334 Form(
"fhMixedEventsTest4_invmass_%i; invariant mass of 4 e^{#pm} "
1338 invmassSpectra_start,
1339 invmassSpectra_end);
1342 new TH1D(Form(
"fhMixedEventsTest4_invmass_ann0_%i", 4),
1343 Form(
"fhMixedEventsTest4_invmass_ann0_%i; invariant mass of 4 "
1344 "e^{#pm} in GeV/c^{2}; #",
1347 invmassSpectra_start,
1348 invmassSpectra_end);
1352 Form(
"fhMixedEventsTest4_pt_vs_rap_%i", 4),
1353 Form(
"fhMixedEventsTest4_pt_vs_rap_%i; p_{t} in GeV/c; rapidity y", 4),
1363 new TH1D(Form(
"fhMixedEventsTest4_invmass_%i_ptBin1", 4),
1364 Form(
"fhMixedEventsTest4_invmass_%i_ptBin1; invariant mass of 4 "
1365 "e^{#pm} in GeV/c^{2}; #",
1368 invmassSpectra_start,
1369 invmassSpectra_end);
1372 new TH1D(Form(
"fhMixedEventsTest4_invmass_%i_ptBin2", 4),
1373 Form(
"fhMixedEventsTest4_invmass_%i_ptBin2; invariant mass of 4 "
1374 "e^{#pm} in GeV/c^{2}; #",
1377 invmassSpectra_start,
1378 invmassSpectra_end);
1381 new TH1D(Form(
"fhMixedEventsTest4_invmass_%i_ptBin3", 4),
1382 Form(
"fhMixedEventsTest4_invmass_%i_ptBin3; invariant mass of 4 "
1383 "e^{#pm} in GeV/c^{2}; #",
1386 invmassSpectra_start,
1387 invmassSpectra_end);
1390 new TH1D(Form(
"fhMixedEventsTest4_invmass_%i_ptBin4", 4),
1391 Form(
"fhMixedEventsTest4_invmass_%i_ptBin4; invariant mass of 4 "
1392 "e^{#pm} in GeV/c^{2}; #",
1395 invmassSpectra_start,
1396 invmassSpectra_end);
1400 new TH2D(Form(
"fhMixedEventsTest4_invmass_ANNcuts_%i", 4),
1401 Form(
"fhMixedEventsTest4_invmass_ANNcuts_%i;; invariant mass of 4 "
1402 "e^{#pm} in GeV/c^{2}",
1408 invmassSpectra_start,
1409 invmassSpectra_end);
1417 gDirectory->mkdir(
"RecoFull");
1418 gDirectory->cd(
"RecoFull");
1420 gDirectory->mkdir(
"NoRefit-NoChicut");
1421 gDirectory->cd(
"NoRefit-NoChicut");
1427 gDirectory->cd(
"..");
1429 gDirectory->mkdir(
"NoRefit-WithChicut");
1430 gDirectory->cd(
"NoRefit-WithChicut");
1436 gDirectory->cd(
"..");
1438 gDirectory->mkdir(
"WithRefit-NoChicut");
1439 gDirectory->cd(
"WithRefit-NoChicut");
1445 gDirectory->cd(
"..");
1447 gDirectory->mkdir(
"WithRefit-WithChicut");
1448 gDirectory->cd(
"WithRefit-WithChicut");
1454 gDirectory->cd(
"..");
1459 gDirectory->cd(
"..");
1462 cout <<
"CbmAnaConversionRecoFull: Realtime - " <<
fTime << endl;
1473 Fatal(
"CbmAnaConversion::Exec",
"No PrimaryVertex array!");
1508 for (
int i = 1;
i <= 4;
i++) {
1547 Int_t nofGT_richsts = 0;
1548 Int_t nofElectrons = 0;
1549 Int_t nofElectrons_1 = 0;
1550 Int_t nofElectrons_2 = 0;
1551 Int_t nofElectrons_3 = 0;
1552 Int_t nofElectrons_4 = 0;
1555 Int_t FilledMixedEventElectron =
1560 cout <<
"CbmAnaConversionRecoFull: number of global tracks "
1561 << nofGlobalTracks << endl;
1562 for (
int iG = 0; iG < nofGlobalTracks; iG++) {
1564 if (NULL == gTrack)
continue;
1567 if (richInd < 0)
continue;
1568 if (stsInd < 0)
continue;
1571 if (stsTrack == NULL)
continue;
1589 int stsMcTrackId = 0;
1591 if (stsMatch != NULL) {
1594 if (stsMcTrackId >= 0) {
1596 if (mcTrack1 == NULL) stsMcTrackId = 0;
1603 int richMcTrackId = 0;
1605 if (richMatch != NULL) {
1607 if (richMcTrackId >= 0) {
1609 if (mcTrack2 == NULL) richMcTrackId = 0;
1620 TVector3 refittedMomentum;
1622 vector<CbmStsTrack> stsTracks;
1623 stsTracks.resize(1);
1624 stsTracks[0] = *stsTrack;
1625 vector<L1FieldRegion> vField;
1626 vector<float> chiPrim;
1630 const FairTrackParam* vtxTrack = stsTracks[0].GetParamFirst();
1631 vtxTrack->Momentum(refittedMomentum);
1634 float result_chi = chiPrim[0];
1650 Bool_t electron_rich2 =
1652 iG, refittedMomentum.Mag());
1659 if (electron_rich2) {
1674 if (FilledMixedEventElectron < 5) {
1677 FilledMixedEventElectron++;
1687 if (result_chi <= chiCut) {
1702 if (FilledMixedEventElectron < 5) {
1705 FilledMixedEventElectron++;
1714 vector<CbmStsTrack> stsTracks_electron;
1715 stsTracks_electron.resize(1);
1716 stsTracks_electron[0] = *stsTrack;
1717 vector<L1FieldRegion> vField_electron;
1718 vector<float> chiPrim_electron;
1719 vector<int> pidHypo_electron;
1720 pidHypo_electron.push_back(11);
1721 fPFFitter_electron.
Fit(stsTracks_electron, pidHypo_electron);
1723 stsTracks_electron, vField_electron, chiPrim_electron,
fKFVertex, 3e6);
1725 TVector3 refittedMomentum_electron;
1726 const FairTrackParam* vtxTrack_electron =
1727 stsTracks_electron[0].GetParamFirst();
1728 vtxTrack_electron->Momentum(refittedMomentum_electron);
1729 float result_chi_electron = chiPrim_electron[0];
1731 refittedMomentum = refittedMomentum_electron;
1732 result_chi = result_chi_electron;
1738 iG, refittedMomentum.Mag());
1741 iG, refittedMomentum.Mag());
1743 iG, refittedMomentum.Mag());
1746 if (electron_rich) {
1761 if (FilledMixedEventElectron < 5) {
1764 FilledMixedEventElectron++;
1766 if (result_chi <= chiCut) {
1782 if (FilledMixedEventElectron < 5) {
1785 FilledMixedEventElectron++;
1803 if (electron_rich && electron_trd)
fhElectrons->Fill(3);
1804 if (electron_rich && electron_tof)
fhElectrons->Fill(4);
1805 if (electron_trd && electron_tof)
fhElectrons->Fill(5);
1806 if (electron_rich && electron_trd && electron_tof)
fhElectrons->Fill(6);
1807 if ((electron_rich && electron_trd) || (electron_rich && electron_tof)
1808 || (electron_trd && electron_tof))
1830 cout <<
"CbmAnaConversionRecoFull: number of global tracks in STS and RICH "
1831 << nofGT_richsts << endl;
1836 cout <<
"CbmAnaConversionRecoFull: combining for each case!" << endl;
1838 for (
int i = 1;
i <= 4;
i++) {
1839 cout <<
"CbmAnaConversionRecoFull: case " <<
i << endl;
1882 vector<CbmGlobalTrack*> gtrack,
1883 vector<TVector3> momenta,
1886 vector<vector<int>> reconstructedPhotons,
1888 Int_t nof = momenta.size();
1890 cout <<
"CbmAnaConversionRecoFull: " << index <<
": CombineElectrons, nof - "
1892 Int_t nofPhotons = 0;
1894 for (
int a = 0; a < nof - 1; a++) {
1895 for (
int b = a + 1; b < nof; b++) {
1897 (gtrack[a]->GetParamLast()->GetQp()
1899 Int_t check2 = (gtrack[b]->GetParamLast()->GetQp() > 0);
1900 Int_t test = check1 + check2;
1901 if (test != 1)
continue;
1909 momenta[a], momenta[b]);
1911 Double_t openingAngleCut = 1.8 - 0.6 * paramsTest.
fPt;
1912 Double_t invMassCut = 0.03;
1914 Int_t IsPhoton_openingAngle1 = (paramsTest.
fAngle < openingAngleCut);
1915 Int_t IsPhoton_invMass1 = (paramsTest.
fMinv < invMassCut);
1924 if (IsPhoton_openingAngle1 && IsPhoton_invMass1) {
1929 reconstructedPhotons.push_back(pair);
1960 TVector3 momentumE1f;
1961 TVector3 momentumE2f;
1962 gtrack[a]->GetParamFirst()->Momentum(momentumE1f);
1963 gtrack[b]->GetParamFirst()->Momentum(momentumE2f);
1964 TVector3 momentumE1l;
1965 TVector3 momentumE2l;
1966 gtrack[a]->GetParamLast()->Momentum(momentumE1l);
1967 gtrack[b]->GetParamLast()->Momentum(momentumE2l);
1978 TVector3 normal1 = momentumE1f.Cross(momentumE1l);
1979 TVector3 normal2 = momentumE2f.Cross(momentumE2l);
1980 Double_t normalAngle = normal1.Angle(normal2);
1981 Double_t theta = 180. * normalAngle /
TMath::Pi();
1994 vector<TVector3> pairmomenta;
1995 pairmomenta.push_back(momenta[a]);
1996 pairmomenta.push_back(momenta[b]);
1997 vector<CbmMCTrack*> pair_mctracks;
1998 pair_mctracks.push_back(
2000 pair_mctracks.push_back(
2006 vector<Bool_t> IsRichElectronAnn0;
2007 IsRichElectronAnn0.push_back(
2010 IsRichElectronAnn0.push_back(
2015 vector<Double_t> electronANNs;
2032 cout <<
"CbmAnaConversionRecoFull: CombineElectrons: " << index
2033 <<
": Crosscheck - nof reconstructed photons: " << nofPhotons << endl;
2038 const TVector3 part2,
2039 const TVector3 part3,
2040 const TVector3 part4)
2043 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
2044 TLorentzVector lorVec1(part1, energy1);
2046 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
2047 TLorentzVector lorVec2(part2, energy2);
2049 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
2050 TLorentzVector lorVec3(part3, energy3);
2052 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
2053 TLorentzVector lorVec4(part4, energy4);
2056 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
2063 const TVector3 part2,
2064 const TVector3 part3,
2065 const TVector3 part4) {
2066 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
2067 TLorentzVector lorVec1(part1, energy1);
2069 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
2070 TLorentzVector lorVec2(part2, energy2);
2072 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
2073 TLorentzVector lorVec3(part3, energy3);
2075 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
2076 TLorentzVector lorVec4(part4, energy4);
2079 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
2081 Double_t perp = sum.Perp();
2082 Double_t pt = TMath::Sqrt(sum.X() * sum.X() + sum.Y() * sum.Y());
2084 cout <<
"CbmAnaConversionRecoFull::Pt_4particlesRECO: perp/pt = " << perp
2085 <<
" / " << pt << endl;
2092 const TVector3 part2,
2093 const TVector3 part3,
2094 const TVector3 part4) {
2095 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
2096 TLorentzVector lorVec1(part1, energy1);
2098 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
2099 TLorentzVector lorVec2(part2, energy2);
2101 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
2102 TLorentzVector lorVec3(part3, energy3);
2104 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
2105 TLorentzVector lorVec4(part4, energy4);
2108 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
2111 TVector3 momPair = part1 + part2 + part3 + part4;
2112 Double_t energyPair = energy1 + energy2 + energy3 + energy4;
2113 Double_t pzPair = momPair.Pz();
2115 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
2117 cout <<
"CbmAnaConversionRecoFull::Rap_4particlesRECO: yPair = " << yPair
2125 const TVector3 electron1,
2126 const TVector3 electron2) {
2129 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2E);
2130 TLorentzVector lorVecP(electron1, energyP);
2132 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2E);
2133 TLorentzVector lorVecM(electron2, energyM);
2135 TVector3 momPair = electron1 + electron2;
2136 Double_t energyPair = energyP + energyM;
2137 Double_t ptPair = momPair.Perp();
2138 Double_t pzPair = momPair.Pz();
2140 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
2141 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
2142 Double_t theta = 180. * anglePair /
TMath::Pi();
2143 Double_t minv = 2. * TMath::Sin(anglePair / 2.)
2144 * TMath::Sqrt(electron1.Mag() * electron2.Mag());
2147 params.
fPt = ptPair;
2149 params.
fMinv = minv;
2157 const TVector3 part1,
2158 const TVector3 part2,
2159 const TVector3 part3,
2160 const TVector3 part4) {
2163 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
2164 TLorentzVector lorVec1(part1, energy1);
2166 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
2167 TLorentzVector lorVec2(part2, energy2);
2169 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
2170 TLorentzVector lorVec3(part3, energy3);
2172 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
2173 TLorentzVector lorVec4(part4, energy4);
2176 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
2178 TVector3 momPair = part1 + part2 + part3 + part4;
2179 Double_t energyPair = energy1 + energy2 + energy3 + energy4;
2180 Double_t ptPair = momPair.Perp();
2181 Double_t pzPair = momPair.Pz();
2183 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
2186 Double_t minv = sum.Mag();
2189 params.
fPt = ptPair;
2191 params.
fMinv = minv;
2198 vector<CbmGlobalTrack*> gtrack,
2199 vector<TVector3> momenta,
2200 vector<float> momentaChi,
2202 vector<vector<int>> reconstructedPhotons,
2215 Int_t nof = reconstructedPhotons.size();
2217 cout <<
"CbmAnaConversionRecoFull: " << index <<
": CombinePhotons, nof - "
2220 for (
int a = 0; a < nof - 1; a++) {
2221 for (
int b = a + 1; b < nof; b++) {
2222 cout <<
"####" << endl;
2223 cout <<
"CbmAnaConversionRecoFull: calculating invariant mass! (" << a
2224 <<
"/" << b <<
")" << endl;
2225 Int_t electron11 = reconstructedPhotons[a][0];
2226 Int_t electron12 = reconstructedPhotons[a][1];
2227 Int_t electron21 = reconstructedPhotons[b][0];
2228 Int_t electron22 = reconstructedPhotons[b][1];
2229 cout <<
"CbmAnaConversionRecoFull: calculating invariant mass! ("
2230 << electron11 <<
"/" << electron12 <<
"/" << electron21 <<
"/"
2231 << electron22 <<
")" << endl;
2233 if (electron11 == electron12 || electron11 == electron21
2234 || electron11 == electron22 || electron12 == electron21
2235 || electron12 == electron22 || electron21 == electron22) {
2236 cout <<
"CbmAnaConversionRecoFull: RecoFull_DoubleIndex!" << endl;
2241 Int_t charge11 = (gtrack[electron11]->GetParamLast()->GetQp() > 0);
2243 Int_t charge21 = (gtrack[electron21]->GetParamLast()->GetQp() > 0);
2244 Int_t charge22 = (gtrack[electron22]->GetParamLast()->GetQp() > 0);
2245 if ((charge11 + charge21 == 2) || (charge11 + charge21 == 0)) {
2248 momenta[electron11], momenta[electron21]);
2251 momenta[electron12], momenta[electron22]);
2257 if ((charge11 + charge22 == 2) || (charge11 + charge22 == 0)) {
2260 momenta[electron11], momenta[electron22]);
2263 momenta[electron12], momenta[electron21]);
2271 momenta[electron12],
2272 momenta[electron21],
2273 momenta[electron22]);
2282 momenta[electron12],
2283 momenta[electron21],
2284 momenta[electron22]);
2286 momenta[electron12],
2287 momenta[electron21],
2288 momenta[electron22]);
2293 momenta, reconstructedPhotons[a], reconstructedPhotons[b]);
2299 momenta[electron12],
2300 momenta[electron21],
2301 momenta[electron22]);
2305 momenta[electron11],
2306 momenta[electron12],
2307 momenta[electron21],
2308 momenta[electron22]);
2310 Bool_t IsRichElectron_ann0_e11 =
2313 momenta[electron11].Mag());
2314 Bool_t IsRichElectron_ann0_e12 =
2317 momenta[electron12].Mag());
2318 Bool_t IsRichElectron_ann0_e21 =
2321 momenta[electron21].Mag());
2322 Bool_t IsRichElectron_ann0_e22 =
2325 momenta[electron22].Mag());
2329 momenta[electron11].Mag());
2332 momenta[electron12].Mag());
2335 momenta[electron21].Mag());
2338 momenta[electron22].Mag());
2340 if (IsRichElectron_ann0_e11 && IsRichElectron_ann0_e12
2341 && IsRichElectron_ann0_e21 && IsRichElectron_ann0_e22) {
2344 if (ANNe11 > -1 && ANNe12 > -1 && ANNe21 > -1 && ANNe22 > -1)
2346 if (ANNe11 > -0.9 && ANNe12 > -0.9 && ANNe21 > -0.9 && ANNe22 > -0.9)
2348 if (ANNe11 > -0.8 && ANNe12 > -0.8 && ANNe21 > -0.8 && ANNe22 > -0.8)
2350 if (ANNe11 > -0.7 && ANNe12 > -0.7 && ANNe21 > -0.7 && ANNe22 > -0.7)
2352 if (ANNe11 > -0.6 && ANNe12 > -0.6 && ANNe21 > -0.6 && ANNe22 > -0.6)
2354 if (ANNe11 > -0.5 && ANNe12 > -0.5 && ANNe21 > -0.5 && ANNe22 > -0.5)
2356 if (ANNe11 > -0.0 && ANNe12 > -0.0 && ANNe21 > -0.0 && ANNe22 > -0.0)
2359 cout <<
"CbmAnaConversionRecoFull: debug: (" << invmass <<
"/"
2360 << paramsTest.
fMinv <<
") - (" << pt <<
"/" << paramsTest.
fPt
2361 <<
") - (" << rap <<
"/" << paramsTest.
fRapidity <<
")" << endl;
2368 Double_t energyE11 = TMath::Sqrt(momenta[electron11].Mag2() +
M2E);
2369 TLorentzVector lorVecE11(momenta[electron11], energyE11);
2370 Double_t energyE12 = TMath::Sqrt(momenta[electron12].Mag2() +
M2E);
2371 TLorentzVector lorVecE12(momenta[electron12], energyE12);
2372 Double_t energyE21 = TMath::Sqrt(momenta[electron21].Mag2() +
M2E);
2373 TLorentzVector lorVecE21(momenta[electron21], energyE21);
2374 Double_t energyE22 = TMath::Sqrt(momenta[electron22].Mag2() +
M2E);
2375 TLorentzVector lorVecE22(momenta[electron22], energyE22);
2376 TLorentzVector g1 = lorVecE11 + lorVecE12;
2377 TLorentzVector g2 = lorVecE21 + lorVecE22;
2378 TLorentzVector pi = lorVecE11 + lorVecE12 + lorVecE21 + lorVecE22;
2380 g1.Boost(-pi.BoostVector());
2381 g2.Boost(-pi.BoostVector());
2383 Double_t boostAngle = g1.Angle(g2.Vect());
2384 Double_t theta = 180. * boostAngle /
TMath::Pi();
2456 if (pt > 0.5 && pt <= 1)
2458 if (pt > 1 && pt <= 1.5)
2460 if (pt > 1.5 && pt <= 2)
2462 if (pt > 2 && pt <= 2.5)
2464 if (pt > 2.5 && pt <= 3)
2546 Int_t motherpdg11 = -2;
2547 Int_t motherpdg12 = -2;
2548 Int_t motherpdg21 = -2;
2549 Int_t motherpdg22 = -2;
2550 if (mothermctrack11 != NULL)
2552 if (mothermctrack12 != NULL)
2554 if (mothermctrack21 != NULL)
2556 if (mothermctrack22 != NULL)
2559 Int_t grandmotherId11 = -2;
2560 Int_t grandmotherId12 = -2;
2561 Int_t grandmotherId21 = -2;
2562 Int_t grandmotherId22 = -2;
2563 if (mothermctrack11 != NULL)
2565 if (mothermctrack12 != NULL)
2567 if (mothermctrack21 != NULL)
2569 if (mothermctrack22 != NULL)
2573 Int_t sameGrandmothers1 = 0;
2574 Int_t sameGrandmothers2 = 0;
2575 Int_t sameGrandmothers3 = 0;
2576 Int_t sameGrandmothers4 = 0;
2577 if (grandmotherId11 == grandmotherId12) sameGrandmothers1++;
2578 if (grandmotherId11 == grandmotherId21) sameGrandmothers1++;
2579 if (grandmotherId11 == grandmotherId22) sameGrandmothers1++;
2580 if (grandmotherId12 == grandmotherId11) sameGrandmothers2++;
2581 if (grandmotherId12 == grandmotherId21) sameGrandmothers2++;
2582 if (grandmotherId12 == grandmotherId22) sameGrandmothers2++;
2583 if (grandmotherId21 == grandmotherId11) sameGrandmothers3++;
2584 if (grandmotherId21 == grandmotherId12) sameGrandmothers3++;
2585 if (grandmotherId21 == grandmotherId22) sameGrandmothers3++;
2586 if (grandmotherId22 == grandmotherId11) sameGrandmothers4++;
2587 if (grandmotherId22 == grandmotherId12) sameGrandmothers4++;
2588 if (grandmotherId22 == grandmotherId21) sameGrandmothers4++;
2589 Int_t sameGrandmothersSum = sameGrandmothers1 + sameGrandmothers2
2590 + sameGrandmothers3 + sameGrandmothers4;
2592 Int_t sameMothers1 = 0;
2593 Int_t sameMothers2 = 0;
2594 Int_t sameMothers3 = 0;
2595 Int_t sameMothers4 = 0;
2596 if (motherId11 == motherId12) sameMothers1++;
2597 if (motherId11 == motherId21) sameMothers1++;
2598 if (motherId11 == motherId22) sameMothers1++;
2599 if (motherId12 == motherId11) sameMothers2++;
2600 if (motherId12 == motherId21) sameMothers2++;
2601 if (motherId12 == motherId22) sameMothers2++;
2602 if (motherId21 == motherId11) sameMothers3++;
2603 if (motherId21 == motherId12) sameMothers3++;
2604 if (motherId21 == motherId22) sameMothers3++;
2605 if (motherId22 == motherId11) sameMothers4++;
2606 if (motherId22 == motherId12) sameMothers4++;
2607 if (motherId22 == motherId21) sameMothers4++;
2608 Int_t sameMothersSum =
2609 sameMothers1 + sameMothers2 + sameMothers3 + sameMothers4;
2613 motherId11 == motherId12
2617 if (TMath::Abs(motherpdg11) == 22
2618 && TMath::Abs(motherpdg21) == 22) {
2621 if (TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 22
2622 && grandmotherId11 == grandmotherId21
2623 && grandmotherId11 > 0) {
2632 if (TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 22
2633 && grandmotherId11 != grandmotherId21) {
2636 if ((TMath::Abs(motherpdg11) == 22
2637 && TMath::Abs(motherpdg21) == 111)
2638 || (TMath::Abs(motherpdg11) == 111
2639 && TMath::Abs(motherpdg21) == 22)) {
2641 if (grandmotherId11 == motherId21
2642 || motherId11 == grandmotherId21) {
2648 if (TMath::Abs(motherpdg11) == 111
2649 && TMath::Abs(motherpdg21) == 111) {
2652 if ((TMath::Abs(motherpdg11) != 22
2653 && TMath::Abs(motherpdg11) != 111)
2654 || (TMath::Abs(motherpdg21) != 22
2655 && TMath::Abs(motherpdg21) != 111)) {
2658 if (TMath::Abs(motherpdg11) != 22 && TMath::Abs(motherpdg11) != 111
2659 && TMath::Abs(motherpdg21) != 22
2660 && TMath::Abs(motherpdg21) != 111) {
2663 if (grandmotherId11 == grandmotherId21) {
2667 if ((motherId11 == motherId12 && motherId21 != motherId22)
2668 || (motherId11 != motherId12 && motherId21 == motherId22)) {
2671 if (motherId11 != motherId12 && motherId21 != motherId22) {
2673 if (sameGrandmothersSum == 12)
2675 if (sameGrandmothersSum == 6)
2677 if (sameGrandmothersSum == 4) {
2679 if (grandmotherId11 < 0 || grandmotherId12 < 0
2680 || grandmotherId21 < 0 || grandmotherId22 < 0) {
2683 if (grandmotherId11 == grandmotherId12) {
2686 if (grandmotherId11 != grandmotherId12) {
2689 if ((motherId11 == motherId21 || motherId11 == motherId22)
2690 && (motherId12 == motherId21 || motherId11 == motherId22)) {
2694 if (sameGrandmothersSum == 2)
2696 if (sameGrandmothersSum == 0)
2701 cout <<
"CbmAnaConversionRecoFull: MC-Crosscheck: " << electron11
2702 <<
"/" << electron12 <<
"/" << electron21 <<
"/" << electron22
2703 <<
" - " << pdg11 <<
"/" << pdg12 <<
"/" << pdg21 <<
"/"
2704 << pdg22 <<
" - " << motherId11 <<
"/" << motherId12 <<
"/"
2705 << motherId21 <<
"/" << motherId22 <<
" - " << motherpdg11
2706 <<
"/" << motherpdg12 <<
"/" << motherpdg21 <<
"/"
2707 << motherpdg22 << endl;
2708 cout <<
"CbmAnaConversionRecoFull: MC-Crosscheck: "
2709 << grandmotherId11 <<
"/" << grandmotherId12 <<
"/"
2710 << grandmotherId21 <<
"/" << grandmotherId22 << endl;
2715 if (index == 4 && TMath::Abs(pdg11) == 11 && TMath::Abs(pdg12) == 11
2716 && TMath::Abs(pdg21) == 11 && TMath::Abs(pdg22) == 11) {
2719 if (index == 4 && (pdg11 + pdg12 + pdg21 + pdg22) == 0) {
2723 if (index == 4 && invmass < 0.1) {
2731 TVector3 startvertex11;
2733 TVector3 startvertex12;
2735 TVector3 startvertex21;
2737 TVector3 startvertex22;
2747 if (motherId11 == motherId12 && motherId21 == motherId22) {
2750 if (motherId11 != -1 && motherId21 != -1) {
2756 Int_t grandmotherId11n = mothermctrack11n->
GetMotherId();
2757 Int_t grandmotherId21n = mothermctrack21n->
GetMotherId();
2759 if (grandmotherId11n == grandmotherId21n) {
2762 if (grandmotherId11n == -1)
continue;
2769 if (grandmotherId11n != grandmotherId21n) {
2776 if (motherId11 != motherId12 || motherId21 != motherId22) {
2780 if ((motherId11 != motherId12 && motherId21 == motherId22)
2781 || (motherId11 == motherId12 && motherId21 != motherId22)) {
2785 if (motherId11 != motherId12 && motherId21 != motherId22) {
2788 if (TMath::Abs(pdg11) != 11 || TMath::Abs(pdg12) != 11
2789 || TMath::Abs(pdg21) != 11 || TMath::Abs(pdg22) != 11) {
2843 vector<int> photon1,
2844 vector<int> photon2) {
2845 Double_t energy1 = TMath::Sqrt(momenta[photon1[0]].Mag2() +
M2E);
2846 TLorentzVector lorVec1(momenta[photon1[0]], energy1);
2848 Double_t energy2 = TMath::Sqrt(momenta[photon1[1]].Mag2() +
M2E);
2849 TLorentzVector lorVec2(momenta[photon1[1]], energy2);
2851 Double_t energy3 = TMath::Sqrt(momenta[photon2[0]].Mag2() +
M2E);
2852 TLorentzVector lorVec3(momenta[photon2[0]], energy3);
2854 Double_t energy4 = TMath::Sqrt(momenta[photon2[1]].Mag2() +
M2E);
2855 TLorentzVector lorVec4(momenta[photon2[1]], energy4);
2857 TLorentzVector lorPhoton1 = lorVec1 + lorVec2;
2858 TLorentzVector lorPhoton2 = lorVec3 + lorVec4;
2860 Double_t angleBetweenPhotons = lorPhoton1.Angle(lorPhoton2.Vect());
2861 Double_t theta = 180. * angleBetweenPhotons /
TMath::Pi();
2869 vector<int> photon2) {
2882 TLorentzVector lorPhoton1 = lorVec1 + lorVec2;
2883 TLorentzVector lorPhoton2 = lorVec3 + lorVec4;
2885 Double_t angleBetweenPhotons = lorPhoton1.Angle(lorPhoton2.Vect());
2886 Double_t theta = 180. * angleBetweenPhotons /
TMath::Pi();
3084 cout <<
"CbmAnaConversionRecoFull: CombineElectrons, nof - " << nof << endl;
3085 Int_t nofPhotons = 0;
3087 for (
int a = 0; a < nof - 1; a++) {
3088 for (
int b = a + 1; b < nof; b++) {
3093 Int_t test = check1 + check2;
3094 if (test != 1)
continue;
3104 Double_t openingAngleCut = 1.8 - 0.6 * params1.
fPt;
3108 Double_t invMassCut = 0.03;
3110 Int_t IsPhoton_openingAngle1 = (params1.
fAngle < openingAngleCut);
3111 Int_t IsPhoton_invMass1 = (params1.
fMinv < invMassCut);
3120 if (IsPhoton_openingAngle1 && IsPhoton_invMass1) {
3134 TVector3 momentumE1f;
3135 TVector3 momentumE2f;
3138 TVector3 momentumE1l;
3139 TVector3 momentumE2l;
3152 TVector3 normal1 = momentumE1f.Cross(momentumE1l);
3153 TVector3 normal2 = momentumE2f.Cross(momentumE2l);
3154 Double_t normalAngle = normal1.Angle(normal2);
3155 Double_t theta = 180. * normalAngle /
TMath::Pi();
3174 cout <<
"CbmAnaConversionRecoFull: CombinePhotons, nof - " << nof << endl;
3176 for (
int a = 0; a < nof - 1; a++) {
3177 for (
int b = a + 1; b < nof; b++) {
3184 if (electron11 == electron12 || electron11 == electron21
3185 || electron11 == electron22 || electron12 == electron21
3186 || electron12 == electron22 || electron21 == electron22) {
3187 cout <<
"CbmAnaConversionRecoFull: "
3188 "RecoFull_CombinePhotons()_DoubleIndex!"
3226 Double_t energyE11 =
3229 Double_t energyE12 =
3232 Double_t energyE21 =
3235 Double_t energyE22 =
3238 TLorentzVector g1 = lorVecE11 + lorVecE12;
3239 TLorentzVector g2 = lorVecE21 + lorVecE22;
3240 TLorentzVector pi = lorVecE11 + lorVecE12 + lorVecE21 + lorVecE22;
3242 g1.Boost(-pi.BoostVector());
3243 g2.Boost(-pi.BoostVector());
3245 Double_t boostAngle = g1.Angle(g2.Vect());
3246 Double_t theta = 180. * boostAngle /
TMath::Pi();
3280 Double_t chicut = 1.0;
3358 TVector3 startvertex11;
3360 TVector3 startvertex12;
3362 TVector3 startvertex21;
3364 TVector3 startvertex22;
3372 if (motherId11 == motherId12 && motherId21 == motherId22) {
3374 if (motherId11 != -1 && motherId21 != -1) {
3380 Int_t grandmotherId11 = mothermctrack11->
GetMotherId();
3381 Int_t grandmotherId21 = mothermctrack21->
GetMotherId();
3383 if (grandmotherId11 == grandmotherId21) {
3385 if (grandmotherId11 == -1)
continue;
3392 if (grandmotherId11 != grandmotherId21) {
3398 if (motherId11 != motherId12 || motherId21 != motherId22) {
3403 if (motherId11 != -1 && motherId12 != -1 && motherId21 != -1
3404 && motherId22 != -1) {
3421 TLorentzVector lorVecE11c;
3422 TLorentzVector lorVecE12c;
3423 TLorentzVector lorVecE21c;
3424 TLorentzVector lorVecE22c;
3431 TLorentzVector g1c = lorVecE11c + lorVecE12c;
3432 TLorentzVector g2c = lorVecE21c + lorVecE22c;
3433 TLorentzVector pic =
3434 lorVecE11c + lorVecE12c + lorVecE21c + lorVecE22c;
3436 g1c.Boost(-pic.BoostVector());
3437 g2c.Boost(-pic.BoostVector());
3439 Double_t boostAnglec = g1c.Angle(g2c.Vect());
3440 Double_t thetac = 180. * boostAnglec /
TMath::Pi();
3452 for (
int i = 1;
i < 5;
i++) {
3467 if (check1 + check2 + check3 + check4 != 2)
continue;
3495 Int_t angleCheck12 =
3499 && check1 + check2 == 1);
3500 Int_t angleCheck13 =
3504 && check1 + check3 == 1);
3505 Int_t angleCheck14 =
3509 && check1 + check4 == 1);
3510 Int_t angleCheck23 =
3514 && check2 + check3 == 1);
3515 Int_t angleCheck24 =
3519 && check2 + check4 == 1);
3520 Int_t angleCheck34 =
3524 && check3 + check4 == 1);
3526 if (angleCheck12 && angleCheck34) {
3531 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3535 if (angleCheck13 && angleCheck24) {
3540 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3544 if (angleCheck14 && angleCheck23) {
3549 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3586 if (check1 + check2 + check3 + check4 != 2)
continue;
3614 Int_t angleCheck12 =
3617 && check1 + check2 == 1);
3618 Int_t angleCheck13 =
3621 && check1 + check3 == 1);
3622 Int_t angleCheck14 =
3625 && check1 + check4 == 1);
3626 Int_t angleCheck23 =
3629 && check2 + check3 == 1);
3630 Int_t angleCheck24 =
3633 && check2 + check4 == 1);
3634 Int_t angleCheck34 =
3637 && check3 + check4 == 1);
3639 if (angleCheck12 && angleCheck34) {
3644 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3648 if (angleCheck13 && angleCheck24) {
3653 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3657 if (angleCheck14 && angleCheck23) {
3662 cout <<
"CbmAnaConversionRecoFull: MixedEventTest(), event "
3677 cout <<
"CbmAnaConversionRecoFull: MixedEventTest3 - nof entries " << nof
3679 for (Int_t a = 0; a < nof - 3; a++) {
3680 for (Int_t b = a + 1; b < nof - 1; b++) {
3681 for (Int_t c = b + 1; c < nof - 1; c++) {
3682 for (Int_t
d = c + 1;
d < nof;
d++) {
3695 if (check1 + check2 + check3 + check4 != 2)
continue;
3723 Int_t angleCheck12 =
3726 && check1 + check2 == 1);
3727 Int_t angleCheck13 =
3730 && check1 + check3 == 1);
3731 Int_t angleCheck14 =
3734 && check1 + check4 == 1);
3735 Int_t angleCheck23 =
3738 && check2 + check3 == 1);
3739 Int_t angleCheck24 =
3742 && check2 + check4 == 1);
3743 Int_t angleCheck34 =
3746 && check3 + check4 == 1);
3748 if (angleCheck12 && angleCheck34) {
3755 if (angleCheck13 && angleCheck24) {
3762 if (angleCheck14 && angleCheck23) {
3780 cout <<
"CbmAnaConversionRecoFull: MixedEventTest4 - nof entries " << nof
3782 for (Int_t a = 0; a < nof - 1; a++) {
3783 for (Int_t b = a + 1; b < nof; b++) {
3804 e11, e12, e21, e22);
3810 if (motherId11 == motherId12 && motherId21 == motherId22) {
3813 if (motherId11 != motherId12 || motherId21 != motherId22) {
3816 if ((motherId11 != motherId12 && motherId21 == motherId22)
3817 || (motherId11 == motherId12 && motherId21 != motherId22)) {
3820 if (motherId11 != motherId12 && motherId21 != motherId22) {
3825 if (params.
fPt <= 0.5)
3827 if (params.
fPt > 0.5 && params.
fPt <= 1)
3829 if (params.
fPt > 1 && params.
fPt <= 1.5)
3831 if (params.
fPt > 1.5 && params.
fPt <= 2)
3840 if (IsRichElectron_ann0_e11 && IsRichElectron_ann0_e12
3841 && IsRichElectron_ann0_e21 && IsRichElectron_ann0_e22) {
3851 if (ANNe11 > -1 && ANNe12 > -1 && ANNe21 > -1 && ANNe22 > -1)
3853 if (ANNe11 > -0.9 && ANNe12 > -0.9 && ANNe21 > -0.9 && ANNe22 > -0.9)
3855 if (ANNe11 > -0.8 && ANNe12 > -0.8 && ANNe21 > -0.8 && ANNe22 > -0.8)
3857 if (ANNe11 > -0.7 && ANNe12 > -0.7 && ANNe21 > -0.7 && ANNe22 > -0.7)
3859 if (ANNe11 > -0.6 && ANNe12 > -0.6 && ANNe21 > -0.6 && ANNe22 > -0.6)
3861 if (ANNe11 > -0.5 && ANNe12 > -0.5 && ANNe21 > -0.5 && ANNe22 > -0.5)
3863 if (ANNe11 > -0.0 && ANNe12 > -0.0 && ANNe21 > -0.0 && ANNe22 > -0.0)
3871 Double_t momentum) {
3877 if (richId < 0)
return -2;
3879 if (NULL == ring)
return -2;
3882 globalTrackIndex, momentum);