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
31 changes: 25 additions & 6 deletions PWGHF/D2H/Tasks/taskLc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ struct HfTaskLc {
const AxisSpec thnAxisBdtScoreLcPrompt{thnConfigAxisBdtScorePrompt, "BDT prompt score (Lc)"};
const AxisSpec thnAxisBdtScoreLcNonPrompt{thnConfigAxisBdtScoreNonPrompt, "BDT non-prompt score (Lc)"};
const AxisSpec thnAxisCanType{thnConfigAxisCanType, "candidates type"};
const AxisSpec thnAxisChannel{4, -0.5, 3.5, "0: direct 1,2,3: resonant"};
const AxisSpec thnAxisY{thnAxisRapidity, "rapidity"};
const AxisSpec thnAxisPtB{thnConfigAxisGenPtB, "#it{p}_{T}^{B} (GeV/#it{c})"};
const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"};
Expand All @@ -284,16 +285,16 @@ struct HfTaskLc {
axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets};
}
if (isMcStd) {
axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType, thnAxisChannel};
}
if (isMcStd || isMcWithMl) {
axesGen = {thnAxisPt, thnAxisCentrality, thnAxisY, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
axesGen = {thnAxisPt, thnAxisCentrality, thnAxisY, thnAxisTracklets, thnAxisPtB, thnAxisCanType, thnAxisChannel};
}
if (isDataWithMl) {
axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets};
}
if (isMcWithMl) {
axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType, thnAxisChannel};
}

if (storeOccupancy) {
Expand Down Expand Up @@ -340,6 +341,22 @@ struct HfTaskLc {
return o2::hf_centrality::getCentralityColl<Coll>(collision);
}

/// Map the reconstructed/generated resonant decay channel to the THn channel bins.
int remapResoChannelLc(int channel)
{
switch (channel) {
case 0:
return 0;
case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToPKstar0:
return 1;
case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToDeltaplusplusK:
return 2;
case o2::hf_decay::hf_cand_3prong::DecayChannelResonant::LcToL1520Pi:
return 3;
}
return -1;
}

/// Evaluate decay time of generated particle
/// \param mcParticleProng0 one of generated particle's daughters
/// \param motherParticle generated particle
Expand Down Expand Up @@ -471,6 +488,7 @@ struct HfTaskLc {

auto fillTHnRecSig = [&](bool isPKPi) {
const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);
const int channel = remapResoChannelLc(candidate.flagMcDecayChanRec());

std::vector<double> valuesToFill;
if constexpr (FillMl) {
Expand All @@ -482,10 +500,10 @@ struct HfTaskLc {
}
/// Fill the ML outputScores and variables of candidate
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)});
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType), static_cast<double>(channel)});
} 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)});
valuesToFill.insert(valuesToFill.end(), {massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType), static_cast<double>(channel)});
}
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
Expand Down Expand Up @@ -555,14 +573,15 @@ struct HfTaskLc {
const auto mcDaughter0 = particle.template daughters_as<McParticles3ProngMatched>().begin();

const float properDecayTime = evaluateMcGenDecayTime(mcDaughter0, particle);
const int channel = remapResoChannelLc(particle.flagMcDecayChanGen());

fillHistogramsGen<Signal>(particle);

auto fillTHnGen = [&](bool isPrompt) {
ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt();

if (fillTHn) {
std::vector<double> valuesToFill{ptGen, cent, yGen, static_cast<double>(numPvContributors), ptGenB, static_cast<double>(originType)};
std::vector<double> valuesToFill{ptGen, cent, yGen, static_cast<double>(numPvContributors), ptGenB, static_cast<double>(originType), static_cast<double>(channel)};
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
valuesToFill.push_back(occ);
}
Expand Down
Loading