diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index c39a16ea784..8ecdae30df1 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -518,22 +518,57 @@ 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 { -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, 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 +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); diff --git a/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorHfeHadrons.cxx index 093ba4c8666..544559ca89e 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}; diff --git a/PWGHF/HFL/DataModel/ElectronSelectionTable.h b/PWGHF/HFL/DataModel/ElectronSelectionTable.h index 2fd0bea9957..4906b01d229 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, diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index e3a571d3bdd..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; @@ -81,13 +79,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"}; @@ -125,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; @@ -198,6 +201,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 +218,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 +262,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 +332,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& 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) { @@ -363,17 +397,173 @@ 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; + 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 @@ -397,15 +587,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,105 +735,74 @@ 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; - + 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 (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(mother.pdgCode()) == kEta) { + 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; - } + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + + } else { isEmbPi0 = true; // pi0 -> e } - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0-> e - } - } } /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->gamma-> e - } + if (std::abs(gmother.pdgCode()) == kEta) { + + isEmbEta = true; // eta->gamma-> e } if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + + 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 (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,100 +826,68 @@ 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; - + 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 (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; - } + 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; - } + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + + } else { isEmbPi0 = true; // pi0 -> e } - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->pi0-> e - } - } } /// ==================================== eta->gamma->e and eta->pi0->gamma->e============ if (std::abs(mother.pdgCode()) == kGamma) { - if (std::abs(gmother.pdgCode()) == kEtaLocal) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } - isEmbEta = true; // eta->gamma-> e - } + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->gamma-> e } if (std::abs(gmother.pdgCode()) == kPi0) { - if (gmother.isPhysicalPrimary() || gmother.has_mothers()) { - auto const& ggmother = gmother.template mothers_first_as(); - if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) || - (std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) { - continue; - } + + 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 (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); @@ -791,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()); @@ -805,80 +934,60 @@ 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 (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; - } + 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; - } + + if (std::abs(gmother.pdgCode()) == kEta) { + isEmbEta = true; // eta->pi0-> e + registry.fill(HIST("hMcgenElectronFromPi0Eta"), particleMc.pt()); + + } else { isEmbPi0 = true; // pi0 -> e - } - 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 - } + 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()) == 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 - } + 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.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 - } + 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 - } + 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()); } } } @@ -896,6 +1005,7 @@ struct HfElectronSelectionWithTpcEmcal { } } } + hfGenElectronSel(mcCollision.globalIndex(), particleMc.globalIndex(), particleMc.eta(), particleMc.phi(), particleMc.pt(), isNonHfe); } }