Skip to content
Draft
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
38 changes: 26 additions & 12 deletions PWGHF/TableProducer/treeCreatorLcToPKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ DECLARE_SOA_TABLE(HfCandLcLites, "AOD", "HFCANDLCLITE",
full::MassKPi,
full::MlScoreFirstClass,
full::MlScoreSecondClass,
full::MlScoreThirdClass);
full::MlScoreThirdClass,
full::CentFT0C);

DECLARE_SOA_TABLE(HfCollIdLCLite, "AOD", "HFCOLLIDLCLITE",
full::CollisionId);
Expand Down Expand Up @@ -343,7 +344,8 @@ DECLARE_SOA_TABLE(HfCandLcFulls, "AOD", "HFCANDLCFULL",
full::MassKPi,
full::MlScoreFirstClass,
full::MlScoreSecondClass,
full::MlScoreThirdClass);
full::MlScoreThirdClass,
full::CentFT0C);

DECLARE_SOA_TABLE(HfCandLcFullEvs, "AOD", "HFCANDLCFULLEV",
full::CollisionId,
Expand Down Expand Up @@ -607,8 +609,8 @@ struct HfTreeCreatorLcToPKPi {
/// \param candidate candidate instance
/// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
template <bool IsMc, typename CandType>
void fillLiteTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
template <bool UseCentrality, bool IsMc, typename CandType, typename CollType>
void fillLiteTable(CandType const& candidate, CollType const& collision, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
{
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
const float functionCt = HfHelper::ctLc(candidate);
Expand All @@ -634,6 +636,11 @@ struct HfTreeCreatorLcToPKPi {
assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag);
}

float centFT0C = -1.f;
if constexpr (UseCentrality) {
centFT0C = collision.centFT0C();
}

rowCandidateLite(
candidate.posX(),
candidate.posY(),
Expand Down Expand Up @@ -681,7 +688,8 @@ struct HfTreeCreatorLcToPKPi {
functionInvMassKPi,
mlScoreFirstClass,
mlScoreSecondClass,
mlScoreThirdClass);
mlScoreThirdClass,
centFT0C);

if (fillCollIdTable) {
/// save also candidate collision indices
Expand All @@ -693,8 +701,8 @@ struct HfTreeCreatorLcToPKPi {
/// \param candidate candidate instance
/// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
template <bool IsMc, typename CandType>
void fillFullTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
template <bool UseCentrality, bool IsMc, typename CandType, typename CollType>
void fillFullTable(CandType const& candidate, CollType const& collision, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
{
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
const float functionCt = HfHelper::ctLc(candidate);
Expand All @@ -721,6 +729,11 @@ struct HfTreeCreatorLcToPKPi {
assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag);
}

float centFT0C = -1.f;
if constexpr (UseCentrality) {
centFT0C = collision.centFT0C();
}

rowCandidateFull(
candidate.collisionId(),
candidate.posX(),
Expand Down Expand Up @@ -797,7 +810,8 @@ struct HfTreeCreatorLcToPKPi {
functionInvMassKPi,
mlScoreFirstClass,
mlScoreSecondClass,
mlScoreThirdClass);
mlScoreThirdClass,
centFT0C);
}

/// \brief function to fill lite table
Expand Down Expand Up @@ -944,9 +958,9 @@ struct HfTreeCreatorLcToPKPi {
const bool notSkippedBkg = isMcCandidateSignal || candidate.pt() > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor;
if (passSelection && notSkippedBkg && (keepAll || (keepSignalMc && isMcCandidateSignal) || (keepBkgMc && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
if (fillCandidateLiteTable) {
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
fillLiteTable<UseCentrality, IsMc>(candidate, collision, candidateMlScore, candFlag);
} else {
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
fillFullTable<UseCentrality, IsMc>(candidate, collision, candidateMlScore, candFlag);
}

if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
Expand Down Expand Up @@ -1126,9 +1140,9 @@ struct HfTreeCreatorLcToPKPi {
const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP();
if (functionSelection >= selectionFlagLc && (candidate.pt() > downSampleBkgPtMax || (pseudoRndm < downSampleBkgFactor && candidate.pt() < downSampleBkgPtMax))) {
if (fillCandidateLiteTable) {
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
fillLiteTable<UseCentrality, IsMc>(candidate, collision, candidateMlScore, candFlag);
} else {
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
fillFullTable<UseCentrality, IsMc>(candidate, collision, candidateMlScore, candFlag);
}

if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
Expand Down
Loading