diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index 49656d8c364..36316355fad 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -21,6 +21,7 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "Common/Core/RecoDecay.h" @@ -139,7 +140,8 @@ DECLARE_SOA_TABLE(HfCandD0Lites, "AOD", "HFCANDD0LITE", full::Y, full::FlagMc, full::FlagMcDecayChanRec, - full::OriginMcRec) + full::OriginMcRec, + hf_cand_mc_flag::PdgBhadMotherPart) DECLARE_SOA_TABLE(HfCandD0Fulls, "AOD", "HFCANDD0FULL", collision::PosX, @@ -201,7 +203,8 @@ DECLARE_SOA_TABLE(HfCandD0Fulls, "AOD", "HFCANDD0FULL", full::E, full::FlagMc, full::FlagMcDecayChanRec, - full::OriginMcRec); + full::OriginMcRec, + hf_cand_mc_flag::PdgBhadMotherPart); DECLARE_SOA_TABLE(HfCandD0FullEvs, "AOD", "HFCANDD0FULLEV", collision::NumContrib, @@ -286,7 +289,7 @@ struct HfTreeCreatorD0ToKPi { template auto fillTable(const T& candidate, int candFlag, double invMass, double topoChi2, - double ct, double y, double e, int8_t flagMc, int8_t flagMcDecay, int8_t origin) + double ct, double y, double e, int8_t flagMc, int8_t flagMcDecay, int8_t origin, int8_t flagBmother) { if (fillCandidateLiteTable) { rowCandidateLite( @@ -325,7 +328,8 @@ struct HfTreeCreatorD0ToKPi { y, flagMc, flagMcDecay, - origin); + origin, + flagBmother); } else { double cosThetaStar = candFlag == 0 ? HfHelper::cosThetaStarD0(candidate) : HfHelper::cosThetaStarD0bar(candidate); rowCandidateFull( @@ -388,7 +392,8 @@ struct HfTreeCreatorD0ToKPi { e, flagMc, flagMcDecay, - origin); + origin, + flagBmother); } if constexpr (ApplyMl) { if (candFlag == 0) { @@ -446,10 +451,10 @@ struct HfTreeCreatorD0ToKPi { massD0bar = HfHelper::invMassD0barToKPi(candidate); } if (candidate.isSelD0()) { - fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); + fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0, -1); } if (candidate.isSelD0bar()) { - fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0); + fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0, -1); } } } @@ -547,10 +552,10 @@ struct HfTreeCreatorD0ToKPi { massD0bar = HfHelper::invMassD0barToKPi(candidate); } if (candidate.isSelD0()) { - fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); + fillTable(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart())); } if (candidate.isSelD0bar()) { - fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec()); + fillTable(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart())); } } diff --git a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx index d301cee0752..e04c1bbec9b 100644 --- a/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx @@ -22,6 +22,7 @@ #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" @@ -149,7 +150,8 @@ DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE", collision::NumContrib, hf_cand_mc_flag::FlagMcMatchRec, hf_cand_mc_flag::OriginMcRec, - hf_cand_mc_flag::FlagMcDecayChanRec) + hf_cand_mc_flag::FlagMcDecayChanRec, + hf_cand_mc_flag::PdgBhadMotherPart) DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL", collision::NumContrib, @@ -230,7 +232,8 @@ DECLARE_SOA_TABLE(HfCandDpFulls, "AOD", "HFCANDDPFULL", full::Centrality, hf_cand_mc_flag::FlagMcMatchRec, hf_cand_mc_flag::OriginMcRec, - hf_cand_mc_flag::FlagMcDecayChanRec); + hf_cand_mc_flag::FlagMcDecayChanRec, + hf_cand_mc_flag::PdgBhadMotherPart); DECLARE_SOA_TABLE(HfCandDpFullEvs, "AOD", "HFCANDDPFULLEV", collision::NumContrib, @@ -305,10 +308,12 @@ struct HfTreeCreatorDplusToPiKPi { int8_t flagMc = 0; int8_t originMc = 0; int8_t channelMc = 0; + int8_t bMotherFlag = -1; if constexpr (DoMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); channelMc = candidate.flagMcDecayChanRec(); + bMotherFlag = o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()); } std::vector outputMl = {-999., -999.}; @@ -374,7 +379,8 @@ struct HfTreeCreatorDplusToPiKPi { coll.numContrib(), flagMc, originMc, - channelMc); + channelMc, + bMotherFlag); } else { rowCandidateFull( coll.numContrib(), @@ -455,7 +461,8 @@ struct HfTreeCreatorDplusToPiKPi { cent, flagMc, originMc, - channelMc); + channelMc, + bMotherFlag); } } diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index 57d484a63b1..353a57cea43 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -23,6 +23,7 @@ #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" @@ -149,6 +150,7 @@ DECLARE_SOA_TABLE(HfCandDsLites, "AOD", "HFCANDDSLITE", hf_cand_mc_flag::FlagMcMatchRec, hf_cand_mc_flag::OriginMcRec, hf_cand_mc_flag::FlagMcDecayChanRec, + hf_cand_mc_flag::PdgBhadMotherPart, hf_cand_mc_flag::IsCandidateSwapped, full::Sign); @@ -222,6 +224,7 @@ DECLARE_SOA_TABLE(HfCandDsFulls, "AOD", "HFCANDDSFULL", hf_cand_mc_flag::FlagMcMatchRec, hf_cand_mc_flag::OriginMcRec, hf_cand_mc_flag::FlagMcDecayChanRec, + hf_cand_mc_flag::PdgBhadMotherPart, hf_cand_mc_flag::IsCandidateSwapped, full::Sign); @@ -346,6 +349,7 @@ struct HfTreeCreatorDsToKKPi { int8_t flagMc{0}; int8_t originMc{0}; int8_t channelMc{0}; + int8_t bMotherFlag{-1}; int8_t isSwapped{MassHypo}; // 0 if KKPi, 1 if PiKK float eCand{0.f}; float ctCand{0.f}; @@ -355,6 +359,7 @@ struct HfTreeCreatorDsToKKPi { originMc = candidate.originMcRec(); channelMc = candidate.flagMcDecayChanRec(); isSwapped = candidate.isCandidateSwapped(); + bMotherFlag = o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()); if (fillDplusMc && candidate.flagMcDecayChanRec() == channelsResonant[Mother::Dplus][decayChannel]) { eCand = HfHelper::eDplus(candidate); ctCand = HfHelper::ctDplus(candidate); @@ -420,6 +425,7 @@ struct HfTreeCreatorDsToKKPi { flagMc, originMc, channelMc, + bMotherFlag, isSwapped, prong0.sign() + prong1.sign() + prong2.sign()); } else { @@ -493,6 +499,7 @@ struct HfTreeCreatorDsToKKPi { flagMc, originMc, channelMc, + bMotherFlag, isSwapped, prong0.sign() + prong1.sign() + prong2.sign()); }