39 , fRichRingMatches(NULL)
42 , fStsTrackMatches(NULL)
49 , fElectrons_richInd()
50 , fElectrons_pi0mcid()
52 , fElectrons_nofPerPi0(NULL)
53 , fElectrons_nofPerPi0_withRichInd(NULL)
54 , fhElectronsTest_invmass(NULL)
55 , fhTest_ParticlesPerEvent(NULL)
56 , fhTest_RICHelectronsPerEvent(NULL)
57 , fhTest_PhotonsPerEvent_RICHonly(NULL)
58 , fhTest_PhotonsPerEvent_STSandRICH(NULL)
59 , fhTest_ReconstructedPi0PerEvent(NULL)
60 , fhTest_invmass(NULL)
61 , fhTest_invmass_pCut(NULL)
62 , fhTest_invmass_GGcut(NULL)
63 , fhTest_invmass_RICHindex0(NULL)
64 , fhTest_invmass_RICHindex1(NULL)
65 , fhTest_invmass_RICHindex2(NULL)
66 , fhTest_invmass_RICHindex3(NULL)
67 , fhTest_invmass_RICHindex4(NULL)
68 , fhTest_invmass_MCcutAll(NULL)
69 , fhTest_peakCheck1(NULL)
70 , fhTest_peakCheck2(NULL)
71 , fhTest_peakCheck3(NULL)
72 , fhTest_invmass_ANNcuts(NULL)
73 , fhTest_phaseSpace_pi0(NULL)
74 , fhTest_phaseSpace_eta(NULL)
75 , fVector_AllMomenta()
82 , fVector_withRichSignal()
83 , fVector_reconstructedPhotons_FromSTSandRICH()
84 , fVector_electronRICH_gt()
85 , fVector_electronRICH_gtIndex()
86 , fVector_electronRICH_mcIndex()
87 , fVector_electronRICH_momenta()
88 , fVector_electronRICH_reconstructedPhotons()
89 , fVector_reconstructedPhotons_STSonly()
91 , fMixedTest_STSonly_photons()
92 , fMixedTest_STSonly_eventno()
93 , fMixedTest_STSonly_hasRichInd()
94 , fhTest_eventMixing_STSonly_2p2(NULL)
95 , fhTest_eventMixing_STSonly_3p1(NULL)
96 , fhTest_eventMixing_STSonly_4p0(NULL)
97 , fMixedTest_3p1_photons()
98 , fMixedTest_3p1_eventno()
99 , fMixedTest_3p1_combined()
100 , fMixedTest_3p1_ann()
101 , fhTest_eventMixing_3p1(NULL)
102 , fhTest_eventMixing_3p1_pCut(NULL)
103 , fhTest_eventMixing_3p1_GGcut(NULL)
104 , fhTest_eventMixing_3p1_ANNcuts(NULL)
156 Double_t invmassSpectra_nof = 800;
157 Double_t invmassSpectra_start = -0.00125;
158 Double_t invmassSpectra_end = 1.99875;
161 fElectrons_nofPerPi0 =
new TH1I(
"fElectrons_nofPerPi0",
"fElectrons_nofPerPi0; nof; #", 7, -0.5, 6.5);
164 new TH1I(
"fElectrons_nofPerPi0_withRichInd",
"fElectrons_nofPerPi0_withRichInd; nof; #", 7, -0.5, 6.5);
168 new TH1D(
"fhElectronsTest_invmass",
"fhElectronsTest_invmass; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
169 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
174 new TH1I(
"fhTest_PhotonsPerEvent_RICHonly",
"fhTest_PhotonsPerEvent_RICHonly; nof; #", 501, -0.5, 500.5);
177 new TH1I(
"fhTest_PhotonsPerEvent_STSandRICH",
"fhTest_PhotonsPerEvent_STSandRICH; nof; #", 501, -0.5, 500.5);
180 new TH1I(
"fhTest_ParticlesPerEvent",
"fhTest_ParticlesPerEvent; nof; #", 1001, -0.5, 1000.5);
183 new TH1I(
"fhTest_ReconstructedPi0PerEvent",
"fhTest_ReconstructedPi0PerEvent; nof; #", 101, -0.5, 100.5);
186 new TH1I(
"fhTest_RICHelectronsPerEvent",
"fhTest_RICHelectronsPerEvent; nof; #", 501, -0.5, 500.5);
190 new TH1D(
"fhTest_invmass",
"fhTest_invmass; invariant mass of 3 e^{#pm} + 1 particle in GeV/c^{2}; #",
191 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
194 "fhTest_invmass_pCut; invariant mass of 3 "
195 "e^{#pm} + 1 particle in GeV/c^{2}; #",
196 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
199 "fhTest_invmass_GGcut; invariant mass of 3 "
200 "e^{#pm} + 1 particle in GeV/c^{2}; #",
201 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
206 new TH1D(
"fhTest_invmass_RICHindex0",
"fhTest_invmass_RICHindex0; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
207 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
210 new TH1D(
"fhTest_invmass_RICHindex1",
"fhTest_invmass_RICHindex1; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
211 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
214 new TH1D(
"fhTest_invmass_RICHindex2",
"fhTest_invmass_RICHindex2; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
215 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
218 new TH1D(
"fhTest_invmass_RICHindex3",
"fhTest_invmass_RICHindex3; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
219 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
222 new TH1D(
"fhTest_invmass_RICHindex4",
"fhTest_invmass_RICHindex4; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
223 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
226 fhTest_invmass_MCcutAll =
new TH2D(
"fhTest_invmass_MCcutAll",
"fhTest_invmass_MCcutAll; case; invariant mass", 25, 0,
227 25, invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
228 fhTest_peakCheck1 =
new TH1D(
"fhTest_peakCheck1",
"fhTest_peakCheck1; sum; #", 15, -0.5, 14.5);
229 fhTest_peakCheck2 =
new TH1D(
"fhTest_peakCheck2",
"fhTest_peakCheck2; sum; #", 15, -0.5, 14.5);
230 fhTest_peakCheck3 =
new TH1D(
"fhTest_peakCheck3",
"fhTest_peakCheck3; sum; #", 20, -5.5, 14.5);
237 "fhTest_invmass_ANNcuts;ann;invariant mass "
238 "of 3 e^{#pm} + 1 particle in GeV/c^{2}",
239 10, 0, 10, invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
243 new TH2D(
"fhTest_phaseSpace_pi0",
"fhTest_phaseSpace_pi0;p_{t} in GeV/c;rapidity y", 240, -2., 10., 270, -2., 7.);
245 new TH2D(
"fhTest_phaseSpace_eta",
"fhTest_phaseSpace_eta;p_{t} in GeV/c;rapidity y", 240, -2., 10., 270, -2., 7.);
250 "fhTest_eventMixing_STSonly_2p2; invariant mass of 4 e^{#pm} in "
252 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
255 "fhTest_eventMixing_STSonly_3p1; invariant mass of 4 e^{#pm} in "
257 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
260 "fhTest_eventMixing_STSonly_4p0; invariant mass of 4 e^{#pm} in "
262 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
266 new TH1D(
"fhTest_eventMixing_3p1",
"fhTest_eventMixing_3p1; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
267 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
270 new TH1D(
"fhTest_eventMixing_3p1_pCut",
"fhTest_eventMixing_3p1_pCut; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
271 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
274 "fhTest_eventMixing_3p1_GGcut; invariant mass of 4 e^{#pm} in GeV/c^{2}; #",
275 invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
279 "fhTest_eventMixing_3p1_ANNcuts;ann;invariant mass of 4 e^{#pm} "
281 10, 0, 10, invmassSpectra_nof, invmassSpectra_start, invmassSpectra_end);
381 std::multimap<int, int> electronMap;
388 for (std::map<int, int>::iterator it = electronMap.begin(); it != electronMap.end(); ++it) {
389 if (it == electronMap.begin()) {
393 if (it != electronMap.begin()) {
394 std::map<int, int>::iterator zwischen = it;
397 int id_old = zwischen->first;
402 std::map<int, int>::iterator zwischen2 = zwischen--;
403 std::map<int, int>::iterator zwischen3 = zwischen2--;
404 Double_t invmass =
CalcInvMass(it->second, zwischen->second, zwischen2->second, zwischen3->second);
486 Int_t nofRICHelectrons = 0;
490 for (Int_t i = 0; i < ngTracks; i++) {
492 if (NULL == gTrack)
continue;
498 if (stsInd < 0)
continue;
500 if (stsTrack == NULL)
continue;
502 if (stsMatch == NULL)
continue;
505 if (stsMcTrackId < 0)
continue;
507 if (mcTrack1 == NULL)
continue;
511 TVector3 refittedMomentum;
513 vector<CbmStsTrack> stsTracks;
515 stsTracks[0] = *stsTrack;
516 vector<CbmL1PFFitter::PFFieldRegion> vField;
517 vector<float> chiPrim;
521 const FairTrackParam* vtxTrack = stsTracks[0].GetParamFirst();
522 vtxTrack->Momentum(refittedMomentum);
528 vector<CbmStsTrack> stsTracks_electron;
529 stsTracks_electron.resize(1);
530 stsTracks_electron[0] = *stsTrack;
531 vector<CbmL1PFFitter::PFFieldRegion> vField_electron;
532 vector<float> chiPrim_electron;
533 vector<int> pidHypo_electron;
534 pidHypo_electron.push_back(11);
535 fPFFitter_electron.
Fit(stsTracks_electron, pidHypo_electron);
538 TVector3 refittedMomentum_electron;
539 const FairTrackParam* vtxTrack_electron = stsTracks_electron[0].GetParamFirst();
540 vtxTrack_electron->Momentum(refittedMomentum_electron);
541 float result_chi_electron = chiPrim_electron[0];
551 if (result_chi_electron > chiCut)
continue;
563 Bool_t WithRichSignal =
false;
584 if (richMatch != NULL) {
586 if (richMcTrackId >= 0) {
588 if (mcTrack2 != NULL) {
591 Bool_t electron_rich =
599 WithRichSignal =
true;
748 cout <<
"CbmAnaConversionTest: CombinePhotons, nof - " << nof_STSandRICH <<
"/" << nof_RICH << endl;
750 if (nof_STSandRICH + nof_RICH >= 2) {
751 for (
int a = 0; a < nof_STSandRICH; a++) {
752 for (
int b = 0; b < nof_RICH; b++) {
763 if (gtIndex11 == gtIndex12 || gtIndex11 == gtIndex21 || gtIndex11 == gtIndex22 || gtIndex12 == gtIndex21
764 || gtIndex12 == gtIndex22 || gtIndex21 == gtIndex22) {
766 cout <<
"CbmAnaConversionTest: Test_DoubleIndex." << endl;
776 Double_t invmass = paramsTest.
fMinv;
801 cout <<
"CbmAnaConversionTest: CombinePhotons, anns: " << ANNe11 <<
"/" << ANNe12 <<
"/" << ANNe21 <<
"/"
814 cout <<
"CbmAnaConversionTest: CombinePhotons, photon combined! " << invmass <<
"/" << gtIndex11 <<
"/"
815 << gtIndex12 <<
"/" << gtIndex21 <<
"/" << gtIndex22 << endl;
844 Int_t motherpdg11 = -2;
846 Int_t motherpdg21 = -2;
848 if (mothermctrack11 != NULL) motherpdg11 = mothermctrack11->
GetPdgCode();
850 if (mothermctrack21 != NULL) motherpdg21 = mothermctrack21->
GetPdgCode();
853 Int_t grandmotherId11 = -2;
854 Int_t grandmotherId12 = -2;
855 Int_t grandmotherId21 = -2;
856 Int_t grandmotherId22 = -2;
857 if (mothermctrack11 != NULL) grandmotherId11 = mothermctrack11->
GetMotherId();
858 if (mothermctrack12 != NULL) grandmotherId12 = mothermctrack12->
GetMotherId();
859 if (mothermctrack21 != NULL) grandmotherId21 = mothermctrack21->
GetMotherId();
860 if (mothermctrack22 != NULL) grandmotherId22 = mothermctrack22->
GetMotherId();
863 Int_t sameGrandmothers1 = 0;
864 Int_t sameGrandmothers2 = 0;
865 Int_t sameGrandmothers3 = 0;
866 Int_t sameGrandmothers4 = 0;
867 if (grandmotherId11 == grandmotherId12) sameGrandmothers1++;
868 if (grandmotherId11 == grandmotherId21) sameGrandmothers1++;
869 if (grandmotherId11 == grandmotherId22) sameGrandmothers1++;
870 if (grandmotherId12 == grandmotherId11) sameGrandmothers2++;
871 if (grandmotherId12 == grandmotherId21) sameGrandmothers2++;
872 if (grandmotherId12 == grandmotherId22) sameGrandmothers2++;
873 if (grandmotherId21 == grandmotherId11) sameGrandmothers3++;
874 if (grandmotherId21 == grandmotherId12) sameGrandmothers3++;
875 if (grandmotherId21 == grandmotherId22) sameGrandmothers3++;
876 if (grandmotherId22 == grandmotherId11) sameGrandmothers4++;
877 if (grandmotherId22 == grandmotherId12) sameGrandmothers4++;
878 if (grandmotherId22 == grandmotherId21) sameGrandmothers4++;
879 Int_t sameGrandmothersSum = sameGrandmothers1 + sameGrandmothers2 + sameGrandmothers3 + sameGrandmothers4;
881 Int_t sameMothers1 = 0;
882 Int_t sameMothers2 = 0;
883 Int_t sameMothers3 = 0;
884 Int_t sameMothers4 = 0;
885 if (motherId11 == motherId12) sameMothers1++;
886 if (motherId11 == motherId21) sameMothers1++;
887 if (motherId11 == motherId22) sameMothers1++;
888 if (motherId12 == motherId11) sameMothers2++;
889 if (motherId12 == motherId21) sameMothers2++;
890 if (motherId12 == motherId22) sameMothers2++;
891 if (motherId21 == motherId11) sameMothers3++;
892 if (motherId21 == motherId12) sameMothers3++;
893 if (motherId21 == motherId22) sameMothers3++;
894 if (motherId22 == motherId11) sameMothers4++;
895 if (motherId22 == motherId12) sameMothers4++;
896 if (motherId22 == motherId21) sameMothers4++;
897 Int_t sameMothersSum = sameMothers1 + sameMothers2 + sameMothers3 + sameMothers4;
901 motherId11 == motherId12
905 if (TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 22) {
908 if (TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 22 && grandmotherId11 == grandmotherId21
909 && grandmotherId11 > 0) {
914 if (TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 22 && grandmotherId11 != grandmotherId21) {
917 if ((TMath::Abs(motherpdg11) == 22 && TMath::Abs(motherpdg21) == 111)
918 || (TMath::Abs(motherpdg11) == 111 && TMath::Abs(motherpdg21) == 22)) {
920 if (grandmotherId11 == motherId21 || motherId11 == grandmotherId21) {
925 if (TMath::Abs(motherpdg11) == 111 && TMath::Abs(motherpdg21) == 111) {
928 if ((TMath::Abs(motherpdg11) != 22 && TMath::Abs(motherpdg11) != 111)
929 || (TMath::Abs(motherpdg21) != 22 && TMath::Abs(motherpdg21) != 111)) {
932 if (TMath::Abs(motherpdg11) != 22 && TMath::Abs(motherpdg11) != 111 && TMath::Abs(motherpdg21) != 22
933 && TMath::Abs(motherpdg21) != 111) {
938 if ((motherId11 == motherId12 && motherId21 != motherId22)
939 || (motherId11 != motherId12 && motherId21 == motherId22)) {
942 if (motherId11 != motherId12 && motherId21 != motherId22) {
946 if (sameGrandmothersSum == 4) {
948 if (grandmotherId11 < 0 || grandmotherId12 < 0 || grandmotherId21 < 0 || grandmotherId22 < 0) {
958 if ((grandmotherId11 < 0 || grandmotherId12 < 0 || grandmotherId21 < 0 || grandmotherId22 < 0)
959 && sameGrandmothersSum == 12) {