diff --git a/PWGEM/Dilepton/DataModel/lmeeMLTables.h b/PWGEM/Dilepton/DataModel/lmeeMLTables.h index 149333eb33a..e8eb1a58458 100644 --- a/PWGEM/Dilepton/DataModel/lmeeMLTables.h +++ b/PWGEM/Dilepton/DataModel/lmeeMLTables.h @@ -220,7 +220,10 @@ DECLARE_SOA_COLUMN(RapidityV0, rapidityV0, float); //! rapidity of associated V0 DECLARE_SOA_COLUMN(RapidityC, rapidityC, float); //! rapidity of associated Cascade DECLARE_SOA_COLUMN(ImpParXY, impParXY, float); //! impact parameter for V0/Cascade in XY plane -DECLARE_SOA_COLUMN(ImpParXYErr, impParXYErr, float); //! sigma of impact parameter for V0/Cascade in XY plane +DECLARE_SOA_COLUMN(ImpParZ, impParZ, float); //! impact parameter for V0/Cascade in XY plane +DECLARE_SOA_COLUMN(ImpParCYY, impParCYY, float); //! sigma of impact parameter for V0/Cascade in XY plane +DECLARE_SOA_COLUMN(ImpParCZY, impParCZY, float); //! sigma of impact parameter for V0/Cascade in XY plane +DECLARE_SOA_COLUMN(ImpParCZZ, impParCZZ, float); //! sigma of impact parameter for V0/Cascade in XY plane DECLARE_SOA_COLUMN(V0CosPA, v0copa, float); //! cosPA of V0 DECLARE_SOA_COLUMN(V0CosPAXY, v0copaXY, float); //! cosPA of V0 in XY plane @@ -263,24 +266,26 @@ using EMMLLHPair = EMMLLHPairs::iterator; DECLARE_SOA_TABLE(EMMLLV0Pairs, "AOD", "EMMLLV0PAIR", //! emmllhpair::EMMLLeptonId, track::Pt, emmllhpair::RapidityV0, - emmllhpair::V0CosPA, emmllhpair::V0CosPAXY, emmllhpair::ImpParXY, emmllhpair::ImpParXYErr, + emmllhpair::V0CosPA, emmllhpair::V0CosPAXY, + emmllhpair::ImpParXY, emmllhpair::ImpParZ, emmllhpair::ImpParCYY, emmllhpair::ImpParCZY, emmllhpair::ImpParCZZ, emmllhpair::Mass, emmllhpair::DcaLH, emmllhpair::CosPA, emmllhpair::CosPAXY, emmllhpair::Lxyz, emmllhpair::LxyzSigma, emmllhpair::Lxy, emmllhpair::LxySigma, emmllhpair::Lz, emmllhpair::LzSigma, - emmllhpair::PdgCodeH, emmllhpair::FoundCommonMother); + emmllhpair::PdgCodeH, emmllhpair::PdgCodeIM, emmllhpair::FoundCommonMother); // iterators using EMMLLV0Pair = EMMLLV0Pairs::iterator; DECLARE_SOA_TABLE(EMMLLCascPairs, "AOD", "EMMLLCAPAIR", //! emmllhpair::EMMLLeptonId, track::Pt, emmllhpair::RapidityC, - emmllhpair::CascCosPA, emmllhpair::CascCosPAXY, emmllhpair::ImpParXY, emmllhpair::ImpParXYErr, + emmllhpair::CascCosPA, emmllhpair::CascCosPAXY, + emmllhpair::ImpParXY, emmllhpair::ImpParZ, emmllhpair::ImpParCYY, emmllhpair::ImpParCZY, emmllhpair::ImpParCZZ, emmllhpair::Mass, emmllhpair::DcaLH, emmllhpair::CosPA, emmllhpair::CosPAXY, emmllhpair::Lxyz, emmllhpair::LxyzSigma, emmllhpair::Lxy, emmllhpair::LxySigma, emmllhpair::Lz, emmllhpair::LzSigma, - emmllhpair::PdgCodeH, emmllhpair::FoundCommonMother); + emmllhpair::PdgCodeH, emmllhpair::PdgCodeIM, emmllhpair::FoundCommonMother); // iterators using EMMLLCascPair = EMMLLCascPairs::iterator; diff --git a/PWGEM/Dilepton/Tasks/taggingHFE.cxx b/PWGEM/Dilepton/Tasks/taggingHFE.cxx index cc144ec335d..4306fcf48b3 100644 --- a/PWGEM/Dilepton/Tasks/taggingHFE.cxx +++ b/PWGEM/Dilepton/Tasks/taggingHFE.cxx @@ -72,6 +72,9 @@ using namespace o2::constants::physics; using namespace o2::aod::pwgem::dilepton::utils::mcutil; struct taggingHFE { + using MyBCs = soa::Join; + using MyBC = MyBCs::iterator; + using MyCollisions = soa::Join; using MyCollisionsWithMCLabel = soa::Join; @@ -101,6 +104,7 @@ struct taggingHFE { Configurable cfgPdgLepton{"cfgPdgLepton", 11, "pdg code of desired lepton: 11 or 13"}; Configurable cfgDownSampling{"cfgDownSampling", 1.1, "down sampling for wrongly found SV"}; Configurable useTOFNSigmaDeltaBC{"useTOFNSigmaDeltaBC", true, "Flag to shift delta BC for TOF n sigma (only with TTCA)"}; + Configurable cfgApplyBCShiftTOF{"cfgApplyBCShiftTOF", true, "apply bc shift for TOF n sigma of track from v0 or cascade"}; struct : ConfigurableGroup { std::string prefix = "dcaFitterGroup_eK"; @@ -176,12 +180,14 @@ struct taggingHFE { struct : ConfigurableGroup { std::string prefix = "v0Cut"; - Configurable cfg_min_mass_k0s{"cfg_min_mass_k0s", 0.49, "min mass for K0S"}; + Configurable cfg_min_mass_k0s{"cfg_min_mass_k0s", 0.48, "min mass for K0S"}; Configurable cfg_max_mass_k0s{"cfg_max_mass_k0s", 0.51, "max mass for K0S"}; - Configurable cfg_min_mass_k0s_veto{"cfg_min_mass_k0s_veto", 0.47, "min mass for K0S veto for Lambda"}; - Configurable cfg_max_mass_k0s_veto{"cfg_max_mass_k0s_veto", 0.52, "max mass for K0S veto for Lambda"}; - Configurable cfg_min_mass_lambda{"cfg_min_mass_lambda", 1.113, "min mass for Lambda"}; - Configurable cfg_max_mass_lambda{"cfg_max_mass_lambda", 1.118, "max mass for Lambda"}; + Configurable cfg_min_mass_k0s_veto{"cfg_min_mass_k0s_veto", 0.48, "min mass for K0S veto for Lambda"}; + Configurable cfg_max_mass_k0s_veto{"cfg_max_mass_k0s_veto", 0.51, "max mass for K0S veto for Lambda"}; + Configurable cfg_min_mass_lambda{"cfg_min_mass_lambda", 1.11, "min mass for Lambda"}; + Configurable cfg_max_mass_lambda{"cfg_max_mass_lambda", 1.12, "max mass for Lambda"}; + Configurable cfg_min_mass_lambda_veto{"cfg_min_mass_lambda_veto", 1.11, "min mass for Lambda veto for K0S"}; + Configurable cfg_max_mass_lambda_veto{"cfg_max_mass_lambda_veto", 1.12, "max mass for Lambda veto for K0S"}; Configurable cfg_min_cospa{"cfg_min_cospa", 0.95, "min cospa for v0"}; Configurable cfg_max_dca2legs{"cfg_max_dca2legs", 0.1, "max distance between 2 legs for v0"}; // Configurable cfg_min_radius{"cfg_min_radius", 0.1, "min rxy for v"}; @@ -195,14 +201,23 @@ struct taggingHFE { Configurable cfg_min_ncluster_itsib{"cfg_min_ncluster_itsib", 0, "min ncluster itsib"}; Configurable cfg_min_dcaxy{"cfg_min_dcaxy", 0.1, "min dca XY for v0 legs in cm"}; + Configurable cfg_max_alpha_veto{"cfg_max_alpha_veto", 0.95, "max alpha for photon conversion rejection"}; + Configurable cfg_max_qt_veto{"cfg_max_qt_veto", 0.01, "max qT for photon conversion rejection"}; + + // for both v0 and cascade Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -3, "min n sigma pi in TPC"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3, "max n sigma pi in TPC"}; + Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3, "min n sigma ka in TPC"}; + Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3, "max n sigma ka in TPC"}; Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3, "min n sigma pr in TPC"}; Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3, "max n sigma pr in TPC"}; Configurable cfg_min_TOFNsigmaPi{"cfg_min_TOFNsigmaPi", -3, "min n sigma pi in TOF"}; Configurable cfg_max_TOFNsigmaPi{"cfg_max_TOFNsigmaPi", +3, "max n sigma pi in TOF"}; + Configurable cfg_min_TOFNsigmaKa{"cfg_min_TOFNsigmaKa", -3, "min n sigma ka in TOF"}; + Configurable cfg_max_TOFNsigmaKa{"cfg_max_TOFNsigmaKa", +3, "max n sigma ka in TOF"}; Configurable cfg_min_TOFNsigmaPr{"cfg_min_TOFNsigmaPr", -3, "min n sigma pr in TOF"}; Configurable cfg_max_TOFNsigmaPr{"cfg_max_TOFNsigmaPr", +3, "max n sigma pr in TOF"}; + Configurable applyTOFif{"applyTOFif", false, "apply TOFif for hadron identification"}; } v0Cut; struct : ConfigurableGroup { @@ -352,7 +367,8 @@ struct taggingHFE { o2::dataformats::DCA mDcaInfoCov; o2::dataformats::VertexBase mVtx; - void initCCDB(aod::BCsWithTimestamps::iterator const& bc) + template + void initCCDB(TBC const& bc) { if (mRunNumber == bc.runNumber()) { return; @@ -447,6 +463,10 @@ struct taggingHFE { fRegistry.add("V0/hMassK0S", "K0S mass;m_{#pi#pi} (GeV/c^{2})", kTH1F, {{100, 0.45, 0.55}}, false); fRegistry.add("V0/hMassLambda", "Lambda mass;m_{p#pi^{#minus}} (GeV/c^{2})", kTH1F, {{100, 1.08, 1.18}}, false); fRegistry.add("V0/hMassAntiLambda", "Anti-Lambda mass;m_{#bar{p}#pi^{+}} (GeV/c^{2})", kTH1F, {{100, 1.08, 1.18}}, false); + fRegistry.add("V0/hMassGamma_misid", "#gamma mass;m_{ee} (GeV/c^{2})", kTH1F, {{100, 0, 0.1}}, false); + fRegistry.add("V0/hMassK0S_misid", "K0S mass;m_{#pi#pi} (GeV/c^{2})", kTH1F, {{100, 0.45, 0.55}}, false); + fRegistry.add("V0/hMassLambda_misid", "Lambda mass;m_{p#pi^{#minus}} (GeV/c^{2})", kTH1F, {{100, 1.08, 1.18}}, false); + fRegistry.add("V0/hMassAntiLambda_misid", "Anti-Lambda mass;m_{#bar{p}#pi^{+}} (GeV/c^{2})", kTH1F, {{100, 1.08, 1.18}}, false); // for cascade fRegistry.add("Cascade/hPt", "pT of V0;p_{T} (GeV/c)", kTH1F, {{100, 0, 10}}, false); @@ -458,6 +478,8 @@ struct taggingHFE { fRegistry.add("Cascade/hMassLambda", "Lambda mass;m_{p#pi^{-}} (GeV/c^{2})", kTH1F, {{100, 1.08, 1.18}}, false); fRegistry.add("Cascade/hMassXi", "#Xi mass;m_{#Lambda#pi} (GeV/c^{2})", kTH1F, {{100, 1.27, 1.37}}, false); fRegistry.add("Cascade/hMassOmega", "#Omega mass;m_{#LambdaK} (GeV/c^{2})", kTH1F, {{100, 1.62, 1.72}}, false); + fRegistry.add("Cascade/hMassXi_misid", "#Xi mass;m_{#Lambda#pi} (GeV/c^{2})", kTH1F, {{100, 1.27, 1.37}}, false); + fRegistry.add("Cascade/hMassOmega_misid", "#Omega mass;m_{#LambdaK} (GeV/c^{2})", kTH1F, {{100, 1.62, 1.72}}, false); } template @@ -480,32 +502,114 @@ struct taggingHFE { return (is_pi_included_TPC && is_pi_included_TOF) || (is_ka_included_TPC && is_ka_included_TOF) || (is_pr_included_TPC && is_pr_included_TOF); } - template - bool isPion(TTrack const& track) + template + bool isPionFromK0S(TCollision const& collision, TTrack const& track) { - // TOFif + float tofNSigmaPi = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::K0, o2::track::PID::Pion)]; bool is_pi_included_TPC = v0Cut.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < v0Cut.cfg_max_TPCNsigmaPi; - bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < track.tofNSigmaPi() && track.tofNSigmaPi() < v0Cut.cfg_max_TOFNsigmaPi) : true; + bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < tofNSigmaPi && tofNSigmaPi < v0Cut.cfg_max_TOFNsigmaPi) : true; + if (!v0Cut.applyTOFif) { + is_pi_included_TOF = true; + } return is_pi_included_TPC && is_pi_included_TOF; } - template - bool isKaon(TTrack const& track) + template + bool isPionFromLambda(TCollision const& collision, TTrack const& track) { - bool is_ka_included_TPC = hadronCut.cfg_min_TPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < hadronCut.cfg_max_TPCNsigmaKa; - bool is_ka_included_TOF = track.hasTOF() ? (hadronCut.cfg_min_TOFNsigmaKa < track.tofNSigmaKa() && track.tofNSigmaKa() < hadronCut.cfg_max_TOFNsigmaKa) : true; - return is_ka_included_TPC && is_ka_included_TOF; + float tofNSigmaPi = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Pion)]; + bool is_pi_included_TPC = v0Cut.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < v0Cut.cfg_max_TPCNsigmaPi; + bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < tofNSigmaPi && tofNSigmaPi < v0Cut.cfg_max_TOFNsigmaPi) : true; + if (!v0Cut.applyTOFif) { + is_pi_included_TOF = true; + } + return is_pi_included_TPC && is_pi_included_TOF; + } + + template + bool isProtonFromLambda(TCollision const& collision, TTrack const& track) + { + float tofNSigmaPr = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Proton)]; + bool is_pr_included_TPC = v0Cut.cfg_min_TPCNsigmaPr < track.tpcNSigmaPr() && track.tpcNSigmaPr() < v0Cut.cfg_max_TPCNsigmaPr; + bool is_pr_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPr < tofNSigmaPr && tofNSigmaPr < v0Cut.cfg_max_TOFNsigmaPr) : true; + if (!v0Cut.applyTOFif) { + is_pr_included_TOF = true; + } + return is_pr_included_TPC && is_pr_included_TOF; + } + + template + bool isPionFromLambdaFromXi(TCollision const& collision, TTrack const& track) + { + float tofNSigmaPi = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)]; + bool is_pi_included_TPC = v0Cut.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < v0Cut.cfg_max_TPCNsigmaPi; + bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < tofNSigmaPi && tofNSigmaPi < v0Cut.cfg_max_TOFNsigmaPi) : true; + if (!v0Cut.applyTOFif) { + is_pi_included_TOF = true; + } + return is_pi_included_TPC && is_pi_included_TOF; + } + + template + bool isPionFromLambdaFromOmega(TCollision const& collision, TTrack const& track) + { + float tofNSigmaPi = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)]; + bool is_pi_included_TPC = v0Cut.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < v0Cut.cfg_max_TPCNsigmaPi; + bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < tofNSigmaPi && tofNSigmaPi < v0Cut.cfg_max_TOFNsigmaPi) : true; + if (!v0Cut.applyTOFif) { + is_pi_included_TOF = true; + } + return is_pi_included_TPC && is_pi_included_TOF; + } + + template + bool isProtonFromLambdaFromXi(TCollision const& collision, TTrack const& track) + { + float tofNSigmaPr = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)]; + bool is_pr_included_TPC = v0Cut.cfg_min_TPCNsigmaPr < track.tpcNSigmaPr() && track.tpcNSigmaPr() < v0Cut.cfg_max_TPCNsigmaPr; + bool is_pr_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPr < tofNSigmaPr && tofNSigmaPr < v0Cut.cfg_max_TOFNsigmaPr) : true; + if (!v0Cut.applyTOFif) { + is_pr_included_TOF = true; + } + return is_pr_included_TPC && is_pr_included_TOF; } - template - bool isProton(TTrack const& track) + template + bool isProtonFromLambdaFromOmega(TCollision const& collision, TTrack const& track) { - // TOFif + float tofNSigmaPr = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)]; bool is_pr_included_TPC = v0Cut.cfg_min_TPCNsigmaPr < track.tpcNSigmaPr() && track.tpcNSigmaPr() < v0Cut.cfg_max_TPCNsigmaPr; - bool is_pr_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPr < track.tofNSigmaPr() && track.tofNSigmaPr() < v0Cut.cfg_max_TOFNsigmaPr) : true; + bool is_pr_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPr < tofNSigmaPr && tofNSigmaPr < v0Cut.cfg_max_TOFNsigmaPr) : true; + if (!v0Cut.applyTOFif) { + is_pr_included_TOF = true; + } return is_pr_included_TPC && is_pr_included_TOF; } + template + bool isPionFromXi(TCollision const& collision, TTrack const& track) + { + float tofNSigmaPi = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)]; + bool is_pi_included_TPC = v0Cut.cfg_min_TPCNsigmaPi < track.tpcNSigmaPi() && track.tpcNSigmaPi() < v0Cut.cfg_max_TPCNsigmaPi; + bool is_pi_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaPi < tofNSigmaPi && tofNSigmaPi < v0Cut.cfg_max_TOFNsigmaPi) : true; + if (!v0Cut.applyTOFif) { + is_pi_included_TOF = true; + } + return is_pi_included_TPC && is_pi_included_TOF; + } + + template + bool isKaonFromOmega(TCollision const& collision, TTrack const& track) + { + float tofNSigmaKa = mapTOFNSigma[std::make_tuple(collision.globalIndex(), track.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)]; + bool is_ka_included_TPC = v0Cut.cfg_min_TPCNsigmaKa < track.tpcNSigmaKa() && track.tpcNSigmaKa() < v0Cut.cfg_max_TPCNsigmaKa; + bool is_ka_included_TOF = track.hasTOF() ? (v0Cut.cfg_min_TOFNsigmaKa < tofNSigmaKa && tofNSigmaKa < v0Cut.cfg_max_TOFNsigmaKa) : true; + if (!v0Cut.applyTOFif) { + is_ka_included_TOF = true; + } + return is_ka_included_TPC && is_ka_included_TOF; + } + // template // bool isElectron(TTrack const& track) // { @@ -642,7 +746,7 @@ struct taggingHFE { template bool isK0S(TV0 const& v0) { - return (v0Cut.cfg_min_mass_k0s < v0.mK0Short() && v0.mK0Short() < v0Cut.cfg_max_mass_k0s); + return (v0Cut.cfg_min_mass_k0s < v0.mK0Short() && v0.mK0Short() < v0Cut.cfg_max_mass_k0s) && (v0.mLambda() < v0Cut.cfg_min_mass_lambda_veto || v0Cut.cfg_max_mass_lambda_veto < v0.mLambda()) && (v0.mAntiLambda() < v0Cut.cfg_min_mass_lambda_veto || v0Cut.cfg_max_mass_lambda_veto < v0.mAntiLambda()); } template @@ -669,7 +773,7 @@ struct taggingHFE { return (cascadeCut.cfg_min_mass_Omega < cascade.mOmega() && cascade.mOmega() < cascadeCut.cfg_max_mass_Omega) && (cascade.mXi() < cascadeCut.cfg_min_mass_Xi_veto || cascadeCut.cfg_max_mass_Xi_veto < cascade.mXi()); } - template + template bool isSelectedV0Leg(TTrack const& track) { if constexpr (isMC) { @@ -731,8 +835,8 @@ struct taggingHFE { fRegistry.fill(HIST("Event/hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV()); } - template - void fillV0Histograms(TV0 const& v0) + template + void fillV0Histograms(TCollision const& collision, TV0 const& v0) { auto pos = v0.template posTrack_as(); auto neg = v0.template negTrack_as(); @@ -743,21 +847,39 @@ struct taggingHFE { fRegistry.fill(HIST("V0/hLxy"), v0.v0radius()); fRegistry.fill(HIST("V0/hDCA2Legs"), v0.dcaV0daughters()); - if (isPion(pos) && isPion(neg)) { - fRegistry.fill(HIST("V0/hMassK0S"), v0.mK0Short()); + if (isPionFromK0S(collision, pos) && isPionFromK0S(collision, neg)) { + if ((v0.mLambda() < v0Cut.cfg_min_mass_lambda_veto || v0Cut.cfg_max_mass_lambda_veto < v0.mLambda()) && (v0.mAntiLambda() < v0Cut.cfg_min_mass_lambda_veto || v0Cut.cfg_max_mass_lambda_veto < v0.mAntiLambda())) { + fRegistry.fill(HIST("V0/hMassK0S"), v0.mK0Short()); + } + fRegistry.fill(HIST("V0/hMassGamma_misid"), v0.mGamma()); + fRegistry.fill(HIST("V0/hMassLambda_misid"), v0.mLambda()); + fRegistry.fill(HIST("V0/hMassAntiLambda_misid"), v0.mAntiLambda()); } - if (isProton(pos) && isPion(neg)) { - fRegistry.fill(HIST("V0/hMassLambda"), v0.mLambda()); + + if (isProtonFromLambda(collision, pos) && isPionFromLambda(collision, neg)) { + if (v0.mK0Short() < v0Cut.cfg_min_mass_k0s_veto || v0Cut.cfg_max_mass_k0s_veto < v0.mK0Short()) { + fRegistry.fill(HIST("V0/hMassLambda"), v0.mLambda()); + } + fRegistry.fill(HIST("V0/hMassGamma_misid"), v0.mGamma()); + fRegistry.fill(HIST("V0/hMassK0S_misid"), v0.mK0Short()); } - if (isProton(neg) && isPion(pos)) { - fRegistry.fill(HIST("V0/hMassAntiLambda"), v0.mAntiLambda()); + + if (isProtonFromLambda(collision, neg) && isPionFromLambda(collision, pos)) { + if (v0.mK0Short() < v0Cut.cfg_min_mass_k0s_veto || v0Cut.cfg_max_mass_k0s_veto < v0.mK0Short()) { + fRegistry.fill(HIST("V0/hMassAntiLambda"), v0.mAntiLambda()); + } + fRegistry.fill(HIST("V0/hMassGamma_misid"), v0.mGamma()); + fRegistry.fill(HIST("V0/hMassK0S_misid"), v0.mK0Short()); } } template void fillCascadeHistograms(TCollision const& collision, TCascade const& cascade) { + auto pos = cascade.template posTrack_as(); + auto neg = cascade.template negTrack_as(); auto bachelor = cascade.template bachelor_as(); + fRegistry.fill(HIST("Cascade/hPt"), cascade.pt()); fRegistry.fill(HIST("Cascade/hMassLambda"), cascade.mLambda()); fRegistry.fill(HIST("Cascade/hCosPA"), cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ())); @@ -765,11 +887,32 @@ struct taggingHFE { fRegistry.fill(HIST("Cascade/hV0CosPA"), cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); fRegistry.fill(HIST("Cascade/hV0DCA2Legs"), cascade.dcaV0daughters()); - if (isPion(bachelor)) { - fRegistry.fill(HIST("Cascade/hMassXi"), cascade.mXi()); - } - if (isKaon(bachelor)) { - fRegistry.fill(HIST("Cascade/hMassOmega"), cascade.mOmega()); + if (cascade.sign() < 0) { // Xi- or Omega- + if (isPionFromXi(collision, bachelor) && isProtonFromLambdaFromXi(collision, pos) && isPionFromLambdaFromXi(collision, neg)) { + if (cascade.mOmega() < cascadeCut.cfg_min_mass_Omega_veto || cascadeCut.cfg_max_mass_Omega_veto < cascade.mOmega()) { + fRegistry.fill(HIST("Cascade/hMassXi"), cascade.mXi()); + } + fRegistry.fill(HIST("Cascade/hMassOmega_misid"), cascade.mOmega()); + } + if (isKaonFromOmega(collision, bachelor) && isProtonFromLambdaFromOmega(collision, pos) && isPionFromLambdaFromOmega(collision, neg)) { + if (cascade.mXi() < cascadeCut.cfg_min_mass_Xi_veto || cascadeCut.cfg_max_mass_Xi_veto < cascade.mXi()) { + fRegistry.fill(HIST("Cascade/hMassOmega"), cascade.mOmega()); + } + fRegistry.fill(HIST("Cascade/hMassXi_misid"), cascade.mXi()); + } + } else { // Xi+ or Omega+ + if (isPionFromXi(collision, bachelor) && isProtonFromLambdaFromXi(collision, neg) && isPionFromLambdaFromXi(collision, pos)) { + if (cascade.mOmega() < cascadeCut.cfg_min_mass_Omega_veto || cascadeCut.cfg_max_mass_Omega_veto < cascade.mOmega()) { + fRegistry.fill(HIST("Cascade/hMassXi"), cascade.mXi()); + } + fRegistry.fill(HIST("Cascade/hMassOmega_misid"), cascade.mOmega()); + } + if (isKaonFromOmega(collision, bachelor) && isProtonFromLambdaFromOmega(collision, neg) && isPionFromLambdaFromOmega(collision, pos)) { + if (cascade.mXi() < cascadeCut.cfg_min_mass_Xi_veto || cascadeCut.cfg_max_mass_Xi_veto < cascade.mXi()) { + fRegistry.fill(HIST("Cascade/hMassOmega"), cascade.mOmega()); + } + fRegistry.fill(HIST("Cascade/hMassXi_misid"), cascade.mXi()); + } } } @@ -871,6 +1014,354 @@ struct taggingHFE { return true; } + std::map, float> mapTOFNSigma; // map -> tof n sigma + std::map, float> mapTOFBeta; // map -> tof beta + + template + float recalculateTOFNSigmaTrackFromV0FromCascade(TCollision const& collision, TCascade const& cascade, const float massCascade, float& beta) + { + if (mapCollisionTime.find(cascade.collisionId()) == mapCollisionTime.end()) { + beta = -1.f; + return -999.f; + } + + auto track = sign > 0 ? cascade.template posTrack_as() : cascade.template negTrack_as(); + auto arrMomTrack = sign > 0 ? std::array{cascade.pxpos(), cascade.pypos(), cascade.pzpos()} : std::array{cascade.pxneg(), cascade.pyneg(), cascade.pzneg()}; + + if (!track.hasTOF() || !track.has_collision()) { + beta = -1.f; + return -999.f; + } + auto bcCascade = collision.template bc_as(); // collision in this function is the collision where this cascade belong. + + o2::track::TrackPar trackPar = o2::track::TrackPar({cascade.xlambda(), cascade.ylambda(), cascade.zlambda()}, arrMomTrack, sign, false); + auto collisionTrack = track.template collision_as(); + auto bcTrack = collisionTrack.template bc_as(); + double deltaTime = track.tofSignalInAnotherBC(bcTrack.globalBC(), bcCascade.globalBC()) - timeCascade(collision, cascade, massCascade) - timeV0inCascade(cascade); // in ps + + const o2::math_utils::Point3D trackVertex{collisionTrack.posX(), collisionTrack.posY(), collisionTrack.posZ()}; + o2::track::TrackLTIntegral ltIntegral; + bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, trackPar, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, <Integral); + if (!successPropag) { + beta = -1.f; + return -999.f; + } + + float length = track.length() - ltIntegral.getL(); + if (length < 0.f) { + beta = -1.f; + return -999.f; + } + + beta = length / (deltaTime - mapCollisionTime[cascade.collisionId()]) / (TMath::C() * 1e+2 * 1e-12); + return mTOFResponse->nSigma(deltaTime, track.tofExpMom(), length, trackPar.getP(), trackPar.getEta(), mapCollisionTime[cascade.collisionId()], mapCollisionTimeError[cascade.collisionId()]); + } + + template + float recalculateTOFNSigmaBachelorFromCascade(TCollision const& collision, TCascade const& cascade, const float massCascade, float& beta) + { + if (mapCollisionTime.find(cascade.collisionId()) == mapCollisionTime.end()) { + beta = -1.f; + return -999.f; + } + + auto bachelor = cascade.template bachelor_as(); + if (!bachelor.hasTOF() || !bachelor.has_collision()) { + beta = -1.f; + return -999.f; + } + + auto bcCascade = collision.template bc_as(); // collision in this function is the collision where this cascade belong. + auto collisionBachelor = bachelor.template collision_as(); + auto bcBachelor = collisionBachelor.template bc_as(); + double deltaTime = bachelor.tofSignalInAnotherBC(bcBachelor.globalBC(), bcCascade.globalBC()) - timeCascade(collision, cascade, massCascade); // in ps + + o2::track::TrackPar bTrackPar = o2::track::TrackPar({cascade.x(), cascade.y(), cascade.z()}, {cascade.pxbach(), cascade.pybach(), cascade.pzbach()}, cascade.sign(), false); // at SV + const o2::math_utils::Point3D trackVertex{collisionBachelor.posX(), collisionBachelor.posY(), collisionBachelor.posZ()}; + o2::track::TrackLTIntegral ltIntegral; + bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, bTrackPar, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, <Integral); + if (!successPropag) { + beta = -1.f; + return -999.f; + } + + float length = bachelor.length() - ltIntegral.getL(); + if (length < 0.f) { + beta = -1.f; + return -999.f; + } + + beta = length / (deltaTime - mapCollisionTime[cascade.collisionId()]) / (TMath::C() * 1e+2 * 1e-12); + return mTOFResponse->nSigma(deltaTime, bachelor.tofExpMom(), length, bTrackPar.getP(), bTrackPar.getEta(), mapCollisionTime[cascade.collisionId()], mapCollisionTimeError[cascade.collisionId()]); + } + + template + float recalculateTOFNSigmaLegFromV0(TCollision const& collision, TV0 const& v0, const float massV0, float& beta) + { + if (mapCollisionTime.find(v0.collisionId()) == mapCollisionTime.end()) { + beta = -1.f; + return -999.f; + } + + auto track = sign > 0 ? v0.template posTrack_as() : v0.template negTrack_as(); + if (!track.hasTOF() || !track.has_collision()) { + beta = -1.f; + return -999.f; + } + + auto bcV0 = collision.template bc_as(); // collision in this function is the collision where this v0 belong. + auto arrMomTrack = sign > 0 ? std::array{v0.pxpos(), v0.pypos(), v0.pzpos()} : std::array{v0.pxneg(), v0.pyneg(), v0.pzneg()}; + + auto collisionTrack = track.template collision_as(); + auto bcTrack = collisionTrack.template bc_as(); + double deltaTime = track.tofSignalInAnotherBC(bcTrack.globalBC(), bcV0.globalBC()) - timeV0(collision, v0, massV0); // in ps + + o2::track::TrackPar trackPar = o2::track::TrackPar({v0.x(), v0.y(), v0.z()}, arrMomTrack, track.sign(), false); // at SV + const o2::math_utils::Point3D trackVertex{collisionTrack.posX(), collisionTrack.posY(), collisionTrack.posZ()}; + o2::track::TrackLTIntegral ltIntegral; + bool successPropag = o2::base::Propagator::Instance()->propagateToDCA(trackVertex, trackPar, d_bz, 2.f, o2::base::Propagator::MatCorrType::USEMatCorrNONE, nullptr, <Integral); + if (!successPropag) { + beta = -1.f; + return -999.f; + } + + float length = track.length() - ltIntegral.getL(); // in cm + if (length < 0.f) { + beta = -1.f; + return -999.f; + } + beta = length / (deltaTime - mapCollisionTime[v0.collisionId()]) / (TMath::C() * 1e+2 * 1e-12); + return mTOFResponse->nSigma(deltaTime, track.tofExpMom(), length, trackPar.getP(), trackPar.getEta(), mapCollisionTime[v0.collisionId()], mapCollisionTimeError[v0.collisionId()]); + } + + template + float timeV0inCascade(TCascade const& cascade) + { + float p = RecoDecay::sqrtSumOfSquares(cascade.pxlambda(), cascade.pylambda(), cascade.pzlambda()); + float length = std::hypot(cascade.xlambda() - cascade.x(), cascade.ylambda() - cascade.y(), cascade.zlambda() - cascade.z()); // cm + float velocity = TMath::C() * 1e+2 * 1e-12 * std::sqrt((p * p) / (p * p + o2::constants::physics::MassLambda * o2::constants::physics::MassLambda)); // cm/ps + return length / velocity; // ps + } + + template + float timeCascade(TCollision const& collision, TCascade const& cascade, const float massCascade) + { + float length = std::hypot(cascade.x() - collision.posX(), cascade.y() - collision.posY(), cascade.z() - collision.posZ()); // cm + float velocity = TMath::C() * 1e+2 * 1e-12 * std::sqrt((cascade.p() * cascade.p()) / (cascade.p() * cascade.p() + massCascade * massCascade)); // cm/ps + return length / velocity; // ps + } + + template + float timeV0(TCollision const& collision, TV0 const& v0, const float massV0) + { + float length = std::hypot(v0.x() - collision.posX(), v0.y() - collision.posY(), v0.z() - collision.posZ()); // cm + float velocity = TMath::C() * 1e+2 * 1e-12 * std::sqrt((v0.p() * v0.p()) / (v0.p() * v0.p() + massV0 * massV0)); // cm/ps + return length / velocity; // ps + } + + template + void calculateTOFNSigmasForV0sAndCascades(TCollisions const& collisions, TBCs const&, TV0s const& v0s, TCascades const& cascades, TTracks const& tracks) + { + for (const auto& track : tracks) { + if (mapCollisionTime.find(track.collisionId()) == mapCollisionTime.end()) { + mapCollisionTime[track.collisionId()] = track.tofEvTime(); + mapCollisionTimeError[track.collisionId()] = track.tofEvTimeErr(); + } + } // end of track loop + + for (const auto& collision : collisions) { + if (!isSelectedCollision(collision)) { + continue; + } + if (eventCut.cfgRequireGoodRCT && !rctChecker.checkTable(collision)) { + continue; + } + + auto v0s_coll = v0s.sliceBy(perCol_v0, collision.globalIndex()); + for (const auto& v0 : v0s_coll) { + auto pos = v0.template posTrack_as(); + auto neg = v0.template negTrack_as(); + + if (v0.dcaV0daughters() > v0Cut.cfg_max_dca2legs) { + continue; + } + if (v0.v0cosPA() < v0Cut.cfg_min_cospa) { + continue; + } + if (pos.sign() * neg.sign() > 0) { + continue; + } + if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg)) { + continue; + } + + float beta = -1.f; + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : pos.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : pos.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : pos.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : neg.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : neg.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : neg.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : pos.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : pos.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : pos.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : neg.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : neg.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : neg.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : pos.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : pos.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : pos.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : neg.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : neg.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : neg.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : pos.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Photon, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : pos.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::K0, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : pos.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassPhoton, beta) : neg.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Photon, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassKaonNeutral, beta) : neg.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::K0, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaLegFromV0(collision, v0, o2::constants::physics::MassLambda, beta) : neg.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::Lambda, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + } // end of v0 loop + + auto cascades_coll = cascades.sliceBy(perCol_casc, collision.globalIndex()); + for (const auto& cascade : cascades_coll) { + // Track casting + auto bachelor = cascade.template bachelor_as(); + auto pos = cascade.template posTrack_as(); + auto neg = cascade.template negTrack_as(); + if (pos.sign() * neg.sign() > 0) { + continue; + } + + if (!(cascadeCut.cfg_min_mass_lambda < cascade.mLambda() && cascade.mLambda() < cascadeCut.cfg_max_mass_lambda)) { + continue; + } + + if (cascade.cascradius() > cascade.v0radius()) { + continue; + } + + if (cascade.dcaV0daughters() > cascadeCut.cfg_max_dcadau_v0) { + continue; + } + if (cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_cospa_v0) { + continue; + } + if (cascade.v0radius() < cascadeCut.cfg_min_rxy_v0) { + continue; + } + + if (cascade.cascradius() < cascadeCut.cfg_min_rxy) { + continue; + } + + if (cascade.dcacascdaughters() > cascadeCut.cfg_max_dcadau) { + continue; + } + if (cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_cospa) { + continue; + } + + if (cascade.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_dcaxy_v0) { + continue; + } + + if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg) || !isSelectedV0Leg(bachelor)) { + continue; + } + + // for bachelor tracks + float beta = -1.f; + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : bachelor.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : bachelor.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : bachelor.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : bachelor.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : bachelor.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : bachelor.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : bachelor.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaBachelorFromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : bachelor.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), bachelor.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : bachelor.beta(); + + // for tracks from lambda from cascade + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : pos.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : pos.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : pos.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : pos.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : neg.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : neg.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : neg.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassXiMinus, beta) : neg.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::XiMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : pos.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : pos.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : pos.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : pos.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), pos.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : pos.beta(); + + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : neg.tofNSigmaEl(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Electron)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : neg.tofNSigmaPi(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Pion)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : neg.tofNSigmaKa(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Kaon)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + mapTOFNSigma[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? recalculateTOFNSigmaTrackFromV0FromCascade(collision, cascade, o2::constants::physics::MassOmegaMinus, beta) : neg.tofNSigmaPr(); + mapTOFBeta[std::make_tuple(collision.globalIndex(), neg.globalIndex(), o2::track::PID::OmegaMinus, o2::track::PID::Proton)] = cfgApplyBCShiftTOF ? beta : neg.beta(); + + } // end of cascade loop + } // end of collision loop + } + std::map, float> mapTOFNsigmaPiReassociated; // map pair(collisionId, trackId) -> tof n sigma pi std::map, float> mapTOFNsigmaKaReassociated; // map pair(collisionId, trackId) -> tof n sigma ka std::map, float> mapTOFNsigmaPrReassociated; // map pair(collisionId, trackId) -> tof n sigma pr @@ -1067,15 +1558,20 @@ struct taggingHFE { if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg)) { continue; } - fillV0Histograms<>(v0); - if (isK0S(v0) && isPion(pos) && isPion(neg)) { + fillV0Histograms(collision, v0); + + if (std::sqrt(std::pow(v0.alpha() / v0Cut.cfg_max_alpha_veto, 2) + std::pow(v0.qtarm() / v0Cut.cfg_max_qt_veto, 2)) < 1.f) { // photon conversion rejection at small qT + continue; + } + + if (isK0S(v0) && isPionFromK0S(collision, pos) && isPionFromK0S(collision, neg)) { k0Ids.emplace_back(v0.globalIndex()); } - if (isLambda(v0) && isProton(pos) && isPion(neg)) { + if (isLambda(v0) && isProtonFromLambda(collision, pos) && isPionFromLambda(collision, neg)) { lambdaIds.emplace_back(v0.globalIndex()); - } else if (isAntiLambda(v0) && isProton(neg) && isPion(pos)) { + } else if (isAntiLambda(v0) && isProtonFromLambda(collision, neg) && isPionFromLambda(collision, pos)) { antilambdaIds.emplace_back(v0.globalIndex()); } } // end of V0 loop @@ -1104,16 +1600,6 @@ struct taggingHFE { continue; } - if (cascade.sign() < 0) { // L-> p pi- - if (!isProton(pos) || !isPion(neg)) { - continue; - } - } else { // Lbar-> pbar pi+ - if (!isProton(neg) || !isPion(pos)) { - continue; - } - } - if (cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_cospa) { continue; } @@ -1122,18 +1608,19 @@ struct taggingHFE { } fillCascadeHistograms(collision, cascade); + if (cascade.sign() < 0) { // Xi- or Omega- - if (isXi(cascade) && isPion(bachelor)) { + if (isXi(cascade) && isPionFromXi(collision, bachelor) && isProtonFromLambdaFromXi(collision, pos) && isPionFromLambdaFromXi(collision, neg)) { xiMinusIds.emplace_back(cascade.globalIndex()); } - if (isOmega(cascade) && isKaon(bachelor)) { + if (isOmega(cascade) && isKaonFromOmega(collision, bachelor) && isProtonFromLambdaFromOmega(collision, pos) && isPionFromLambdaFromOmega(collision, neg)) { omegaMinusIds.emplace_back(cascade.globalIndex()); } } else { // Xi+ or Omega+ - if (isXi(cascade) && isPion(bachelor)) { + if (isXi(cascade) && isPionFromXi(collision, bachelor) && isProtonFromLambdaFromXi(collision, neg) && isPionFromLambdaFromXi(collision, pos)) { xiPlusIds.emplace_back(cascade.globalIndex()); } - if (isOmega(cascade) && isKaon(bachelor)) { + if (isOmega(cascade) && isKaonFromOmega(collision, bachelor) && isProtonFromLambdaFromOmega(collision, neg) && isPionFromLambdaFromOmega(collision, pos)) { omegaPlusIds.emplace_back(cascade.globalIndex()); } } @@ -1153,11 +1640,11 @@ struct taggingHFE { bool isMotherFromB = IsFromBeauty(mcMother, mcParticles) > -1; auto mcCollision = mcpos.template mcCollision_as(); - bool is_e_from_dy = std::abs(mcMother.pdgCode()) == 23; // virtual photon is Z in simulation. - bool is_e_from_prompt_jpsi = std::abs(mcMother.pdgCode()) == 443 && !isMotherFromB && std::abs(mcMother.pdgCode()) != 100443; + bool is_e_from_dy = std::abs(mcMother.pdgCode()) == 23; // virtual photon is Z in simulation. + bool is_e_from_jpsi = std::abs(mcMother.pdgCode()) == 443; // e from prompt J/psi is treated as the same as Z. // e from nonprompt J/psi is treated as the same as B. bool is_e_from_hc = (std::abs(mcMother.pdgCode()) == 411 || std::abs(mcMother.pdgCode()) == 421 || std::abs(mcMother.pdgCode()) == 431 || std::abs(mcMother.pdgCode()) == 4122 || std::abs(mcMother.pdgCode()) == 4132 || std::abs(mcMother.pdgCode()) == 4232 || std::abs(mcMother.pdgCode()) == 4332) && isSemiLeptonic(mcMother, mcParticles, -cfgPdgLepton, cfgPdgLepton + 1); bool is_e_from_hb = (std::abs(mcMother.pdgCode()) == 511 || std::abs(mcMother.pdgCode()) == 521 || std::abs(mcMother.pdgCode()) == 531 || std::abs(mcMother.pdgCode()) == 541 || std::abs(mcMother.pdgCode()) == 5122 || std::abs(mcMother.pdgCode()) == 5132 || std::abs(mcMother.pdgCode()) == 5232 || std::abs(mcMother.pdgCode()) == 5332) && isSemiLeptonic(mcMother, mcParticles, -cfgPdgLepton, cfgPdgLepton + 1); - if (!(is_e_from_dy || is_e_from_prompt_jpsi || is_e_from_hc || is_e_from_hb)) { + if (!(is_e_from_dy || is_e_from_jpsi || is_e_from_hc || is_e_from_hb)) { continue; } @@ -1202,7 +1689,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { // I want 3 types. // 1. truely found HF->eh (SV should found by eh, and truely found.) For signal sample in ML. // 2. mistakenly found DY->eh (SV should not be found by eh, but found.) For bkg sample in ML. @@ -1266,7 +1753,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { // I want 3 types. // 1. truely found HF->eh (SV should found by eh, and truely found.) For signal sample in ML. // 2. mistakenly found DY->eh (SV should not be found by eh, but found.) For bkg sample in ML. @@ -1332,6 +1819,7 @@ struct taggingHFE { int mcK0SId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 211, -211, 310, mcParticles); int pdgCodeV0 = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcK0SId > 0) { // true K0S pdgCodeV0 = 310; auto mcK0S = mcParticles.rawIteratorAt(mcK0SId); @@ -1348,12 +1836,13 @@ struct taggingHFE { int commonMotherId = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcMother_of_k0s); if (commonMotherId > 0) { foundCommonMother = true; + pdgCodeIM = mcMother_of_k0s.pdgCode(); } } } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1361,12 +1850,12 @@ struct taggingHFE { v0.pt(), v0.rapidity(0), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), - impactParameterV0.getY(), std::sqrt(impactParameterV0.getSigmaY2()), + impactParameterV0.getY(), impactParameterV0.getZ(), impactParameterV0.getSigmaY2(), impactParameterV0.getSigmaYZ(), impactParameterV0.getSigmaZ2(), eV0pair.mass, eV0pair.dca2legs, eV0pair.cospa, eV0pair.cospaXY, eV0pair.lxyz, eV0pair.lxyzErr, eV0pair.lxy, eV0pair.lxyErr, eV0pair.lz, eV0pair.lzErr, - pdgCodeV0, foundCommonMother); + pdgCodeV0, pdgCodeIM, foundCommonMother); } // end of K0S loop @@ -1407,13 +1896,14 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 2212, -211, 3122, mcParticles); int pdgCodeV0 = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true v0 auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); pdgCodeV0 = mcLambda.pdgCode(); foundCommonMother = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcLambda) > 0; } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1421,12 +1911,12 @@ struct taggingHFE { v0.pt(), v0.rapidity(1), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), - impactParameterV0.getY(), std::sqrt(impactParameterV0.getSigmaY2()), + impactParameterV0.getY(), impactParameterV0.getZ(), impactParameterV0.getSigmaY2(), impactParameterV0.getSigmaYZ(), impactParameterV0.getSigmaZ2(), eV0pair.mass, eV0pair.dca2legs, eV0pair.cospa, eV0pair.cospaXY, eV0pair.lxyz, eV0pair.lxyzErr, eV0pair.lxy, eV0pair.lxyErr, eV0pair.lz, eV0pair.lzErr, - pdgCodeV0, foundCommonMother); + pdgCodeV0, pdgCodeIM, foundCommonMother); } // end of Lambda loop @@ -1468,6 +1958,7 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 2212, -211, 3122, mcParticles); int pdgCodeCascade = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true Lambda auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); int mcXiId = FindCommonMotherFrom2Prongs(mcLambda, mcbachelor, 3122, -211, 3312, mcParticles); @@ -1478,7 +1969,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1486,12 +1977,12 @@ struct taggingHFE { cascade.pt(), cascade.rapidity(0), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), - impactParameterCasc.getY(), std::sqrt(impactParameterCasc.getSigmaY2()), + impactParameterCasc.getY(), impactParameterCasc.getZ(), impactParameterCasc.getSigmaY2(), impactParameterCasc.getSigmaYZ(), impactParameterCasc.getSigmaZ2(), eCpair.mass, eCpair.dca2legs, eCpair.cospa, eCpair.cospaXY, eCpair.lxyz, eCpair.lxyzErr, eCpair.lxy, eCpair.lxyErr, eCpair.lz, eCpair.lzErr, - pdgCodeCascade, foundCommonMother); + pdgCodeCascade, pdgCodeIM, foundCommonMother); } // end of Xi- loop @@ -1533,6 +2024,7 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 2212, -211, 3122, mcParticles); int pdgCodeCascade = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true Lambda auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); int mcOmegaId = FindCommonMotherFrom2Prongs(mcLambda, mcbachelor, 3122, -321, 3334, mcParticles); @@ -1543,7 +2035,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1551,12 +2043,12 @@ struct taggingHFE { cascade.pt(), cascade.rapidity(2), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), - impactParameterCasc.getY(), std::sqrt(impactParameterCasc.getSigmaY2()), + impactParameterCasc.getY(), impactParameterCasc.getZ(), impactParameterCasc.getSigmaY2(), impactParameterCasc.getSigmaYZ(), impactParameterCasc.getSigmaZ2(), eCpair.mass, eCpair.dca2legs, eCpair.cospa, eCpair.cospaXY, eCpair.lxyz, eCpair.lxyzErr, eCpair.lxy, eCpair.lxyErr, eCpair.lz, eCpair.lzErr, - pdgCodeCascade, foundCommonMother); + pdgCodeCascade, pdgCodeIM, foundCommonMother); } // end of Omega- loop @@ -1576,11 +2068,11 @@ struct taggingHFE { bool isMotherFromB = IsFromBeauty(mcMother, mcParticles) > -1; auto mcCollision = mcele.template mcCollision_as(); - bool is_e_from_dy = std::abs(mcMother.pdgCode()) == 23; // virtual photon is Z in simulation. - bool is_e_from_prompt_jpsi = std::abs(mcMother.pdgCode()) == 443 && !isMotherFromB && std::abs(mcMother.pdgCode()) != 100443; + bool is_e_from_dy = std::abs(mcMother.pdgCode()) == 23; // virtual photon is Z in simulation. + bool is_e_from_jpsi = std::abs(mcMother.pdgCode()) == 443; // e from prompt J/psi is treated as the same as Z. // e from nonprompt J/psi is treated as the same as B. // B+ -> J/psi K+ -> e+ e- K+ bool is_e_from_hc = (std::abs(mcMother.pdgCode()) == 411 || std::abs(mcMother.pdgCode()) == 421 || std::abs(mcMother.pdgCode()) == 431 || std::abs(mcMother.pdgCode()) == 4122 || std::abs(mcMother.pdgCode()) == 4132 || std::abs(mcMother.pdgCode()) == 4232 || std::abs(mcMother.pdgCode()) == 4332) && isSemiLeptonic(mcMother, mcParticles, cfgPdgLepton, -cfgPdgLepton - 1); bool is_e_from_hb = (std::abs(mcMother.pdgCode()) == 511 || std::abs(mcMother.pdgCode()) == 521 || std::abs(mcMother.pdgCode()) == 531 || std::abs(mcMother.pdgCode()) == 541 || std::abs(mcMother.pdgCode()) == 5122 || std::abs(mcMother.pdgCode()) == 5132 || std::abs(mcMother.pdgCode()) == 5232 || std::abs(mcMother.pdgCode()) == 5332) && isSemiLeptonic(mcMother, mcParticles, cfgPdgLepton, -cfgPdgLepton - 1); - if (!(is_e_from_dy || is_e_from_prompt_jpsi || is_e_from_hc || is_e_from_hb)) { + if (!(is_e_from_dy || is_e_from_jpsi || is_e_from_hc || is_e_from_hb)) { continue; } @@ -1624,7 +2116,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { // I want 3 types. // 1. truely found HF->eh (SV should found by eh, and truely found.) For signal sample in ML. // 2. mistakenly found DY->eh (SV should not be found by eh, but found.) For bkg sample in ML. @@ -1689,7 +2181,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && foundCommonMother && std::abs(mckaon.pdgCode()) == cfgPdgLepton))) { // I want 3 types. // 1. truely found HF->eh (SV should found by eh, and truely found.) For signal sample in ML. // 2. mistakenly found DY->eh (SV should not be found by eh, but found.) For bkg sample in ML. @@ -1755,6 +2247,7 @@ struct taggingHFE { int mcK0SId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 211, -211, 310, mcParticles); int pdgCodeV0 = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcK0SId > 0) { // true K0S pdgCodeV0 = 310; auto mcK0S = mcParticles.rawIteratorAt(mcK0SId); @@ -1770,12 +2263,13 @@ struct taggingHFE { int commonMotherId = FindCommonMotherFrom2ProngsWithoutPDG(mcele, mcMother_of_k0s); if (commonMotherId > 0) { foundCommonMother = true; + pdgCodeIM = mcMother_of_k0s.pdgCode(); } } } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1783,12 +2277,12 @@ struct taggingHFE { v0.pt(), v0.rapidity(0), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), - impactParameterV0.getY(), std::sqrt(impactParameterV0.getSigmaY2()), + impactParameterV0.getY(), impactParameterV0.getZ(), impactParameterV0.getSigmaY2(), impactParameterV0.getSigmaYZ(), impactParameterV0.getSigmaZ2(), eV0pair.mass, eV0pair.dca2legs, eV0pair.cospa, eV0pair.cospaXY, eV0pair.lxyz, eV0pair.lxyzErr, eV0pair.lxy, eV0pair.lxyErr, eV0pair.lz, eV0pair.lzErr, - pdgCodeV0, foundCommonMother); + pdgCodeV0, pdgCodeIM, foundCommonMother); } // end of K0S loop @@ -1829,13 +2323,14 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 211, -2212, -3122, mcParticles); int pdgCodeV0 = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true v0 auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); pdgCodeV0 = mcLambda.pdgCode(); foundCommonMother = FindCommonMotherFrom2ProngsWithoutPDG(mcele, mcLambda) > 0; } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1843,12 +2338,12 @@ struct taggingHFE { v0.pt(), v0.rapidity(1), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{v0.x(), v0.y(), v0.z()}, std::array{v0.px(), v0.py(), v0.pz()}), - impactParameterV0.getY(), std::sqrt(impactParameterV0.getSigmaY2()), + impactParameterV0.getY(), impactParameterV0.getZ(), impactParameterV0.getSigmaY2(), impactParameterV0.getSigmaYZ(), impactParameterV0.getSigmaZ2(), eV0pair.mass, eV0pair.dca2legs, eV0pair.cospa, eV0pair.cospaXY, eV0pair.lxyz, eV0pair.lxyzErr, eV0pair.lxy, eV0pair.lxyErr, eV0pair.lz, eV0pair.lzErr, - pdgCodeV0, foundCommonMother); + pdgCodeV0, pdgCodeIM, foundCommonMother); } // end of Anti-Lambda loop @@ -1890,6 +2385,7 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 211, -2212, -3122, mcParticles); int pdgCodeCascade = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true Lambda auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); int mcXiId = FindCommonMotherFrom2Prongs(mcLambda, mcbachelor, -3122, 211, -3312, mcParticles); @@ -1900,7 +2396,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1908,12 +2404,12 @@ struct taggingHFE { cascade.pt(), cascade.rapidity(0), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), - impactParameterCasc.getY(), std::sqrt(impactParameterCasc.getSigmaY2()), + impactParameterCasc.getY(), impactParameterCasc.getZ(), impactParameterCasc.getSigmaY2(), impactParameterCasc.getSigmaYZ(), impactParameterCasc.getSigmaZ2(), eCpair.mass, eCpair.dca2legs, eCpair.cospa, eCpair.cospaXY, eCpair.lxyz, eCpair.lxyzErr, eCpair.lxy, eCpair.lxyErr, eCpair.lz, eCpair.lzErr, - pdgCodeCascade, foundCommonMother); + pdgCodeCascade, pdgCodeIM, foundCommonMother); } // end of Xi+ loop @@ -1955,6 +2451,7 @@ struct taggingHFE { int mcLambdaId = FindCommonMotherFrom2Prongs(mcposLeg, mcnegLeg, 211, -2212, -3122, mcParticles); int pdgCodeCascade = 0; bool foundCommonMother = false; + int pdgCodeIM = 0; if (mcLambdaId > 0) { // true Lambda auto mcLambda = mcParticles.rawIteratorAt(mcLambdaId); int mcOmegaId = FindCommonMotherFrom2Prongs(mcLambda, mcbachelor, -3122, 321, -3334, mcParticles); @@ -1965,7 +2462,7 @@ struct taggingHFE { } } - if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_prompt_jpsi) && !foundCommonMother))) { + if (!(((is_e_from_hc || is_e_from_hb) && foundCommonMother) || ((is_e_from_dy || is_e_from_jpsi) && !foundCommonMother))) { continue; } @@ -1973,12 +2470,12 @@ struct taggingHFE { cascade.pt(), cascade.rapidity(2), RecoDecay::cpa(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), RecoDecay::cpaXY(std::array{collision.posX(), collision.posY(), collision.posZ()}, std::array{cascade.x(), cascade.y(), cascade.z()}, std::array{cascade.px(), cascade.py(), cascade.pz()}), - impactParameterCasc.getY(), std::sqrt(impactParameterCasc.getSigmaY2()), + impactParameterCasc.getY(), impactParameterCasc.getZ(), impactParameterCasc.getSigmaY2(), impactParameterCasc.getSigmaYZ(), impactParameterCasc.getSigmaZ2(), eCpair.mass, eCpair.dca2legs, eCpair.cospa, eCpair.cospaXY, eCpair.lxyz, eCpair.lxyzErr, eCpair.lxy, eCpair.lxyErr, eCpair.lz, eCpair.lzErr, - pdgCodeCascade, foundCommonMother); + pdgCodeCascade, pdgCodeIM, foundCommonMother); } // end of Omega+ loop @@ -2158,7 +2655,8 @@ struct taggingHFE { std::vector> used_electronIds; // pair of hTypeId and electronId - void processMC(FilteredMyCollisionsWithMCLabel const& collisions, aod::BCsWithTimestamps const& bcs, MyTracksWithMCLabel const& tracks, aod::TrackAssoc const& trackIndices, filteredV0s const& v0s, filteredMyCascades const& cascades, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + // void processMC(FilteredMyCollisionsWithMCLabel const& collisions, MyBCs const& bcs, MyTracksWithMCLabel const& tracks, aod::TrackAssoc const& trackIndices, filteredV0s const& v0s, filteredMyCascades const& cascades, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + void processMC(MyCollisionsWithMCLabel const& collisions, MyBCs const& bcs, MyTracksWithMCLabel const& tracks, aod::TrackAssoc const& trackIndices, filteredV0s const& v0s, filteredMyCascades const& cascades, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) { initCCDB(bcs.iteratorAt(0)); mTOFResponse->processSetup(bcs.iteratorAt(0)); @@ -2170,7 +2668,8 @@ struct taggingHFE { mapCollisionTimeError[track.collisionId()] = track.tofEvTimeErr(); } } - calculateTOFNSigmaWithReassociation(collisions, bcs, tracks, trackIndices); + calculateTOFNSigmaWithReassociation(collisions, bcs, tracks, trackIndices); // for primary tracks + calculateTOFNSigmasForV0sAndCascades(collisions, bcs, v0s, cascades, tracks); // for secondary tracks runPairing(bcs, collisions, tracks, trackIndices, v0s, cascades, mcCollisions, mcParticles); runGen(mcCollisions, mcParticles); @@ -2181,6 +2680,9 @@ struct taggingHFE { mapTOFNsigmaKaReassociated.clear(); mapTOFNsigmaPrReassociated.clear(); mapTOFBetaReassociated.clear(); + + mapTOFNSigma.clear(); + mapTOFBeta.clear(); } PROCESS_SWITCH(taggingHFE, processMC, "process with TTCA", true);