Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions PWGHF/TableProducer/treeCreatorD0ToKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -286,7 +289,7 @@ struct HfTreeCreatorD0ToKPi {

template <bool ApplyMl, typename T>
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(
Expand Down Expand Up @@ -325,7 +328,8 @@ struct HfTreeCreatorD0ToKPi {
y,
flagMc,
flagMcDecay,
origin);
origin,
flagBmother);
} else {
double cosThetaStar = candFlag == 0 ? HfHelper::cosThetaStarD0(candidate) : HfHelper::cosThetaStarD0bar(candidate);
rowCandidateFull(
Expand Down Expand Up @@ -388,7 +392,8 @@ struct HfTreeCreatorD0ToKPi {
e,
flagMc,
flagMcDecay,
origin);
origin,
flagBmother);
}
if constexpr (ApplyMl) {
if (candFlag == 0) {
Expand Down Expand Up @@ -446,10 +451,10 @@ struct HfTreeCreatorD0ToKPi {
massD0bar = HfHelper::invMassD0barToKPi(candidate);
}
if (candidate.isSelD0()) {
fillTable<ApplyMl>(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0);
fillTable<ApplyMl>(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0, -1);
}
if (candidate.isSelD0bar()) {
fillTable<ApplyMl>(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0);
fillTable<ApplyMl>(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, 0, 0, 0, -1);
}
}
}
Expand Down Expand Up @@ -547,10 +552,10 @@ struct HfTreeCreatorD0ToKPi {
massD0bar = HfHelper::invMassD0barToKPi(candidate);
}
if (candidate.isSelD0()) {
fillTable<ApplyMl>(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec());
fillTable<ApplyMl>(candidate, 0, massD0, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()));
}
if (candidate.isSelD0bar()) {
fillTable<ApplyMl>(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec());
fillTable<ApplyMl>(candidate, 1, massD0bar, topolChi2PerNdf, ctD, yD, eD, candidate.flagMcMatchRec(), candidate.flagMcDecayChanRec(), candidate.originMcRec(), o2::analysis::getBHadMotherFlag(candidate.pdgBhadMotherPart()));
}
}

Expand Down
15 changes: 11 additions & 4 deletions PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<float> outputMl = {-999., -999.};
Expand Down Expand Up @@ -374,7 +379,8 @@ struct HfTreeCreatorDplusToPiKPi {
coll.numContrib(),
flagMc,
originMc,
channelMc);
channelMc,
bMotherFlag);
} else {
rowCandidateFull(
coll.numContrib(),
Expand Down Expand Up @@ -455,7 +461,8 @@ struct HfTreeCreatorDplusToPiKPi {
cent,
flagMc,
originMc,
channelMc);
channelMc,
bMotherFlag);
}
}

Expand Down
7 changes: 7 additions & 0 deletions PWGHF/TableProducer/treeCreatorDsToKKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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};
Expand All @@ -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);
Expand Down Expand Up @@ -420,6 +425,7 @@ struct HfTreeCreatorDsToKKPi {
flagMc,
originMc,
channelMc,
bMotherFlag,
isSwapped,
prong0.sign() + prong1.sign() + prong2.sign());
} else {
Expand Down Expand Up @@ -493,6 +499,7 @@ struct HfTreeCreatorDsToKKPi {
flagMc,
originMc,
channelMc,
bMotherFlag,
isSwapped,
prong0.sign() + prong1.sign() + prong2.sign());
}
Expand Down
Loading