From 657760cdd811238eb35eef3093e5aa9253ba3090 Mon Sep 17 00:00:00 2001 From: "rashi.gupta@cern.ch" Date: Mon, 23 Mar 2026 19:34:52 +0530 Subject: [PATCH 01/15] Add histograms for Non-HFE analysis --- .../electronSelectionWithTpcEmcal.cxx | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 8acebbbe14d..6ed8c26ceb5 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -103,7 +103,7 @@ struct HfElectronSelectionWithTpcEmcal { Configurable etaTrackDCalNegativeMin{"etaTrackDCalNegativeMin", -0.6f, "Eta range for electron tracks"}; Configurable etaTrackDCalPositiveMax{"etaTrackDCalPositiveMax", 0.6f, "Eta range for electron Dcal tracks"}; Configurable etaTrackDCalPositiveMin{"etaTrackDCalPositiveMin", 0.22f, "Eta range for electron tracks"}; - Configurable phiTrackDCalMax{"phiTrackDCalMax", 5.708f, "phi range for electron tracks associated Dcal"}; + Configurable phiTrackDCalMax{"phiTrackDCalMax", 4.5355f, "phi range for electron tracks associated Dcal"}; Configurable phiTrackDCalMin{"phiTrackDCalMin", 4.5355f, "phi range for electron tracks associated Dcal"}; Configurable phiTrackEMCalMax{"phiTrackEMCalMax", 3.3621f, "phi range for electron tracks associated Emcal"}; Configurable phiTrackEMCalMin{"phiTrackEMCalMin", 1.3955f, "phi range for electron tracks associated Emcal"}; @@ -189,14 +189,20 @@ struct HfElectronSelectionWithTpcEmcal { registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); registry.add("hNeventsAfterPassEmcal", "No of events pass the Emcal", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); - registry.add("hLikeMass", "Like mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hLikeSignPt", "Like sign Momentum ", {HistType::kTH1D, {{axisPt}}}); - registry.add("hUnLikeSignPt", "UnLike sign Momentum", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_EMCAL", "Like mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_EMCAL", "unLike mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_EMCAL", "Like sign Momentum Emcal ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_EMCAL", "UnLike sign Momentum Emcal", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_NoEMCAL", "Like mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_NoEMCAL", "unLike mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_NoEMCAL", "Like sign Momentum NoEMCAL ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_NoEMCAL", "UnLike sign Momentum NoEMCAL", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenInElectron", "Mc Gen Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecInElectron", "Mc Rec Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecwithoutEMCalInElectron", "Mc Rec Inclusive Electron without Emcal", {HistType::kTH1D, {{axisPt}}}); - + 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}}}); @@ -352,8 +358,10 @@ struct HfElectronSelectionWithTpcEmcal { massLike = invMassElectron; vecLSMass.push_back(massLike); isLSElectron = true; - if (isEMcal) { - registry.fill(HIST("hLikeMass"), massLike); + if (!isEMcal) { + registry.fill(HIST("hLikeMass_EMCAL"), massLike); + } else { + registry.fill(HIST("hLikeMass_NoEMCAL"), massLike); } } // for unlike charge @@ -361,8 +369,10 @@ struct HfElectronSelectionWithTpcEmcal { massUnLike = invMassElectron; vecULSMass.push_back(massUnLike); isULSElectron = true; - if (isEMcal) { - registry.fill(HIST("hUnLikeMass"), massUnLike); + if (!isEMcal) { + registry.fill(HIST("hUnLikeMass_EMCAL"), massUnLike); + } else { + registry.fill(HIST("hUnLikeMass_NoEMCAL"), massUnLike); } } @@ -371,7 +381,9 @@ struct HfElectronSelectionWithTpcEmcal { massLike = invMassElectron; ++nElPairsLS; if (isEMcal) { - registry.fill(HIST("hLikeSignPt"), electron.pt()); + registry.fill(HIST("hLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hLikeSignPt_NoEMCAL"), electron.pt()); } } // for unlike charge @@ -379,7 +391,9 @@ struct HfElectronSelectionWithTpcEmcal { massUnLike = invMassElectron; ++nElPairsUS; if (isEMcal) { - registry.fill(HIST("hUnLikeSignPt"), electron.pt()); + registry.fill(HIST("hUnLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hUnLikeSignPt_NoEMCAL"), electron.pt()); } } } @@ -445,7 +459,7 @@ struct HfElectronSelectionWithTpcEmcal { } if (fillTrackInfo) { - registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit + // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsP"), track.tpcSignal(), pTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsPt"), track.tpcSignal(), ptTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTracknSigmaVsP"), tpcNsigmaTrack, pTrack, passEMCal); // track etaphi infor after filter bit @@ -530,7 +544,7 @@ struct HfElectronSelectionWithTpcEmcal { if (eop < eopElectronMin || eop > eopElectronMax) { continue; } - + registry.fill(HIST("hphiElectronPassEmcal"), track.phi()); ///////////////// NonHf electron Selection with Emcal //////////////////////// if constexpr (IsMc) { if (matchTrack.has_mcParticle()) { @@ -648,6 +662,7 @@ struct HfElectronSelectionWithTpcEmcal { 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(); From ade7132030138f8e3ccc6ca6e85a561e344204a7 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:37:31 +0530 Subject: [PATCH 02/15] Correct Pass emcal histogram --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 6ed8c26ceb5..e3a571d3bdd 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -103,7 +103,7 @@ struct HfElectronSelectionWithTpcEmcal { Configurable etaTrackDCalNegativeMin{"etaTrackDCalNegativeMin", -0.6f, "Eta range for electron tracks"}; Configurable etaTrackDCalPositiveMax{"etaTrackDCalPositiveMax", 0.6f, "Eta range for electron Dcal tracks"}; Configurable etaTrackDCalPositiveMin{"etaTrackDCalPositiveMin", 0.22f, "Eta range for electron tracks"}; - Configurable phiTrackDCalMax{"phiTrackDCalMax", 4.5355f, "phi range for electron tracks associated Dcal"}; + Configurable phiTrackDCalMax{"phiTrackDCalMax", 5.708f, "phi range for electron tracks associated Dcal"}; Configurable phiTrackDCalMin{"phiTrackDCalMin", 4.5355f, "phi range for electron tracks associated Dcal"}; Configurable phiTrackEMCalMax{"phiTrackEMCalMax", 3.3621f, "phi range for electron tracks associated Emcal"}; Configurable phiTrackEMCalMin{"phiTrackEMCalMin", 1.3955f, "phi range for electron tracks associated Emcal"}; @@ -358,7 +358,7 @@ struct HfElectronSelectionWithTpcEmcal { massLike = invMassElectron; vecLSMass.push_back(massLike); isLSElectron = true; - if (!isEMcal) { + if (isEMcal) { registry.fill(HIST("hLikeMass_EMCAL"), massLike); } else { registry.fill(HIST("hLikeMass_NoEMCAL"), massLike); @@ -369,7 +369,7 @@ struct HfElectronSelectionWithTpcEmcal { massUnLike = invMassElectron; vecULSMass.push_back(massUnLike); isULSElectron = true; - if (!isEMcal) { + if (isEMcal) { registry.fill(HIST("hUnLikeMass_EMCAL"), massUnLike); } else { registry.fill(HIST("hUnLikeMass_NoEMCAL"), massUnLike); From b856609f6c329ba1713221fb8ecbfa8f87db917e Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 18:57:29 +0530 Subject: [PATCH 03/15] Add some variables in electron selection table --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 42 ++++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 2fd0bea9957..005fb2acf8f 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -79,18 +79,27 @@ DECLARE_SOA_TABLE(HfSelEl, "AOD", "HFSELEL", //! Electron Informations // definition of columns and tables for HfcorrElectron Selection namespace hf_corr_sel_electron { -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track -DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track -DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track -DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track -DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track -DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) -DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) -DECLARE_SOA_COLUMN(LSMassEE, lSMassEE, std::vector); //! mass of the Like sign electron pair -DECLARE_SOA_COLUMN(ULSMassEE, uLSMassEE, std::vector); //! mass of UnLike sign electron pair -DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair -DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair -DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! collisioniD of the electron track +DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track +DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! pseudorapidity of the electron track +DECLARE_SOA_COLUMN(PhiTrack, phiTrack, float); //! azimuth of the electron track +DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! transverse momentum of the electron track +DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) +DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) +DECLARE_SOA_COLUMN(TpcNClsCrRowsTrack, tpcNClsCrRowsTrack, float); //! Number of crossed TPC Rows in electron track +DECLARE_SOA_COLUMN(TpcCrRowsRatioTrack, tpcCrRowsRatioTrack, float); //! Ratio crossed rows over findable clusters electron track +DECLARE_SOA_COLUMN(ITSChi2NClTrack, itsChi2NClTrack, float); //! Chi2 / cluster for the ITS electron track +DECLARE_SOA_COLUMN(TPCChi2NClTrack, tpcChi2NClTrack, float); //! Chi2 / cluster for the TPC electron track +DECLARE_SOA_COLUMN(DcaXYTrack, dcaXYTrack, float); //! dca of the electron in xy direction +DECLARE_SOA_COLUMN(DcaZTrack, dcaZTrack, float); //! dca of the electron in z direction + +DECLARE_SOA_COLUMN(M02El, m02El, float); //! M02 of the electron cluster +DECLARE_SOA_COLUMN(EOPEl, eopEl, float); //! energy momentum ratio of the electron +DECLARE_SOA_COLUMN(LSMassEE, lSMassEE, std::vector); //! mass of the Like sign electron pair +DECLARE_SOA_COLUMN(ULSMassEE, uLSMassEE, std::vector); //! mass of UnLike sign electron pair +DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair +DECLARE_SOA_COLUMN(NElPairUS, nElPairUS, int); //! Number of UnLike sign electron pair +DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information } // namespace hf_corr_sel_electron DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations @@ -101,6 +110,14 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations hf_corr_sel_electron::PtTrack, hf_corr_sel_electron::TpcNSigmaElTrack, hf_corr_sel_electron::TofNSigmaElTrack, + hf_corr_sel_electron::TpcNClsCrRowsTrack, + hf_corr_sel_electron::TpcCrRowsRatioTrack, + hf_corr_sel_electron::ITSChi2NClTrack, + hf_corr_sel_electron::TPCChi2NClTrack, + hf_corr_sel_electron::DcaXYTrack, + hf_corr_sel_electron::DcaZTrack, + hf_corr_sel_electron::EOPEl, + hf_corr_sel_electron::M02El, hf_corr_sel_electron::LSMassEE, hf_corr_sel_electron::ULSMassEE, hf_corr_sel_electron::NElPairLS, @@ -129,3 +146,4 @@ DECLARE_SOA_TABLE(HfMcGenSelEl, "AOD", "HFMCGENSELEL", //! Electron Informations } // namespace o2::aod #endif // PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ + From c38be3fb2b5f0c002ac5f5f470468b234f4064b0 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:02:42 +0530 Subject: [PATCH 04/15] Add MC-based efficiency calculation and new variables to electron selection table Introduce MC changes for efficiency estimation and extend electron selection table with additional variables --- .../electronSelectionWithTpcEmcal.cxx | 535 +++++++++++++----- 1 file changed, 394 insertions(+), 141 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index e3a571d3bdd..3a7c5957f55 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -81,13 +81,22 @@ struct HfElectronSelectionWithTpcEmcal { // Event Selection Configurable zPvPosMax{"zPvPosMax", 10., "Maximum z of the primary vertex (cm)"}; Configurable isRun3{"isRun3", true, "Data is from Run3 or Run2"}; - + Configurable sel8Minibias{"sel8Minibias", true, "Sel8 (T0A + T0C) Selection Run3"}; // Track selection Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.5f, "DCA XY cut"}; Configurable dcaZTrackMax{"dcaZTrackMax", 1.0f, "DCA Z cut"}; Configurable etaTrackMax{"etaTrackMax", 0.6f, "Eta range for electron tracks"}; Configurable etaTrackMin{"etaTrackMin", -0.6f, "Eta range for electron tracks"}; Configurable ptTrackMin{"ptTrackMin", 3.0f, "Transverse MOmentum range for electron tracks"}; + Configurable tpccrossCut{"TPCcrosscut", 70, "TPC crossrows cut"}; + Configurable itsChi2{"itsChi2", 36, "ITS chi2 cluster cut"}; + Configurable tpcChi2NCl{"tpcChi2NCl", 4, "TPC chi2 cluster cut"}; + Configurable tpccrOverFindableRatio{"tpccrOverFindableRatio", 0.8f, "TPC chi2 cluster cut"}; + Configurable isDefault{"isDefault", true, "Default cut"}; + Configurable csyTPCcr{"csyTPCcr", true, "tpc crossed rows"}; + Configurable csyTPCcrOverFindableRatio{"csyTPCcrOverFindableRatio", true, "tpc crossed rows over findable cluster"}; + Configurable csyITSchi{"csyITSchi", true, "ITS chi2"}; + Configurable csyTPCchi{"csyTPCchi", true, "TPC chi2"}; // Associated electron selection cut Configurable etaAssoTrackMax{"etaAssoTrackMax", 0.9f, "Eta range for Associatred electron tracks"}; @@ -198,6 +207,15 @@ struct HfElectronSelectionWithTpcEmcal { registry.add("hLikeSignPt_NoEMCAL", "Like sign Momentum NoEMCAL ", {HistType::kTH1D, {{axisPt}}}); registry.add("hUnLikeSignPt_NoEMCAL", "UnLike sign Momentum NoEMCAL", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_McRec_EMCAL", "McRec Like mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_McRec_EMCAL", "McRec unLike mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_McRec_EMCAL", "McRec Like sign Momentum Emcal ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_McRec_EMCAL", "McRec UnLike sign Momentum Emcal", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_McRec_NoEMCAL", "McRec Like mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_McRec_NoEMCAL", "McRec unLike mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_McRec_NoEMCAL", "McRec Like sign Momentum NoEMCAL ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_McRec_NoEMCAL", "McRec UnLike sign Momentum NoEMCAL", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenInElectron", "Mc Gen Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecInElectron", "Mc Rec Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecwithoutEMCalInElectron", "Mc Rec Inclusive Electron without Emcal", {HistType::kTH1D, {{axisPt}}}); @@ -206,8 +224,16 @@ struct HfElectronSelectionWithTpcEmcal { 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}}}); - registry.add("hEtaeEmbTrkPt", "Mc Gen Eta mother NonHf Electron", {HistType::kTH1D, {{axisPt}}}); + + registry.add("hMcgenElectronFromEta", "Mc Gen Electron from Eta", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenElectronFromPi0", "Mc Gen NonHf Electron From Pi0", {HistType::kTH1D, {{axisPt}}}); + + registry.add("hMcgenElectronFromPi0Eta", "Mc Gen NonHf Electron From Pi0 Eta", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenElectronFromEtaGamma", "Mc Gen NonHf Electron From Eta Gamma", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenElectronFromPi0Gamma", "Mc Gen NonHf Electron From Pi0 Gamma", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenElectronFromEtaPi0Gamma", "Mc Gen NonHf Electron From Eta Pi0 Gamma", {HistType::kTH1D, {{axisPt}}}); + registry.add("hEmcClusterM02", "m02", {HistType::kTH1D, {{axisM02}}}); registry.add("hEmcClusterM20", "m20", {HistType::kTH1D, {{axisM20}}}); registry.add("hTrackEtaPhi", "TPC EtaPhi Info; #eta;#varphi;passEMcal;", {HistType::kTH3F, {{axisEta}, {axisPhi}, {axisPassEMcal}}}); @@ -242,7 +268,19 @@ struct HfElectronSelectionWithTpcEmcal { template bool selTracks(T const& track) { - if (!track.isGlobalTrackWoDCA()) { + if (isDefault && !track.isGlobalTrackWoDCA()) { + return false; + } + if (csyTPCcr && track.tpcNClsCrossedRows() < tpccrossCut) { + return false; + } + if (csyTPCcrOverFindableRatio && track.tpcCrossedRowsOverFindableCls() < tpccrOverFindableRatio) { + return false; + } + if (csyITSchi && track.itsChi2NCl() > itsChi2) { + return false; + } + if (csyTPCchi && track.tpcChi2NCl() > tpcChi2NCl) { return false; } if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { @@ -300,14 +338,16 @@ struct HfElectronSelectionWithTpcEmcal { } // nonHfe Identification - template - void nonHfe(ElectronType const& electron, TracksType const& tracks, bool isEMcal) + template + void nonHfe(ElectronType const& electron, TracksType const& tracks, McParticleType const&, float eop, + float m02, bool isEMcal) { int nElPairsLS = 0; int nElPairsUS = 0; float invMassElectron = 0.; float massLike = 0; float massUnLike = 0; + std::vector vecLSMass; std::vector vecULSMass; for (const auto& pTrack : tracks) { @@ -363,17 +403,226 @@ struct HfElectronSelectionWithTpcEmcal { } else { registry.fill(HIST("hLikeMass_NoEMCAL"), massLike); } + + if constexpr (IsMc) { + if (pTrack.has_mcParticle()) { + auto mcAssoParticle = pTrack.template mcParticle_as(); + if (std::abs(mcAssoParticle.pdgCode()) == kElectron) { + bool isEmbEta = false; + bool isEmbPi0 = false; + + // Check first mother + if (mcAssoParticle.has_mothers()) { + auto const& motherAsso = mcAssoParticle.template mothers_first_as(); + + if (std::abs(motherAsso.pdgCode()) == kEtaLocal || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { + + auto const& gmotherAsso = motherAsso.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(motherAsso.pdgCode()) == kEtaLocal) { + + if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(motherAsso.pdgCode()) == kPi0) { + + if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + + if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0-> e + + } else { + isEmbPi0 = true; // pi0 -> e + } + } + + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(motherAsso.pdgCode()) == kGamma) { + + if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->gamma-> e + } + if (std::abs(gmotherAsso.pdgCode()) == kPi0) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + + if (std::abs(ggmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& gggmotherAsso = ggmotherAsso.template mothers_first_as(); + if ((std::abs(gggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0->gamma-> e + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + } + } + } + if (isEmbPi0 || isEmbEta) { + + if (isEMcal) { + registry.fill(HIST("hLikeMass_McRec_EMCAL"), massLike); + } else { + registry.fill(HIST("hLikeMass_McRec_NoEMCAL"), massLike); + } + if (massLike <= invariantMass) { + if (isEMcal) { + registry.fill(HIST("hLikeSignPt_McRec_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hLikeSignPt_McRec_NoEMCAL"), electron.pt()); + } + } + } + } + } + } + } + } } // for unlike charge if (pTrack.sign() != electron.sign()) { massUnLike = invMassElectron; vecULSMass.push_back(massUnLike); isULSElectron = true; + if (isEMcal) { registry.fill(HIST("hUnLikeMass_EMCAL"), massUnLike); } else { registry.fill(HIST("hUnLikeMass_NoEMCAL"), massUnLike); } + + if constexpr (IsMc) { + if (pTrack.has_mcParticle()) { + auto mcAssoParticle = pTrack.template mcParticle_as(); + if (std::abs(mcAssoParticle.pdgCode()) == kElectron) { + bool isEmbEta = false; + bool isEmbPi0 = false; + + // Check first mother + if (mcAssoParticle.has_mothers()) { + auto const& motherAsso = mcAssoParticle.template mothers_first_as(); + + if (std::abs(motherAsso.pdgCode()) == kEtaLocal || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { + + auto const& gmotherAsso = motherAsso.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(motherAsso.pdgCode()) == kEtaLocal) { + + if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(motherAsso.pdgCode()) == kPi0) { + + if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + + if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0-> e + + } else { + isEmbPi0 = true; // pi0 -> e + } + } + + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(motherAsso.pdgCode()) == kGamma) { + + if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->gamma-> e + } + if (std::abs(gmotherAsso.pdgCode()) == kPi0) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + + if (std::abs(ggmotherAsso.pdgCode()) == kEtaLocal) { + + auto const& gggmotherAsso = ggmotherAsso.template mothers_first_as(); + if ((std::abs(gggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { + continue; + } + isEmbEta = true; // eta->pi0->gamma-> e + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + } + } + } + if (isEmbPi0 || isEmbEta) { + + if (isEMcal) { + registry.fill(HIST("hUnLikeMass_McRec_EMCAL"), massUnLike); + } else { + registry.fill(HIST("hUnLikeMass_McRec_NoEMCAL"), massUnLike); + } + if (massUnLike <= invariantMass) { + if (isEMcal) { + registry.fill(HIST("hUnLikeSignPt_McRec_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hUnLikeSignPt_McRec_NoEMCAL"), electron.pt()); + } + } + } + } + } + } + } + } } // for like charge @@ -397,15 +646,15 @@ struct HfElectronSelectionWithTpcEmcal { } } } + // Pass multiplicities and other required parameters for this electron - // Pass multiplicities and other required parameters for this electron - hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal); + hfElectronSelection(electron.collisionId(), electron.globalIndex(), electron.eta(), electron.phi(), electron.pt(), electron.tpcNSigmaEl(), electron.tofNSigmaEl(), electron.tpcNClsCrossedRows(), electron.tpcCrossedRowsOverFindableCls(), electron.itsChi2NCl(), electron.tpcChi2NCl(), electron.dcaXY(), electron.dcaZ(), m02, eop, vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal); } // Electron Identification template - void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const&) + void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& mcparticles) { - if (!(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { + if (sel8Minibias && !(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { return; } @@ -545,12 +794,13 @@ struct HfElectronSelectionWithTpcEmcal { continue; } registry.fill(HIST("hphiElectronPassEmcal"), track.phi()); + + nonHfe(matchTrack, tracks, mcparticles, eop, m02MatchEmcCluster, true); ///////////////// NonHf electron Selection with Emcal //////////////////////// if constexpr (IsMc) { if (matchTrack.has_mcParticle()) { auto mcParticle = matchTrack.template mcParticle_as(); if (std::abs(mcParticle.pdgCode()) == kElectron) { - registry.fill(HIST("hMcRecInElectron"), mcParticle.pt()); bool isEmbEta = false; bool isEmbPi0 = false; @@ -567,34 +817,33 @@ struct HfElectronSelectionWithTpcEmcal { //================= 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; + 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()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; } + 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 + + 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 + + } else { + isEmbPi0 = true; // pi0 -> e } } @@ -602,48 +851,45 @@ struct HfElectronSelectionWithTpcEmcal { 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 + + 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)) { + + 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; + } + + if (std::abs(ggmother.pdgCode()) == kEtaLocal) { + + 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 + + } else { 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)) { + if (!(isEmbPi0 || isEmbEta)) { continue; } + nonHfe(matchTrack, tracks, mcparticles, eop, m02MatchEmcCluster, true); } } } } } - 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(), @@ -667,7 +913,6 @@ struct HfElectronSelectionWithTpcEmcal { 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; @@ -684,34 +929,33 @@ struct HfElectronSelectionWithTpcEmcal { //================= 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; + 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()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; } + 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 + + 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 + + } else { + isEmbPi0 = true; // pi0 -> e } } @@ -719,48 +963,47 @@ struct HfElectronSelectionWithTpcEmcal { 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 + + 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)) { + + 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; + } + + if (std::abs(ggmother.pdgCode()) == kEtaLocal) { + + 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 + + } else { 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)) { + if (!(isEmbPi0 || isEmbEta)) { continue; } + + nonHfe(track, tracks, mcparticles, eop, m02MatchEmcCluster, false); } } } } } - nonHfe(track, tracks, false); + nonHfe(track, tracks, mcparticles, eop, m02MatchEmcCluster, false); ///////////////// 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); @@ -815,34 +1058,36 @@ struct HfElectronSelectionWithTpcEmcal { //================= 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; + if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; } + isEmbEta = true; + registry.fill(HIST("hMcgenElectronFromEta"), particleMc.pt()); } //================= 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()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || + (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { + continue; } + if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.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 + auto const& ggmother = gmother.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 + registry.fill(HIST("hMcgenElectronFromPi0Eta"), particleMc.pt()); + + } else { + isEmbPi0 = true; // pi0 -> e + registry.fill(HIST("hMcgenElectronFromPi0"), particleMc.pt()); } } @@ -850,35 +1095,42 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kGamma) { if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.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 + + auto const& ggmother = gmother.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 + + registry.fill(HIST("hMcgenElectronFromEtaGamma"), particleMc.pt()); } if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.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 + + auto const& ggmother = gmother.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; } + if (gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); if (std::abs(ggmother.pdgCode()) == kEtaLocal) { - if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) { - auto const& gggmother = ggmother.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 + + auto const& gggmother = ggmother.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 + + registry.fill(HIST("hMcgenElectronFromEtaPi0Gamma"), particleMc.pt()); + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + + registry.fill(HIST("hMcgenElectronFromPi0Gamma"), particleMc.pt()); } } } @@ -896,6 +1148,7 @@ struct HfElectronSelectionWithTpcEmcal { } } } + hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); } } From 844c912f896e3577154a8b2f772281cf79e79718 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:08:56 +0530 Subject: [PATCH 05/15] =?UTF-8?q?Adding=20variables=20to=20the=20electron?= =?UTF-8?q?=E2=80=93hadron=20correlation=20table.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGHF/HFC/DataModel/CorrelationTables.h | 51 +++++++++++++++++++++---- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index c39a16ea784..956893d7b7d 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -519,21 +519,58 @@ DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties aod::hf_electron::GIndexCol, aod::hf_electron::TimeStamp); + +// Note: definition of columns and tables for Electron Hadron correlation pairs for Data namespace hf_correlation_electron_hadron { -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Electron and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons -DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron; -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity -DECLARE_SOA_COLUMN(NPairsLS, nPairsLS, int); //! number of like-sign electron-hadron pairs -DECLARE_SOA_COLUMN(NPairsUS, nPairsUS, int); //! number of unlike-sign electron-hadron pairs +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Electron and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons +DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron; +DECLARE_SOA_COLUMN(EoPElectron, eopElectron, float); //! enery momentum ratio for Electron +DECLARE_SOA_COLUMN(M02Electron, m02Electron, float); //! M02 of Electron +DECLARE_SOA_COLUMN(TPCnSigmaEle, tpcnSigmaEle, float); //! TPCn Sigma of Electron +DECLARE_SOA_COLUMN(TOFnSigmaEle, tofnSigmaEle, float); //! TOFn Sigma of Electron + +DECLARE_SOA_COLUMN(TPCNClsCrRowsEle, tpcNClsCrossedRowsEle, float); //! tpcNClsCrossedRows for Electron +DECLARE_SOA_COLUMN(TPCCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track +DECLARE_SOA_COLUMN(ITSChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron +DECLARE_SOA_COLUMN(TPCChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; +DECLARE_SOA_COLUMN(DCAXYEle, dcaXYEle, float); //! DCAXY for Electron +DECLARE_SOA_COLUMN(DCAZEle, dcaZEle, float); //! M02 of Electron + +DECLARE_SOA_COLUMN(TPCNClsCrRowsHad, tpcNClsCrossedRowsHad, float); //! tpcNClsCrossedRows for Hadron +DECLARE_SOA_COLUMN(TPCCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track +DECLARE_SOA_COLUMN(ITSChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron +DECLARE_SOA_COLUMN(TPCChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; +DECLARE_SOA_COLUMN(DCAXYHad, dcaXYHad, float); //! DCAXY for Hadron +DECLARE_SOA_COLUMN(DCAZHad, dcaZHad, float); //! M02 of Hadron + +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity +DECLARE_SOA_COLUMN(NPairsLS, nPairsLS, int); //! number of like-sign electron-hadron pairs +DECLARE_SOA_COLUMN(NPairsUS, nPairsUS, int); //! number of unlike-sign electron-hadron pairs } // namespace hf_correlation_electron_hadron DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs Informations hf_correlation_electron_hadron::DeltaPhi, hf_correlation_electron_hadron::DeltaEta, hf_correlation_electron_hadron::PtElectron, hf_correlation_electron_hadron::PtHadron, + hf_correlation_electron_hadron::EoPElectron, + hf_correlation_electron_hadron::M02Electron, + hf_correlation_electron_hadron::TPCnSigmaEle, + hf_correlation_electron_hadron::TOFnSigmaEle, + hf_correlation_electron_hadron::TPCNClsCrRowsEle, + hf_correlation_electron_hadron::TPCCrRowsRatioEle, + hf_correlation_electron_hadron::ITSChi2NClEle, + hf_correlation_electron_hadron::TPCChi2NClEle, + hf_correlation_electron_hadron::DCAXYEle, + hf_correlation_electron_hadron::DCAZEle, + hf_correlation_electron_hadron::TPCNClsCrRowsHad, + hf_correlation_electron_hadron::TPCCrRowsRatioHad, + hf_correlation_electron_hadron::ITSChi2NClHad, + hf_correlation_electron_hadron::TPCChi2NClHad, + hf_correlation_electron_hadron::DCAXYHad, + hf_correlation_electron_hadron::DCAZHad, hf_correlation_electron_hadron::PoolBin, hf_correlation_electron_hadron::NPairsLS, hf_correlation_electron_hadron::NPairsUS); From f4712f203bcd1a68cfe53ebd4d1427bc54885aef Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:10:28 +0530 Subject: [PATCH 06/15] =?UTF-8?q?Adding=20variables=20to=20the=20electron?= =?UTF-8?q?=E2=80=93hadron=20correlation=20table.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TableProducer/correlatorHfeHadrons.cxx | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 093ba4c8666..b195b843b17 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -49,11 +49,7 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::hf_sel_electron; -const std::vector zBins{VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}; -const std::vector multBins{VARIABLE_WIDTH, 0., 200., 500.0, 5000.}; -const std::vector multBinsMcGen{VARIABLE_WIDTH, 0., 20., 50.0, 500.}; // In MCGen multiplicity is defined by counting primaries using BinningType = ColumnBinningPolicy>; -const BinningType corrBinning{{zBins, multBins}, true}; using BinningTypeMcGen = ColumnBinningPolicy; @@ -75,6 +71,16 @@ struct HfCorrelatorHfeHadrons { Configurable etaTrackMin{"etaTrackMin", -0.8f, "Eta range for associated hadron tracks"}; Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.5f, "DCA XY cut"}; Configurable dcaZTrackMax{"dcaZTrackMax", 1.0f, "DCA Z cut"}; + Configurable tpccrossCut{"TPCcrosscut", 70, "TPC crossrows cut"}; + Configurable itsChi2{"itsChi2", 36, "ITS chi2 cluster cut"}; + Configurable tpcChi2NCl{"tpcChi2NCl", 4, "TPC chi2 cluster cut"}; + Configurable tpccrOverFindableRatio{"tpccrOverFindableRatio", 0.8f, "TPC chi2 cluster cut"}; + Configurable isDefault{"isDefault", true, "Default cut"}; + Configurable csyTPCcr{"csyTPCcr", true, "tpc crossed rows"}; + Configurable csyTPCcrOverFindableRatio{"csyTPCcrOverFindableRatio", true, "tpc crossed rows over findable cluster"}; + Configurable csyITSchi{"csyITSchi", true, "ITS chi2"}; + Configurable csyTPCchi{"csyTPCchi", true, "TPC chi2"}; + Configurable requireEmcal{"requireEmcal", true, "Require electron to be in EMCal"}; // Sigma cut for non-EMCal electrons @@ -103,6 +109,10 @@ struct HfCorrelatorHfeHadrons { Preslice perCol = aod::track::collisionId; Preslice perCollision = aod::hf_sel_electron::collisionId; + ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; ConfigurableAxis binsDeltaEta{"binsDeltaEta", {30, -1.8, 1.8}, "#it{#Delta#eta}"}; ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {32, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, "#it{#Delta#varphi}"}; @@ -111,6 +121,7 @@ struct HfCorrelatorHfeHadrons { ConfigurableAxis binsNSigma{"binsNSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; ConfigurableAxis binsMass{"binsMass", {100, 0.0, 2.0}, "Mass (GeV/#it{c}^{2}); entries"}; + BinningType corrBinning{{zPoolBins, multPoolBins}, true}; HistogramRegistry registry{ "registry", {}}; @@ -171,7 +182,19 @@ struct HfCorrelatorHfeHadrons { template bool selAssoHadron(T const& track) { - if (!track.isGlobalTrackWoDCA()) { + if (isDefault && !track.isGlobalTrackWoDCA()) { + return false; + } + if (csyTPCcr && track.tpcNClsCrossedRows() < tpccrossCut) { + return false; + } + if (csyTPCcrOverFindableRatio && track.tpcCrossedRowsOverFindableCls() < tpccrOverFindableRatio) { + return false; + } + if (csyITSchi && track.itsChi2NCl() > itsChi2) { + return false; + } + if (csyTPCchi && track.tpcChi2NCl() > tpcChi2NCl) { return false; } @@ -261,6 +284,7 @@ struct HfCorrelatorHfeHadrons { ptElectron = eTrack.ptTrack(); phiElectron = eTrack.phiTrack(); etaElectron = eTrack.etaTrack(); + bool acceptElectron = false; double deltaPhi = -999; @@ -353,7 +377,7 @@ struct HfCorrelatorHfeHadrons { ++nElHadUSCorr; } } - entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, poolBin, nElHadLSCorr, nElHadUSCorr); + entryElectronHadronPair(deltaPhi, deltaEta, ptElectron, ptHadron, eTrack.eopEl(), eTrack.m02El(), eTrack.tpcNSigmaElTrack(), eTrack.tofNSigmaElTrack(), eTrack.tpcNClsCrRowsTrack(), eTrack.tpcCrRowsRatioTrack(), eTrack.itsChi2NClTrack(), eTrack.tpcChi2NClTrack(), eTrack.dcaXYTrack(), eTrack.dcaZTrack(), hTrack.tpcNClsCrossedRows(), hTrack.tpcCrossedRowsOverFindableCls(), hTrack.itsChi2NCl(), hTrack.tpcChi2NCl(), hTrack.dcaXY(), hTrack.dcaZ(), poolBin, nElHadLSCorr, nElHadUSCorr); } // end Hadron Track loop @@ -416,7 +440,7 @@ struct HfCorrelatorHfeHadrons { ++nElHadUSCorr; } } - entryElectronHadronPair(deltaPhiMix, deltaEtaMix, ptElectronMix, ptHadronMix, poolBin, nElHadLSCorr, nElHadUSCorr); + entryElectronHadronPair(deltaPhiMix, deltaEtaMix, ptElectronMix, ptHadronMix, t1.eopEl(), t1.m02El(), t1.tpcNSigmaElTrack(), t1.tofNSigmaElTrack(), t1.tpcNClsCrRowsTrack(), t1.tpcCrRowsRatioTrack(), t1.itsChi2NClTrack(), t1.tpcChi2NClTrack(), t1.dcaXYTrack(), t1.dcaZTrack(), t2.tpcNClsCrossedRows(), t2.tpcCrossedRowsOverFindableCls(), t2.itsChi2NCl(), t2.tpcChi2NCl(), t2.dcaXY(), t2.dcaZ(), poolBin, nElHadLSCorr, nElHadUSCorr); } } @@ -447,7 +471,7 @@ struct HfCorrelatorHfeHadrons { void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles, aod::HfMcGenSelEl const& electrons) { - BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); for (const auto& particleMc : mcParticles) { @@ -566,7 +590,7 @@ struct HfCorrelatorHfeHadrons { void processMcGenMixedEvent(McGenTableCollisions const& mcCollision, aod::HfMcGenSelEl const& electrons, aod::McParticles const& mcParticles) { - BinningTypeMcGen const corrBinningMcGen{{zBins, multBinsMcGen}, true}; + BinningTypeMcGen const corrBinningMcGen{{zPoolBins, multPoolBinsMcGen}, true}; auto tracksTuple = std::make_tuple(electrons, mcParticles); Pair const pairMcGen{corrBinningMcGen, 5, -1, mcCollision, tracksTuple, &cache}; From 5b431e97eff7e94fc5ae543229c45dd50e9241bc Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:27:58 +0530 Subject: [PATCH 07/15] Remove formate error --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 005fb2acf8f..465a5dfd0fd 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -146,4 +146,3 @@ DECLARE_SOA_TABLE(HfMcGenSelEl, "AOD", "HFMCGENSELEL", //! Electron Informations } // namespace o2::aod #endif // PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ - From dd9880b54c6be0c591c02ac71e137abe9ecaf860 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 12 Apr 2026 19:37:03 +0530 Subject: [PATCH 08/15] remove O2linter error --- PWGHF/HFC/DataModel/CorrelationTables.h | 66 ++++++++++++------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 956893d7b7d..bd284a40e8d 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -518,8 +518,6 @@ DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties aod::hf_electron::PoolBin, aod::hf_electron::GIndexCol, aod::hf_electron::TimeStamp); - - // Note: definition of columns and tables for Electron Hadron correlation pairs for Data namespace hf_correlation_electron_hadron { @@ -527,24 +525,24 @@ DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Elec DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron; -DECLARE_SOA_COLUMN(EoPElectron, eopElectron, float); //! enery momentum ratio for Electron +DECLARE_SOA_COLUMN(EopElectron, eopElectron, float); //! enery momentum ratio for Electron DECLARE_SOA_COLUMN(M02Electron, m02Electron, float); //! M02 of Electron -DECLARE_SOA_COLUMN(TPCnSigmaEle, tpcnSigmaEle, float); //! TPCn Sigma of Electron -DECLARE_SOA_COLUMN(TOFnSigmaEle, tofnSigmaEle, float); //! TOFn Sigma of Electron - -DECLARE_SOA_COLUMN(TPCNClsCrRowsEle, tpcNClsCrossedRowsEle, float); //! tpcNClsCrossedRows for Electron -DECLARE_SOA_COLUMN(TPCCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track -DECLARE_SOA_COLUMN(ITSChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron -DECLARE_SOA_COLUMN(TPCChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; -DECLARE_SOA_COLUMN(DCAXYEle, dcaXYEle, float); //! DCAXY for Electron -DECLARE_SOA_COLUMN(DCAZEle, dcaZEle, float); //! M02 of Electron - -DECLARE_SOA_COLUMN(TPCNClsCrRowsHad, tpcNClsCrossedRowsHad, float); //! tpcNClsCrossedRows for Hadron -DECLARE_SOA_COLUMN(TPCCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track -DECLARE_SOA_COLUMN(ITSChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron -DECLARE_SOA_COLUMN(TPCChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; -DECLARE_SOA_COLUMN(DCAXYHad, dcaXYHad, float); //! DCAXY for Hadron -DECLARE_SOA_COLUMN(DCAZHad, dcaZHad, float); //! M02 of Hadron +DECLARE_SOA_COLUMN(TpcNSigmaEle, tpcNSigmaEle, float); //! TPCn Sigma of Electron +DECLARE_SOA_COLUMN(TofnSigmaEle, tofNSigmaEle, float); //! TOFn Sigma of Electron + +DECLARE_SOA_COLUMN(TpcNClsCrRowsEle, tpcNClsCrossedRowsEle, float); //! tpcNClsCrossedRows for Electron +DECLARE_SOA_COLUMN(TpcCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track +DECLARE_SOA_COLUMN(ItsChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron +DECLARE_SOA_COLUMN(TpcChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; +DECLARE_SOA_COLUMN(DcaXYEle, dcaXYEle, float); //! DCAXY of Electron +DECLARE_SOA_COLUMN(DcaZEle, dcaZEle, float); //! DCAZ of Electron + +DECLARE_SOA_COLUMN(TpcNClsCrRowsHad, tpcNClsCrossedRowsHad, float); //! tpcNClsCrossedRows for Hadron +DECLARE_SOA_COLUMN(TpcCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track +DECLARE_SOA_COLUMN(ItsChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron +DECLARE_SOA_COLUMN(TpcChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; +DECLARE_SOA_COLUMN(DcaXYHad, dcaXYHad, float); //! DCAXY of Hadron +DECLARE_SOA_COLUMN(DcaZHad, dcaZHad, float); //! DCAZ of Hadron DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity DECLARE_SOA_COLUMN(NPairsLS, nPairsLS, int); //! number of like-sign electron-hadron pairs @@ -555,22 +553,22 @@ DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs I hf_correlation_electron_hadron::DeltaEta, hf_correlation_electron_hadron::PtElectron, hf_correlation_electron_hadron::PtHadron, - hf_correlation_electron_hadron::EoPElectron, + hf_correlation_electron_hadron::EopElectron, hf_correlation_electron_hadron::M02Electron, - hf_correlation_electron_hadron::TPCnSigmaEle, - hf_correlation_electron_hadron::TOFnSigmaEle, - hf_correlation_electron_hadron::TPCNClsCrRowsEle, - hf_correlation_electron_hadron::TPCCrRowsRatioEle, - hf_correlation_electron_hadron::ITSChi2NClEle, - hf_correlation_electron_hadron::TPCChi2NClEle, - hf_correlation_electron_hadron::DCAXYEle, - hf_correlation_electron_hadron::DCAZEle, - hf_correlation_electron_hadron::TPCNClsCrRowsHad, - hf_correlation_electron_hadron::TPCCrRowsRatioHad, - hf_correlation_electron_hadron::ITSChi2NClHad, - hf_correlation_electron_hadron::TPCChi2NClHad, - hf_correlation_electron_hadron::DCAXYHad, - hf_correlation_electron_hadron::DCAZHad, + hf_correlation_electron_hadron::TpcnSigmaEle, + hf_correlation_electron_hadron::TofnSigmaEle, + hf_correlation_electron_hadron::TpcNClsCrRowsEle, + hf_correlation_electron_hadron::TpcCrRowsRatioEle, + hf_correlation_electron_hadron::ItsChi2NClEle, + hf_correlation_electron_hadron::TpcChi2NClEle, + hf_correlation_electron_hadron::DcaXYEle, + hf_correlation_electron_hadron::DcaZEle, + hf_correlation_electron_hadron::TpcNClsCrRowsHad, + hf_correlation_electron_hadron::TpcCrRowsRatioHad, + hf_correlation_electron_hadron::ItsChi2NClHad, + hf_correlation_electron_hadron::TpcChi2NClHad, + hf_correlation_electron_hadron::DcaXYHad, + hf_correlation_electron_hadron::DcaZHad, hf_correlation_electron_hadron::PoolBin, hf_correlation_electron_hadron::NPairsLS, hf_correlation_electron_hadron::NPairsUS); From 834c9b5d5742db9ba2c0d407cb7ee07ccfffe473 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:10:31 +0530 Subject: [PATCH 09/15] Remove build error --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 465a5dfd0fd..4906b01d229 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -88,13 +88,13 @@ DECLARE_SOA_COLUMN(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSig DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) DECLARE_SOA_COLUMN(TpcNClsCrRowsTrack, tpcNClsCrRowsTrack, float); //! Number of crossed TPC Rows in electron track DECLARE_SOA_COLUMN(TpcCrRowsRatioTrack, tpcCrRowsRatioTrack, float); //! Ratio crossed rows over findable clusters electron track -DECLARE_SOA_COLUMN(ITSChi2NClTrack, itsChi2NClTrack, float); //! Chi2 / cluster for the ITS electron track -DECLARE_SOA_COLUMN(TPCChi2NClTrack, tpcChi2NClTrack, float); //! Chi2 / cluster for the TPC electron track +DECLARE_SOA_COLUMN(ItsChi2NClTrack, itsChi2NClTrack, float); //! Chi2 / cluster for the ITS electron track +DECLARE_SOA_COLUMN(TpcChi2NClTrack, tpcChi2NClTrack, float); //! Chi2 / cluster for the TPC electron track DECLARE_SOA_COLUMN(DcaXYTrack, dcaXYTrack, float); //! dca of the electron in xy direction DECLARE_SOA_COLUMN(DcaZTrack, dcaZTrack, float); //! dca of the electron in z direction DECLARE_SOA_COLUMN(M02El, m02El, float); //! M02 of the electron cluster -DECLARE_SOA_COLUMN(EOPEl, eopEl, float); //! energy momentum ratio of the electron +DECLARE_SOA_COLUMN(EopEl, eopEl, float); //! energy momentum ratio of the electron DECLARE_SOA_COLUMN(LSMassEE, lSMassEE, std::vector); //! mass of the Like sign electron pair DECLARE_SOA_COLUMN(ULSMassEE, uLSMassEE, std::vector); //! mass of UnLike sign electron pair DECLARE_SOA_COLUMN(NElPairLS, nElPairLS, int); //! Number of Like sign electron pair @@ -112,11 +112,11 @@ DECLARE_SOA_TABLE(HfCorrSelEl, "AOD", "HfCORRSELEL", //! Electron Informations hf_corr_sel_electron::TofNSigmaElTrack, hf_corr_sel_electron::TpcNClsCrRowsTrack, hf_corr_sel_electron::TpcCrRowsRatioTrack, - hf_corr_sel_electron::ITSChi2NClTrack, - hf_corr_sel_electron::TPCChi2NClTrack, + hf_corr_sel_electron::ItsChi2NClTrack, + hf_corr_sel_electron::TpcChi2NClTrack, hf_corr_sel_electron::DcaXYTrack, hf_corr_sel_electron::DcaZTrack, - hf_corr_sel_electron::EOPEl, + hf_corr_sel_electron::EopEl, hf_corr_sel_electron::M02El, hf_corr_sel_electron::LSMassEE, hf_corr_sel_electron::ULSMassEE, From c787157dde5d456e3673f6292f88f0c85e61e2c4 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:11:01 +0530 Subject: [PATCH 10/15] Remove build error --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 3a7c5957f55..66e4ecb58e5 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -88,7 +88,7 @@ struct HfElectronSelectionWithTpcEmcal { Configurable etaTrackMax{"etaTrackMax", 0.6f, "Eta range for electron tracks"}; Configurable etaTrackMin{"etaTrackMin", -0.6f, "Eta range for electron tracks"}; Configurable ptTrackMin{"ptTrackMin", 3.0f, "Transverse MOmentum range for electron tracks"}; - Configurable tpccrossCut{"TPCcrosscut", 70, "TPC crossrows cut"}; + Configurable tpccrossCut{"tpccrossCut", 70, "TPC crossrows cut"}; Configurable itsChi2{"itsChi2", 36, "ITS chi2 cluster cut"}; Configurable tpcChi2NCl{"tpcChi2NCl", 4, "TPC chi2 cluster cut"}; Configurable tpccrOverFindableRatio{"tpccrOverFindableRatio", 0.8f, "TPC chi2 cluster cut"}; From ad748e7db77e52b35811d4b243cb4cb2c38e2d96 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:12:43 +0530 Subject: [PATCH 11/15] Remove build error --- PWGHF/HFC/DataModel/CorrelationTables.h | 34 ++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index bd284a40e8d..ad148549bab 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -509,6 +509,29 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the colli } // namespace hf_electron +DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties + aod::hf_electron::PhiElectron, + aod::hf_electron::EtaElectron, + aod::hf_electron::PtElectron, + aod::hf_electron::NElectronsLS, + aod::hf_electron::NElectronsUS, + aod::hf_electron::PoolBin, + aod::hf_electron::GIndexCol, + aod::hf_electron::TimeStamp); +// Note: definition of columns and tables for Electron Hadron correlation pairs for Data +namespace hf_electron +{ +DECLARE_SOA_COLUMN(PhiElectron, phiElectron, float); //! Phi of electron +DECLARE_SOA_COLUMN(EtaElectron, etaElectron, float); //! Eta of electron +DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of electron +DECLARE_SOA_COLUMN(NElectronsLS, nElectronsLS, int); //! number of like-sign +DECLARE_SOA_COLUMN(NElectronsUS, nElectronsUS, int); //! number of Unlike-sign +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicit +DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision +DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision + +} // namespace hf_electron + DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties aod::hf_electron::PhiElectron, aod::hf_electron::EtaElectron, @@ -528,16 +551,16 @@ DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum o DECLARE_SOA_COLUMN(EopElectron, eopElectron, float); //! enery momentum ratio for Electron DECLARE_SOA_COLUMN(M02Electron, m02Electron, float); //! M02 of Electron DECLARE_SOA_COLUMN(TpcNSigmaEle, tpcNSigmaEle, float); //! TPCn Sigma of Electron -DECLARE_SOA_COLUMN(TofnSigmaEle, tofNSigmaEle, float); //! TOFn Sigma of Electron +DECLARE_SOA_COLUMN(TofNSigmaEle, tofNSigmaEle, float); //! TOFn Sigma of Electron -DECLARE_SOA_COLUMN(TpcNClsCrRowsEle, tpcNClsCrossedRowsEle, float); //! tpcNClsCrossedRows for Electron +DECLARE_SOA_COLUMN(TpcNClsCrRowsEle, tpcNClsCrRowsEle, float); //! tpcNClsCrossedRows for Electron DECLARE_SOA_COLUMN(TpcCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track DECLARE_SOA_COLUMN(ItsChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron DECLARE_SOA_COLUMN(TpcChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; DECLARE_SOA_COLUMN(DcaXYEle, dcaXYEle, float); //! DCAXY of Electron DECLARE_SOA_COLUMN(DcaZEle, dcaZEle, float); //! DCAZ of Electron -DECLARE_SOA_COLUMN(TpcNClsCrRowsHad, tpcNClsCrossedRowsHad, float); //! tpcNClsCrossedRows for Hadron +DECLARE_SOA_COLUMN(TpcNClsCrRowsHad, tpcNClsCrRowsHad, float); //! tpcNClsCrossedRows for Hadron DECLARE_SOA_COLUMN(TpcCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track DECLARE_SOA_COLUMN(ItsChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron DECLARE_SOA_COLUMN(TpcChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; @@ -555,8 +578,8 @@ DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs I hf_correlation_electron_hadron::PtHadron, hf_correlation_electron_hadron::EopElectron, hf_correlation_electron_hadron::M02Electron, - hf_correlation_electron_hadron::TpcnSigmaEle, - hf_correlation_electron_hadron::TofnSigmaEle, + hf_correlation_electron_hadron::TpcNSigmaEle, + hf_correlation_electron_hadron::TofNSigmaEle, hf_correlation_electron_hadron::TpcNClsCrRowsEle, hf_correlation_electron_hadron::TpcCrRowsRatioEle, hf_correlation_electron_hadron::ItsChi2NClEle, @@ -572,7 +595,6 @@ DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs I hf_correlation_electron_hadron::PoolBin, hf_correlation_electron_hadron::NPairsLS, hf_correlation_electron_hadron::NPairsUS); - // Note: definition of columns and tables for Electron Hadron correlation pairs for MC Gen namespace hf_correlation_mcgenelectron_hadron { From 9834e243a127c9ce1a8df54b5d7dbe538e0c081f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:13:40 +0530 Subject: [PATCH 12/15] Remove build error --- PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index b195b843b17..544559ca89e 100644 --- a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx @@ -71,7 +71,7 @@ struct HfCorrelatorHfeHadrons { Configurable etaTrackMin{"etaTrackMin", -0.8f, "Eta range for associated hadron tracks"}; Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.5f, "DCA XY cut"}; Configurable dcaZTrackMax{"dcaZTrackMax", 1.0f, "DCA Z cut"}; - Configurable tpccrossCut{"TPCcrosscut", 70, "TPC crossrows cut"}; + Configurable tpccrossCut{"tpccrossCut", 70, "TPC crossrows cut"}; Configurable itsChi2{"itsChi2", 36, "ITS chi2 cluster cut"}; Configurable tpcChi2NCl{"tpcChi2NCl", 4, "TPC chi2 cluster cut"}; Configurable tpccrOverFindableRatio{"tpccrOverFindableRatio", 0.8f, "TPC chi2 cluster cut"}; From 612fc0e6a83484460bdf9c1af571731c10351c7a Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:34:46 +0530 Subject: [PATCH 13/15] Remove formate error --- PWGHF/HFC/DataModel/CorrelationTables.h | 27 +++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index ad148549bab..b111af40429 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -553,19 +553,19 @@ DECLARE_SOA_COLUMN(M02Electron, m02Electron, float); //! M02 of Electron DECLARE_SOA_COLUMN(TpcNSigmaEle, tpcNSigmaEle, float); //! TPCn Sigma of Electron DECLARE_SOA_COLUMN(TofNSigmaEle, tofNSigmaEle, float); //! TOFn Sigma of Electron -DECLARE_SOA_COLUMN(TpcNClsCrRowsEle, tpcNClsCrRowsEle, float); //! tpcNClsCrossedRows for Electron -DECLARE_SOA_COLUMN(TpcCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track -DECLARE_SOA_COLUMN(ItsChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron -DECLARE_SOA_COLUMN(TpcChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; -DECLARE_SOA_COLUMN(DcaXYEle, dcaXYEle, float); //! DCAXY of Electron -DECLARE_SOA_COLUMN(DcaZEle, dcaZEle, float); //! DCAZ of Electron - -DECLARE_SOA_COLUMN(TpcNClsCrRowsHad, tpcNClsCrRowsHad, float); //! tpcNClsCrossedRows for Hadron -DECLARE_SOA_COLUMN(TpcCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track -DECLARE_SOA_COLUMN(ItsChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron -DECLARE_SOA_COLUMN(TpcChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; -DECLARE_SOA_COLUMN(DcaXYHad, dcaXYHad, float); //! DCAXY of Hadron -DECLARE_SOA_COLUMN(DcaZHad, dcaZHad, float); //! DCAZ of Hadron +DECLARE_SOA_COLUMN(TpcNClsCrRowsEle, tpcNClsCrRowsEle, float); //! tpcNClsCrossedRows for Electron +DECLARE_SOA_COLUMN(TpcCrRowsRatioEle, tpcCrRowsRatioEle, float); //! Ratio crossed rows over findable clusters electron track +DECLARE_SOA_COLUMN(ItsChi2NClEle, itsChi2NClEle, float); //! itsChi2NCl of Electron +DECLARE_SOA_COLUMN(TpcChi2NClEle, tpcChi2NClEle, float); //! TPC Chi2NCl of electron; +DECLARE_SOA_COLUMN(DcaXYEle, dcaXYEle, float); //! DCAXY of Electron +DECLARE_SOA_COLUMN(DcaZEle, dcaZEle, float); //! DCAZ of Electron + +DECLARE_SOA_COLUMN(TpcNClsCrRowsHad, tpcNClsCrRowsHad, float); //! tpcNClsCrossedRows for Hadron +DECLARE_SOA_COLUMN(TpcCrRowsRatioHad, tpcCrRowsRatioHad, float); //! Ratio crossed rows over findable clusters Hadron track +DECLARE_SOA_COLUMN(ItsChi2NClHad, itsChi2NClHad, float); //! itsChi2NCl of Hadron +DECLARE_SOA_COLUMN(TpcChi2NClHad, tpcChi2NClHad, float); //! TPC Chi2NCl of Hadron; +DECLARE_SOA_COLUMN(DcaXYHad, dcaXYHad, float); //! DCAXY of Hadron +DECLARE_SOA_COLUMN(DcaZHad, dcaZHad, float); //! DCAZ of Hadron DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity DECLARE_SOA_COLUMN(NPairsLS, nPairsLS, int); //! number of like-sign electron-hadron pairs @@ -595,6 +595,7 @@ DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs I hf_correlation_electron_hadron::PoolBin, hf_correlation_electron_hadron::NPairsLS, hf_correlation_electron_hadron::NPairsUS); + // Note: definition of columns and tables for Electron Hadron correlation pairs for MC Gen namespace hf_correlation_mcgenelectron_hadron { From c584738d73b57b3fa365ddd30af9cb72aaf02eb4 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 17:37:04 +0530 Subject: [PATCH 14/15] Update CorrelationTables.h --- PWGHF/HFC/DataModel/CorrelationTables.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index b111af40429..8ecdae30df1 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -509,29 +509,6 @@ DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the colli } // namespace hf_electron -DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties - aod::hf_electron::PhiElectron, - aod::hf_electron::EtaElectron, - aod::hf_electron::PtElectron, - aod::hf_electron::NElectronsLS, - aod::hf_electron::NElectronsUS, - aod::hf_electron::PoolBin, - aod::hf_electron::GIndexCol, - aod::hf_electron::TimeStamp); -// Note: definition of columns and tables for Electron Hadron correlation pairs for Data -namespace hf_electron -{ -DECLARE_SOA_COLUMN(PhiElectron, phiElectron, float); //! Phi of electron -DECLARE_SOA_COLUMN(EtaElectron, etaElectron, float); //! Eta of electron -DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of electron -DECLARE_SOA_COLUMN(NElectronsLS, nElectronsLS, int); //! number of like-sign -DECLARE_SOA_COLUMN(NElectronsUS, nElectronsUS, int); //! number of Unlike-sign -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicit -DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision -DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision - -} // namespace hf_electron - DECLARE_SOA_TABLE(HfElectron, "AOD", "HFELECTRON", //! Hf Electron properties aod::hf_electron::PhiElectron, aod::hf_electron::EtaElectron, From ce98b5c29c8901e8ae973ff2276ddd8b9c82dd38 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Wed, 15 Apr 2026 14:19:17 +0530 Subject: [PATCH 15/15] Used getcharmHadron Function Used getcharmHadron Function --- .../electronSelectionWithTpcEmcal.cxx | 239 ++++-------------- 1 file changed, 48 insertions(+), 191 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 66e4ecb58e5..358d5d3642b 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -54,8 +54,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; -const int kEtaLocal = 221; - struct HfElectronSelectionWithTpcEmcal { Produces electronSel; @@ -134,10 +132,6 @@ struct HfElectronSelectionWithTpcEmcal { Configurable tpcNsigmaElectronMin{"tpcNsigmaElectronMin", -0.5f, "min Electron TPCnsigma"}; Configurable tpcNsigmaElectronMax{"tpcNsigmaElectronMax", 3.0f, "max Electron TPCnsigma"}; Configurable tofNSigmaEl{"tofNSigmaEl", 3.0, "Sigma cut for electrons not in EMCal"}; - Configurable pdgCodeCharmMin{"pdgCodeCharmMin", 400, "Min Charm Hadron PdgCode"}; - Configurable pdgCodeCharmMax{"pdgCodeCharmMax", 600, "Max Charm Hadron PdgCode"}; - Configurable pdgCodeBeautyMin{"pdgCodeBeautyMin", 4000, "Min beauty Hadron PdgCode"}; - Configurable pdgCodeBeautyMax{"pdgCodeBeautyMax", 6000, "Max beauty Hadron PdgCode"}; using TableCollisions = o2::soa::Filtered>; using TableCollision = TableCollisions::iterator; @@ -339,7 +333,7 @@ struct HfElectronSelectionWithTpcEmcal { // nonHfe Identification template - void nonHfe(ElectronType const& electron, TracksType const& tracks, McParticleType const&, float eop, + void nonHfe(ElectronType const& electron, TracksType const& tracks, McParticleType const& mcparticles, float eop, float m02, bool isEMcal) { int nElPairsLS = 0; @@ -410,23 +404,21 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mcAssoParticle.pdgCode()) == kElectron) { bool isEmbEta = false; bool isEmbPi0 = false; - + int heavyquark = RecoDecay::getCharmHadronOrigin(mcparticles, mcAssoParticle, true); + if (heavyquark != RecoDecay::OriginType::None) { + continue; + } // Check first mother if (mcAssoParticle.has_mothers()) { auto const& motherAsso = mcAssoParticle.template mothers_first_as(); - if (std::abs(motherAsso.pdgCode()) == kEtaLocal || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { + if (std::abs(motherAsso.pdgCode()) == kEta || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { auto const& gmotherAsso = motherAsso.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(motherAsso.pdgCode()) == kEtaLocal) { - - if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + if (std::abs(motherAsso.pdgCode()) == kEta) { isEmbEta = true; } @@ -434,18 +426,7 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(motherAsso.pdgCode()) == kPi0) { - if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { - - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + if (std::abs(gmotherAsso.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0-> e } else { @@ -456,30 +437,16 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(motherAsso.pdgCode()) == kGamma) { - if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + if (std::abs(gmotherAsso.pdgCode()) == kEta) { - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; // eta->gamma-> e } if (std::abs(gmotherAsso.pdgCode()) == kPi0) { auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - if (std::abs(ggmotherAsso.pdgCode()) == kEtaLocal) { + if (std::abs(ggmotherAsso.pdgCode()) == kEta) { - auto const& gggmotherAsso = ggmotherAsso.template mothers_first_as(); - if ((std::abs(gggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; // eta->pi0->gamma-> e } else { @@ -526,23 +493,22 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mcAssoParticle.pdgCode()) == kElectron) { bool isEmbEta = false; bool isEmbPi0 = false; - + int heavyquark = RecoDecay::getCharmHadronOrigin(mcparticles, mcAssoParticle, true); + if (heavyquark != RecoDecay::OriginType::None) { + continue; + } // Check first mother if (mcAssoParticle.has_mothers()) { auto const& motherAsso = mcAssoParticle.template mothers_first_as(); - if (std::abs(motherAsso.pdgCode()) == kEtaLocal || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { + if (std::abs(motherAsso.pdgCode()) == kEta || std::abs(motherAsso.pdgCode()) == kPi0 || std::abs(motherAsso.pdgCode()) == kGamma) { auto const& gmotherAsso = motherAsso.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(motherAsso.pdgCode()) == kEtaLocal) { + if (std::abs(motherAsso.pdgCode()) == kEta) { - if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; } @@ -550,18 +516,8 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(motherAsso.pdgCode()) == kPi0) { - if ((std::abs(gmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + if (std::abs(gmotherAsso.pdgCode()) == kEta) { - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; // eta->pi0-> e } else { @@ -572,30 +528,15 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(motherAsso.pdgCode()) == kGamma) { - if (std::abs(gmotherAsso.pdgCode()) == kEtaLocal) { + if (std::abs(gmotherAsso.pdgCode()) == kEta) { - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; // eta->gamma-> e } if (std::abs(gmotherAsso.pdgCode()) == kPi0) { auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - if ((std::abs(ggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(ggmotherAsso.pdgCode()) == kEtaLocal) { - auto const& gggmotherAsso = ggmotherAsso.template mothers_first_as(); - if ((std::abs(gggmotherAsso.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gggmotherAsso.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmotherAsso.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + if (std::abs(ggmotherAsso.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0->gamma-> e } else { @@ -804,23 +745,21 @@ struct HfElectronSelectionWithTpcEmcal { registry.fill(HIST("hMcRecInElectron"), mcParticle.pt()); bool isEmbEta = false; bool isEmbPi0 = false; - + int heavyquark = RecoDecay::getCharmHadronOrigin(mcparticles, mcParticle, true); + if (heavyquark != RecoDecay::OriginType::None) { + continue; + } // 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) { + if (std::abs(mother.pdgCode()) == kEta || 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 ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + if (std::abs(mother.pdgCode()) == kEta) { isEmbEta = true; } @@ -828,18 +767,7 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - - 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; - } + if (std::abs(gmother.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0-> e } else { @@ -850,30 +778,15 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEtaLocal) { + if (std::abs(gmother.pdgCode()) == kEta) { - 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) { 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; - } - - if (std::abs(ggmother.pdgCode()) == kEtaLocal) { + if (std::abs(ggmother.pdgCode()) == kEta) { - 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 } else { @@ -916,23 +829,22 @@ struct HfElectronSelectionWithTpcEmcal { registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); bool isEmbEta = false; bool isEmbPi0 = false; - + int heavyquark = RecoDecay::getCharmHadronOrigin(mcparticles, mcParticle, true); + if (heavyquark != RecoDecay::OriginType::None) { + continue; + } // 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) { + if (std::abs(mother.pdgCode()) == kEta || 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 (std::abs(mother.pdgCode()) == kEta) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; } @@ -940,18 +852,7 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - - 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; - } + if (std::abs(gmother.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0-> e } else { @@ -962,30 +863,13 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - - 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; - } + if (std::abs(gmother.pdgCode()) == kEta) { isEmbEta = true; // eta->gamma-> e } if (std::abs(gmother.pdgCode()) == kPi0) { 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; - } - - if (std::abs(ggmother.pdgCode()) == kEtaLocal) { - - 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; - } + if (std::abs(ggmother.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0->gamma-> e } else { @@ -1034,11 +918,13 @@ struct HfElectronSelectionWithTpcEmcal { { bool isNonHfe = false; + for (const auto& particleMc : mcParticles) { if (!mcGensel(particleMc)) { continue; } + if (std::abs(particleMc.pdgCode()) == kElectron) { registry.fill(HIST("hMcgenInElectron"), particleMc.pt()); @@ -1048,20 +934,19 @@ struct HfElectronSelectionWithTpcEmcal { // Check first mother if (particleMc.has_mothers()) { auto const& mother = particleMc.mothers_first_as(); - - if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { + int heavyquark = RecoDecay::getCharmHadronOrigin(mcParticles, particleMc, true); + if (heavyquark != RecoDecay::OriginType::None) { + continue; + } + if (std::abs(mother.pdgCode()) == kEta || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) { registry.fill(HIST("hMcgenAllNonHfeElectron"), particleMc.pt()); auto const& gmother = mother.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 (std::abs(mother.pdgCode()) == kEta) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } isEmbEta = true; registry.fill(HIST("hMcgenElectronFromEta"), particleMc.pt()); } @@ -1070,18 +955,7 @@ struct HfElectronSelectionWithTpcEmcal { if (std::abs(mother.pdgCode()) == kPi0) { - if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - auto const& ggmother = gmother.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; - } - + if (std::abs(gmother.pdgCode()) == kEta) { isEmbEta = true; // eta->pi0-> e registry.fill(HIST("hMcgenElectronFromPi0Eta"), particleMc.pt()); @@ -1094,13 +968,7 @@ struct HfElectronSelectionWithTpcEmcal { /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - - auto const& ggmother = gmother.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; - } + if (std::abs(gmother.pdgCode()) == kEta) { isEmbEta = true; // eta->gamma-> e @@ -1108,21 +976,10 @@ struct HfElectronSelectionWithTpcEmcal { } if (std::abs(gmother.pdgCode()) == kPi0) { - auto const& ggmother = gmother.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; - } - if (gmother.has_mothers()) { auto const& ggmother = gmother.mothers_first_as(); - if (std::abs(ggmother.pdgCode()) == kEtaLocal) { + if (std::abs(ggmother.pdgCode()) == kEta) { - auto const& gggmother = ggmother.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 registry.fill(HIST("hMcgenElectronFromEtaPi0Gamma"), particleMc.pt());