From 770a7fd39ecedf4c3f3cb187a5b0c599bd83e2e2 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 23 Mar 2026 10:03:18 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../electronSelectionWithTpcEmcal.cxx | 262 +++++++++--------- 1 file changed, 128 insertions(+), 134 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 797e4fdd5b6..b7ecc107c36 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -205,7 +205,6 @@ struct HfElectronSelectionWithTpcEmcal { registry.add("hphiElectron", "hphiElectron", {HistType::kTH1D, {axisPhi}}); registry.add("hphiElectronPassEmcal", "hphiElectron pass Emcal", {HistType::kTH1D, {axisPhi}}); - registry.add("hMcgenAllNonHfeElectron", "Mc Gen All NonHf Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcgenNonHfeElectron", "Mc Gen NonHf Electron with mother", {HistType::kTH1D, {{axisPt}}}); registry.add("hPi0eEmbTrkPt", "Mc Gen Pi0 mother NonHf Electron", {HistType::kTH1D, {{axisPt}}}); @@ -558,7 +557,6 @@ struct HfElectronSelectionWithTpcEmcal { bool isEmbEta = false; bool isEmbPi0 = false; - // Check first mother if (mcParticle.has_mothers()) { auto const& mother = mcParticle.template mothers_first_as(); @@ -602,7 +600,135 @@ struct HfElectronSelectionWithTpcEmcal { } } + // Check first mother + if (mcParticle.has_mothers()) { + auto const& mother = mcParticle.template mothers_first_as(); + + if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { + auto const& gmother = mother.template mothers_first_as(); + // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e + + //================= eta->e ====================================== + if (std::abs(mother.pdgCode()) == kEtaLocal) { + + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; + } + } + + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + if (mother.isPhysicalPrimary()) { + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbPi0 = true; // pi0 -> e + } + if (std::abs(gmother.pdgCode()) == kEtaLocal) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.template mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0-> e + } + } + } + + > + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) + { + + if (std::abs(gmother.pdgCode()) == kEtaLocal) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.template mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->gamma-> e + } + } + if (std::abs(gmother.pdgCode()) == kPi0) { + if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { + auto const& ggmother = gmother.template mothers_first_as(); + if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbPi0 = true; // pi0-> gamma-> e + } + if (gmother.has_mothers()) { + auto const& ggmother = gmother.template mothers_first_as(); + if (std::abs(ggmother.pdgCode()) == kEtaLocal) { + if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) { + auto const& gggmother = ggmother.template mothers_first_as(); + if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0->gamma-> e + } + } + } + } + } + if (!(isEmbPi0 && isEmbEta)) { + continue; + } + } + } + } + } + } + nonHfe(matchTrack, tracks, true); + + ///////////////// NonHf electron Selection without Emcal //////////////////////// + electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(), + eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal); + } + /// Electron information without Emcal and use TPC and TOF + if (isEMcal) { + continue; + } + if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) { + continue; + } + registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt()); + registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt()); + + if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { + continue; + } + + registry.fill(HIST("hphiElectron"), track.phi()); +======= + + if constexpr (IsMc) { + if (track.has_mcParticle()) { + auto mcParticle = track.template mcParticle_as(); + if (std::abs(mcParticle.pdgCode()) == kElectron) { + + registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); + bool isEmbEta = false; + bool isEmbPi0 = false; + + // Check first mother + if (mcParticle.has_mothers()) { + auto const& mother = mcParticle.template mothers_first_as(); + + registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); + bool isEmbEta = false; + bool isEmbPi0 = false; // Check first mother if (mcParticle.has_mothers()) { @@ -647,7 +773,6 @@ struct HfElectronSelectionWithTpcEmcal { } } -> /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { @@ -691,137 +816,6 @@ struct HfElectronSelectionWithTpcEmcal { } } } - } - } - nonHfe(matchTrack, tracks, true); - - ///////////////// NonHf electron Selection without Emcal //////////////////////// - electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(), - eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal); - } - /// Electron information without Emcal and use TPC and TOF - if (isEMcal) { - continue; - } - if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) { - continue; - } - registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt()); - registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt()); - - if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { - continue; - } - - registry.fill(HIST("hphiElectron"), track.phi()); -======= - - if constexpr (IsMc) { - if (track.has_mcParticle()) { - auto mcParticle = track.template mcParticle_as(); - if (std::abs(mcParticle.pdgCode()) == kElectron) { - - - registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); - bool isEmbEta = false; - bool isEmbPi0 = false; - - // Check first mother - if (mcParticle.has_mothers()) { - auto const& mother = mcParticle.template mothers_first_as(); - - - - registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); - bool isEmbEta = false; - bool isEmbPi0 = false; - - // Check first mother - if (mcParticle.has_mothers()) { - auto const& mother = mcParticle.template mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { - - auto const& gmother = mother.template mothers_first_as(); - // cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e - - //================= eta->e ====================================== - if (std::abs(mother.pdgCode()) == kEtaLocal) { - - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; - } - } - - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - if (mother.isPhysicalPrimary()) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0 -> e - } - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0-> e - } - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->gamma-> e - } - } - if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbPi0 = true; // pi0-> gamma-> e - } - if (gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if (std::abs(ggmother.pdgCode()) == kEtaLocal) { - if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) { - auto const& gggmother = ggmother.template mothers_first_as(); - if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0->gamma-> e - } - } - } - } - } - if (!(isEmbPi0 && isEmbEta)) { - continue; - } - } - } - } } } nonHfe(track, tracks, false);