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
60 changes: 29 additions & 31 deletions PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@
// Events
DECLARE_SOA_COLUMN(IsEventReject, isEventReject, int); //! Event rejection flag
DECLARE_SOA_COLUMN(RunNumber, runNumber, int); //! Run number
DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Collision centrality (for reco MC)
DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Collision centrality (for reco MC)
// ML scores
DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); //! Bkg score (for reco MC candidates)
DECLARE_SOA_COLUMN(FdScore, fdScore, float); //! FD score (for reco MC candidates)
DECLARE_SOA_COLUMN(BkgScore, bkgScore, float); //! Bkg score (for reco MC candidates)
DECLARE_SOA_COLUMN(FdScore, fdScore, float); //! FD score (for reco MC candidates)
} // namespace full
DECLARE_SOA_TABLE(HfCandDpMls, "AOD", "HFCANDDPML",
full::M,
full::Pt,
full::Centrality,
full::BkgScore,
full::FdScore,
hf_cand_3prong::FlagMcMatchRec,
hf_cand_3prong::OriginMcRec,
hf_cand_3prong::FlagMcDecayChanRec)
full::M,
full::Pt,
full::Centrality,
full::BkgScore,
full::FdScore,
hf_cand_3prong::FlagMcMatchRec,
hf_cand_3prong::OriginMcRec,
hf_cand_3prong::FlagMcDecayChanRec)
DECLARE_SOA_TABLE(HfCandDpLites, "AOD", "HFCANDDPLITE",
hf_cand::Chi2PCA,
full::DecayLength,
Expand Down Expand Up @@ -257,7 +257,7 @@
Configurable<bool> fillOnlyBackground{"fillOnlyBackground", false, "Flag to fill derived tables with background for ML trainings"};
Configurable<float> downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"};
Configurable<float> ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"};
Configurable<std::vector<int>> classMl{"classMlindexes", {0, 2}, "Indexes of ML bkg and non-prompt scores."};

Check warning on line 260 in PWGHF/TableProducer/treeCreatorDplusToPiKPi.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)

HfHelper hfHelper;

Expand Down Expand Up @@ -302,18 +302,18 @@
originMc = candidate.originMcRec();
channelMc = candidate.flagMcDecayChanRec();
}

std::vector<float> outputMl = {-999., -999.};
if constexpr (doMl) {
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
}
}

auto prong0 = candidate.template prong0_as<TracksWPid>();
auto prong1 = candidate.template prong1_as<TracksWPid>();
auto prong2 = candidate.template prong2_as<TracksWPid>();

if (fillCandidateLiteTable) {
rowCandidateLite(
candidate.chi2PCA(),
Expand Down Expand Up @@ -360,20 +360,19 @@
flagMc,
originMc,
channelMc);
} else if (fillOnlySignalMl) {
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
double cent = getCentralityColl(collision, CentralityEstimator::FT0C);
rowCandidateMl(
hfHelper.invMassDplusToPiKPi(candidate),
candidate.pt(),
cent,
outputMl[0],
outputMl[1],
flagMc,
originMc,
channelMc
);
} else {
} else if (fillOnlySignalMl) {
auto collision = candidate.template collision_as<McRecoCollisionsCent>();
double cent = getCentralityColl(collision, CentralityEstimator::FT0C);
rowCandidateMl(
hfHelper.invMassDplusToPiKPi(candidate),
candidate.pt(),
cent,
outputMl[0],
outputMl[1],
flagMc,
originMc,
channelMc);
} else {
rowCandidateFull(
candidate.collision().bcId(),
candidate.collision().numContrib(),
Expand Down Expand Up @@ -454,8 +453,8 @@
flagMc,
originMc,
channelMc);
}
}
}

void processData(aod::Collisions const& collisions,
soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>> const& candidates,
Expand Down Expand Up @@ -536,8 +535,7 @@
}
fillCandidateTable<true, true>(candidate);
}
}
else {
} else {
if (fillCandidateLiteTable) {
rowCandidateLite.reserve(candidates.size());
} else {
Expand Down
Loading