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/21] 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/21] 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/21] 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/21] 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/21] =?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/21] =?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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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/21] 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()); From 8efe0a544e355fbad75b5ebfcf9688a32c11639f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 13:56:08 +0530 Subject: [PATCH 16/21] Update electronSelectionWithTpcEmcal.cxx --- PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 358d5d3642b..c274de08037 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -85,7 +85,8 @@ struct HfElectronSelectionWithTpcEmcal { 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 ptTrackMin{"ptTrackMin", 3.0f, "Min Transverse MOmentum range for electron tracks"}; + Configurable ptTrackMax{"ptTrackMax", 12.0f, "Max 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"}; @@ -286,7 +287,7 @@ struct HfElectronSelectionWithTpcEmcal { if ((track.phi() < phiTrackEMCalMin || track.phi() > phiTrackEMCalMax) && (track.phi() < phiTrackDCalMin || track.phi() > phiTrackDCalMax)) { return false; } - if (track.pt() < ptTrackMin) { + if (track.pt() < ptTrackMin || track.pt() > ptTrackMax) { return false; } return true; @@ -589,7 +590,7 @@ struct HfElectronSelectionWithTpcEmcal { } // Pass multiplicities and other required parameters for this electron - 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); + 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(), eop, m02, vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal); } // Electron Identification template From 3c1a8a345b37f71f6081e020b9abc8adc4bc5d3a Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 13:59:09 +0530 Subject: [PATCH 17/21] Add Event mixing task --- PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx | 67 ++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx index f3eaef5e54f..a522e2832ef 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationHfeHadrons.cxx @@ -37,6 +37,7 @@ struct HfTaskCorrelationHfeHadrons { 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}"}; ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; + ConfigurableAxis binsPhi{"binsPhi", {100, 0.0, 7}, "#it{p_{T}}(GeV/#it{c})"}; HistogramRegistry registry{ "registry", @@ -47,11 +48,22 @@ struct HfTaskCorrelationHfeHadrons { AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{Electron}- #eta_{Hadron}"}; AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{Electron}- #varphi_{Hadron}"}; AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; - + AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; registry.add("hInclusiveEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hLikeSignEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); registry.add("hUnLikeSignEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + + registry.add("hInclusiveMixEHCorrel", "Sparse for Delta phi and Delta eta Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseD, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hLikeSignMixEHCorrel", "Sparse for Delta phi and Delta eta Like sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseD, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hUnlikeSignMixEHCorrel", "Sparse for Delta phi and Delta eta UnLike sign Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseD, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hPhi", "phi distribution for electron", {HistType::kTH1D, {{axisPhi}}}); + registry.add("hPhiLS", "phi distribution for Like sign electron", {HistType::kTH1D, {{axisPhi}}}); + registry.add("hPhiUS", "phi distribution for Unlike sign electron", {HistType::kTH1D, {{axisPhi}}}); + + registry.add("hadronPhi", "phi distribution for hadron", {HistType::kTH1D, {{axisPhi}}}); + registry.add("hMcGenInclusiveEHCorrel", "Sparse for Delta phi and Delta eta for McGen Inclusive Electron with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); + registry.add("hMcGenNonHfEHCorrel", "Sparse for Delta phi and Delta eta for McGen NonHeavy flavour Electron pair with Hadron;p_{T}^{e} (GeV#it{/c});p_{T}^{h} (GeV#it{/c});#Delta#varphi;#Delta#eta;", {HistType::kTHnSparseF, {{axisPt}, {axisPt}, {axisDeltaPhi}, {axisDeltaEta}}}); } @@ -88,6 +100,57 @@ struct HfTaskCorrelationHfeHadrons { PROCESS_SWITCH(HfTaskCorrelationHfeHadrons, process, "Process ", false); + // correlation for electron hadron + void processDataMixedEvent(aod::HfElectron const& electrons, aod::Hadron const& hadrons) + { + + for (const auto& electron : electrons) { + + double deltaPhiMix = -999; + double deltaEtaMix = -999; + registry.fill(HIST("hPhi"), electron.phiElectron()); + + if (electron.nElectronsUS() > 0) { + + registry.fill(HIST("hPhiUS"), electron.phiElectron()); + } + + if (electron.nElectronsLS() > 0) { + + registry.fill(HIST("hPhiLS"), electron.phiElectron()); + } + if (electron.poolBin() < 0) + continue; + + for (const auto& hadron : hadrons) { + if (electron.timeStamp() == hadron.timeStamp()) { + + continue; // or continue; if you're inside a loop + } + + if (hadron.poolBin() == electron.poolBin()) { + continue; + } + if (hadron.gIndexCol() == electron.gIndexCol()) { + continue; + } + + deltaPhiMix = RecoDecay::constrainAngle(electron.phiElectron() - hadron.phi(), -o2::constants::math::PIHalf); + deltaEtaMix = electron.etaElectron() - hadron.eta(); + + registry.fill(HIST("hadronPhi"), hadron.phi()); + registry.fill(HIST("hInclusiveMixEHCorrel"), electron.ptElectron(), hadron.ptH(), deltaPhiMix, deltaEtaMix); + + if (electron.nElectronsLS() > 0) { + registry.fill(HIST("hLikeSignMixEHCorrel"), electron.ptElectron(), hadron.ptH(), deltaPhiMix, deltaEtaMix); + } + if (electron.nElectronsUS() > 0) { + registry.fill(HIST("hUnlikeSignMixEHCorrel"), electron.ptElectron(), hadron.ptH(), deltaPhiMix, deltaEtaMix); + } + } + } + } + PROCESS_SWITCH(HfTaskCorrelationHfeHadrons, processDataMixedEvent, "Process offlineevent mix ", true); void processMcGen(aod::HfEHadronMcPair const& mcGenpairEntries) { double deltaPhi = -999; @@ -109,7 +172,7 @@ struct HfTaskCorrelationHfeHadrons { } } } - PROCESS_SWITCH(HfTaskCorrelationHfeHadrons, processMcGen, "Process for Mc Gen ", true); + PROCESS_SWITCH(HfTaskCorrelationHfeHadrons, processMcGen, "Process for Mc Gen ", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 04ff7365ed35af2e1c29a4cf00df55fe97d60165 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 14:11:38 +0530 Subject: [PATCH 18/21] correct eop and mo2 in table --- PWGHF/HFL/DataModel/ElectronSelectionTable.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 4906b01d229..d819332e3ba 100644 --- a/PWGHF/HFL/DataModel/ElectronSelectionTable.h +++ b/PWGHF/HFL/DataModel/ElectronSelectionTable.h @@ -93,8 +93,9 @@ DECLARE_SOA_COLUMN(TpcChi2NClTrack, tpcChi2NClTrack, float); //! Chi2 / 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(M02El, m02El, float); //! M02 of the electron cluster + 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 From 81cb6534a2698eaf69176def10e5a5d66749a2e6 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 14:14:39 +0530 Subject: [PATCH 19/21] remove clang error --- .../electronSelectionWithTpcEmcal.cxx | 1129 ++--------------- 1 file changed, 127 insertions(+), 1002 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index b595822791f..d819332e3ba 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -9,1016 +9,141 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file electronSelectionWithTpcEmcal.cxx -/// \brief Task used to electron selection with tpc and emcal. +/// \file ElectronSelectionTable.h +/// \brief Definitions of tables produced by Electron Selection + /// \author Rashi Gupta , IIT Indore /// \author Ravindra Singh , IIT Indore -#include "PWGHF/HFL/DataModel/ElectronSelectionTable.h" -#include "PWGJE/DataModel/EMCALClusters.h" - -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/RecoDecay.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Tools/KFparticle/KFUtilities.h" +#ifndef PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ +#define PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include #include #include -using namespace o2; -using namespace o2::constants::physics; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; - -struct HfElectronSelectionWithTpcEmcal { - - Produces electronSel; - Produces hfElectronSelection; - Produces hfGenElectronSel; - - // select the emcal or dcal acceptance - enum EMCalRegion { - NoAcceptance = 0, - EMCalAcceptance = 1, - DCalAcceptance = 2 - }; - // Configurables - // EMCal Cluster information - KFParticle kfNonHfe; - Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; - Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; - Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; - - // select the emcal or dcal acceptance - Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms (see EMCalRegion enum)"}; - - // 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, "Min Transverse MOmentum range for electron tracks"}; - Configurable ptTrackMax{"ptTrackMax", 12.0f, "Max 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"}; - Configurable etaAssoTrackMin{"etaAssoTrackMin", -0.9f, "Eta range for Associatred electron tracks"}; - Configurable ptAssoTrackMin{"ptAssoTrackMin", 0.2f, "Transverse MOmentum range for Associatred electron tracks"}; - Configurable tpcNsigmaAssoElectronMin{"tpcNsigmaAssoElectronMin", -3.0f, "min Associated Electron TPCnsigma"}; - Configurable tpcNsigmaAssoElectronMax{"tpcNsigmaAssoElectronMax", 3.0f, "max Associated Electron TPCnsigma"}; - Configurable invariantMass{"invariantMass", 0.14f, "max Invariant Mass for Photonic electron"}; - Configurable chiSquareMax{"chiSquareMax", 3.0f, "chiSquare on the reconstructed parent particle"}; - - // EMcal and Dcal selection cut - Configurable etaTrackDCalNegativeMax{"etaTrackDCalNegativeMax", -0.22f, "Eta range for electron Dcal tracks"}; - 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 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"}; - - // Track and EMCal Cluster matching cut - Configurable deltaEtaMatchMin{"deltaEtaMatchMin", -0.013f, "Min Eta distance of EMCAL cluster to its closest track"}; - Configurable deltaEtaMatchMax{"deltaEtaMatchMax", 0.0171f, "Max Eta distance of EMCAL cluster to its closest track"}; - Configurable deltaPhiMatchMin{"deltaPhiMatchMin", -0.022f, "Min Phi distance of EMCAL cluster to its closest track"}; - Configurable deltaPhiMatchMax{"deltaPhiMatchMax", 0.028f, "Max Phi distance of EMCAL cluster to its closest track"}; - Configurable timeEmcClusterMax{"timeEmcClusterMax", 50.f, "EMCal Cluster time"}; - - // Inclusive electron selection cut - Configurable eopElectronMin{"eopElectronMin", 0.8f, "Minimum E/p for electron tracks"}; - Configurable eopElectronMax{"eopElectronMax", 1.2f, "Maximum E/p for electron tracks"}; - Configurable m02EmcClusterElectronMax{"m02EmcClusterElectronMax", 0.9f, "max Electron EMCal Cluster M02"}; - Configurable m02EmcClusterElectronMin{"m02EmcClusterElectronMin", 0.02f, "min Electron EMCal Cluster M02"}; - Configurable m20EmcClusterElectronMax{"m20EmcClusterElectronMax", 1000.f, "max Electron EMCal Cluster M20"}; - Configurable m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"}; - 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"}; - - using TableCollisions = o2::soa::Filtered>; - using TableCollision = TableCollisions::iterator; - using TableTracks = o2::soa::Join; - - using McTableCollisions = o2::soa::Filtered>; - using McTableCollision = McTableCollisions::iterator; - using McGenTableCollisions = soa::Join; - using McGenTableCollision = McGenTableCollisions::iterator; - using McTableTracks = soa::Join; - using McTableEmcals = soa::Join; - - Filter collisionFilter = nabs(aod::collision::posZ) < zPvPosMax && aod::collision::numContrib > static_cast(1); - PresliceUnsorted perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId; - - // configurable axis - ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; - ConfigurableAxis binsEta{"binsEta", {100, -2.0, 2.}, "#it{#eta}"}; - ConfigurableAxis binsPhi{"binsPhi", {32, 0.0, o2::constants::math::TwoPI}, "#it{#varphi}"}; - ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; - ConfigurableAxis binsdEdx{"binsdEdx", {160, 0., 160.}, "dE/dX"}; - ConfigurableAxis binsnSigma{"binsnSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; - ConfigurableAxis binsM02{"binsM02", {50, 0., 2.0}, "M02; entries"}; - ConfigurableAxis binsM20{"binsM20", {50, 0., 2.0}, "M20; entries"}; - ConfigurableAxis binsEoP{"binsEoP", {30, 0., 3.}, "e/p"}; - ConfigurableAxis binsEmcEnergy{"binsEmcEnergy", {50, 0., 50.}, "Cluster Energy (GeV/#it{c}^{2})"}; - ConfigurableAxis binsEmcClsNCells{"binsEmcClsNCells", {50, 0., 50.}, "nCells"}; - ConfigurableAxis binsEmcClsTime{"binsEmcClsTime", {1800, -900.0, 900.}, "Cluster Time"}; - ConfigurableAxis binsPassEMcal{"binsPassEMcal", {3, 0.0, 3.}, "Pass EMcal"}; - - ConfigurableAxis binsDeltaEta{"binsDeltaEta", {20, -0.2, 0.2}, "Track Cluser Match #Delta #eta"}; - ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {20, -0.2, 0.2}, "Track Cluser Match #Delta #varphi"}; - ConfigurableAxis binsMass{"binsMass", {100, 0.0, 2.0}, "Mass (GeV/#it{c}^{2}); entries"}; - - HistogramRegistry registry{ - "registry", - {}}; - - void init(o2::framework::InitContext&) - { - AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; - AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; - AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; - AxisSpec axisEta = {binsEta, "#it{#eta}"}; - AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; - AxisSpec axisdEdx = {binsdEdx, "dE/dX"}; - AxisSpec axisnSigma = {binsnSigma, "it{#sigma_{TPC}}"}; - AxisSpec axisM02 = {binsM02, "M02; entries"}; - AxisSpec axisM20 = {binsM20, "M20; entries"}; - AxisSpec axisEoP = {binsEoP, "E/p"}; - AxisSpec axisEmcEnergy = {binsEmcEnergy, "Cluster Energy (GeV/#it{c}^{2})"}; - AxisSpec axisEmcClsNCells = {binsEmcClsNCells, "nCell"}; - AxisSpec axisEmcClsTime = {binsEmcClsTime, "Cluster Time"}; - AxisSpec axisPassEMcal = {binsPassEMcal, "Pass EMcal"}; - AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{trk}- #eta_{cluster}"}; - AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{trk}- #varphi_{cluster}"}; - - 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_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("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}}}); - 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}}}); - 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}}}); - registry.add("hTrackEnergyLossVsP", " TPC Energy loss info vs P; dE/dx;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisdEdx}, {axisPt}, {axisPassEMcal}}}); - registry.add("hTrackEnergyLossVsPt", "TPC Energy loss info vs Pt; dE/dx;#it{p}_{T} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisdEdx}, {axisPt}, {axisPassEMcal}}}); - registry.add("hTracknSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisnSigma}, {axisPt}, {axisPassEMcal}}}); - registry.add("hTracknSigmaVsPt", " TPC nSigma info vs Pt; n#sigma;#it{p}_{T} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisnSigma}, {axisPt}, {axisPassEMcal}}}); - registry.add("hEmcClusterEnergy", "EMCal Cluster Info before match Energy; Energy (GeV); entries;", {HistType::kTH1D, {{axisEmcEnergy}}}); - registry.add("hEmcClusterEtaPhi", "EMCal Cluster Info before match Eta and Phi; #eta;#varphi;", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); - registry.add("hEmcClusterEnergyCell", "EMCal Cluster Info before match Energy vs nCells; Energy (GeV);ncell;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsNCells}}}); - registry.add("hEmcClusterEnergyTime", "EMCal Cluster Info before match Energy vs time; Energy (GeV); sec;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsTime}}}); - registry.add("hEmcClusterAfterMatchEnergy", "EMCal Cluster Info After match Energy; Energy (GeV); entries;", {HistType::kTH1D, {{axisEmcEnergy}}}); - registry.add("hEmcClusterAfterMatchEtaPhi", "EMCal Cluster Info After match Eta and Phi; #eta;#varphi;", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); - registry.add("hEmcClusterAfterMatchEnergyCells", "EMCal Cluster Info After match Energy vs nCells; Energy (GeV);ncell;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsNCells}}}); - registry.add("hEmcClusterAfterMatchEnergyTime", "EMCal Cluster Info After match Energy vs time; Energy (GeV); sec;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsTime}}}); - registry.add("hAfterMatchSigmaVsEoP", "PID Info after match EoP vs Sigma ; E/P;#it{p}_{T} (GeV#it{/c});n#sigma; m02; m20;", {HistType::kTHnSparseF, {{axisEoP}, {axisPt}, {axisnSigma}, {axisM02}, {axisM20}}}); - registry.add("hAfterMatchEoPVsP", "PID Info after match EoP vs P; E/P;#it{p} (GeV#it{/c});", {HistType::kTH2F, {{axisEoP}, {axisPt}}}); - registry.add("hAfterMatchSigmaVsP", "PID Info after match Sigma vs Momentum ; n#sigma; #it{p} (GeV#it{/c}; ", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); - registry.add("hAfterMatchEtaPhi", "PID Info after match Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); - registry.add("hAfterMatchEnergyLossVsP", "PID Info after match Energy loss info vs P ; dE/dx;#it{p} (GeV#it{/c});; ", {HistType::kTH2F, {{axisdEdx}, {axisPt}}}); - registry.add("hAfterMatchEnergyLossVsPt", "PID Info after match Energy loss info vs Pt ;dE/dx;#it{p}_{T} (GeV#it{/c}); ", {HistType::kTH2F, {{axisdEdx}, {axisPt}}}); - - registry.add("hAfterPIDEtaPhi", "PID Info after PID Cuts Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); - registry.add("hEPRatioAfterPID", "E/P Ratio after PID Cuts apply only trackwodca filter", {HistType::kTH2F, {{axisPt}, {axisEmcEnergy}}}); - - registry.add("hPIDAfterPIDCuts", "PID Info after PID cuts; E/P;#it{p}_{T} (GeV#it{/c});n#sigma;m02; m20;", {HistType::kTHnSparseF, {{axisEoP}, {axisPt}, {axisnSigma}, {axisM02}, {axisM20}}}); - registry.add("hEmcClsTrkEtaPhiDiffTime", "EmcClsTrkEtaPhiDiffTime;#Delta#eta;#Delta#varphi;Sec;", {HistType::kTH3F, {{axisDeltaEta}, {axisDeltaPhi}, {axisEmcClsTime}}}); - registry.add("hTofNSigmaVsPt", " TOF nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); - registry.add("hTpcNSigmaVsPt", " TPC nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); - } - // Track Selection Cut - template - bool selTracks(T const& track) - { - 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) { - return false; - } - if (track.eta() < etaTrackMin || track.eta() > etaTrackMax) { - return false; - } - if ((track.phi() < phiTrackEMCalMin || track.phi() > phiTrackEMCalMax) && (track.phi() < phiTrackDCalMin || track.phi() > phiTrackDCalMax)) { - return false; - } - if (track.pt() < ptTrackMin || track.pt() > ptTrackMax) { - return false; - } - return true; - } - // Associated electron Selection Cut - template - bool selAssoTracks(T const& track) - { - if (!track.isGlobalTrackWoDCA()) { - return false; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { - return false; - } - if (track.eta() < etaAssoTrackMin || track.eta() > etaAssoTrackMax) { - return false; - } - - if (track.pt() < ptAssoTrackMin) { - return false; - } - if (track.tpcNSigmaEl() < tpcNsigmaAssoElectronMin || track.tpcNSigmaEl() > tpcNsigmaAssoElectronMax) { - return false; - } - - return true; - } - - // mc gen particle selection cut - template - bool mcGensel(T const& track) - { - if (track.eta() < etaTrackMin || track.eta() > etaTrackMax) { - return false; - } - if ((track.phi() < phiTrackEMCalMin || track.phi() > phiTrackEMCalMax) && (track.phi() < phiTrackDCalMin || track.phi() > phiTrackDCalMax)) { - return false; - } - if (track.pt() < ptTrackMin) { - return false; - } - return true; - } - // nonHfe Identification - - template - void nonHfe(ElectronType const& electron, TracksType const& tracks, McParticleType const& mcparticles, 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) { - if (pTrack.globalIndex() == electron.globalIndex()) { - continue; - } - // Apply partner electron selection - - if (!selAssoTracks(pTrack)) { - continue; - } - if (electron.pt() <= pTrack.pt()) { - continue; - } - int pdgE1 = kElectron; - int pdgE2 = kElectron; - if (electron.sign() > 0) { - pdgE1 = kPositron; - } - - if (pTrack.sign() > 0) { - pdgE2 = kPositron; - } - - KFPTrack const kfpTrack = createKFPTrackFromTrack(electron); - KFPTrack const kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); - KFParticle const kfTrack(kfpTrack, pdgE1); - KFParticle const kfAssociatedTrack(kfpAssociatedTrack, pdgE2); - const KFParticle* electronPairs[2] = {&kfTrack, &kfAssociatedTrack}; - kfNonHfe.SetConstructMethod(2); - kfNonHfe.Construct(electronPairs, 2); - - int const ndf = kfNonHfe.GetNDF(); - double const chi2recg = kfNonHfe.GetChi2() / ndf; - if (ndf < 1.0) { - continue; - } - - if (std::sqrt(std::abs(chi2recg)) > chiSquareMax) { - continue; - } - - invMassElectron = RecoDecay::m(std::array{pTrack.pVector(), electron.pVector()}, std::array{MassElectron, MassElectron}); - bool isLSElectron = false; - bool isULSElectron = false; - // for like charge - if (pTrack.sign() == electron.sign()) { - massLike = invMassElectron; - vecLSMass.push_back(massLike); - isLSElectron = true; - if (isEMcal) { - registry.fill(HIST("hLikeMass_EMCAL"), massLike); - } 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; - 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()) == 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()) == kEta) { - isEmbEta = true; - } - - //================= eta->pi0->e ====================================== - - if (std::abs(motherAsso.pdgCode()) == kPi0) { - - if (std::abs(gmotherAsso.pdgCode()) == kEta) { - 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()) == kEta) { - - isEmbEta = true; // eta->gamma-> e - } - if (std::abs(gmotherAsso.pdgCode()) == kPi0) { - - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - - if (std::abs(ggmotherAsso.pdgCode()) == kEta) { - - 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; - 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()) == 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()) == kEta) { - - isEmbEta = true; - } - - //================= eta->pi0->e ====================================== - - if (std::abs(motherAsso.pdgCode()) == kPi0) { - - if (std::abs(gmotherAsso.pdgCode()) == kEta) { - - 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()) == kEta) { - - isEmbEta = true; // eta->gamma-> e - } - if (std::abs(gmotherAsso.pdgCode()) == kPi0) { - - auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); - - if (std::abs(ggmotherAsso.pdgCode()) == kEta) { - 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 - if (isLSElectron && (invMassElectron <= invariantMass)) { - massLike = invMassElectron; - ++nElPairsLS; - if (isEMcal) { - registry.fill(HIST("hLikeSignPt_EMCAL"), electron.pt()); - } else { - registry.fill(HIST("hLikeSignPt_NoEMCAL"), electron.pt()); - } - } - // for unlike charge - if (isULSElectron && (invMassElectron <= invariantMass)) { - massUnLike = invMassElectron; - ++nElPairsUS; - if (isEMcal) { - registry.fill(HIST("hUnLikeSignPt_EMCAL"), electron.pt()); - } else { - registry.fill(HIST("hUnLikeSignPt_NoEMCAL"), electron.pt()); - } - } - } - - // Pass multiplicities and other required parameters for this electron - - 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(), eop, m02, vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal); - - } - // Electron Identification - template - void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& mcparticles) - { - if (sel8Minibias && !(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { - return; - } - - registry.fill(HIST("hNevents"), emcalRegion.value); - - // skip events with no clusters - if (emcClusters.size() == 0 && skipNoEmcClusters) { - return; - } - registry.fill(HIST("hZvertex"), collision.posZ()); - registry.fill(HIST("hNeventsAfterPassEmcal"), static_cast(emcalRegion)); - ///////////////////////////////// - // EMCal cluster info before match /// - /////////////////////////////// - if (fillEmcClusterInfo) { - for (const auto& emcClusterBefore : emcClusters) { - registry.fill(HIST("hEmcClusterEnergy"), emcClusterBefore.energy()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterEtaPhi"), emcClusterBefore.eta(), emcClusterBefore.phi()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterEnergyCell"), emcClusterBefore.energy(), emcClusterBefore.nCells()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterEnergyTime"), emcClusterBefore.energy(), emcClusterBefore.time()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterM02"), emcClusterBefore.m02()); - registry.fill(HIST("hEmcClusterM20"), emcClusterBefore.m20()); - } - } - EMCalRegion passEMCal = NoAcceptance; - float phiTrack = -999; - float etaTrack = -999; - float pTrack = -999; - float ptTrack = -999; - float dcaxyTrack = -999; - float dcazTrack = -999; - float tpcNsigmaTrack = -999; - - for (const auto& track : tracks) { - phiTrack = track.phi(); - etaTrack = track.eta(); - pTrack = track.p(); - ptTrack = track.pt(); - dcaxyTrack = track.dcaXY(); - dcazTrack = track.dcaZ(); - tpcNsigmaTrack = track.tpcNSigmaEl(); - // Apply Track Selection - if (!selTracks(track)) { - continue; - } - if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) { - passEMCal = EMCalAcceptance; // EMcal acceptance passed - } - if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) { - passEMCal = DCalAcceptance; // Dcal acceptance passed - } - - if (fillTrackInfo) { - // 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 - registry.fill(HIST("hTracknSigmaVsPt"), tpcNsigmaTrack, ptTrack, passEMCal); // track etaphi infor after filter bit - } - auto tracksofcluster = matchedTracks.sliceBy(perClusterMatchedTracks, track.globalIndex()); - float phiMatchTrack = -999; - float etaMatchTrack = -999; - float pMatchTrack = -999; - float ptMatchTrack = -999; - float tpcNsigmaMatchTrack = -999; - float phiMatchEmcCluster = -999; - float etaMatchEmcCluster = -999; - float eMatchEmcCluster = -999; - float m02MatchEmcCluster = -999; - float m20MatchEmcCluster = -999; - float timeEmcCluster = -999; - float cellEmcCluster = -999; - float deltaPhiMatch = -999.; - float deltaEtaMatch = -999.; - float eop = -999; - bool const isEMcal = false; - - float trackRapidity = track.rapidity(MassElectron); - - for (const auto& ematchTrack : tracksofcluster) { - - auto matchTrack = ematchTrack.template track_as(); - - auto emcCluster = ematchTrack.template emcalcluster_as(); - - phiMatchTrack = matchTrack.phi(); - etaMatchTrack = matchTrack.eta(); - pMatchTrack = matchTrack.p(); - ptMatchTrack = matchTrack.pt(); - tpcNsigmaMatchTrack = matchTrack.tpcNSigmaEl(); - phiMatchEmcCluster = emcCluster.phi(); - etaMatchEmcCluster = emcCluster.eta(); - eMatchEmcCluster = emcCluster.energy(); - m02MatchEmcCluster = emcCluster.m02(); - m20MatchEmcCluster = emcCluster.m20(); - timeEmcCluster = emcCluster.time(); - cellEmcCluster = emcCluster.nCells(); - - deltaPhiMatch = ematchTrack.deltaPhi(); - deltaEtaMatch = ematchTrack.deltaEta(); - - // Track and EMCal cluster Matching - if (std::abs(timeEmcCluster) > timeEmcClusterMax) { - continue; - } - if (deltaPhiMatch < deltaPhiMatchMin || deltaPhiMatch > deltaPhiMatchMax || deltaEtaMatch < deltaEtaMatchMin || deltaEtaMatch > deltaEtaMatchMax) { - continue; - } - - registry.fill(HIST("hEmcClsTrkEtaPhiDiffTime"), deltaEtaMatch, deltaPhiMatch, timeEmcCluster); - - if (fillEmcClusterInfo) { - registry.fill(HIST("hEmcClusterAfterMatchEnergy"), emcCluster.energy()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterAfterMatchEtaPhi"), emcCluster.eta(), emcCluster.phi()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterAfterMatchEnergyCells"), emcCluster.energy(), emcCluster.nCells()); // track etaphi infor after filter bit - registry.fill(HIST("hEmcClusterAfterMatchEnergyTime"), emcCluster.energy(), emcCluster.time()); // track etaphi infor after filter bit - } - - eop = eMatchEmcCluster / pMatchTrack; - - registry.fill(HIST("hAfterMatchSigmaVsEoP"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster); - registry.fill(HIST("hAfterMatchEoPVsP"), eop, pMatchTrack); - registry.fill(HIST("hAfterMatchSigmaVsP"), tpcNsigmaMatchTrack, pMatchTrack); - registry.fill(HIST("hAfterMatchEtaPhi"), etaMatchTrack, phiMatchTrack); - registry.fill(HIST("hAfterMatchEnergyLossVsP"), matchTrack.tpcSignal(), pMatchTrack); - registry.fill(HIST("hAfterMatchEnergyLossVsPt"), matchTrack.tpcSignal(), ptMatchTrack); - // Apply Electron Identification cuts - - if ((tpcNsigmaMatchTrack < tpcNsigmaElectronMin || tpcNsigmaMatchTrack > tpcNsigmaElectronMax) || (m02MatchEmcCluster < m02EmcClusterElectronMin || m02MatchEmcCluster > m02EmcClusterElectronMax) || (m20MatchEmcCluster < m20EmcClusterElectronMin || m20MatchEmcCluster > m20EmcClusterElectronMax)) { - continue; - } - - registry.fill(HIST("hPIDAfterPIDCuts"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster); - registry.fill(HIST("hEPRatioAfterPID"), pMatchTrack, eMatchEmcCluster); - registry.fill(HIST("hAfterPIDEtaPhi"), etaMatchTrack, phiMatchTrack); - if (eop < eopElectronMin || eop > eopElectronMax) { - 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; - 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()) == 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()) == kEta) { - isEmbEta = true; - } - - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - - if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->pi0-> e - - } else { - isEmbPi0 = true; // pi0 -> e - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - - 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()) == kEta) { - - isEmbEta = true; // eta->pi0->gamma-> e - - } else { - isEmbPi0 = true; // pi0-> gamma-> e - } - } - } - if (!(isEmbPi0 || isEmbEta)) { - continue; - } - nonHfe(matchTrack, tracks, mcparticles, eop, m02MatchEmcCluster, true); - } - } - } - } - } - - ///////////////// NonHf electron Selection without Emcal //////////////////////// - electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(), - eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal); - } - /// Electron information without Emcal and use TPC and TOF - if (isEMcal) { - continue; - } - if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) { - continue; - } - registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt()); - registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt()); - - if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { - continue; - } - registry.fill(HIST("hphiElectron"), track.phi()); - if constexpr (IsMc) { - if (track.has_mcParticle()) { - auto mcParticle = track.template mcParticle_as(); - if (std::abs(mcParticle.pdgCode()) == kElectron) { - registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); - bool isEmbEta = false; - bool isEmbPi0 = false; - 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()) == 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()) == kEta) { - - isEmbEta = true; - } - - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - - if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->pi0-> e - - } else { - isEmbPi0 = true; // pi0 -> e - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - - 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()) == kEta) { - isEmbEta = true; // eta->pi0->gamma-> e - - } else { - isEmbPi0 = true; // pi0-> gamma-> e - } - } - } - if (!(isEmbPi0 || isEmbEta)) { - continue; - } - - nonHfe(track, tracks, mcparticles, eop, m02MatchEmcCluster, 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); - } - } - - /// Electron selection - for real data and data-like analysis - void processData(TableCollision const& collision, - TableTracks const& tracks, - aod::EMCALClusters const& emcClusters, - o2::aod::EMCALMatchedTracks const& matchedTracks) - { - fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); - } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); - /// Electron selection - for MC reco-level analysis - void processMcRec(McTableCollision const& mcCollision, - McTableTracks const& mcTracks, - McTableEmcals const& mcEmcClusters, - o2::aod::EMCALMatchedTracks const& matchedTracks, - aod::McParticles const& mcParticles) - { - fillElectronTrack(mcCollision, mcTracks, mcEmcClusters, matchedTracks, mcParticles); - } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", false); - - void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) - { - - bool isNonHfe = false; - - for (const auto& particleMc : mcParticles) { - - if (!mcGensel(particleMc)) { - continue; - } - - if (std::abs(particleMc.pdgCode()) == kElectron) { - - registry.fill(HIST("hMcgenInElectron"), particleMc.pt()); - bool isEmbEta = false; - bool isEmbPi0 = false; - - // Check first mother - if (particleMc.has_mothers()) { - auto const& mother = particleMc.mothers_first_as(); - 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()) == kEta) { - - isEmbEta = true; - registry.fill(HIST("hMcgenElectronFromEta"), particleMc.pt()); - } - - //================= eta->pi0->e ====================================== - - if (std::abs(mother.pdgCode()) == kPi0) { - - if (std::abs(gmother.pdgCode()) == kEta) { - isEmbEta = true; // eta->pi0-> e - registry.fill(HIST("hMcgenElectronFromPi0Eta"), particleMc.pt()); - - } else { - isEmbPi0 = true; // pi0 -> e - registry.fill(HIST("hMcgenElectronFromPi0"), particleMc.pt()); - } - } - - /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ - if (std::abs(mother.pdgCode()) == kGamma) { - - if (std::abs(gmother.pdgCode()) == kEta) { - - isEmbEta = true; // eta->gamma-> e - - registry.fill(HIST("hMcgenElectronFromEtaGamma"), particleMc.pt()); - } - if (std::abs(gmother.pdgCode()) == kPi0) { - - if (gmother.has_mothers()) { - auto const& ggmother = gmother.mothers_first_as(); - if (std::abs(ggmother.pdgCode()) == kEta) { - - isEmbEta = true; // eta->pi0->gamma-> e - - registry.fill(HIST("hMcgenElectronFromEtaPi0Gamma"), particleMc.pt()); - - } else { - isEmbPi0 = true; // pi0-> gamma-> e - - registry.fill(HIST("hMcgenElectronFromPi0Gamma"), particleMc.pt()); - } - } - } - } - if (isEmbPi0 || isEmbEta) { - registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); - isNonHfe = true; - if (isEmbPi0) { - - registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); - } - if (isEmbEta) { - registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); - } - } - } - } - - hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); - } - } - } - PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +namespace o2::aod +{ +// definition of columns and tables for electron selection +namespace hf_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(PTrack, pTrack, float); //! momentum of the electron track +DECLARE_SOA_COLUMN(RapidityTrack, rapidityTrack, float); //! rapidity of the 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(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) +DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) + +// EMCal cluster values +DECLARE_SOA_COLUMN(EnergyEmcCluster, energyEmcCluster, float); //! energy of the EMCal cluster +DECLARE_SOA_COLUMN(EtaEmcCluster, etaEmcCluster, float); //! pseudorapidity of the EMCal cluster +DECLARE_SOA_COLUMN(PhiEmcCluster, phiEmcCluster, float); //! azimuth of the EMCal cluster +DECLARE_SOA_COLUMN(M02EmcCluster, m02EmcCluster, float); //! shower shape long axis of the EMCal cluster +DECLARE_SOA_COLUMN(M20EmcCluster, m20EmcCluster, float); //! shower shape short axis of the EMCal cluster +DECLARE_SOA_COLUMN(NCellsEmcCluster, nCellsEmcCluster, uint8_t); //! number of cells of the EMCal cluster +DECLARE_SOA_COLUMN(TimeEmcCluster, timeEmcCluster, float); //! time of the EMCal cluster (ns) + +DECLARE_SOA_COLUMN(DeltaEtaMatch, deltaEtaMatch, float); //! dEta matched track to EMCal cluster +DECLARE_SOA_COLUMN(DeltaPhiMatch, deltaPhiMatch, float); //! dPhi matched track to EMCal cluster +DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information with Emcal +} // namespace hf_sel_electron +DECLARE_SOA_TABLE(HfSelEl, "AOD", "HFSELEL", //! Electron Informations + hf_sel_electron::CollisionId, + hf_sel_electron::TrackId, + hf_sel_electron::EtaTrack, + hf_sel_electron::PhiTrack, + hf_sel_electron::PtTrack, + hf_sel_electron::PTrack, + hf_sel_electron::RapidityTrack, + hf_sel_electron::DcaXYTrack, + hf_sel_electron::DcaZTrack, + hf_sel_electron::TpcNSigmaElTrack, + hf_sel_electron::TofNSigmaElTrack, + hf_sel_electron::EnergyEmcCluster, + hf_sel_electron::EtaEmcCluster, + hf_sel_electron::PhiEmcCluster, + hf_sel_electron::M02EmcCluster, + hf_sel_electron::M20EmcCluster, + hf_sel_electron::NCellsEmcCluster, + hf_sel_electron::TimeEmcCluster, + hf_sel_electron::DeltaEtaMatch, + hf_sel_electron::DeltaPhiMatch, + hf_sel_electron::IsEmcal); +// 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(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(EopEl, eopEl, float); //! energy momentum ratio of the electron +DECLARE_SOA_COLUMN(M02El, m02El, float); //! M02 of the electron cluster + +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 + hf_corr_sel_electron::CollisionId, + hf_corr_sel_electron::TrackId, + hf_corr_sel_electron::EtaTrack, + hf_corr_sel_electron::PhiTrack, + 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, + hf_corr_sel_electron::NElPairUS, + hf_corr_sel_electron::IsEmcal); + +// definition of columns and tables for Mc Gen HfElectron Selection +namespace hf_mcgen_sel_electron { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} +DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! collisioniD of the electron track +DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track +DECLARE_SOA_COLUMN(EtaTrackMc, etaTrackMc, float); //! pseudorapidity of the electron track +DECLARE_SOA_COLUMN(PhiTrackMc, phiTrackMc, float); //! azimuth of the electron track +DECLARE_SOA_COLUMN(PtTrackMc, ptTrackMc, float); //! transverse momentum of the electron track +DECLARE_SOA_COLUMN(IsNonHfeMc, isNonHfeMc, bool); //! Non-Heavy flavour electron information + +} // namespace hf_mcgen_sel_electron + +DECLARE_SOA_TABLE(HfMcGenSelEl, "AOD", "HFMCGENSELEL", //! Electron Informations + hf_mcgen_sel_electron::McCollisionId, + hf_mcgen_sel_electron::TrackId, + hf_mcgen_sel_electron::EtaTrackMc, + hf_mcgen_sel_electron::PhiTrackMc, + hf_mcgen_sel_electron::PtTrackMc, + hf_mcgen_sel_electron::IsNonHfeMc); +} // namespace o2::aod + +#endif // PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ From 284788bb8fb8da20c590abf0811c3345383dbc8f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 14:26:27 +0530 Subject: [PATCH 20/21] remove linter erro --- .../electronSelectionWithTpcEmcal.cxx | 1125 +++++++++++++++-- 1 file changed, 998 insertions(+), 127 deletions(-) diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index d819332e3ba..74b90d38f6e 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -9,141 +9,1012 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file ElectronSelectionTable.h -/// \brief Definitions of tables produced by Electron Selection - +/// \file electronSelectionWithTpcEmcal.cxx +/// \brief Task used to electron selection with tpc and emcal. /// \author Rashi Gupta , IIT Indore /// \author Ravindra Singh , IIT Indore -#ifndef PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ -#define PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ +#include "PWGHF/HFL/DataModel/ElectronSelectionTable.h" +#include "PWGJE/DataModel/EMCALClusters.h" + +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Tools/KFparticle/KFUtilities.h" +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include #include #include -namespace o2::aod -{ -// definition of columns and tables for electron selection -namespace hf_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(PTrack, pTrack, float); //! momentum of the electron track -DECLARE_SOA_COLUMN(RapidityTrack, rapidityTrack, float); //! rapidity of the 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(TpcNSigmaElTrack, tpcNSigmaElTrack, float); //! tpcNSigma of the electron track(TPC PID) -DECLARE_SOA_COLUMN(TofNSigmaElTrack, tofNSigmaElTrack, float); //! tofNSigma of the electron track(TOF PID) - -// EMCal cluster values -DECLARE_SOA_COLUMN(EnergyEmcCluster, energyEmcCluster, float); //! energy of the EMCal cluster -DECLARE_SOA_COLUMN(EtaEmcCluster, etaEmcCluster, float); //! pseudorapidity of the EMCal cluster -DECLARE_SOA_COLUMN(PhiEmcCluster, phiEmcCluster, float); //! azimuth of the EMCal cluster -DECLARE_SOA_COLUMN(M02EmcCluster, m02EmcCluster, float); //! shower shape long axis of the EMCal cluster -DECLARE_SOA_COLUMN(M20EmcCluster, m20EmcCluster, float); //! shower shape short axis of the EMCal cluster -DECLARE_SOA_COLUMN(NCellsEmcCluster, nCellsEmcCluster, uint8_t); //! number of cells of the EMCal cluster -DECLARE_SOA_COLUMN(TimeEmcCluster, timeEmcCluster, float); //! time of the EMCal cluster (ns) - -DECLARE_SOA_COLUMN(DeltaEtaMatch, deltaEtaMatch, float); //! dEta matched track to EMCal cluster -DECLARE_SOA_COLUMN(DeltaPhiMatch, deltaPhiMatch, float); //! dPhi matched track to EMCal cluster -DECLARE_SOA_COLUMN(IsEmcal, isEmcal, bool); //! electron information with Emcal -} // namespace hf_sel_electron -DECLARE_SOA_TABLE(HfSelEl, "AOD", "HFSELEL", //! Electron Informations - hf_sel_electron::CollisionId, - hf_sel_electron::TrackId, - hf_sel_electron::EtaTrack, - hf_sel_electron::PhiTrack, - hf_sel_electron::PtTrack, - hf_sel_electron::PTrack, - hf_sel_electron::RapidityTrack, - hf_sel_electron::DcaXYTrack, - hf_sel_electron::DcaZTrack, - hf_sel_electron::TpcNSigmaElTrack, - hf_sel_electron::TofNSigmaElTrack, - hf_sel_electron::EnergyEmcCluster, - hf_sel_electron::EtaEmcCluster, - hf_sel_electron::PhiEmcCluster, - hf_sel_electron::M02EmcCluster, - hf_sel_electron::M20EmcCluster, - hf_sel_electron::NCellsEmcCluster, - hf_sel_electron::TimeEmcCluster, - hf_sel_electron::DeltaEtaMatch, - hf_sel_electron::DeltaPhiMatch, - hf_sel_electron::IsEmcal); -// 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(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(EopEl, eopEl, float); //! energy momentum ratio of the electron -DECLARE_SOA_COLUMN(M02El, m02El, float); //! M02 of the electron cluster - -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 - hf_corr_sel_electron::CollisionId, - hf_corr_sel_electron::TrackId, - hf_corr_sel_electron::EtaTrack, - hf_corr_sel_electron::PhiTrack, - 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, - hf_corr_sel_electron::NElPairUS, - hf_corr_sel_electron::IsEmcal); - -// definition of columns and tables for Mc Gen HfElectron Selection -namespace hf_mcgen_sel_electron +using namespace o2; +using namespace o2::constants::physics; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct HfElectronSelectionWithTpcEmcal { + + Produces electronSel; + Produces hfElectronSelection; + Produces hfGenElectronSel; + + // select the emcal or dcal acceptance + enum EMCalRegion { + NoAcceptance = 0, + EMCalAcceptance = 1, + DCalAcceptance = 2 + }; + // Configurables + // EMCal Cluster information + KFParticle kfNonHfe; + Configurable fillEmcClusterInfo{"fillEmcClusterInfo", true, "Fill histograms with EMCal cluster info before and after track match"}; + Configurable fillTrackInfo{"fillTrackInfo", true, "Fill histograms with Track Information info before track match"}; + Configurable skipNoEmcClusters{"skipNoEmcClusters", false, "Skip events with no EMCal clusters"}; + + // select the emcal or dcal acceptance + Configurable emcalRegion{"emcalRegion", 0, "Select EMCal region for filling histograms (see EMCalRegion enum)"}; + + // 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, "Min Transverse MOmentum range for electron tracks"}; + Configurable ptTrackMax{"ptTrackMax", 12.0f, "Max 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"}; + Configurable etaAssoTrackMin{"etaAssoTrackMin", -0.9f, "Eta range for Associatred electron tracks"}; + Configurable ptAssoTrackMin{"ptAssoTrackMin", 0.2f, "Transverse MOmentum range for Associatred electron tracks"}; + Configurable tpcNsigmaAssoElectronMin{"tpcNsigmaAssoElectronMin", -3.0f, "min Associated Electron TPCnsigma"}; + Configurable tpcNsigmaAssoElectronMax{"tpcNsigmaAssoElectronMax", 3.0f, "max Associated Electron TPCnsigma"}; + Configurable invariantMass{"invariantMass", 0.14f, "max Invariant Mass for Photonic electron"}; + Configurable chiSquareMax{"chiSquareMax", 3.0f, "chiSquare on the reconstructed parent particle"}; + + // EMcal and Dcal selection cut + Configurable etaTrackDCalNegativeMax{"etaTrackDCalNegativeMax", -0.22f, "Eta range for electron Dcal tracks"}; + 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 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"}; + + // Track and EMCal Cluster matching cut + Configurable deltaEtaMatchMin{"deltaEtaMatchMin", -0.013f, "Min Eta distance of EMCAL cluster to its closest track"}; + Configurable deltaEtaMatchMax{"deltaEtaMatchMax", 0.0171f, "Max Eta distance of EMCAL cluster to its closest track"}; + Configurable deltaPhiMatchMin{"deltaPhiMatchMin", -0.022f, "Min Phi distance of EMCAL cluster to its closest track"}; + Configurable deltaPhiMatchMax{"deltaPhiMatchMax", 0.028f, "Max Phi distance of EMCAL cluster to its closest track"}; + Configurable timeEmcClusterMax{"timeEmcClusterMax", 50.f, "EMCal Cluster time"}; + + // Inclusive electron selection cut + Configurable eopElectronMin{"eopElectronMin", 0.8f, "Minimum E/p for electron tracks"}; + Configurable eopElectronMax{"eopElectronMax", 1.2f, "Maximum E/p for electron tracks"}; + Configurable m02EmcClusterElectronMax{"m02EmcClusterElectronMax", 0.9f, "max Electron EMCal Cluster M02"}; + Configurable m02EmcClusterElectronMin{"m02EmcClusterElectronMin", 0.02f, "min Electron EMCal Cluster M02"}; + Configurable m20EmcClusterElectronMax{"m20EmcClusterElectronMax", 1000.f, "max Electron EMCal Cluster M20"}; + Configurable m20EmcClusterElectronMin{"m20EmcClusterElectronMin", 0.0f, "min Electron EMCal Cluster M20"}; + 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"}; + + using TableCollisions = o2::soa::Filtered>; + using TableCollision = TableCollisions::iterator; + using TableTracks = o2::soa::Join; + + using McTableCollisions = o2::soa::Filtered>; + using McTableCollision = McTableCollisions::iterator; + using McGenTableCollisions = soa::Join; + using McGenTableCollision = McGenTableCollisions::iterator; + using McTableTracks = soa::Join; + using McTableEmcals = soa::Join; + + Filter collisionFilter = nabs(aod::collision::posZ) < zPvPosMax && aod::collision::numContrib > static_cast(1); + PresliceUnsorted perClusterMatchedTracks = o2::aod::emcalmatchedtrack::trackId; + + // configurable axis + ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; + ConfigurableAxis binsEta{"binsEta", {100, -2.0, 2.}, "#it{#eta}"}; + ConfigurableAxis binsPhi{"binsPhi", {32, 0.0, o2::constants::math::TwoPI}, "#it{#varphi}"}; + ConfigurableAxis binsPt{"binsPt", {50, 0.0, 50}, "#it{p_{T}}(GeV/#it{c})"}; + ConfigurableAxis binsdEdx{"binsdEdx", {160, 0., 160.}, "dE/dX"}; + ConfigurableAxis binsnSigma{"binsnSigma", {30, -15., 15.}, "#it{#sigma_{TPC}}"}; + ConfigurableAxis binsM02{"binsM02", {50, 0., 2.0}, "M02; entries"}; + ConfigurableAxis binsM20{"binsM20", {50, 0., 2.0}, "M20; entries"}; + ConfigurableAxis binsEoP{"binsEoP", {30, 0., 3.}, "e/p"}; + ConfigurableAxis binsEmcEnergy{"binsEmcEnergy", {50, 0., 50.}, "Cluster Energy (GeV/#it{c}^{2})"}; + ConfigurableAxis binsEmcClsNCells{"binsEmcClsNCells", {50, 0., 50.}, "nCells"}; + ConfigurableAxis binsEmcClsTime{"binsEmcClsTime", {1800, -900.0, 900.}, "Cluster Time"}; + ConfigurableAxis binsPassEMcal{"binsPassEMcal", {3, 0.0, 3.}, "Pass EMcal"}; + + ConfigurableAxis binsDeltaEta{"binsDeltaEta", {20, -0.2, 0.2}, "Track Cluser Match #Delta #eta"}; + ConfigurableAxis binsDeltaPhi{"binsDeltaPhi", {20, -0.2, 0.2}, "Track Cluser Match #Delta #varphi"}; + ConfigurableAxis binsMass{"binsMass", {100, 0.0, 2.0}, "Mass (GeV/#it{c}^{2}); entries"}; + + HistogramRegistry registry{ + "registry", + {}}; + + void init(o2::framework::InitContext&) + { + AxisSpec const axisPosZ = {binsPosZ, "Pos Z"}; + AxisSpec axisMass = {binsMass, "Mass (GeV/#it{c}^{2}); entries"}; + AxisSpec axisPt = {binsPt, "#it{p_{T}}(GeV/#it{c})"}; + AxisSpec axisEta = {binsEta, "#it{#eta}"}; + AxisSpec axisPhi = {binsPhi, "#it{#varphi}"}; + AxisSpec axisdEdx = {binsdEdx, "dE/dX"}; + AxisSpec axisnSigma = {binsnSigma, "it{#sigma_{TPC}}"}; + AxisSpec axisM02 = {binsM02, "M02; entries"}; + AxisSpec axisM20 = {binsM20, "M20; entries"}; + AxisSpec axisEoP = {binsEoP, "E/p"}; + AxisSpec axisEmcEnergy = {binsEmcEnergy, "Cluster Energy (GeV/#it{c}^{2})"}; + AxisSpec axisEmcClsNCells = {binsEmcClsNCells, "nCell"}; + AxisSpec axisEmcClsTime = {binsEmcClsTime, "Cluster Time"}; + AxisSpec axisPassEMcal = {binsPassEMcal, "Pass EMcal"}; + AxisSpec axisDeltaEta = {binsDeltaEta, "#Delta #eta = #eta_{trk}- #eta_{cluster}"}; + AxisSpec axisDeltaPhi = {binsDeltaPhi, "#Delta #varphi = #varphi_{trk}- #varphi_{cluster}"}; + + 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_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("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}}}); + 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}}}); + 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}}}); + registry.add("hTrackEnergyLossVsP", " TPC Energy loss info vs P; dE/dx;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisdEdx}, {axisPt}, {axisPassEMcal}}}); + registry.add("hTrackEnergyLossVsPt", "TPC Energy loss info vs Pt; dE/dx;#it{p}_{T} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisdEdx}, {axisPt}, {axisPassEMcal}}}); + registry.add("hTracknSigmaVsP", " TPC nSigma info vs P; n#sigma;#it{p} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisnSigma}, {axisPt}, {axisPassEMcal}}}); + registry.add("hTracknSigmaVsPt", " TPC nSigma info vs Pt; n#sigma;#it{p}_{T} (GeV#it{/c});passEMcal;", {HistType::kTH3F, {{axisnSigma}, {axisPt}, {axisPassEMcal}}}); + registry.add("hEmcClusterEnergy", "EMCal Cluster Info before match Energy; Energy (GeV); entries;", {HistType::kTH1D, {{axisEmcEnergy}}}); + registry.add("hEmcClusterEtaPhi", "EMCal Cluster Info before match Eta and Phi; #eta;#varphi;", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); + registry.add("hEmcClusterEnergyCell", "EMCal Cluster Info before match Energy vs nCells; Energy (GeV);ncell;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsNCells}}}); + registry.add("hEmcClusterEnergyTime", "EMCal Cluster Info before match Energy vs time; Energy (GeV); sec;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsTime}}}); + registry.add("hEmcClusterAfterMatchEnergy", "EMCal Cluster Info After match Energy; Energy (GeV); entries;", {HistType::kTH1D, {{axisEmcEnergy}}}); + registry.add("hEmcClusterAfterMatchEtaPhi", "EMCal Cluster Info After match Eta and Phi; #eta;#varphi;", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); + registry.add("hEmcClusterAfterMatchEnergyCells", "EMCal Cluster Info After match Energy vs nCells; Energy (GeV);ncell;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsNCells}}}); + registry.add("hEmcClusterAfterMatchEnergyTime", "EMCal Cluster Info After match Energy vs time; Energy (GeV); sec;", {HistType::kTH2F, {{axisEmcEnergy}, {axisEmcClsTime}}}); + registry.add("hAfterMatchSigmaVsEoP", "PID Info after match EoP vs Sigma ; E/P;#it{p}_{T} (GeV#it{/c});n#sigma; m02; m20;", {HistType::kTHnSparseF, {{axisEoP}, {axisPt}, {axisnSigma}, {axisM02}, {axisM20}}}); + registry.add("hAfterMatchEoPVsP", "PID Info after match EoP vs P; E/P;#it{p} (GeV#it{/c});", {HistType::kTH2F, {{axisEoP}, {axisPt}}}); + registry.add("hAfterMatchSigmaVsP", "PID Info after match Sigma vs Momentum ; n#sigma; #it{p} (GeV#it{/c}; ", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + registry.add("hAfterMatchEtaPhi", "PID Info after match Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); + registry.add("hAfterMatchEnergyLossVsP", "PID Info after match Energy loss info vs P ; dE/dx;#it{p} (GeV#it{/c});; ", {HistType::kTH2F, {{axisdEdx}, {axisPt}}}); + registry.add("hAfterMatchEnergyLossVsPt", "PID Info after match Energy loss info vs Pt ;dE/dx;#it{p}_{T} (GeV#it{/c}); ", {HistType::kTH2F, {{axisdEdx}, {axisPt}}}); + + registry.add("hAfterPIDEtaPhi", "PID Info after PID Cuts Eta vs Phi ; #eta; #varphi; ", {HistType::kTH2F, {{axisEta}, {axisPhi}}}); + registry.add("hEPRatioAfterPID", "E/P Ratio after PID Cuts apply only trackwodca filter", {HistType::kTH2F, {{axisPt}, {axisEmcEnergy}}}); + + registry.add("hPIDAfterPIDCuts", "PID Info after PID cuts; E/P;#it{p}_{T} (GeV#it{/c});n#sigma;m02; m20;", {HistType::kTHnSparseF, {{axisEoP}, {axisPt}, {axisnSigma}, {axisM02}, {axisM20}}}); + registry.add("hEmcClsTrkEtaPhiDiffTime", "EmcClsTrkEtaPhiDiffTime;#Delta#eta;#Delta#varphi;Sec;", {HistType::kTH3F, {{axisDeltaEta}, {axisDeltaPhi}, {axisEmcClsTime}}}); + registry.add("hTofNSigmaVsPt", " TOF nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + registry.add("hTpcNSigmaVsPt", " TPC nSigma vs pt; n#sigma;#it{pt} (GeV/#it{c});", {HistType::kTH2F, {{axisnSigma}, {axisPt}}}); + } + // Track Selection Cut + template + bool selTracks(T const& track) + { + 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) { + return false; + } + if (track.eta() < etaTrackMin || track.eta() > etaTrackMax) { + return false; + } + if ((track.phi() < phiTrackEMCalMin || track.phi() > phiTrackEMCalMax) && (track.phi() < phiTrackDCalMin || track.phi() > phiTrackDCalMax)) { + return false; + } + if (track.pt() < ptTrackMin || track.pt() > ptTrackMax) { + return false; + } + return true; + } + // Associated electron Selection Cut + template + bool selAssoTracks(T const& track) + { + if (!track.isGlobalTrackWoDCA()) { + return false; + } + if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + return false; + } + if (track.eta() < etaAssoTrackMin || track.eta() > etaAssoTrackMax) { + return false; + } + + if (track.pt() < ptAssoTrackMin) { + return false; + } + if (track.tpcNSigmaEl() < tpcNsigmaAssoElectronMin || track.tpcNSigmaEl() > tpcNsigmaAssoElectronMax) { + return false; + } + + return true; + } + + // mc gen particle selection cut + template + bool mcGensel(T const& track) + { + if (track.eta() < etaTrackMin || track.eta() > etaTrackMax) { + return false; + } + if ((track.phi() < phiTrackEMCalMin || track.phi() > phiTrackEMCalMax) && (track.phi() < phiTrackDCalMin || track.phi() > phiTrackDCalMax)) { + return false; + } + if (track.pt() < ptTrackMin) { + return false; + } + return true; + } + // nonHfe Identification + + template + void nonHfe(ElectronType const& electron, TracksType const& tracks, McParticleType const& mcparticles, 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) { + if (pTrack.globalIndex() == electron.globalIndex()) { + continue; + } + // Apply partner electron selection + + if (!selAssoTracks(pTrack)) { + continue; + } + if (electron.pt() <= pTrack.pt()) { + continue; + } + int pdgE1 = kElectron; + int pdgE2 = kElectron; + if (electron.sign() > 0) { + pdgE1 = kPositron; + } + + if (pTrack.sign() > 0) { + pdgE2 = kPositron; + } + + KFPTrack const kfpTrack = createKFPTrackFromTrack(electron); + KFPTrack const kfpAssociatedTrack = createKFPTrackFromTrack(pTrack); + KFParticle const kfTrack(kfpTrack, pdgE1); + KFParticle const kfAssociatedTrack(kfpAssociatedTrack, pdgE2); + const KFParticle* electronPairs[2] = {&kfTrack, &kfAssociatedTrack}; + kfNonHfe.SetConstructMethod(2); + kfNonHfe.Construct(electronPairs, 2); + + int const ndf = kfNonHfe.GetNDF(); + double const chi2recg = kfNonHfe.GetChi2() / ndf; + if (ndf < 1.0) { + continue; + } + + if (std::sqrt(std::abs(chi2recg)) > chiSquareMax) { + continue; + } + + invMassElectron = RecoDecay::m(std::array{pTrack.pVector(), electron.pVector()}, std::array{MassElectron, MassElectron}); + bool isLSElectron = false; + bool isULSElectron = false; + // for like charge + if (pTrack.sign() == electron.sign()) { + massLike = invMassElectron; + vecLSMass.push_back(massLike); + isLSElectron = true; + if (isEMcal) { + registry.fill(HIST("hLikeMass_EMCAL"), massLike); + } 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; + 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()) == 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()) == kEta) { + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(motherAsso.pdgCode()) == kPi0) { + + if (std::abs(gmotherAsso.pdgCode()) == kEta) { + 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()) == kEta) { + + isEmbEta = true; // eta->gamma-> e + } + if (std::abs(gmotherAsso.pdgCode()) == kPi0) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + + if (std::abs(ggmotherAsso.pdgCode()) == kEta) { + + 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; + 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()) == 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()) == kEta) { + + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(motherAsso.pdgCode()) == kPi0) { + + if (std::abs(gmotherAsso.pdgCode()) == kEta) { + + 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()) == kEta) { + + isEmbEta = true; // eta->gamma-> e + } + if (std::abs(gmotherAsso.pdgCode()) == kPi0) { + + auto const& ggmotherAsso = gmotherAsso.template mothers_first_as(); + + if (std::abs(ggmotherAsso.pdgCode()) == kEta) { + 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 + if (isLSElectron && (invMassElectron <= invariantMass)) { + massLike = invMassElectron; + ++nElPairsLS; + if (isEMcal) { + registry.fill(HIST("hLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hLikeSignPt_NoEMCAL"), electron.pt()); + } + } + // for unlike charge + if (isULSElectron && (invMassElectron <= invariantMass)) { + massUnLike = invMassElectron; + ++nElPairsUS; + if (isEMcal) { + registry.fill(HIST("hUnLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hUnLikeSignPt_NoEMCAL"), electron.pt()); + } + } + } + + // Pass multiplicities and other required parameters for this electron + 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(), eop, m02, vecLSMass, vecULSMass, nElPairsLS, nElPairsUS, isEMcal); + } + // Electron Identification + template + void fillElectronTrack(CollisionType const& collision, TracksType const& tracks, EmcClusterType const& emcClusters, MatchType const& matchedTracks, ParticleType const& mcparticles) + { + if (sel8Minibias && !(isRun3 ? collision.sel8() : (collision.sel7() && collision.alias_bit(kINT7)))) { + return; + } + + registry.fill(HIST("hNevents"), emcalRegion.value); + + // skip events with no clusters + if (emcClusters.size() == 0 && skipNoEmcClusters) { + return; + } + registry.fill(HIST("hZvertex"), collision.posZ()); + registry.fill(HIST("hNeventsAfterPassEmcal"), static_cast(emcalRegion)); + ///////////////////////////////// + // EMCal cluster info before match /// + /////////////////////////////// + if (fillEmcClusterInfo) { + for (const auto& emcClusterBefore : emcClusters) { + registry.fill(HIST("hEmcClusterEnergy"), emcClusterBefore.energy()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterEtaPhi"), emcClusterBefore.eta(), emcClusterBefore.phi()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterEnergyCell"), emcClusterBefore.energy(), emcClusterBefore.nCells()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterEnergyTime"), emcClusterBefore.energy(), emcClusterBefore.time()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterM02"), emcClusterBefore.m02()); + registry.fill(HIST("hEmcClusterM20"), emcClusterBefore.m20()); + } + } + EMCalRegion passEMCal = NoAcceptance; + float phiTrack = -999; + float etaTrack = -999; + float pTrack = -999; + float ptTrack = -999; + float dcaxyTrack = -999; + float dcazTrack = -999; + float tpcNsigmaTrack = -999; + + for (const auto& track : tracks) { + phiTrack = track.phi(); + etaTrack = track.eta(); + pTrack = track.p(); + ptTrack = track.pt(); + dcaxyTrack = track.dcaXY(); + dcazTrack = track.dcaZ(); + tpcNsigmaTrack = track.tpcNSigmaEl(); + // Apply Track Selection + if (!selTracks(track)) { + continue; + } + if ((phiTrack > phiTrackEMCalMin && phiTrack < phiTrackEMCalMax) && (etaTrack > etaTrackMin && etaTrack < etaTrackMax)) { + passEMCal = EMCalAcceptance; // EMcal acceptance passed + } + if ((phiTrack > phiTrackDCalMin && phiTrack < phiTrackDCalMax) && ((etaTrack > etaTrackDCalPositiveMin && etaTrack < etaTrackDCalPositiveMax) || (etaTrack > etaTrackDCalNegativeMin && etaTrack < etaTrackDCalNegativeMax))) { + passEMCal = DCalAcceptance; // Dcal acceptance passed + } + + if (fillTrackInfo) { + // 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 + registry.fill(HIST("hTracknSigmaVsPt"), tpcNsigmaTrack, ptTrack, passEMCal); // track etaphi infor after filter bit + } + auto tracksofcluster = matchedTracks.sliceBy(perClusterMatchedTracks, track.globalIndex()); + float phiMatchTrack = -999; + float etaMatchTrack = -999; + float pMatchTrack = -999; + float ptMatchTrack = -999; + float tpcNsigmaMatchTrack = -999; + float phiMatchEmcCluster = -999; + float etaMatchEmcCluster = -999; + float eMatchEmcCluster = -999; + float m02MatchEmcCluster = -999; + float m20MatchEmcCluster = -999; + float timeEmcCluster = -999; + float cellEmcCluster = -999; + float deltaPhiMatch = -999.; + float deltaEtaMatch = -999.; + float eop = -999; + bool const isEMcal = false; + + float trackRapidity = track.rapidity(MassElectron); + + for (const auto& ematchTrack : tracksofcluster) { + + auto matchTrack = ematchTrack.template track_as(); + + auto emcCluster = ematchTrack.template emcalcluster_as(); + + phiMatchTrack = matchTrack.phi(); + etaMatchTrack = matchTrack.eta(); + pMatchTrack = matchTrack.p(); + ptMatchTrack = matchTrack.pt(); + tpcNsigmaMatchTrack = matchTrack.tpcNSigmaEl(); + phiMatchEmcCluster = emcCluster.phi(); + etaMatchEmcCluster = emcCluster.eta(); + eMatchEmcCluster = emcCluster.energy(); + m02MatchEmcCluster = emcCluster.m02(); + m20MatchEmcCluster = emcCluster.m20(); + timeEmcCluster = emcCluster.time(); + cellEmcCluster = emcCluster.nCells(); + + deltaPhiMatch = ematchTrack.deltaPhi(); + deltaEtaMatch = ematchTrack.deltaEta(); + + // Track and EMCal cluster Matching + if (std::abs(timeEmcCluster) > timeEmcClusterMax) { + continue; + } + if (deltaPhiMatch < deltaPhiMatchMin || deltaPhiMatch > deltaPhiMatchMax || deltaEtaMatch < deltaEtaMatchMin || deltaEtaMatch > deltaEtaMatchMax) { + continue; + } + + registry.fill(HIST("hEmcClsTrkEtaPhiDiffTime"), deltaEtaMatch, deltaPhiMatch, timeEmcCluster); + + if (fillEmcClusterInfo) { + registry.fill(HIST("hEmcClusterAfterMatchEnergy"), emcCluster.energy()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterAfterMatchEtaPhi"), emcCluster.eta(), emcCluster.phi()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterAfterMatchEnergyCells"), emcCluster.energy(), emcCluster.nCells()); // track etaphi infor after filter bit + registry.fill(HIST("hEmcClusterAfterMatchEnergyTime"), emcCluster.energy(), emcCluster.time()); // track etaphi infor after filter bit + } + + eop = eMatchEmcCluster / pMatchTrack; + + registry.fill(HIST("hAfterMatchSigmaVsEoP"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster); + registry.fill(HIST("hAfterMatchEoPVsP"), eop, pMatchTrack); + registry.fill(HIST("hAfterMatchSigmaVsP"), tpcNsigmaMatchTrack, pMatchTrack); + registry.fill(HIST("hAfterMatchEtaPhi"), etaMatchTrack, phiMatchTrack); + registry.fill(HIST("hAfterMatchEnergyLossVsP"), matchTrack.tpcSignal(), pMatchTrack); + registry.fill(HIST("hAfterMatchEnergyLossVsPt"), matchTrack.tpcSignal(), ptMatchTrack); + // Apply Electron Identification cuts + + if ((tpcNsigmaMatchTrack < tpcNsigmaElectronMin || tpcNsigmaMatchTrack > tpcNsigmaElectronMax) || (m02MatchEmcCluster < m02EmcClusterElectronMin || m02MatchEmcCluster > m02EmcClusterElectronMax) || (m20MatchEmcCluster < m20EmcClusterElectronMin || m20MatchEmcCluster > m20EmcClusterElectronMax)) { + continue; + } + + registry.fill(HIST("hPIDAfterPIDCuts"), eop, ptMatchTrack, tpcNsigmaMatchTrack, m02MatchEmcCluster, m20MatchEmcCluster); + registry.fill(HIST("hEPRatioAfterPID"), pMatchTrack, eMatchEmcCluster); + registry.fill(HIST("hAfterPIDEtaPhi"), etaMatchTrack, phiMatchTrack); + if (eop < eopElectronMin || eop > eopElectronMax) { + 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; + 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()) == 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()) == kEta) { + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + + } else { + isEmbPi0 = true; // pi0 -> e + } + } + + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + + 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()) == kEta) { + + isEmbEta = true; // eta->pi0->gamma-> e + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + } + } + } + if (!(isEmbPi0 || isEmbEta)) { + continue; + } + nonHfe(matchTrack, tracks, mcparticles, eop, m02MatchEmcCluster, true); + } + } + } + } + } + + ///////////////// NonHf electron Selection without Emcal //////////////////////// + electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(), + eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal); + } + /// Electron information without Emcal and use TPC and TOF + if (isEMcal) { + continue; + } + if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) { + continue; + } + registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt()); + registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt()); + + if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { + continue; + } + registry.fill(HIST("hphiElectron"), track.phi()); + if constexpr (IsMc) { + if (track.has_mcParticle()) { + auto mcParticle = track.template mcParticle_as(); + if (std::abs(mcParticle.pdgCode()) == kElectron) { + registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt()); + bool isEmbEta = false; + bool isEmbPi0 = false; + 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()) == 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()) == kEta) { + + isEmbEta = true; + } + + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + + } else { + isEmbPi0 = true; // pi0 -> e + } + } + + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + + 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()) == kEta) { + isEmbEta = true; // eta->pi0->gamma-> e + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + } + } + } + if (!(isEmbPi0 || isEmbEta)) { + continue; + } + + nonHfe(track, tracks, mcparticles, eop, m02MatchEmcCluster, 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); + } + } + + /// Electron selection - for real data and data-like analysis + void processData(TableCollision const& collision, + TableTracks const& tracks, + aod::EMCALClusters const& emcClusters, + o2::aod::EMCALMatchedTracks const& matchedTracks) + { + fillElectronTrack(collision, tracks, emcClusters, matchedTracks, 0); + } + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processData, "process Data info only", true); + /// Electron selection - for MC reco-level analysis + void processMcRec(McTableCollision const& mcCollision, + McTableTracks const& mcTracks, + McTableEmcals const& mcEmcClusters, + o2::aod::EMCALMatchedTracks const& matchedTracks, + aod::McParticles const& mcParticles) + { + fillElectronTrack(mcCollision, mcTracks, mcEmcClusters, matchedTracks, mcParticles); + } + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcRec, "Process MC Reco mode", false); + + void processMcGen(McGenTableCollision const& mcCollision, aod::McParticles const& mcParticles) + { + + bool isNonHfe = false; + + for (const auto& particleMc : mcParticles) { + + if (!mcGensel(particleMc)) { + continue; + } + + if (std::abs(particleMc.pdgCode()) == kElectron) { + + registry.fill(HIST("hMcgenInElectron"), particleMc.pt()); + bool isEmbEta = false; + bool isEmbPi0 = false; + + // Check first mother + if (particleMc.has_mothers()) { + auto const& mother = particleMc.mothers_first_as(); + 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()) == kEta) { + + isEmbEta = true; + registry.fill(HIST("hMcgenElectronFromEta"), particleMc.pt()); + } + + //================= eta->pi0->e ====================================== + + if (std::abs(mother.pdgCode()) == kPi0) { + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + registry.fill(HIST("hMcgenElectronFromPi0Eta"), particleMc.pt()); + + } else { + isEmbPi0 = true; // pi0 -> e + registry.fill(HIST("hMcgenElectronFromPi0"), particleMc.pt()); + } + } + + /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ + if (std::abs(mother.pdgCode()) == kGamma) { + + if (std::abs(gmother.pdgCode()) == kEta) { + + isEmbEta = true; // eta->gamma-> e + + registry.fill(HIST("hMcgenElectronFromEtaGamma"), particleMc.pt()); + } + if (std::abs(gmother.pdgCode()) == kPi0) { + + if (gmother.has_mothers()) { + auto const& ggmother = gmother.mothers_first_as(); + if (std::abs(ggmother.pdgCode()) == kEta) { + + isEmbEta = true; // eta->pi0->gamma-> e + + registry.fill(HIST("hMcgenElectronFromEtaPi0Gamma"), particleMc.pt()); + + } else { + isEmbPi0 = true; // pi0-> gamma-> e + + registry.fill(HIST("hMcgenElectronFromPi0Gamma"), particleMc.pt()); + } + } + } + } + if (isEmbPi0 || isEmbEta) { + registry.fill(HIST("hMcgenNonHfeElectron"), particleMc.pt()); + isNonHfe = true; + if (isEmbPi0) { + + registry.fill(HIST("hPi0eEmbTrkPt"), particleMc.pt()); + } + if (isEmbEta) { + registry.fill(HIST("hEtaeEmbTrkPt"), particleMc.pt()); + } + } + } + } + + hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); + } + } + } + PROCESS_SWITCH(HfElectronSelectionWithTpcEmcal, processMcGen, "Process MC Gen mode", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { -DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! collisioniD of the electron track -DECLARE_SOA_INDEX_COLUMN(Track, track); //! trackid of of the electron track -DECLARE_SOA_COLUMN(EtaTrackMc, etaTrackMc, float); //! pseudorapidity of the electron track -DECLARE_SOA_COLUMN(PhiTrackMc, phiTrackMc, float); //! azimuth of the electron track -DECLARE_SOA_COLUMN(PtTrackMc, ptTrackMc, float); //! transverse momentum of the electron track -DECLARE_SOA_COLUMN(IsNonHfeMc, isNonHfeMc, bool); //! Non-Heavy flavour electron information - -} // namespace hf_mcgen_sel_electron - -DECLARE_SOA_TABLE(HfMcGenSelEl, "AOD", "HFMCGENSELEL", //! Electron Informations - hf_mcgen_sel_electron::McCollisionId, - hf_mcgen_sel_electron::TrackId, - hf_mcgen_sel_electron::EtaTrackMc, - hf_mcgen_sel_electron::PhiTrackMc, - hf_mcgen_sel_electron::PtTrackMc, - hf_mcgen_sel_electron::IsNonHfeMc); -} // namespace o2::aod - -#endif // PWGHF_HFL_DATAMODEL_ELECTRONSELECTIONTABLE_H_ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 0676d7e41b1c69f527468c0c4ddaa10985104a16 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 5 May 2026 14:30:51 +0530 Subject: [PATCH 21/21] remove clang 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 74b90d38f6e..c274de08037 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -86,7 +86,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, "Min Transverse MOmentum range for electron tracks"}; - Configurable ptTrackMax{"ptTrackMax", 12.0f, "Max Transverse MOmentum range for electron tracks"}; + Configurable ptTrackMax{"ptTrackMax", 12.0f, "Max 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"};