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
56 changes: 28 additions & 28 deletions PWGHF/D2H/Tasks/taskLc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ struct HfTaskLc {
auto fillTHnRecSig = [&](bool isPKPi) {
const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);

std::vector<double> valuesToFill;
if constexpr (FillMl) {
const auto& mlProb = isPKPi ? candidate.mlProbLcToPKPi() : candidate.mlProbLcToPiKP();
if (mlProb.size() == NumberOfMlClasses) {
Expand All @@ -476,22 +477,21 @@ struct HfTaskLc {
outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score
}
/// Fill the ML outputScores and variables of candidate
std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)};
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
valuesToFill.reserve(registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->GetNdimensions());
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)});
} else {
valuesToFill.reserve(registry.get<THnSparse>(HIST("hnLcVars"))->GetNdimensions());
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)});
}
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
if constexpr (FillMl) {
registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data());
} else {
std::vector<double> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)};
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
registry.get<THnSparse>(HIST("hnLcVars"))->Fill(valuesToFill.data());
}
};
Expand Down Expand Up @@ -661,6 +661,7 @@ struct HfTaskLc {
auto fillTHnData = [&](bool isPKPi) {
const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);

std::vector<double> valuesToFill;
if constexpr (FillMl) {
const auto& mlProb = isPKPi ? candidate.mlProbLcToPKPi() : candidate.mlProbLcToPiKP();
if (mlProb.size() == NumberOfMlClasses) {
Expand All @@ -669,22 +670,21 @@ struct HfTaskLc {
outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score
}
/// Fill the ML outputScores and variables of candidate
std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors)};
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
valuesToFill.reserve(registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->GetNdimensions());
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors)});
} else {
valuesToFill.reserve(registry.get<THnSparse>(HIST("hnLcVars"))->GetNdimensions());
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors)});
}
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
if constexpr (FillMl) {
registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data());
} else {
std::vector<double> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors)};
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
if (storeProperLifetime) {
valuesToFill.push_back(properLifetime);
}
registry.get<THnSparse>(HIST("hnLcVars"))->Fill(valuesToFill.data());
}
};
Expand Down
Loading