From 03f7c8abba5f18abba16412d37f0575c63d4ba40 Mon Sep 17 00:00:00 2001 From: Laura Gansbartl Date: Tue, 19 May 2026 16:32:21 +0200 Subject: [PATCH 1/3] include of check for gamma gamma contamination in Dalitz decays --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 2464ec82ec2..87ae707abd3 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -92,6 +92,7 @@ struct Pi0EtaToGammaGammaMC { o2::framework::Configurable cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"}; o2::framework::Configurable cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut (A * tanh(B*pT))"}; o2::framework::Configurable cfgAlphaMesonB{"cfgAlphaMesonB", 1.2, "photon energy asymmetry distribution parameter B for pT dependent cut (A * tanh(B*pT))"}; + o2::framework::Configurable cfgGGContaCheck{"cfgGGContaCheck", false, "check gamma gamma contamination of dalitz"}; EMPhotonEventCut fEMEventCut; struct : o2::framework::ConfigurableGroup { @@ -250,8 +251,14 @@ struct Pi0EtaToGammaGammaMC { DefinePHOSCut(); f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); - + fRegistry.add("Event/hNrecPerMCCollision", "Nrec per mc collision;N_{rec} collisions per MC collision", o2::framework::HistType::kTH1F, {{21, -0.5f, 20.5f}}, false); + if(cfgGGContaCheck){ + fRegistry.add("Event/hNGGContamEta", "Number of Eta from etaToGammaGamma; p_{T, #eta} (GeV/#it{c}); N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); + fRegistry.add("Event/hNGGContamPion", "Number of Pion from etaToGammaGamma; p_{T, #pi} (GeV/#it{c}); N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); + } + fRegistry.add("Event/hNDalitzEtaPt", "Number of DalitzEta; p_{T, #eta} (GeV/#it{c}); N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); + fRegistry.add("Event/hNDalitzPionPt", "Number of DalitzPion; p_{T, #pi} (GeV/#it{c}) ; N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); mRunNumber = 0; d_bz = 0; @@ -792,6 +799,25 @@ struct Pi0EtaToGammaGammaMC { auto pos2mc = mcparticles.iteratorAt(pos2.emmcparticleId()); auto ele2mc = mcparticles.iteratorAt(ele2.emmcparticleId()); + if(cfgGGContaCheck){ + photonid2 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos2mc, ele2mc, -11, 11, 22, mcparticles); //check possible contamination + if(photonid2 > 0){ + auto photon2 = mcparticles.iteratorAt(photonid2); + int photon2pdg = photon2.pdgCode(); + int photon2mothid = photon2.mothersIds()[0]; + auto photon2moth = mcparticles.iteratorAt(photon2mothid); + if(photon2pdg == 22 && (o2::aod::pwgem::photonmeson::utils::mcutil::isGammaGammaDecay(photon2moth, mcparticles))){ + int mothID = o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(photon2, mcparticles); + if(mothID == 221) { + fRegistry.fill(HIST("Event/hNGGContamEta"), photon2moth.pt()); + } + if(mothID == 111) { + fRegistry.fill(HIST("Event/hNGGContamPion"), photon2moth.pt()); + } + } + } + } + pi0id = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); etaid = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 221, mcparticles); if (pi0id < 0 && etaid < 0) { @@ -805,12 +831,14 @@ struct Pi0EtaToGammaGammaMC { } if (pi0id > 0) { auto pi0mc = mcparticles.iteratorAt(pi0id); + fRegistry.fill(HIST("Event/hNDalitzPionPt"), pi0mc.pt()); if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) { continue; } o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); } else if (etaid > 0) { auto etamc = mcparticles.iteratorAt(etaid); + fRegistry.fill(HIST("Event/hNDalitzEtaPt"), etamc.pt()); if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) { continue; } From e1f84c423f33b5225a5ca83bfd7cacc5ebcb6a20 Mon Sep 17 00:00:00 2001 From: Laura Gansbartl Date: Wed, 20 May 2026 09:24:33 +0200 Subject: [PATCH 2/3] Fix formatting --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 87ae707abd3..bbc04f00d71 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -251,9 +251,9 @@ struct Pi0EtaToGammaGammaMC { DefinePHOSCut(); f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); - + fRegistry.add("Event/hNrecPerMCCollision", "Nrec per mc collision;N_{rec} collisions per MC collision", o2::framework::HistType::kTH1F, {{21, -0.5f, 20.5f}}, false); - if(cfgGGContaCheck){ + if (cfgGGContaCheck) { fRegistry.add("Event/hNGGContamEta", "Number of Eta from etaToGammaGamma; p_{T, #eta} (GeV/#it{c}); N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); fRegistry.add("Event/hNGGContamPion", "Number of Pion from etaToGammaGamma; p_{T, #pi} (GeV/#it{c}); N", o2::framework::HistType::kTH1F, {{40, -0.5f, 20.5f}}, false); } @@ -799,19 +799,19 @@ struct Pi0EtaToGammaGammaMC { auto pos2mc = mcparticles.iteratorAt(pos2.emmcparticleId()); auto ele2mc = mcparticles.iteratorAt(ele2.emmcparticleId()); - if(cfgGGContaCheck){ - photonid2 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos2mc, ele2mc, -11, 11, 22, mcparticles); //check possible contamination - if(photonid2 > 0){ + if (cfgGGContaCheck) { + photonid2 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos2mc, ele2mc, -11, 11, 22, mcparticles); // check possible contamination + if (photonid2 > 0) { auto photon2 = mcparticles.iteratorAt(photonid2); int photon2pdg = photon2.pdgCode(); int photon2mothid = photon2.mothersIds()[0]; auto photon2moth = mcparticles.iteratorAt(photon2mothid); - if(photon2pdg == 22 && (o2::aod::pwgem::photonmeson::utils::mcutil::isGammaGammaDecay(photon2moth, mcparticles))){ - int mothID = o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(photon2, mcparticles); - if(mothID == 221) { + if (photon2pdg == 22 && (o2::aod::pwgem::photonmeson::utils::mcutil::isGammaGammaDecay(photon2moth, mcparticles))) { + int mothID = o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(photon2, mcparticles); + if (mothID == 221) { fRegistry.fill(HIST("Event/hNGGContamEta"), photon2moth.pt()); - } - if(mothID == 111) { + } + if (mothID == 111) { fRegistry.fill(HIST("Event/hNGGContamPion"), photon2moth.pt()); } } @@ -844,8 +844,8 @@ struct Pi0EtaToGammaGammaMC { } o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); } - } // end of dielectron loop - } // end of pcm loop + } // end of dielectron loop + } // end of pcm loop } else { // PCM-EMC, PCM-PHOS. // TODO: implement proper functionality if we ever want to run this in Pb-Pb auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); @@ -892,8 +892,8 @@ struct Pi0EtaToGammaGammaMC { // o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); // } } // end of pairing loop - } // end of pairing in same event - } // end of collision loop + } // end of pairing in same event + } // end of collision loop } template From f46a0c2833ed553c29dd4dcc64869874f1a1e53f Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 20 May 2026 08:08:04 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index bbc04f00d71..ffdbd41e872 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -844,8 +844,8 @@ struct Pi0EtaToGammaGammaMC { } o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); } - } // end of dielectron loop - } // end of pcm loop + } // end of dielectron loop + } // end of pcm loop } else { // PCM-EMC, PCM-PHOS. // TODO: implement proper functionality if we ever want to run this in Pb-Pb auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); @@ -892,8 +892,8 @@ struct Pi0EtaToGammaGammaMC { // o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); // } } // end of pairing loop - } // end of pairing in same event - } // end of collision loop + } // end of pairing in same event + } // end of collision loop } template