19 #include "TDirectory.h"
26 #include "FairRootManager.h"
37 , fGlobalTracks(nullptr)
39 , fStsTrackMatches(nullptr)
40 , El_Photon_Eta_refmomentum()
41 , El_Photon_Eta_MCtrack()
43 , El_Photon_Pion_Eta_refmomentum()
44 , El_Photon_Pion_Eta_MCtrack()
45 , El_Photon_Pion_Eta_Id()
46 , Pion_Eta_refmomentum()
49 , All_El_refmomentum()
52 , All_Pion_refmomentum()
61 , ECPGA_leptons_RefMom()
64 , ECPGA_pions_RefMom()
67 , InvMass_eta_gg_mc(nullptr)
68 , InvMass_eta_gg_reffited(nullptr)
69 , InvMassPhoton_eta_gg_mc(nullptr)
70 , InvMassPhoton_eta_gg_reffited(nullptr)
71 , OpeningAnglePhoton_eta_gg_mc(nullptr)
72 , OpeningAnglePhoton_eta_gg_reffited(nullptr)
73 , OpeningAngle_eta_gg_between_gg_mc(nullptr)
74 , OpeningAngle_eta_gg_between_gg_reffited(nullptr)
75 , InvMass_eta_gg_allcombinations_mc(nullptr)
76 , InvMass_eta_gg_allcombinations_reffited(nullptr)
78 , InvMass_eta_gg_reco_aftercuts(nullptr)
79 , rap_vs_pt_eta_gg_reco_aftercuts(nullptr)
80 , rap_vs_pt_NOTeta_gg_reco_aftercuts(nullptr)
81 , fHistoList_eta_ppg()
82 , InvMass_eta_ppg_mc(nullptr)
83 , InvMass_eta_ppg_reffited(nullptr)
84 , InvMassPhoton_eta_ppg_mc(nullptr)
85 , InvMassPhoton_eta_ppg_reffited(nullptr)
86 , OpeningAnglePhoton_eta_ppg_mc(nullptr)
87 , OpeningAnglePhoton_eta_ppg_reffited(nullptr)
88 , InvMass_eta_ppg_allcombinations_mc(nullptr)
89 , InvMass_eta_ppg_allcombinations_reffited(nullptr)
90 , Pion_P_fromEta_reco(nullptr)
91 , Pion_P_elsewhere_reco(nullptr)
92 , Pion_Pt_fromEta_reco(nullptr)
93 , Pion_Pt_elsewhere_reco(nullptr)
94 , OA_betweenPions_fromEta_mc(nullptr)
95 , OA_betweenPions_fromEta_reco(nullptr)
96 , OA_betweenPions_fromEta_reco_wrongcombinations(nullptr)
97 , EMT_eta_ppg(nullptr)
98 , EMT_eta_three_body(nullptr)
99 , InvMass_eta_ppg_reco_aftercuts(nullptr)
100 , rap_vs_pt_eta_ppg_reco_aftercuts(nullptr)
101 , rap_vs_pt_NOTeta_ppg_reco_aftercuts(nullptr)
102 , fHistoList_eta_ppp()
103 , InvMass_eta_ppp_mc(nullptr)
104 , InvMass_eta_ppp_reffited(nullptr)
105 , InvMass_eta_Npion_mc(nullptr)
106 , InvMass_eta_Npion_reffited(nullptr)
107 , InvMass_eta_ppp_allcombinations_mc(nullptr)
108 , InvMass_eta_ppp_allcombinations_reffited(nullptr)
110 , EMT_gg_pair_momenta()
112 , EMT_ppg_ee_pair_momenta()
114 , EMT_ppg_pp_pair_momenta()
115 , EMT_ppg_positive_pion_Event()
116 , EMT_ppg_positive_pion_momenta()
117 , EMT_ppg_negative_pion_Event()
118 , EMT_ppg_negative_pion_momenta() {}
125 FairRootManager* ioman = FairRootManager::Instance();
126 if (
nullptr == ioman) {
127 Fatal(
"CbmKresEtaMCAnalysis::Init",
"RootManager not instantised!");
130 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
132 Fatal(
"CbmKresEtaMCAnalysis::Init",
"No MCTrack array!");
135 fGlobalTracks = (TClonesArray*) ioman->GetObject(
"GlobalTrack");
137 Fatal(
"CbmKresEtaMCAnalysis::Init",
"No GlobalTrack array!");
140 fStsTracks = (TClonesArray*) ioman->GetObject(
"StsTrack");
142 Fatal(
"CbmKresEtaMCAnalysis::Init",
"No StsTrack array!");
147 Fatal(
"CbmKresEtaMCAnalysis::Init",
"No StsTrackMatch array!");
153 double OpeningAngleCut,
154 double GammaInvMassCut) {
158 Int_t nofMcTracks =
fMcTracks->GetEntriesFast();
159 for (
int i = 0;
i < nofMcTracks;
i++) {
161 if (mctrack ==
nullptr)
continue;
202 for (Int_t iTr = 0; iTr < ngTracks; iTr++) {
204 if (
nullptr == gTrack)
continue;
209 if (stsInd < 0)
continue;
211 if (stsTrack ==
nullptr)
continue;
214 if (stsMatch ==
nullptr)
continue;
217 if (McTrackId < 0)
continue;
219 if (mcTrack ==
nullptr)
continue;
222 if (TMath::Abs(pdg) != 11 && TMath::Abs(pdg) != 211)
continue;
227 TVector3 refmomentum =
243 if (TMath::Abs(pdg) == 11) {
248 if (TMath::Abs(pdg) == 211) {
256 if (motherId == -1)
continue;
258 if (mcMotherTrack ==
nullptr)
continue;
260 if (TMath::Abs(pdg) == 11 && mcMotherTrack->
GetPdgCode() == 22) {
264 if (mcGrTrack ==
nullptr)
continue;
282 if (TMath::Abs(pdg) == 211 && mcMotherTrack->
GetPdgCode() == 221) {
333 if (Event % 1000 == 0) {
339 if (Event % 10 == 0) {
359 Double_t openingAngle;
360 TLorentzVector gamma1;
361 TLorentzVector gamma2;
385 Double_t angle = gamma1.Angle(gamma2.Vect());
386 openingAngle = 180. * angle /
TMath::Pi();
395 TVector3 electron4) {
396 double M2El = 2.6112004954086e-7;
397 Double_t energy1 = TMath::Sqrt(electron1.Mag2() + M2El);
398 TLorentzVector lorVec1(electron1, energy1);
400 Double_t energy2 = TMath::Sqrt(electron2.Mag2() + M2El);
401 TLorentzVector lorVec2(electron2, energy2);
403 Double_t energy3 = TMath::Sqrt(electron3.Mag2() + M2El);
404 TLorentzVector lorVec3(electron3, energy3);
406 Double_t energy4 = TMath::Sqrt(electron4.Mag2() + M2El);
407 TLorentzVector lorVec4(electron4, energy4);
409 TLorentzVector lorPhoton1 = lorVec1 + lorVec2;
410 TLorentzVector lorPhoton2 = lorVec3 + lorVec4;
412 Double_t angleBetweenPhotons = lorPhoton1.Angle(lorPhoton2.Vect());
413 Double_t theta = 180. * angleBetweenPhotons /
TMath::Pi();
420 vector<CbmMCTrack*> MC,
425 if (MC.size() < 4)
return;
427 for (
size_t i = 0;
i < MC.size();
i++) {
428 for (
size_t j =
i + 1; j < MC.size(); j++) {
429 for (
size_t k = j + 1; k < MC.size(); k++) {
430 for (
size_t l = k + 1; l < MC.size(); l++) {
432 int pdg1 = MC.at(
i)->GetPdgCode();
433 int pdg2 = MC.at(j)->GetPdgCode();
434 int pdg3 = MC.at(k)->GetPdgCode();
435 int pdg4 = MC.at(l)->GetPdgCode();
437 if (pdg1 + pdg2 + pdg3 + pdg4 != 0)
continue;
438 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11
439 || TMath::Abs(pdg3) != 11 || TMath::Abs(pdg4) != 11)
442 int motherId1 = MC.at(
i)->GetMotherId();
443 int motherId2 = MC.at(j)->GetMotherId();
444 int motherId3 = MC.at(k)->GetMotherId();
445 int motherId4 = MC.at(l)->GetMotherId();
447 int mcId1 = Id.at(
i);
448 int mcId2 = Id.at(j);
449 int mcId3 = Id.at(k);
450 int mcId4 = Id.at(l);
452 if (mcId1 == mcId2 || mcId1 == mcId3 || mcId1 == mcId4
453 || mcId2 == mcId3 || mcId2 == mcId4 || mcId3 == mcId4)
455 if (motherId1 == -1 || motherId2 == -1 || motherId3 == -1
469 if (mcMotherPdg1 != 22 || mcMotherPdg2 != 22 || mcMotherPdg3 != 22
470 || mcMotherPdg4 != 22)
478 if (grandmotherId1 == -1)
continue;
481 if (grandmotherId1 == grandmotherId2
482 && grandmotherId1 == grandmotherId3
483 && grandmotherId1 == grandmotherId4) {
486 int mcGrandmotherPdg1 = GrMother1->
GetPdgCode();
487 if (mcGrandmotherPdg1 != 221)
continue;
490 MC.at(
i), MC.at(j), MC.at(k), MC.at(l));
492 RefMom.at(
i), RefMom.at(j), RefMom.at(k), RefMom.at(l));
494 <<
"Decay eta -> gamma gamma -> e+e- e+e- detected!\t\t mc mass: "
495 << InvMass_true <<
"\t, reco mass: " << InvMass_reco << endl;
496 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/"
497 << motherId3 <<
"/" << motherId4 << endl;
498 cout <<
"grandmotherid: " << grandmotherId1 <<
"/" << grandmotherId2
499 <<
"/" << grandmotherId3 <<
"/" << grandmotherId4 << endl;
500 cout <<
"pdgs: " << mcGrandmotherPdg1 <<
"-->" << mcMotherPdg1
501 <<
"/" << mcMotherPdg2 <<
"/" << mcMotherPdg3 <<
"/"
502 << mcMotherPdg4 <<
"-->" << pdg1 <<
"/" << pdg2 <<
"/" << pdg3
503 <<
"/" << pdg4 << endl;
505 gg[0]->Fill(InvMass_true);
506 gg[1]->Fill(InvMass_reco);
508 cout <<
"\t \t mc true info: " << endl;
509 cout <<
"particle 1: \t" << MC.at(
i)->GetPdgCode()
510 <<
";\t pt = " << MC.at(
i)->GetPt()
511 <<
";\t X = " << MC.at(
i)->GetStartX()
512 <<
";\t Y = " << MC.at(
i)->GetStartY()
513 <<
";\t Z = " << MC.at(
i)->GetStartZ()
514 <<
";\t E = " << MC.at(
i)->GetEnergy() << endl;
515 cout <<
"particle 2: \t" << MC.at(j)->GetPdgCode()
516 <<
";\t pt = " << MC.at(j)->GetPt()
517 <<
";\t X = " << MC.at(j)->GetStartX()
518 <<
";\t Y = " << MC.at(j)->GetStartY()
519 <<
";\t Z = " << MC.at(j)->GetStartZ()
520 <<
";\t E = " << MC.at(j)->GetEnergy() << endl;
521 cout <<
"particle 3: \t" << MC.at(k)->GetPdgCode()
522 <<
";\t pt = " << MC.at(k)->GetPt()
523 <<
";\t X = " << MC.at(k)->GetStartX()
524 <<
";\t Y = " << MC.at(k)->GetStartY()
525 <<
";\t Z = " << MC.at(k)->GetStartZ()
526 <<
";\t E = " << MC.at(k)->GetEnergy() << endl;
527 cout <<
"particle 4: \t" << MC.at(l)->GetPdgCode()
528 <<
";\t pt = " << MC.at(l)->GetPt()
529 <<
";\t X = " << MC.at(l)->GetStartX()
530 <<
";\t Y = " << MC.at(l)->GetStartY()
531 <<
";\t Z = " << MC.at(l)->GetStartZ()
532 <<
";\t E = " << MC.at(l)->GetEnergy() << endl;
534 Double_t OpeningAngle1_mc = 0;
535 Double_t OpeningAngle2_mc = 0;
536 Double_t OpeningAngle1_refitted = 0;
537 Double_t OpeningAngle2_refitted = 0;
538 Double_t InvMass_realg1_mc = 0;
539 Double_t InvMass_realg2_mc = 0;
540 Double_t InvMass_realg1_refitted = 0;
541 Double_t InvMass_realg2_refitted = 0;
543 Double_t openingAngleBetweenGammasReco = 0;
545 if (motherId1 == motherId2) {
550 gg[4]->Fill(OpeningAngle1_mc);
551 gg[4]->Fill(OpeningAngle2_mc);
552 OpeningAngle1_refitted =
555 OpeningAngle2_refitted =
558 gg[5]->Fill(OpeningAngle1_refitted);
559 gg[5]->Fill(OpeningAngle2_refitted);
565 gg[2]->Fill(InvMass_realg1_mc);
566 gg[2]->Fill(InvMass_realg2_mc);
567 InvMass_realg1_refitted =
570 InvMass_realg2_refitted =
573 gg[3]->Fill(InvMass_realg1_refitted);
574 gg[3]->Fill(InvMass_realg2_refitted);
575 openingAngleBetweenGammasReco =
577 RefMom.at(
i), RefMom.at(j), RefMom.at(k), RefMom.at(l));
579 if (motherId1 == motherId3) {
584 gg[4]->Fill(OpeningAngle1_mc);
585 gg[4]->Fill(OpeningAngle2_mc);
586 OpeningAngle1_refitted =
589 OpeningAngle2_refitted =
592 gg[5]->Fill(OpeningAngle1_refitted);
593 gg[5]->Fill(OpeningAngle2_refitted);
599 gg[2]->Fill(InvMass_realg1_mc);
600 gg[2]->Fill(InvMass_realg2_mc);
601 InvMass_realg1_refitted =
604 InvMass_realg2_refitted =
607 gg[3]->Fill(InvMass_realg1_refitted);
608 gg[3]->Fill(InvMass_realg2_refitted);
609 openingAngleBetweenGammasReco =
611 RefMom.at(
i), RefMom.at(k), RefMom.at(j), RefMom.at(l));
613 if (motherId1 == motherId4) {
618 gg[4]->Fill(OpeningAngle1_mc);
619 gg[4]->Fill(OpeningAngle2_mc);
620 OpeningAngle1_refitted =
623 OpeningAngle2_refitted =
626 gg[5]->Fill(OpeningAngle1_refitted);
627 gg[5]->Fill(OpeningAngle2_refitted);
633 gg[2]->Fill(InvMass_realg1_mc);
634 gg[2]->Fill(InvMass_realg2_mc);
635 InvMass_realg1_refitted =
638 InvMass_realg2_refitted =
641 gg[3]->Fill(InvMass_realg1_refitted);
642 gg[3]->Fill(InvMass_realg2_refitted);
643 openingAngleBetweenGammasReco =
645 RefMom.at(
i), RefMom.at(l), RefMom.at(j), RefMom.at(k));
647 Double_t openingAngleBetweenGammas =
649 MC.at(
i), MC.at(j), MC.at(k), MC.at(l));
650 gg[6]->Fill(openingAngleBetweenGammas);
651 gg[7]->Fill(openingAngleBetweenGammasReco);
661 vector<TVector3> RefMomPion,
662 vector<CbmMCTrack*> MCPion,
664 vector<TVector3> RefMomEl,
665 vector<CbmMCTrack*> MCEl,
669 if (MCPion.size() < 2 || MCEl.size() < 2)
return;
673 for (
size_t i = 0;
i < MCEl.size();
i++) {
674 for (
size_t j =
i + 1; j < MCEl.size(); j++) {
675 int pdg1 = MCEl.at(
i)->GetPdgCode();
676 int pdg2 = MCEl.at(j)->GetPdgCode();
678 if (pdg1 + pdg2 != 0)
continue;
679 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11)
continue;
681 int motherId1 = MCEl.at(
i)->GetMotherId();
682 int motherId2 = MCEl.at(j)->GetMotherId();
684 if (motherId1 != motherId2)
continue;
685 if (motherId1 == -1 || motherId2 == -1)
continue;
693 if (grandmotherId1 == -1)
continue;
696 int mcGrandmotherPdg1 = GrMother1->
GetPdgCode();
697 if (mcGrandmotherPdg1 != 221)
continue;
700 for (
size_t k = 0; k < MCPion.size(); k++) {
701 for (
size_t l = k + 1; l < MCPion.size(); l++) {
702 int pdg3 = MCPion.at(k)->GetPdgCode();
703 int pdg4 = MCPion.at(l)->GetPdgCode();
705 if (pdg3 + pdg4 != 0)
continue;
706 if (TMath::Abs(pdg3) != 211 || TMath::Abs(pdg4) != 211)
continue;
708 int motherId3 = MCPion.at(k)->GetMotherId();
709 int motherId4 = MCPion.at(l)->GetMotherId();
711 if (motherId3 != motherId4)
continue;
712 if (motherId3 == -1 || motherId4 == -1)
continue;
713 if (motherId3 != grandmotherId1)
continue;
716 MCEl.at(
i), MCEl.at(j), MCPion.at(k), MCPion.at(l));
718 RefMomEl.at(
i), RefMomEl.at(j), RefMomPion.at(k), RefMomPion.at(l));
719 cout <<
"Decay eta -> p+p- gamma -> p+p- e+e- detected!\t\t mc mass: "
720 << InvMass_true <<
"\t, reco mass: " << InvMass_reco << endl;
721 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/"
722 << motherId3 <<
"/" << motherId4 << endl;
723 cout <<
"grandmotherid: " << grandmotherId1 << endl;
724 cout <<
"pdgs: " << mcGrandmotherPdg1 <<
"-->"
725 << mother1->
GetPdgCode() <<
"/" << pdg3 <<
"/" << pdg4 <<
"-->"
726 << pdg1 <<
"/" << pdg2 <<
"/" << pdg3 <<
"/" << pdg4 << endl;
728 ppg[0]->Fill(InvMass_true);
729 ppg[1]->Fill(InvMass_reco);
731 cout <<
"\t \t mc true info: " << endl;
732 cout <<
"particle 1: \t" << MCEl.at(
i)->GetPdgCode()
733 <<
";\t pt = " << MCEl.at(
i)->GetPt()
734 <<
";\t X = " << MCEl.at(
i)->GetStartX()
735 <<
";\t Y = " << MCEl.at(
i)->GetStartY()
736 <<
";\t Z = " << MCEl.at(
i)->GetStartZ()
737 <<
";\t E = " << MCEl.at(
i)->GetEnergy() << endl;
738 cout <<
"particle 2: \t" << MCEl.at(j)->GetPdgCode()
739 <<
";\t pt = " << MCEl.at(j)->GetPt()
740 <<
";\t X = " << MCEl.at(j)->GetStartX()
741 <<
";\t Y = " << MCEl.at(j)->GetStartY()
742 <<
";\t Z = " << MCEl.at(j)->GetStartZ()
743 <<
";\t E = " << MCEl.at(j)->GetEnergy() << endl;
744 cout <<
"particle 3: \t" << MCPion.at(k)->GetPdgCode()
745 <<
";\t pt = " << MCPion.at(k)->GetPt()
746 <<
";\t X = " << MCPion.at(k)->GetStartX()
747 <<
";\t Y = " << MCPion.at(k)->GetStartY()
748 <<
";\t Z = " << MCPion.at(k)->GetStartZ()
749 <<
";\t E = " << MCPion.at(k)->GetEnergy() << endl;
750 cout <<
"particle 4: \t" << MCPion.at(l)->GetPdgCode()
751 <<
";\t pt = " << MCPion.at(l)->GetPt()
752 <<
";\t X = " << MCPion.at(l)->GetStartX()
753 <<
";\t Y = " << MCPion.at(l)->GetStartY()
754 <<
";\t Z = " << MCPion.at(l)->GetStartZ()
755 <<
";\t E = " << MCPion.at(l)->GetEnergy() << endl;
757 double InvMass_g_mc =
760 RefMomEl.at(
i), RefMomEl.at(j));
761 double OpeningAngle_g_mc =
763 double OpeningAngle_g_refitted =
767 ppg[2]->Fill(InvMass_g_mc);
768 ppg[3]->Fill(InvMass_g_reffited);
769 ppg[4]->Fill(OpeningAngle_g_mc);
770 ppg[5]->Fill(OpeningAngle_g_refitted);
779 vector<TVector3> RefMomNeutral,
780 vector<CbmMCTrack*> MCNeutral,
781 vector<Int_t> IdNeutral,
782 vector<TVector3> RefMomPion,
783 vector<CbmMCTrack*> MCPion,
786 if (MCNeutral.size() < 4 || MCPion.size() < 2)
return;
788 int fDecayedParticlePdg = 221;
792 for (
size_t i = 0;
i < MCNeutral.size();
i++) {
793 for (
size_t j =
i + 1; j < MCNeutral.size(); j++) {
794 for (
size_t k = j + 1; k < MCNeutral.size(); k++) {
795 for (
size_t l = k + 1; l < MCNeutral.size(); l++) {
797 int pdg1 = MCNeutral.at(
i)->GetPdgCode();
798 int pdg2 = MCNeutral.at(j)->GetPdgCode();
799 int pdg3 = MCNeutral.at(k)->GetPdgCode();
800 int pdg4 = MCNeutral.at(l)->GetPdgCode();
802 if (pdg1 + pdg2 + pdg3 + pdg4 != 0)
continue;
803 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11
804 || TMath::Abs(pdg3) != 11 || TMath::Abs(pdg4) != 11)
807 int motherId1 = MCNeutral.at(
i)->GetMotherId();
808 int motherId2 = MCNeutral.at(j)->GetMotherId();
809 int motherId3 = MCNeutral.at(k)->GetMotherId();
810 int motherId4 = MCNeutral.at(l)->GetMotherId();
812 int mcId1 = IdNeutral.at(
i);
813 int mcId2 = IdNeutral.at(j);
814 int mcId3 = IdNeutral.at(k);
815 int mcId4 = IdNeutral.at(l);
817 if (mcId1 == mcId2 || mcId1 == mcId3 || mcId1 == mcId4
818 || mcId2 == mcId3 || mcId2 == mcId4 || mcId3 == mcId4)
820 if (motherId1 == -1 || motherId2 == -1 || motherId3 == -1
834 if (mcMotherPdg1 != 22 || mcMotherPdg2 != 22 || mcMotherPdg3 != 22
835 || mcMotherPdg4 != 22)
843 if (grandmotherId1 == -1)
continue;
845 if (grandmotherId1 == grandmotherId2
846 && grandmotherId1 == grandmotherId3
847 && grandmotherId1 == grandmotherId4) {
849 int mcGrandmotherPdg1 = GrMother1->
GetPdgCode();
850 if (mcGrandmotherPdg1 != 111)
continue;
855 if (TopTrack->
GetPdgCode() != fDecayedParticlePdg)
continue;
858 for (
size_t m = 0;
m < MCPion.size();
m++) {
859 for (
size_t s =
m + 1; s < MCPion.size(); s++) {
860 int pdg5 = MCPion.at(
m)->GetPdgCode();
861 int pdg6 = MCPion.at(s)->GetPdgCode();
863 if (pdg5 + pdg6 != 0)
continue;
864 if (TMath::Abs(pdg5) != 211 || TMath::Abs(pdg6) != 211)
867 int motherId5 = MCPion.at(
m)->GetMotherId();
868 int motherId6 = MCPion.at(s)->GetMotherId();
870 if (motherId5 != motherId6)
continue;
871 if (motherId5 == -1 || motherId6 == -1)
continue;
872 if (motherId5 != GrMother1->
GetMotherId())
continue;
874 Double_t InvMass_six_true =
881 Double_t InvMass_six_reco =
888 cout <<
"Decay eta -> p+p- p0 -> p+p- e+e-e+e- detected!\t\t "
891 <<
"\t, reco mass: " << InvMass_six_reco << endl;
892 cout <<
"motherids for neutral: " << motherId1 <<
"/"
893 << motherId2 <<
"/" << motherId3 <<
"/" << motherId4
895 cout <<
"grandmotherid: " << GrMother1->
GetMotherId() <<
"/"
896 << motherId5 <<
"/" << motherId6 << endl;
897 cout <<
"pdgs: " << TopTrack->
GetPdgCode() <<
"-->"
898 << GrMother1->
GetPdgCode() <<
"/" << pdg5 <<
"/" << pdg6
901 ppp[0]->Fill(InvMass_six_true);
902 ppp[1]->Fill(InvMass_six_reco);
904 cout <<
"\t \t mc true info: " << endl;
905 cout <<
"particle 1: \t" << MCNeutral.at(
i)->GetPdgCode()
906 <<
";\t pt = " << MCNeutral.at(
i)->GetPt()
907 <<
";\t X = " << MCNeutral.at(
i)->GetStartX()
908 <<
";\t Y = " << MCNeutral.at(
i)->GetStartY()
909 <<
";\t Z = " << MCNeutral.at(
i)->GetStartZ()
910 <<
";\t E = " << MCNeutral.at(
i)->GetEnergy() << endl;
911 cout <<
"particle 2: \t" << MCNeutral.at(j)->GetPdgCode()
912 <<
";\t pt = " << MCNeutral.at(j)->GetPt()
913 <<
";\t X = " << MCNeutral.at(j)->GetStartX()
914 <<
";\t Y = " << MCNeutral.at(j)->GetStartY()
915 <<
";\t Z = " << MCNeutral.at(j)->GetStartZ()
916 <<
";\t E = " << MCNeutral.at(j)->GetEnergy() << endl;
917 cout <<
"particle 3: \t" << MCNeutral.at(k)->GetPdgCode()
918 <<
";\t pt = " << MCNeutral.at(k)->GetPt()
919 <<
";\t X = " << MCNeutral.at(k)->GetStartX()
920 <<
";\t Y = " << MCNeutral.at(k)->GetStartY()
921 <<
";\t Z = " << MCNeutral.at(k)->GetStartZ()
922 <<
";\t E = " << MCNeutral.at(k)->GetEnergy() << endl;
923 cout <<
"particle 4: \t" << MCNeutral.at(l)->GetPdgCode()
924 <<
";\t pt = " << MCNeutral.at(l)->GetPt()
925 <<
";\t X = " << MCNeutral.at(l)->GetStartX()
926 <<
";\t Y = " << MCNeutral.at(l)->GetStartY()
927 <<
";\t Z = " << MCNeutral.at(l)->GetStartZ()
928 <<
";\t E = " << MCNeutral.at(l)->GetEnergy() << endl;
929 cout <<
"particle 5: \t" << MCPion.at(
m)->GetPdgCode()
930 <<
";\t pt = " << MCPion.at(
m)->GetPt()
931 <<
";\t X = " << MCPion.at(
m)->GetStartX()
932 <<
";\t Y = " << MCPion.at(
m)->GetStartY()
933 <<
";\t Z = " << MCPion.at(
m)->GetStartZ()
934 <<
";\t E = " << MCPion.at(
m)->GetEnergy() << endl;
935 cout <<
"particle 6: \t" << MCPion.at(s)->GetPdgCode()
936 <<
";\t pt = " << MCPion.at(s)->GetPt()
937 <<
";\t X = " << MCPion.at(s)->GetStartX()
938 <<
";\t Y = " << MCPion.at(s)->GetStartY()
939 <<
";\t Z = " << MCPion.at(s)->GetStartZ()
940 <<
";\t E = " << MCPion.at(s)->GetEnergy() << endl;
942 Double_t InvMass_true =
947 Double_t InvMass_reco =
952 RefMomNeutral.at(l));
953 ppp[2]->Fill(InvMass_true);
954 ppp[3]->Fill(InvMass_reco);
966 double OpeningAngleCut,
967 double GammaInvMassCut,
969 vector<TVector3> RefMom,
970 vector<CbmMCTrack*> MC,
973 if (MC.size() < 4)
return;
979 for (
size_t i = 0;
i < MC.size();
i++) {
980 for (
size_t j =
i + 1; j < MC.size(); j++) {
981 int pdg1 = MC.at(
i)->GetPdgCode();
982 int pdg2 = MC.at(j)->GetPdgCode();
983 if (pdg1 + pdg2 != 0)
continue;
984 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11)
continue;
986 double OpeningAngle_g_refitted =
989 double InvMass_g_refitted =
992 if (OpeningAngle_g_refitted > OpeningAngleCut
993 || InvMass_g_refitted > GammaInvMassCut)
1003 fMCId.push_back(Id.at(
i));
1004 fMCId.push_back(Id.at(j));
1016 if (
EDGA_MC.size() < 2)
return;
1017 for (
size_t gamma1 = 0; gamma1 <
EDGA_RefMom.size(); gamma1++) {
1018 for (
size_t gamma2 = gamma1 + 1; gamma2 <
EDGA_RefMom.size(); gamma2++) {
1030 int mcId1 =
EDGA_Id[gamma1][0];
1031 int mcId2 =
EDGA_Id[gamma1][1];
1032 int mcId3 =
EDGA_Id[gamma2][0];
1033 int mcId4 =
EDGA_Id[gamma2][1];
1035 if (mcId1 == mcId2 || mcId1 == mcId3 || mcId1 == mcId4 || mcId2 == mcId3
1036 || mcId2 == mcId4 || mcId3 == mcId4)
1039 double openingAngleBetweenGammasReco =
1041 if (openingAngleBetweenGammasReco < 10
1042 || openingAngleBetweenGammasReco > 40)
1046 mcTrack1, mcTrack2, mcTrack3, mcTrack4);
1047 double InvMass_reco =
1051 e11, e12, e21, e22);
1053 gg[8]->Fill(InvMass_true);
1054 gg[9]->Fill(InvMass_reco);
1079 if (GrandMothTrack1->
GetPdgCode() == 221) CorrectEta = 1;
1083 if (CorrectEta == 1) {
1094 double OpeningAngleCut,
1095 double GammaInvMassCut,
1097 vector<TVector3> RefMomPion,
1098 vector<CbmMCTrack*> MCPion,
1100 vector<TVector3> RefMomEl,
1101 vector<CbmMCTrack*> MCEl,
1105 if (MCPion.size() < 2 || MCEl.size() < 2)
return;
1111 for (
size_t i = 0;
i < MCEl.size();
i++) {
1112 for (
size_t j =
i + 1; j < MCEl.size(); j++) {
1113 int pdg1 = MCEl.at(
i)->GetPdgCode();
1114 int pdg2 = MCEl.at(j)->GetPdgCode();
1115 if (pdg1 + pdg2 != 0)
continue;
1116 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11)
continue;
1118 double OpeningAngle_g_refitted =
1122 RefMomEl.at(
i), RefMomEl.at(j));
1124 if (OpeningAngle_g_refitted > OpeningAngleCut
1125 || InvMass_g_refitted > GammaInvMassCut)
1135 fMCId.push_back(IdEl.at(
i));
1136 fMCId.push_back(IdEl.at(j));
1150 for (
size_t k = 0; k < MCPion.size(); k++) {
1151 if (MCPion.at(k)->GetPdgCode() == 211) {
1158 for (
size_t l = k + 1; l < MCPion.size(); l++) {
1159 int pdg3 = MCPion.at(k)->GetPdgCode();
1160 int pdg4 = MCPion.at(l)->GetPdgCode();
1161 if (pdg3 + pdg4 != 0)
continue;
1162 if (TMath::Abs(pdg3) != 211 || TMath::Abs(pdg4) != 211)
continue;
1164 double Pions_angle_true =
1167 double Pions_angle_reco =
1169 RefMomPion.at(k), RefMomPion.at(l));
1171 if (Pions_angle_reco > 20)
continue;
1204 int correctPionspair = 0;
1209 if (EtaTrack->
GetPdgCode() == 221) correctPionspair = 1;
1212 if (correctPionspair == 1) {
1243 mcTrack1, mcTrack2, mcTrack3, mcTrack4);
1244 Double_t InvMass_reco =
1248 e11, e12, e21, e22);
1250 ppg[6]->Fill(InvMass_true);
1251 ppg[7]->Fill(InvMass_reco);
1263 if (EtaTrack->
GetPdgCode() == 221) CorrectEta = 1;
1267 if (CorrectEta == 1) {
1298 if (mcId1 == mcId2 || mcId1 == mcId3 || mcId1 == mcId4 || mcId2 == mcId3
1299 || mcId2 == mcId4 || mcId3 == mcId4)
1304 mcTrack1, mcTrack2, mcTrack3, mcTrack4);
1305 Double_t InvMass_pi_reco =
1308 if (InvMass_pi_reco < 0.12 || InvMass_pi_reco > 0.15)
continue;
1310 for (
size_t k = 0; k < MCPion.size(); k++) {
1311 for (
size_t l = k + 1; l < MCPion.size(); l++) {
1312 int pdg5 = MCPion.at(k)->GetPdgCode();
1313 int pdg6 = MCPion.at(l)->GetPdgCode();
1315 if (pdg5 + pdg6 != 0)
continue;
1316 if (TMath::Abs(pdg5) != 211 || TMath::Abs(pdg6) != 211)
continue;
1319 mcTrack1, mcTrack2, mcTrack3, mcTrack4, MCPion.at(k), MCPion.at(l));
1321 e11, e12, e21, e22, RefMomPion.at(k), RefMomPion.at(l));
1322 double Pions_angle_reco =
1324 RefMomPion.at(k), RefMomPion.at(l));
1326 if (Pions_angle_reco > 20)
continue;
1328 ppp[4]->Fill(InvMass_six_true);
1329 ppp[5]->Fill(InvMass_six_reco);
1339 cout <<
"Mixing for eta->gg channel - nof entries " << nof << endl;
1340 for (Int_t a = 0; a < nof - 1; a++) {
1341 for (Int_t b = a + 1; b < nof; b++) {
1349 double openingAngleBetweenGammasReco =
1351 if (openingAngleBetweenGammasReco < 10
1352 || openingAngleBetweenGammasReco > 40)
1357 e11, e12, e21, e22);
1366 cout <<
"Mixing for eta->(pp)g channel - nof lepton pairs = " << nof_leptons
1367 <<
"; nof pion pairs = " << nof_pions << endl;
1368 for (Int_t a = 0; a < nof_leptons; a++) {
1369 for (Int_t b = 0; b < nof_pions; b++) {
1379 e11, e12, e21, e22);
1390 cout <<
"Mixing 3 bodies for eta-> p p g channel - nof photons = "
1391 << nof_photons <<
"; nof +pions = " << nof_positive
1392 <<
"; nof -pions = " << nof_negative << endl;
1394 for (Int_t p = 0; p < nof_positive; p++) {
1395 for (Int_t
m = 0;
m < nof_negative;
m++) {
1401 double Pions_angle_reco =
1403 if (Pions_angle_reco > 20)
continue;
1405 for (Int_t a = 0; a < nof_photons; a++) {
1414 e11, e12, e21, e22);
1423 gDirectory->mkdir(
"EtaMCAnalysis");
1424 gDirectory->cd(
"EtaMCAnalysis");
1426 gDirectory->mkdir(
"eta_gg");
1427 gDirectory->cd(
"eta_gg");
1431 gDirectory->cd(
"..");
1433 gDirectory->mkdir(
"eta_ppg");
1434 gDirectory->cd(
"eta_ppg");
1438 gDirectory->cd(
"..");
1440 gDirectory->mkdir(
"eta_ppp");
1441 gDirectory->cd(
"eta_ppp");
1445 gDirectory->cd(
"..");
1448 gDirectory->cd(
"..");
1454 new TH1D(
"InvMass_eta_gg_mc",
1455 "InvMass_eta_gg_mc; invariant mass in GeV/c^{2};#",
1461 new TH1D(
"InvMass_eta_gg_reffited",
1462 "InvMass_eta_gg_reffited; invariant mass in GeV/c^{2};#",
1468 new TH1D(
"InvMassPhoton_eta_gg_mc",
1469 "InvMassPhoton_eta_gg_mc; invariant mass in GeV/c^{2};#",
1475 new TH1D(
"InvMassPhoton_eta_gg_reffited",
1476 "InvMassPhoton_eta_gg_reffited; invariant mass in GeV/c^{2};#",
1482 "OpeningAnglePhoton_eta_gg_mc",
1483 "OpeningAnglePhoton_eta_gg_mc (between e+e- from #gamma); angle [deg];#",
1489 new TH1D(
"OpeningAnglePhoton_eta_gg_reffited",
1490 "OpeningAnglePhoton_eta_gg_reffited (between e+e- from #gamma); "
1497 new TH1D(
"OpeningAngle_eta_gg_between_gg_mc",
1498 "OpeningAngle_eta_gg_between_gg_mc (between #gamma#gamma from "
1499 "#eta); angle [deg];#",
1505 new TH1D(
"OpeningAngle_eta_gg_between_gg_reffited",
1506 "OpeningAngle_eta_gg_between_gg_reffited (between #gamma#gamma "
1507 "from #eta); angle [deg];#",
1513 new TH1D(
"InvMass_eta_gg_allcombinations_mc",
1514 "InvMass_eta_gg_allcombinations_mc; invariant mass in GeV/c^{2};#",
1520 "InvMass_eta_gg_allcombinations_reffited",
1521 "InvMass_eta_gg_allcombinations_reffited; invariant mass in GeV/c^{2};#",
1527 "EMT_eta_gg",
"EMT_eta_gg; invariant mass in GeV/c^{2};#", 200, 0.0, 2.0);
1530 new TH1D(
"InvMass_eta_gg_reco_aftercuts",
1531 "InvMass_eta_gg_reco_aftercuts; invariant mass in GeV/c^{2};#",
1537 new TH2D(
"rap_vs_pt_eta_gg_reco_aftercuts",
1538 "rap_vs_pt_eta_gg_reco_aftercuts; rapidity y; p_{t} in GeV/c ",
1547 new TH2D(
"rap_vs_pt_NOTeta_gg_reco_aftercuts",
1548 "rap_vs_pt_NOTeta_gg_reco_aftercuts; rapidity y; p_{t} in GeV/c ",
1560 new TH1D(
"InvMass_eta_ppg_mc",
1561 "InvMass_eta_ppg_mc; invariant mass in GeV/c^{2};#",
1567 new TH1D(
"InvMass_eta_ppg_reffited",
1568 "InvMass_eta_ppg_reffited; invariant mass in GeV/c^{2};#",
1574 new TH1D(
"InvMassPhoton_eta_ppg_mc",
1575 "InvMassPhoton_eta_ppg_mc; invariant mass in GeV/c^{2};#",
1581 new TH1D(
"InvMassPhoton_eta_ppg_reffited",
1582 "InvMassPhoton_eta_ppg_reffited; invariant mass in GeV/c^{2};#",
1588 "OpeningAnglePhoton_eta_ppg_mc",
1589 "OpeningAnglePhoton_eta_ppg_mc (between e+e- from #gamma); angle [deg];#",
1595 new TH1D(
"OpeningAnglePhoton_eta_ppg_reffited",
1596 "OpeningAnglePhoton_eta_ppg_reffited (between e+e- from #gamma); "
1603 "InvMass_eta_ppg_allcombinations_mc",
1604 "InvMass_eta_ppg_allcombinations_mc; invariant mass in GeV/c^{2};#",
1610 "InvMass_eta_ppg_allcombinations_reffited",
1611 "InvMass_eta_ppg_allcombinations_reffited; invariant mass in GeV/c^{2};#",
1617 "Pion_P_fromEta_reco; pions P in GeV/c;#",
1623 "Pion_P_elsewhere_reco; pions P in GeV/c;#",
1629 new TH1D(
"Pion_Pt_fromEta_reco",
1630 "Pion_Pt_fromEta_reco; pions P_{t} in GeV/c;#",
1636 new TH1D(
"Pion_Pt_elsewhere_reco",
1637 "Pion_Pt_elsewhere_reco; pions P_{t} in GeV/c;#",
1643 new TH1D(
"OA_betweenPions_fromEta_mc",
1644 "OA_betweenPions_fromEta_mc (between #p^{+}#p^{-} from #eta); "
1651 new TH1D(
"OA_betweenPions_fromEta_reco",
1652 "OA_betweenPions_fromEta_reco (between #p^{+}#p^{-} from #eta); "
1659 new TH1D(
"OA_betweenPions_fromEta_reco_wrongcombinations",
1660 "OA_betweenPions_fromEta_reco_wrongcombinations (between "
1661 "#p^{+}#p^{-} from #eta); angle [deg];#",
1667 "EMT_eta_ppg",
"EMT_eta_ppg; invariant mass in GeV/c^{2};#", 200, 0.0, 2.0);
1670 new TH1D(
"EMT_eta_three_body",
1671 "EMT_eta_three_body; invariant mass in GeV/c^{2};#",
1677 new TH1D(
"InvMass_eta_ppg_reco_aftercuts",
1678 "InvMass_eta_ppg_reco_aftercuts; invariant mass in GeV/c^{2};#",
1684 new TH2D(
"rap_vs_pt_eta_ppg_reco_aftercuts",
1685 "rap_vs_pt_eta_ppg_reco_aftercuts; rapidity y; p_{t} in GeV/c ",
1694 new TH2D(
"rap_vs_pt_NOTeta_ppg_reco_aftercuts",
1695 "rap_vs_pt_NOTeta_ppg_reco_aftercuts; rapidity y; p_{t} in GeV/c ",
1707 new TH1D(
"InvMass_eta_ppp_mc",
1708 "InvMass_eta_ppp_mc; invariant mass in GeV/c^{2};#",
1714 new TH1D(
"InvMass_eta_ppp_reffited",
1715 "InvMass_eta_ppp_reffited; invariant mass in GeV/c^{2};#",
1721 new TH1D(
"InvMass_eta_Npion_mc",
1722 "InvMass_eta_Npion_mc; invariant mass in GeV/c^{2};#",
1728 new TH1D(
"InvMass_eta_Npion_reffited",
1729 "InvMass_eta_Npion_reffited; invariant mass in GeV/c^{2};#",
1735 "InvMass_eta_ppp_allcombinations_mc",
1736 "InvMass_eta_ppp_allcombinations_mc; invariant mass in GeV/c^{2};#",
1742 "InvMass_eta_ppp_allcombinations_reffited",
1743 "InvMass_eta_ppp_allcombinations_reffited; invariant mass in GeV/c^{2};#",