Skip to content
Merged
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
30 changes: 12 additions & 18 deletions PWGHF/TableProducer/treeCreatorLcToPKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -565,17 +565,11 @@ struct HfTreeCreatorLcToPKPi {
/// \brief function to evaluate invariant mass of the Lc candidate and KPi pair
/// \param candidate candidate instance
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
template <int reconstructionType, typename CandType>
std::pair<float, float> evaluateInvariantMasses(CandType const& candidate, int candFlag)
template <typename CandType>
std::pair<float, float> evaluateInvariantMassesDCAFitter(CandType const& candidate, int candFlag)
{
float invMass, invMassKPi;
if constexpr (reconstructionType == aod::hf_cand::VertexerType::DCAFitter) {
invMass = candFlag == 0 ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate);
invMassKPi = candFlag == 0 ? hfHelper.invMassKPiPairLcToPKPi(candidate) : hfHelper.invMassKPiPairLcToPiKP(candidate);
} else {
invMass = candFlag == 0 ? candidate.kfMassPKPi() : candidate.kfMassPiKP();
invMassKPi = candFlag == 0 ? candidate.kfMassKPi() : candidate.kfMassPiK();
}
const float invMass = candFlag == 0 ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate);
const float invMassKPi = candFlag == 0 ? hfHelper.invMassKPiPairLcToPKPi(candidate) : hfHelper.invMassKPiPairLcToPiKP(candidate);

return std::make_pair(invMass, invMassKPi);
}
Expand Down Expand Up @@ -612,10 +606,10 @@ 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, int reconstructionType, typename CandType>
template <bool isMc, typename CandType>
void fillLiteTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
{
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType>(candidate, candFlag);
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
const float functionCt = hfHelper.ctLc(candidate);
const float functionY = hfHelper.yLc(candidate);

Expand Down Expand Up @@ -697,10 +691,10 @@ 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, int reconstructionType, typename CandType>
template <bool isMc, typename CandType>
void fillFullTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
{
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType>(candidate, candFlag);
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
const float functionCt = hfHelper.ctLc(candidate);
const float functionY = hfHelper.yLc(candidate);
const float functionE = hfHelper.eLc(candidate);
Expand Down Expand Up @@ -948,9 +942,9 @@ struct HfTreeCreatorLcToPKPi {
const bool notSkippedBkg = isMcCandidateSignal || candidate.pt() > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor;
if (passSelection && notSkippedBkg && (keepAll || (keepOnlySignalMc && isMcCandidateSignal) || (keepOnlyBkg && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
if (fillCandidateLiteTable) {
fillLiteTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
} else {
fillFullTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
}

if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) {
Expand Down Expand Up @@ -1130,9 +1124,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, reconstructionType>(candidate, candidateMlScore, candFlag);
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
} else {
fillFullTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
}

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