26#include "FairRootManager.h"
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)
113 FairRootManager* ioman = FairRootManager::Instance();
114 if (NULL == ioman) { Fatal(
"CbmAnaConversion::Init",
"RootManager not instantised!"); }
116 fRichPoints = (TClonesArray*) ioman->GetObject(
"RichPoint");
117 if (NULL ==
fRichPoints) { Fatal(
"CbmAnaConversion::Init",
"No RichPoint array!"); }
119 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
120 if (NULL ==
fMcTracks) { Fatal(
"CbmAnaConversion::Init",
"No MCTrack array!"); }
122 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
123 if (NULL ==
fStsTracks) { Fatal(
"CbmAnaConversion::Init",
"No StsTrack array!"); }
126 if (NULL ==
fStsTrackMatches) { Fatal(
"CbmAnaConversion::Init",
"No StsTrackMatch array!"); }
128 fGlobalTracks = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
129 if (NULL ==
fGlobalTracks) { Fatal(
"CbmAnaConversion::Init",
"No GlobalTrack array!"); }
136 if (
nullptr ==
fPrimVertex) { LOG(fatal) <<
"No PrimaryVertex array!"; }
138 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
139 if (NULL ==
fRichRings) { Fatal(
"CbmAnaConversion::Init",
"No RichRing array!"); }
142 if (NULL ==
fRichRingMatches) { Fatal(
"CbmAnaConversion::Init",
"No RichRingMatch array!"); }
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);
289 gDirectory->mkdir(
"Test");
290 gDirectory->cd(
"Test");
294 gDirectory->cd(
"..");
300 cout <<
"CbmAnaConversionTest: Exec()" << endl;
306 Fatal(
"CbmAnaConversionTest::Exec",
"No PrimaryVertex array!");
317 for (
Int_t i = 0; i < nGTracks; i++) {
319 if (NULL == gTrack)
continue;
322 if (stsInd < 0)
continue;
323 if (richInd < 0)
continue;
326 if (stsTrack == NULL)
continue;
329 if (stsMatch == NULL)
continue;
331 if (stsMcTrackId < 0)
continue;
333 if (mcTrack1 == NULL)
continue;
336 if (richMatch == NULL)
continue;
338 if (richMcTrackId < 0)
continue;
340 if (mcTrack2 == NULL)
continue;
345 if (motherId < 0)
continue;
347 if (mcTrack1mother == NULL)
continue;
349 if (grandmotherId < 0)
continue;
351 if (mcTrack1grandmother == NULL)
continue;
353 int pdg_mother = TMath::Abs(mcTrack1mother->
GetPdgCode());
354 int pdg_grandmother = TMath::Abs(mcTrack1grandmother->
GetPdgCode());
356 cout <<
"CbmAnaConversionTest: pdg particle/mother/grandmother: " << pdg <<
" / " << pdg_mother <<
" / "
357 << pdg_grandmother << endl;
359 Int_t sameRichSts = (stsMcTrackId == richMcTrackId);
361 if (TMath::Abs(pdg) == 11 && (pdg_mother == 111 || pdg_grandmother == 111)) {
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);
432 TLorentzVector lorentz1;
434 TLorentzVector lorentz2;
436 TLorentzVector lorentz3;
438 TLorentzVector lorentz4;
442 sum = lorentz1 + lorentz2 + lorentz3 + lorentz4;
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) {
599 WithRichSignal =
true;
625 cout <<
"CbmAnaConversionTest: CombineElectrons_FromSTSandRICH, nof sts/rich - " << nof_sts <<
" / " << nof_rich
627 Int_t nofPhotons = 0;
628 if (nof_sts + nof_rich >= 2) {
629 for (
int a = 0; a < nof_sts; a++) {
630 for (
int b = 0; b < nof_rich; b++) {
634 Int_t test = check1 + check2;
635 if (test != 1)
continue;
644 Double_t openingAngleCut = 1.8 - 0.6 * paramsTest.
fPt;
647 Double_t invMassCut = 0.03;
649 Int_t IsPhoton_openingAngle1 = (paramsTest.
fAngle < openingAngleCut);
650 Int_t IsPhoton_invMass1 = (paramsTest.
fMinv < invMassCut);
653 if (IsPhoton_openingAngle1 && IsPhoton_invMass1) {
661 vector<TVector3> pairmomenta;
665 vector<Double_t> ann;
678 cout <<
"CbmAnaConversionTest: CombineElectronsFromSTSandRICH: Crosscheck - "
679 "nof reconstructed photons: "
680 << nofPhotons << endl;
687 cout <<
"CbmAnaConversionTest: CombineElectronsFromRICH, nof - " << nof << endl;
688 Int_t nofPhotons = 0;
690 for (
int a = 0; a < nof - 1; a++) {
691 for (
int b = a + 1; b < nof; b++) {
695 Int_t test = check1 + check2;
696 if (test != 1)
continue;
704 Double_t openingAngleCut = 1.8 - 0.6 * paramsTest.
fPt;
707 Double_t invMassCut = 0.03;
709 Int_t IsPhoton_openingAngle1 = (paramsTest.
fAngle < openingAngleCut);
710 Int_t IsPhoton_invMass1 = (paramsTest.
fMinv < invMassCut);
713 if (IsPhoton_openingAngle1 && IsPhoton_invMass1) {
721 vector<TVector3> pairmomenta;
725 vector<Double_t> ann;
738 cout <<
"CbmAnaConversionTest: CombineElectronsFromRICH: Crosscheck - nof "
739 "reconstructed photons: "
740 << nofPhotons << endl;
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) {
977 Double_t energyP = TMath::Sqrt(electron1.Mag2() +
M2E);
978 TLorentzVector lorVecP(electron1, energyP);
980 Double_t energyM = TMath::Sqrt(electron2.Mag2() +
M2E);
981 TLorentzVector lorVecM(electron2, energyM);
983 TVector3 momPair = electron1 + electron2;
984 Double_t energyPair = energyP + energyM;
985 Double_t ptPair = momPair.Perp();
986 Double_t pzPair = momPair.Pz();
987 Double_t yPair = 0.5 * TMath::Log((energyPair + pzPair) / (energyPair - pzPair));
988 Double_t anglePair = lorVecM.Angle(lorVecP.Vect());
989 Double_t theta = 180. * anglePair / TMath::Pi();
990 Double_t minv = 2. * TMath::Sin(anglePair / 2.) * TMath::Sqrt(electron1.Mag() * electron2.Mag());
1002 const TVector3 part4)
1005 Double_t energy1 = TMath::Sqrt(part1.Mag2() +
M2E);
1006 TLorentzVector lorVec1(part1, energy1);
1008 Double_t energy2 = TMath::Sqrt(part2.Mag2() +
M2E);
1009 TLorentzVector lorVec2(part2, energy2);
1011 Double_t energy3 = TMath::Sqrt(part3.Mag2() +
M2E);
1012 TLorentzVector lorVec3(part3, energy3);
1014 Double_t energy4 = TMath::Sqrt(part4.Mag2() +
M2E);
1015 TLorentzVector lorVec4(part4, energy4);
1018 sum = lorVec1 + lorVec2 + lorVec3 + lorVec4;
1027 cout <<
"CbmAnaConversionTest: CombineElectrons_STSonly, nof - " << nof << endl;
1028 Int_t nofPhotons = 0;
1030 for (
int a = 0; a < nof - 1; a++) {
1031 for (
int b = a + 1; b < nof; b++) {
1035 Int_t test = check1 + check2;
1036 if (test != 1)
continue;
1044 Double_t openingAngleCut = 1.8 - 0.6 * paramsTest.
fPt;
1045 Double_t invMassCut = 0.03;
1047 Int_t IsPhoton_openingAngle1 = (paramsTest.
fAngle < openingAngleCut);
1048 Int_t IsPhoton_invMass1 = (paramsTest.
fMinv < invMassCut);
1051 if (IsPhoton_openingAngle1 && IsPhoton_invMass1) {
1060 vector<TVector3> pairmomenta;
1065 vector<bool> pair_hasRichInd;
1081 cout <<
"CbmAnaConversionTest: CombinePhotons_STSonly, nof - " << nof << endl;
1091 for (
int a = 0; a < nof - 1; a++) {
1092 for (
int b = a + 1; b < nof; b++) {
1108 if (gtIndex11 == gtIndex12 || gtIndex11 == gtIndex21 || gtIndex11 == gtIndex22 || gtIndex12 == gtIndex21
1109 || gtIndex12 == gtIndex22 || gtIndex21 == gtIndex22) {
1120 Double_t invmass = paramsTest.
fMinv;
1127 if (nofRICHindices == 0) {
1131 if (nofRICHindices == 1) {
1135 if (nofRICHindices == 2) {
1139 if (nofRICHindices == 3) {
1144 if (nofRICHindices == 4) {
1153 cout <<
"CbmAnaConversionTest: CombinePhotons_STSonly, nofPi0 - " << nofPi0 <<
"/" << nofPi0_0 <<
"/" << nofPi0_1
1154 <<
"/" << nofPi0_2 <<
"/" << nofPi0_3 <<
"/" << nofPi0_4 << endl;
1161 if (NULL == gTrack)
return false;
1165 if (stsInd < 0)
return false;
1167 if (stsTrack == NULL)
return false;
1169 if (stsMatch == NULL)
return false;
1172 if (stsMcTrackId < 0)
return false;
1174 if (mcTrack1 == NULL)
return false;
1176 if (richInd < 0)
return false;
1178 if (richMatch == NULL)
return false;
1180 if (richMcTrackId < 0)
return false;
1182 if (mcTrack2 == NULL)
return false;
1222 return electron_rich;
1233 for (
Int_t a = 0; a < nof - 1; a++) {
1234 for (
Int_t b = a + 1; b < nof; b++) {
1281 for (
Int_t a = 0; a < nof - 1; a++) {
1282 for (
Int_t b = a + 1; b < nof; b++) {
1294 Int_t IsRichSum = IsRich11 + IsRich12 + IsRich21 + IsRich22;
1314 if (richId < 0)
return -2;
1316 if (NULL == ring)
return -2;
Data class for STS tracks.
static Double_t CalcChiCut(Double_t pt)
static Double_t OpeningAngleBetweenGamma(const TVector3 part11, const TVector3 part12, const TVector3 part21, const TVector3 part22)
static CbmAnaConversionKinematicParams KinematicParams_2particles_Reco(const TVector3 electron1, const TVector3 electron2)
static CbmAnaConversionKinematicParams KinematicParams_4particles_Reco(const TVector3 part1, const TVector3 part2, const TVector3 part3, const TVector3 part4)
std::vector< std::vector< int > > fVector_electronRICH_reconstructedPhotons
TH1I * fhTest_PhotonsPerEvent_STSandRICH
std::vector< int > fVector_electronRICH_mcIndex
void CombinePhotons_STSonly()
std::vector< int > fMixedTest_3p1_eventno
LmvmKinePar CalculateKinematicParamsReco(const TVector3 electron1, const TVector3 electron2)
std::vector< int > fMixedTest_3p1_combined
TH1D * fhTest_invmass_RICHindex1
std::vector< std::vector< int > > fVector_reconstructedPhotons_FromSTSandRICH
std::vector< double > fVector_chi
std::vector< int > fVector_electronRICH_gtIndex
std::vector< int > fElectrons_gtid
TH2D * fhTest_invmass_MCcutAll
std::vector< int > fVector_richIndex
std::vector< int > fElectrons_pi0mcid
TH1D * fhTest_invmass_RICHindex2
std::vector< CbmGlobalTrack * > fVector_electronRICH_gt
TH1I * fElectrons_nofPerPi0_withRichInd
std::vector< TVector3 > fVector_AllMomenta
void MixedEventTest_3p1()
TH1D * fhTest_invmass_RICHindex4
TH1I * fhTest_RICHelectronsPerEvent
TH1I * fhTest_ParticlesPerEvent
TH1I * fhTest_PhotonsPerEvent_RICHonly
std::vector< std::vector< int > > fVector_reconstructedPhotons_STSonly
std::vector< std::vector< bool > > fMixedTest_STSonly_hasRichInd
Double_t Invmass_4particlesRECO(const TVector3 part1, const TVector3 part2, const TVector3 part3, const TVector3 part4)
std::vector< int > fElectrons_same
std::vector< std::vector< TVector3 > > fMixedTest_STSonly_photons
TClonesArray * fStsTrackMatches
std::vector< int > fVector_gtIndex
void GetNofRichElectrons()
TH1D * fhTest_eventMixing_3p1_GGcut
TH1D * fhTest_eventMixing_3p1_pCut
std::vector< int > fMixedTest_STSonly_eventno
void MixedEventTest_STSonly()
std::vector< std::vector< TVector3 > > fMixedTest_3p1_photons
void CombineElectrons_FromSTSandRICH()
Double_t ElectronANNvalue(Int_t globalTrackIndex, Double_t momentum)
TH1D * fhTest_eventMixing_STSonly_4p0
void CombineElectrons_STSonly()
std::vector< CbmGlobalTrack * > fVector_gt
void CombineElectrons_FromRICH()
TH1I * fhTest_ReconstructedPi0PerEvent
std::vector< bool > fVector_withRichSignal
TH2D * fhTest_invmass_ANNcuts
std::vector< int > fVector_mcIndex
Bool_t HasRichInd(Int_t gtIndex, Int_t arrayIndex)
TH1D * fhTest_invmass_GGcut
TH1D * fhTest_eventMixing_3p1
TClonesArray * fRichPoints
TH1D * fhTest_eventMixing_STSonly_3p1
TH1D * fhTest_invmass_RICHindex3
TH1D * fhTest_eventMixing_STSonly_2p2
std::vector< TH1 * > fHistoList_test
TH2D * fhTest_phaseSpace_pi0
TH1D * fhElectronsTest_invmass
TClonesArray * fGlobalTracks
TClonesArray * fStsTracks
TH2D * fhTest_phaseSpace_eta
std::vector< std::vector< Double_t > > fMixedTest_3p1_ann
std::vector< int > fElectrons_richInd
std::vector< int > fElectrons_mcid
TH1I * fElectrons_nofPerPi0
TClonesArray * fRichRings
TH1D * fhTest_invmass_pCut
TH1D * fhTest_invmass_RICHindex0
Double_t CalcInvMass(Int_t e1, Int_t e2, Int_t e3, Int_t e4)
std::vector< TVector3 > fVector_momenta
TH2D * fhTest_eventMixing_3p1_ANNcuts
virtual ~CbmAnaConversionTest()
TClonesArray * fRichRingMatches
std::vector< TVector3 > fVector_electronRICH_momenta
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
void GetChiToVertex(std::vector< CbmStsTrack > &Tracks, std::vector< PFFieldRegion > &field, std::vector< float > &chiToVtx, CbmKFVertex &primVtx, float chiPrim=-1)
void Fit(std::vector< CbmStsTrack > &Tracks, const std::vector< CbmMvdHit > &vMvdHits, const std::vector< CbmStsHit > &vStsHits, const std::vector< int > &pidHypo)
Bool_t IsRichElectron(Int_t globalTrackIndex, Double_t momentum)
Identify electron in RICH detector.
void SetRichAnnCut(Double_t par)
Set cut on RICH ANN output value.
static CbmLitGlobalElectronId & GetInstance()
int32_t GetMotherId() const
int32_t GetPdgCode() const
void Get4Momentum(TLorentzVector &momentum) const
int32_t GetNofLinks() const
const CbmLink & GetMatchedLink() const
double CalculateAnnValue(int globalTrackIndex, double momentum)
Calculate output value of the ANN.
static CbmRichElectronIdAnn & GetInstance()