18 #include "FairLogger.h"
19 #include "FairRootManager.h"
20 #include "FairRunSim.h"
27 : FairTask(), fMcTracks(nullptr), fApp(nullptr) {}
33 FairRunSim* sim = FairRunSim::Instance();
34 if (sim) {
fApp = FairMCApplication::Instance(); }
36 FairRootManager* ioman = FairRootManager::Instance();
37 if (
nullptr == ioman) {
38 Fatal(
"CbmKresEta::Init",
"RootManager not instantised!");
41 fMcTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
43 Fatal(
"CbmKresSelectGoodEvents::Init",
"No MCTrack array!");
52 Int_t nofMcTracks =
fMcTracks->GetEntriesFast();
53 for (
int i = 0;
i < nofMcTracks;
i++) {
55 if (mctrack ==
nullptr)
continue;
59 if (mcMotherTrack ==
nullptr)
continue;
66 if (mcGrTrack ==
nullptr)
continue;
71 int EtaConversion = 0;
74 for (
size_t j =
i + 1; j <
Electrons.size(); j++) {
75 for (
size_t k = j + 1; k <
Electrons.size(); k++) {
76 for (
size_t l = k + 1; l <
Electrons.size(); l++) {
83 if (pdg1 + pdg2 + pdg3 + pdg4 != 0)
continue;
84 if (TMath::Abs(pdg1) != 11 || TMath::Abs(pdg2) != 11
85 || TMath::Abs(pdg3) != 11 || TMath::Abs(pdg4) != 11)
88 int motherId1 =
Electrons.at(
i)->GetMotherId();
89 int motherId2 =
Electrons.at(j)->GetMotherId();
90 int motherId3 =
Electrons.at(k)->GetMotherId();
91 int motherId4 =
Electrons.at(l)->GetMotherId();
93 if (motherId1 == -1 || motherId2 == -1 || motherId3 == -1
107 if (mcMotherPdg1 != 22 || mcMotherPdg2 != 22 || mcMotherPdg3 != 22
108 || mcMotherPdg4 != 22)
116 if (grandmotherId1 == -1)
continue;
119 if (grandmotherId1 == grandmotherId2
120 && grandmotherId1 == grandmotherId3
121 && grandmotherId1 == grandmotherId4
124 cout <<
"Decay eta -> gamma gamma -> e+e- e+e- detected!\t\t mc "
127 cout <<
"motherids: " << motherId1 <<
"/" << motherId2 <<
"/"
128 << motherId3 <<
"/" << motherId4 << endl;
129 cout <<
"grandmotherid: " << grandmotherId1 <<
"/"
130 << grandmotherId2 <<
"/" << grandmotherId3 <<
"/"
131 << grandmotherId4 << endl;
139 cout <<
"CbmKresSelectGoodEvents, EtaConversion = " << EtaConversion << endl;