Skip to content

Commit

Permalink
PWGEM/PhotonMeson: update pi0/eta MC task
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat committed Feb 4, 2024
1 parent 6922315 commit 81cc86e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 23 deletions.
3 changes: 3 additions & 0 deletions PWGEM/PhotonMeson/Core/DalitzEECut.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ class DalitzEECut : public TNamed
void SetMaxDcaXYPtDep(std::function<float(float)> ptDepCut);
void ApplyPrefilter(bool flag);

// Getters
bool IsPhotonConversionSelected() const { return mSelectPC; }

/// @brief Print the track selection
void print() const;

Expand Down
42 changes: 21 additions & 21 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
if (TString(histClass) == "V0Leg") {
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH1F("hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", 400, -20, 20));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", 200, -50.0f, 50.0f, 200, -50.0f, 50.0f));
list->Add(new TH1F("hNclsTPC", "number of TPC clusters", 161, -0.5, 160.5));
list->Add(new TH1F("hNcrTPC", "number of TPC crossed rows", 161, -0.5, 160.5));
Expand Down Expand Up @@ -78,7 +78,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
}
if (TString(histClass) == "V0") {
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hRadius", "V0Radius; radius in Z (cm);radius in XY (cm)", 200, -100, 100, 200, 0.0f, 100.0f));
list->Add(new TH1F("hCosPA", "V0CosPA;cosine pointing angle", 100, 0.9f, 1.0f));
list->Add(new TH2F("hCosPA_Rxy", "cos PA vs. R_{xy};R_{xy} (cm);cosine pointing angle", 200, 0.f, 100.f, 100, 0.9f, 1.0f));
Expand All @@ -96,18 +96,18 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f));

if (TString(subGroup) == "mc") {
list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for denominator of purity
list->Add(new TH2F("hEtaPhi_Photon_Candidate", "#eta vs. #varphi of photon candidate ;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for denominator of purity
list->Add(new TH1F("hPt_Photon_Candidate", "pT of photon candidate;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for denominator of purity
list->Add(new TH2F("hEtaPhi_Photon_Candidate", "#eta vs. #varphi of photon candidate ;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for denominator of purity

list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH2F("hEtaPhi_Photon_Primary", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH2F("hEtaPhi_Photon_Primary", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH2F("hXY_Photon_Primary", "X vs. Y of photon rec.;X (cm);Y (cm)", 400, -100.0f, +100, 400, -100, +100));
list->Add(new TH2F("hXY_Photon_Primary_MC", "X vs. Y of photon gen.;X (cm);Y (cm)", 400, -100.0f, +100, 400, -100, +100));
list->Add(new TH2F("hRZ_Photon_Primary", "R vs. Z of photon rec.;Z (cm);R_{xy} (cm)", 200, -100.0f, +100, 100, 0, 100));
list->Add(new TH2F("hRZ_Photon_Primary_MC", "R vs. Z of photon gen;Z (cm);R_{xy} (cm)", 200, -100.0f, +100, 100, 0, 100));

list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC feed down correction
list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for MC feed down correction
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC feed down correction
list->Add(new TH2F("hEtaPhi_Photon_FromWD", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f)); // for MC feed down correction

list->Add(new TH2F("hRZ_Photon_hs", "R vs. Z of photon from hadronic shower in materials;Z (cm);R_{xy} (cm)", 200, -100.0f, +100, 100, 0, 100));
list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 1000, 0.0f, 10));
Expand Down Expand Up @@ -287,7 +287,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*

list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, maxP));
list->Add(new TH1F("hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", 400, -20, 20));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 40, -2.0f, 2.0f));
list->Add(new TH2F("hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", 200, -1.0f, 1.0f, 200, -1.0f, 1.0f));
list->Add(new TH2F("hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", 200, -10.0f, 10.0f, 200, -10.0f, 10.0f));
list->Add(new TH2F("hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", 1000, 0, maxP, 100, 0., 1000));
Expand Down Expand Up @@ -322,7 +322,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*

if (TString(histClass) == "Cluster") {
list->Add(new TH1F("hPt", "pT;p_{T} (GeV/c)", 1000, 0.0f, 10));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 72, 0, 2 * M_PI, 400, -2.0f, 2.0f));
list->Add(new TH2F("hEtaPhi", "#eta vs. #varphi;#varphi (rad.);#eta", 180, 0, 2 * M_PI, 400, -2.0f, 2.0f));
list->Add(new TH1F("hNgamma", "Number of #gamma candidates per collision", 101, -0.5f, 100.5f));

if (TString(subGroup) == "PHOS") {
Expand All @@ -341,17 +341,17 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
if (TString(histClass) == "singlephoton") {
list->Add(new TH1F("hPt", "pT of photon candidates;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY", "rapidity of photon candidates;y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi", "azimuthal angle of photon candidates;#varphi (rad.)", 72, 0, 2 * M_PI));
list->Add(new TH1F("hPhi", "azimuthal angle of photon candidates;#varphi (rad.)", 180, 0, 2 * M_PI));
if (TString(subGroup) == "mc") {
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH1F("hY_Photon_Primary", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPhi_Photon_Primary", "#varphi;#varphi (rad.);", 72, 0, 2 * M_PI)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for Feed down correction
list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for Feed down correction
list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 72, 0, 2 * M_PI)); // for Feed down correction
list->Add(new TH1F("hPt_Photon_Primary", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for MC efficiency
list->Add(new TH1F("hY_Photon_Primary", "rapidity;y", 40, -2.0f, 2.0f)); // for MC efficiency
list->Add(new TH1F("hPhi_Photon_Primary", "#varphi;#varphi (rad.);", 180, 0, 2 * M_PI)); // for MC efficiency
list->Add(new TH1F("hPt_Photon_FromWD", "pT;p_{T} (GeV/c)", 2000, 0.0f, 20)); // for Feed down correction
list->Add(new TH1F("hY_Photon_FromWD", "rapidity;y", 40, -2.0f, 2.0f)); // for Feed down correction
list->Add(new TH1F("hPhi_Photon_FromWD", "#varphi;#varphi (rad.);", 180, 0, 2 * M_PI)); // for Feed down correction
list->Add(new TH1F("hPt_Photon_hs", "pT of photon from hadronic shower in materials;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY_Photon_hs", "rapidity from hadronic shower in materials;y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_Photon_hs", "#varphi from hadronic shower in materials;#varphi (rad.);", 72, 0, 2 * M_PI));
list->Add(new TH1F("hPhi_Photon_hs", "#varphi from hadronic shower in materials;#varphi (rad.);", 180, 0, 2 * M_PI));
}
}

Expand Down Expand Up @@ -448,10 +448,10 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
if (TString(subGroup) == "Photon") {
list->Add(new TH1F("hPt_Photon", "photon pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY_Photon", "photon y;rapidity y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_Photon", "photon #varphi;#varphi (rad.)", 72, 0, 2 * M_PI));
list->Add(new TH1F("hPhi_Photon", "photon #varphi;#varphi (rad.)", 180, 0, 2 * M_PI));
list->Add(new TH1F("hPt_ConvertedPhoton", "converted photon pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
list->Add(new TH1F("hY_ConvertedPhoton", "converted photon y;rapidity y", 40, -2.0f, 2.0f));
list->Add(new TH1F("hPhi_ConvertedPhoton", "converted photon #varphi;#varphi (rad.)", 72, 0, 2 * M_PI));
list->Add(new TH1F("hPhi_ConvertedPhoton", "converted photon #varphi;#varphi (rad.)", 180, 0, 2 * M_PI));
list->Add(new TH2F("hPhotonRxy", "conversion point in XY MC;V_{x} (cm);V_{y} (cm)", 2000, -100.0f, 100.0f, 2000, -100.0f, 100.0f));
list->Add(new TH2F("hPhotonRZ", "conversion point in RZ MC;V_{z} (cm);R_{xy} (cm)", 2000, -100.0f, 100.0f, 1000, 0.f, 100.0f));
list->Add(new TH2F("hPhotonPhivsRxy", "conversion point of #varphi vs. R_{xy} MC;#varphi (rad.);R_{xy} (cm);N_{e}", 360, 0.0f, 2 * M_PI, 100, 0, 100));
Expand All @@ -462,7 +462,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
for (int i = 0; i < 2; i++) {
list->Add(new TH1F(Form("hPt_%s", parnames[i].data()), Form("%s pT;p_{T} (GeV/c)", parnames[i].data()), 2000, 0.0f, 20));
list->Add(new TH1F(Form("hY_%s", parnames[i].data()), Form("%s y;rapidity y", parnames[i].data()), 40, -2.0f, 2.0f));
list->Add(new TH1F(Form("hPhi_%s", parnames[i].data()), Form("%s #varphi;#varphi (rad.)", parnames[i].data()), 72, 0, 2 * M_PI));
list->Add(new TH1F(Form("hPhi_%s", parnames[i].data()), Form("%s #varphi;#varphi (rad.)", parnames[i].data()), 180, 0, 2 * M_PI));
}
}
if (TString(subGroup) == "dielectron") {
Expand Down
14 changes: 12 additions & 2 deletions PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,19 @@ struct Pi0EtaToGammaGammaMC {
continue;
}
auto g1mc = mcparticles.iteratorAt(photonid1);
pi0id = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles);
etaid = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 221, mcparticles);

if (cut2.IsPhotonConversionSelected()) { // v0photon + photon conversion on ITSib stored in dielectron table. pi0 -> gamma gamma
int photonid2 = FindCommonMotherFrom2Prongs(pos2mc, ele2mc, -11, 11, 22, mcparticles); // photon conversion stored in dielectron table
if (photonid2 < 0) {
continue;
}
auto g2mc = mcparticles.iteratorAt(photonid2);
pi0id = FindCommonMotherFrom2Prongs(g1mc, g2mc, 22, 22, 111, mcparticles);
etaid = FindCommonMotherFrom2Prongs(g1mc, g2mc, 22, 22, 221, mcparticles);
} else { // pi0/eta -> ee gamma, dalitz decay
pi0id = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles);
etaid = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 221, mcparticles);
}
} else if constexpr (pairtype == PairType::kPCMDalitzMuMu) { // check 4 legs
auto pos1 = g1.template posTrack_as<MyMCV0Legs>();
auto ele1 = g1.template negTrack_as<MyMCV0Legs>();
Expand Down

0 comments on commit 81cc86e

Please sign in to comment.