21 #include "FairLogger.h"
22 #include "FairRootManager.h"
43 , fRichRingMatches(NULL)
46 , fStsTrackMatches(NULL)
50 , fHistoList_photons()
51 , fHistoList_photons_withRICH()
52 , fHistoList_photons_withRICH_withChi()
53 , fHistoList_photons_withRICH_fromTarget()
54 , fRecoTracklist_gtIndex()
55 , fRecoTracklist_mcIndex()
56 , fRecoTracklist_momentum()
57 , fRecoTracklist_chi()
58 , fRecoTracklist_mctrack()
59 , fRecoTracklist_withRICH_gtIndex()
60 , fRecoTracklist_withRICH_mcIndex()
61 , fRecoTracklist_withRICH_momentum()
62 , fRecoTracklist_withRICH_chi()
63 , fRecoTracklist_withRICH_mctrack()
64 , fh2Electrons_angle_all(NULL)
65 , fh2Electrons_angle_combBack(NULL)
66 , fh2Electrons_angle_allSameG(NULL)
67 , fh2Electrons_angle_all_cuts(NULL)
68 , fh2Electrons_angle_combBack_cuts(NULL)
69 , fh2Electrons_angle_allSameG_cuts(NULL)
70 , fh2Electrons_angle_CUTcomparison(NULL)
71 , fh2Electrons_angle_CUTcomparison_chi(NULL)
72 , fh2Electrons_angle_CUTcomparison_withRICH(NULL)
73 , fh2Electrons_angle_CUTcomparison_withRICH_chi(NULL)
74 , fh2Electrons_angle_CUTcomparison_withRICH_withChi(NULL)
75 , fh2Electrons_invmass_all(NULL)
76 , fh2Electrons_invmass_combBack(NULL)
77 , fh2Electrons_invmass_allSameG(NULL)
78 , fh2Electrons_invmass_all_cut(NULL)
79 , fh2Electrons_invmass_combBack_cut(NULL)
80 , fh2Electrons_invmass_allSameG_cut(NULL)
81 , fh2Electrons_angleVSpt_all(NULL)
82 , fh2Electrons_angleVSpt_combBack(NULL)
83 , fh2Electrons_angleVSpt_allSameG(NULL)
84 , fh2Electrons_invmassVSpt_all(NULL)
85 , fh2Electrons_invmassVSpt_combBack(NULL)
86 , fh2Electrons_invmassVSpt_allSameG(NULL)
87 , fh2Electrons_angle_withRICH_all(NULL)
88 , fh2Electrons_angle_withRICH_combBack(NULL)
89 , fh2Electrons_angle_withRICH_allSameG(NULL)
90 , fh2Electrons_angleVSpt_withRICH_all(NULL)
91 , fh2Electrons_angleVSpt_withRICH_combBack(NULL)
92 , fh2Electrons_angleVSpt_withRICH_allSameG(NULL)
93 , fh2Electrons_invmass_withRICH_all(NULL)
94 , fh2Electrons_invmass_withRICH_combBack(NULL)
95 , fh2Electrons_invmass_withRICH_allSameG(NULL)
96 , fh2Electrons_invmassVSpt_withRICH_all(NULL)
97 , fh2Electrons_invmassVSpt_withRICH_combBack(NULL)
98 , fh2Electrons_invmassVSpt_withRICH_allSameG(NULL)
99 , fh2Electrons_angle_withRICH_withChi_all(NULL)
100 , fh2Electrons_angle_withRICH_withChi_combBack(NULL)
101 , fh2Electrons_angle_withRICH_withChi_allSameG(NULL)
102 , fh2Electrons_angleVSpt_withRICH_withChi_all(NULL)
103 , fh2Electrons_angleVSpt_withRICH_withChi_combBack(NULL)
104 , fh2Electrons_angleVSpt_withRICH_withChi_allSameG(NULL)
105 , fh2Electrons_invmass_withRICH_withChi_all(NULL)
106 , fh2Electrons_invmass_withRICH_withChi_combBack(NULL)
107 , fh2Electrons_invmass_withRICH_withChi_allSameG(NULL)
108 , fh2Electrons_invmassVSpt_withRICH_withChi_all(NULL)
109 , fh2Electrons_invmassVSpt_withRICH_withChi_combBack(NULL)
110 , fh2Electrons_invmassVSpt_withRICH_withChi_allSameG(NULL)
111 , fh2Electrons_angle_withRICH_fromTarget_all(NULL)
112 , fh2Electrons_angle_withRICH_fromTarget_combBack(NULL)
113 , fh2Electrons_angle_withRICH_fromTarget_allSameG(NULL)
114 , fh2Electrons_angleVSpt_withRICH_fromTarget_all(NULL)
115 , fh2Electrons_angleVSpt_withRICH_fromTarget_combBack(NULL)
116 , fh2Electrons_angleVSpt_withRICH_fromTarget_allSameG(NULL)
117 , fh2Electrons_invmass_withRICH_fromTarget_all(NULL)
118 , fh2Electrons_invmass_withRICH_fromTarget_combBack(NULL)
119 , fh2Electrons_invmass_withRICH_fromTarget_allSameG(NULL)
120 , fh2Electrons_invmassVSpt_withRICH_fromTarget_all(NULL)
121 , fh2Electrons_invmassVSpt_withRICH_fromTarget_combBack(NULL)
122 , fh2Electrons_invmassVSpt_withRICH_fromTarget_allSameG(NULL)
123 , fVector_combinations()
124 , fh2Electrons_fullrecoCheck(NULL)
132 FairRootManager* ioman = FairRootManager::Instance();
134 Fatal(
"CbmAnaConversion::Init",
"RootManager not instantised!");
137 fRichPoints = (TClonesArray*) ioman->GetObject(
"RichPoint");
139 Fatal(
"CbmAnaConversion::Init",
"No RichPoint array!");
142 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
144 Fatal(
"CbmAnaConversion::Init",
"No MCTrack array!");
147 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
149 Fatal(
"CbmAnaConversion::Init",
"No StsTrack array!");
154 Fatal(
"CbmAnaConversion::Init",
"No StsTrackMatch array!");
157 fGlobalTracks = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
159 Fatal(
"CbmAnaConversion::Init",
"No GlobalTrack array!");
169 if (
nullptr ==
fPrimVertex) { LOG(fatal) <<
"No PrimaryVertex array!"; }
171 fRichRings = (TClonesArray*) ioman->GetObject(
"RichRing");
173 Fatal(
"CbmAnaConversion::Init",
"No RichRing array!");
178 Fatal(
"CbmAnaConversion::Init",
"No RichRingMatch array!");
195 new TH1D(
"fh2Electrons_angle_all",
196 "fh2Electrons_angle_all; opening angle [deg]; #",
201 new TH1D(
"fh2Electrons_angle_combBack",
202 "fh2Electrons_angle_combBack; opening angle [deg]; #",
207 new TH1D(
"fh2Electrons_angle_allSameG",
208 "fh2Electrons_angle_allSameG; opening angle [deg]; #",
219 new TH1I(
"fh2Electrons_angle_CUTcomparison",
220 "fh2Electrons_angle_CUTcomparison; ; #",
242 new TH1I(
"fh2Electrons_angle_CUTcomparison_chi",
243 "fh2Electrons_angle_CUTcomparison_chi; ; #",
271 new TH1I(
"fh2Electrons_angle_CUTcomparison_withRICH",
272 "fh2Electrons_angle_CUTcomparison_withRICH; ; #",
308 new TH1I(
"fh2Electrons_angle_CUTcomparison_withRICH_chi",
309 "fh2Electrons_angle_CUTcomparison_withRICH_chi; ; #",
337 new TH1I(
"fh2Electrons_angle_CUTcomparison_withRICH_withChi",
338 "fh2Electrons_angle_CUTcomparison_withRICH_withChi; ; #",
376 new TH1D(
"fh2Electrons_angle_all_cuts",
377 "fh2Electrons_angle_all_cuts; opening angle [deg]; #",
382 new TH1D(
"fh2Electrons_angle_combBack_cuts",
383 "fh2Electrons_angle_combBack_cuts; opening angle [deg]; #",
388 new TH1D(
"fh2Electrons_angle_allSameG_cuts",
389 "fh2Electrons_angle_allSameG_cuts; opening angle [deg]; #",
399 new TH1D(
"fh2Electrons_invmass_all",
400 "fh2Electrons_invmass_all; invmass [GeV/c^2]; #",
405 new TH1D(
"fh2Electrons_invmass_combBack",
406 "fh2Electrons_invmass_combBack; invmass [GeV/c^2]; #",
411 new TH1D(
"fh2Electrons_invmass_allSameG",
412 "fh2Electrons_invmass_allSameG; invmass [GeV/c^2]; #",
421 new TH1D(
"fh2Electrons_invmass_all_cut",
422 "fh2Electrons_invmass_all_cut; invmass [GeV/c^2]; #",
427 new TH1D(
"fh2Electrons_invmass_combBack_cut",
428 "fh2Electrons_invmass_combBack_cut; invmass [GeV/c^2]; #",
433 new TH1D(
"fh2Electrons_invmass_allSameG_cut",
434 "fh2Electrons_invmass_allSameG_cut; invmass [GeV/c^2]; #",
445 new TH2D(
"fh2Electrons_angleVSpt_all",
446 "fh2Electrons_angleVSpt_all;pt [GeV/c];opening angle [deg]",
454 new TH2D(
"fh2Electrons_angleVSpt_combBack",
455 "fh2Electrons_angleVSpt_combBack;pt [GeV/c];opening angle [deg]",
463 new TH2D(
"fh2Electrons_angleVSpt_allSameG",
464 "fh2Electrons_angleVSpt_allSameG;pt [GeV/c];opening angle [deg]",
478 new TH2D(
"fh2Electrons_invmassVSpt_all",
479 "fh2Electrons_invmassVSpt_all;pt [GeV/c];invmass [GeV]",
487 new TH2D(
"fh2Electrons_invmassVSpt_combBack",
488 "fh2Electrons_invmassVSpt_combBack;pt [GeV/c];invmass [GeV]",
496 new TH2D(
"fh2Electrons_invmassVSpt_allSameG",
497 "fh2Electrons_invmassVSpt_allSameG;pt [GeV/c];invmass [GeV]",
516 new TH1D(
"fh2Electrons_angle_withRICH_all",
517 "fh2Electrons_angle_withRICH_all; opening angle [deg]; #",
522 new TH1D(
"fh2Electrons_angle_withRICH_combBack",
523 "fh2Electrons_angle_withRICH_combBack; opening angle [deg]; #",
528 new TH1D(
"fh2Electrons_angle_withRICH_allSameG",
529 "fh2Electrons_angle_withRICH_allSameG; opening angle [deg]; #",
539 "fh2Electrons_angleVSpt_withRICH_all",
540 "fh2Electrons_angleVSpt_withRICH_all;pt [GeV/c];opening angle [deg]",
548 "fh2Electrons_angleVSpt_withRICH_combBack",
549 "fh2Electrons_angleVSpt_withRICH_combBack;pt [GeV/c];opening angle [deg]",
557 "fh2Electrons_angleVSpt_withRICH_allSameG",
558 "fh2Electrons_angleVSpt_withRICH_allSameG;pt [GeV/c];opening angle [deg]",
573 new TH1D(
"fh2Electrons_invmass_withRICH_all",
574 "fh2Electrons_invmass_withRICH_all; invmass [GeV/c^2]; #",
579 new TH1D(
"fh2Electrons_invmass_withRICH_combBack",
580 "fh2Electrons_invmass_withRICH_combBack; invmass [GeV/c^2]; #",
585 new TH1D(
"fh2Electrons_invmass_withRICH_allSameG",
586 "fh2Electrons_invmass_withRICH_allSameG; invmass [GeV/c^2]; #",
596 new TH2D(
"fh2Electrons_invmassVSpt_withRICH_all",
597 "fh2Electrons_invmassVSpt_withRICH_all;pt [GeV/c];invmass [GeV]",
605 "fh2Electrons_invmassVSpt_withRICH_combBack",
606 "fh2Electrons_invmassVSpt_withRICH_combBack;pt [GeV/c];invmass [GeV]",
614 "fh2Electrons_invmassVSpt_withRICH_allSameG",
615 "fh2Electrons_invmassVSpt_withRICH_allSameG;pt [GeV/c];invmass [GeV]",
630 "fh2Electrons_fullrecoCheck",
"fh2Electrons_fullrecoCheck;; #", 5, 0., 5.);
641 new TH1D(
"fh2Electrons_angle_withRICH_withChi_all",
642 "fh2Electrons_angle_withRICH_withChi_all; opening angle [deg]; #",
647 "fh2Electrons_angle_withRICH_withChi_combBack",
648 "fh2Electrons_angle_withRICH_withChi_combBack; opening angle [deg]; #",
653 "fh2Electrons_angle_withRICH_withChi_allSameG",
654 "fh2Electrons_angle_withRICH_withChi_allSameG; opening angle [deg]; #",
667 new TH2D(
"fh2Electrons_angleVSpt_withRICH_withChi_all",
668 "fh2Electrons_angleVSpt_withRICH_withChi_all;pt [GeV/c];opening "
677 new TH2D(
"fh2Electrons_angleVSpt_withRICH_withChi_combBack",
678 "fh2Electrons_angleVSpt_withRICH_withChi_combBack;pt "
679 "[GeV/c];opening angle [deg]",
687 new TH2D(
"fh2Electrons_angleVSpt_withRICH_withChi_allSameG",
688 "fh2Electrons_angleVSpt_withRICH_withChi_allSameG;pt "
689 "[GeV/c];opening angle [deg]",
705 new TH1D(
"fh2Electrons_invmass_withRICH_withChi_all",
706 "fh2Electrons_invmass_withRICH_withChi_all; invmass [GeV/c^2]; #",
711 "fh2Electrons_invmass_withRICH_withChi_combBack",
712 "fh2Electrons_invmass_withRICH_withChi_combBack; invmass [GeV/c^2]; #",
717 "fh2Electrons_invmass_withRICH_withChi_allSameG",
718 "fh2Electrons_invmass_withRICH_withChi_allSameG; invmass [GeV/c^2]; #",
731 "fh2Electrons_invmassVSpt_withRICH_withChi_all",
732 "fh2Electrons_invmassVSpt_withRICH_withChi_all;pt [GeV/c];invmass [GeV]",
740 new TH2D(
"fh2Electrons_invmassVSpt_withRICH_withChi_combBack",
741 "fh2Electrons_invmassVSpt_withRICH_withChi_combBack;pt "
742 "[GeV/c];invmass [GeV]",
750 new TH2D(
"fh2Electrons_invmassVSpt_withRICH_withChi_allSameG",
751 "fh2Electrons_invmassVSpt_withRICH_withChi_allSameG;pt "
752 "[GeV/c];invmass [GeV]",
774 "fh2Electrons_angle_withRICH_fromTarget_all",
775 "fh2Electrons_angle_withRICH_fromTarget_all; opening angle [deg]; #",
780 "fh2Electrons_angle_withRICH_fromTarget_combBack",
781 "fh2Electrons_angle_withRICH_fromTarget_combBack; opening angle [deg]; #",
786 "fh2Electrons_angle_withRICH_fromTarget_allSameG",
787 "fh2Electrons_angle_withRICH_fromTarget_allSameG; opening angle [deg]; #",
800 new TH2D(
"fh2Electrons_angleVSpt_withRICH_fromTarget_all",
801 "fh2Electrons_angleVSpt_withRICH_fromTarget_all;pt "
802 "[GeV/c];opening angle [deg]",
810 new TH2D(
"fh2Electrons_angleVSpt_withRICH_fromTarget_combBack",
811 "fh2Electrons_angleVSpt_withRICH_fromTarget_combBack;pt "
812 "[GeV/c];opening angle [deg]",
820 new TH2D(
"fh2Electrons_angleVSpt_withRICH_fromTarget_allSameG",
821 "fh2Electrons_angleVSpt_withRICH_fromTarget_allSameG;pt "
822 "[GeV/c];opening angle [deg]",
838 "fh2Electrons_invmass_withRICH_fromTarget_all",
839 "fh2Electrons_invmass_withRICH_fromTarget_all; invmass [GeV/c^2]; #",
844 "fh2Electrons_invmass_withRICH_fromTarget_combBack",
845 "fh2Electrons_invmass_withRICH_fromTarget_combBack; invmass [GeV/c^2]; #",
850 "fh2Electrons_invmass_withRICH_fromTarget_allSameG",
851 "fh2Electrons_invmass_withRICH_fromTarget_allSameG; invmass [GeV/c^2]; #",
864 "fh2Electrons_invmassVSpt_withRICH_fromTarget_all",
865 "fh2Electrons_invmassVSpt_withRICH_fromTarget_all;pt [GeV/c];invmass [GeV]",
873 new TH2D(
"fh2Electrons_invmassVSpt_withRICH_fromTarget_combBack",
874 "fh2Electrons_invmassVSpt_withRICH_fromTarget_combBack;pt "
875 "[GeV/c];invmass [GeV]",
883 new TH2D(
"fh2Electrons_invmassVSpt_withRICH_fromTarget_allSameG",
884 "fh2Electrons_invmassVSpt_withRICH_fromTarget_allSameG;pt "
885 "[GeV/c];invmass [GeV]",
903 gDirectory->mkdir(
"Photons2");
904 gDirectory->cd(
"Photons2");
906 gDirectory->mkdir(
"With RICH");
907 gDirectory->cd(
"With RICH");
912 gDirectory->cd(
"..");
914 gDirectory->mkdir(
"With RICH, with Chi");
915 gDirectory->cd(
"With RICH, with Chi");
920 gDirectory->cd(
"..");
922 gDirectory->mkdir(
"With RICH, from target");
923 gDirectory->cd(
"With RICH, from target");
928 gDirectory->cd(
"..");
933 gDirectory->cd(
"..");
941 Fatal(
"CbmAnaConversionPhotons2::Exec",
"No PrimaryVertex array!");
962 for (
int iG = 0; iG < nofGlobalTracks; iG++) {
964 if (NULL == gTrack)
continue;
967 if (stsInd < 0)
continue;
970 if (stsTrack == NULL)
continue;
974 if (stsMatch == NULL)
continue;
977 if (stsMcTrackId < 0)
continue;
979 if (mcTrack1 == NULL)
continue;
986 TVector3 refittedMomentum;
988 vector<CbmStsTrack> stsTracks;
990 stsTracks[0] = *stsTrack;
991 vector<L1FieldRegion> vField;
992 vector<float> chiPrim;
996 const FairTrackParam* vtxTrack = stsTracks[0].GetParamFirst();
997 vtxTrack->Momentum(refittedMomentum);
998 float result_chi = chiPrim[0];
1003 vector<CbmStsTrack> stsTracks_electron;
1004 stsTracks_electron.resize(1);
1005 stsTracks_electron[0] = *stsTrack;
1006 vector<L1FieldRegion> vField_electron;
1007 vector<float> chiPrim_electron;
1008 vector<int> pidHypo_electron;
1009 pidHypo_electron.push_back(11);
1010 fPFFitter_electron.
Fit(stsTracks_electron, pidHypo_electron);
1012 stsTracks_electron, vField_electron, chiPrim_electron,
fKFVertex, 3e6);
1014 TVector3 refittedMomentum_electron;
1015 const FairTrackParam* vtxTrack_electron =
1016 stsTracks_electron[0].GetParamFirst();
1017 vtxTrack_electron->Momentum(refittedMomentum_electron);
1018 float result_chi_electron = chiPrim_electron[0];
1020 refittedMomentum = refittedMomentum_electron;
1021 result_chi = result_chi_electron;
1033 if (richInd < 0)
continue;
1036 if (richMatch == NULL)
continue;
1038 if (richMcTrackId < 0)
continue;
1040 if (mcTrack2 == NULL)
continue;
1060 cout <<
"CbmAnaConversionPhotons: array size in AnalyseElectronsReco(): "
1061 << electronnumber << endl;
1062 for (
int i = 0;
i < electronnumber - 1;
i++) {
1063 for (
int j =
i + 1; j < electronnumber; j++) {
1073 Double_t OpeningAngleCut =
1088 if (paramSet.
fAngle < OpeningAngleCut) {
1095 if (motherID_i != motherID_j) {
1101 if (paramSet.
fAngle < OpeningAngleCut) {
1172 if (paramSet.
fAngle < OpeningAngleCut) {
1234 cout <<
"CbmAnaConversionPhotons: array size in AnalyseElectronsReco(): "
1235 << electronnumber << endl;
1236 for (
int i = 0;
i < electronnumber - 1;
i++) {
1237 for (
int j =
i + 1; j < electronnumber; j++) {
1271 TVector3 startvertex1;
1273 TVector3 startvertex2;
1277 if (startvertex1.Z() < 1 && startvertex2.Z() < 1) {
1290 Bool_t electron_rich1 =
1294 Bool_t electron_rich2 =
1301 if (motherID_i != motherID_j) {
1401 if (startvertex1.Z() < 1 && startvertex2.Z() < 1) {
1413 Bool_t WithinChiCut =
1418 Bool_t WithinAngleCut =
1422 Bool_t WithinMassCut = (paramSet.
fMinv < 0.03);
1423 Bool_t WithElectronId = (electron_rich1 && electron_rich2);
1425 if (WithinChiCut && WithinAngleCut && WithinMassCut && WithElectronId) {
1529 if (startvertex1.Z() < 1 && startvertex2.Z() < 1) {
1539 Bool_t WithinChiCut =
1544 Bool_t WithinAngleCut =
1547 Bool_t WithinMassCut = (paramSet.
fMinv < 0.03);
1548 Bool_t WithElectronId = (electron_rich1 && electron_rich2);
1550 if (WithinChiCut && WithinAngleCut && WithinMassCut && WithElectronId) {
1565 if (nof < 2)
return;
1567 for (
int i = 0;
i < nof - 1;
i++) {
1568 for (
int j =
i + 1; j < nof; j++) {
1588 Int_t grandmotherID_11 = mothertrack_11->
GetMotherId();
1589 Int_t grandmotherID_12 = mothertrack_12->
GetMotherId();
1590 Int_t grandmotherID_21 = mothertrack_21->
GetMotherId();
1591 Int_t grandmotherID_22 = mothertrack_22->
GetMotherId();
1593 if (grandmotherID_11 == grandmotherID_12
1594 && grandmotherID_11 == grandmotherID_21
1595 && grandmotherID_11 == grandmotherID_22) {