From 43ee265828b09237cdb889444d313b32b9b7b2f8 Mon Sep 17 00:00:00 2001 From: fchinu Date: Fri, 16 Aug 2024 18:22:26 +0200 Subject: [PATCH 1/2] Automatically detect centrality estimator --- PWGHF/Core/CentralityEstimation.h | 80 +++++++++ PWGHF/D2H/Tasks/taskDs.cxx | 260 +++++++++++------------------- 2 files changed, 178 insertions(+), 162 deletions(-) diff --git a/PWGHF/Core/CentralityEstimation.h b/PWGHF/Core/CentralityEstimation.h index 23fd5d6ebb7..7e4cdeac9d8 100644 --- a/PWGHF/Core/CentralityEstimation.h +++ b/PWGHF/Core/CentralityEstimation.h @@ -28,6 +28,86 @@ enum CentralityEstimator { NTracksPV, NCentralityEstimators }; + +template +concept hasFT0ACent = requires(T collision) { + collision.centFT0A(); +}; + +template +concept hasFT0CCent = requires(T collision) { + collision.centFT0C(); +}; + +template +concept hasFT0MCent = requires(T collision) { + collision.centFT0M(); +}; + +template +concept hasFV0ACent = requires(T collision) { + collision.centFV0A(); +}; + +template +concept hasNTracksPVCent = requires(T collision) { + collision.centNTPV(); +}; + +/// Evaluate centrality/multiplicity percentile using FT0A estimator +/// \param candidate is candidate +/// \return centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll& collision) +{ + return collision.centFT0A(); +} + +/// Evaluate centrality/multiplicity percentile using FT0C estimator +/// \param candidate is candidate +/// \return centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll& collision) +{ + return collision.centFT0C(); +} + +/// Evaluate centrality/multiplicity percentile using FT0M estimator +/// \param candidate is candidate +/// \return centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll& collision) +{ + return collision.centFT0M(); +} + +/// Evaluate centrality/multiplicity percentile using FV0A estimator +/// \param candidate is candidate +/// \return centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll& collision) +{ + return collision.centFV0A(); +} + +/// Evaluate centrality/multiplicity percentile using NTracksPV estimator +/// \param candidate is candidate +/// \return centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll& collision) +{ + return collision.centNTPV(); +} + +/// Default case if no centrality/multiplicity estimator is provided +/// \param candidate is candidate +/// \return dummy value for centrality/multiplicity percentile of the collision +template +float getCentralityColl(const Coll&) +{ + return 105.0f; +} + } // namespace o2::hf_centrality #endif // PWGHF_CORE_CENTRALITYESTIMATION_H_ diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index bfdae9df51e..e2e9f6e5666 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -139,45 +139,25 @@ struct HfTaskDs { AxisSpec massbins = {600, 1.67, 2.27, "inv. mass (KK#pi) (GeV/#it{c}^{2})"}; AxisSpec centralitybins = {100, 0., 100., "Centrality"}; - if (!(doprocessData || doprocessMc || doprocessDataWithMl || doprocessMcWithMl)) { // If using centrality tables - histosPtr[DataType::Data]["hNPvContribAll"] = registry.add((folders[DataType::Data] + "hNPvContribAll").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, {100, 0., 100}}); - } + histosPtr[DataType::Data]["hNPvContribAll"] = registry.add((folders[DataType::Data] + "hNPvContribAll").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, {100, 0., 100}}); for (auto i = 0; i < DataType::kDataTypes; ++i) { - if (doprocessDataWithCentFT0C || doprocessDataWithCentFT0M || doprocessDataWithCentNTracksPV || - doprocessMcWithCentFT0C || doprocessMcWithCentFT0M || doprocessMcWithCentNTracksPV) { + if (doprocessDataWithCentFT0C || doprocessDataWithCentFT0M || doprocessDataWithCentNTracksPV || doprocessData || doprocessMcWithCentFT0C || doprocessMcWithCentFT0M || doprocessMcWithCentNTracksPV || doprocessMc) { if (i == DataType::Data) { // If data do not fill PV contributors in sparse histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, centralitybins}); } else { histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, centralitybins, axisNPvContributors}); } - - histosPtr[i]["hNPvContribCands"] = registry.add((folders[i] + "hNPvContribCands").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - histosPtr[i]["hNPvContribCandsInSignalRegionDs"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDs").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - histosPtr[i]["hNPvContribCandsInSignalRegionDplus"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDplus").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - } else if (doprocessDataWithMlAndCentFT0C || doprocessDataWithMlAndCentFT0M || doprocessDataWithMlAndCentNTracksPV || - doprocessMcWithMlAndCentFT0C || doprocessMcWithMlAndCentFT0M || doprocessMcWithMlAndCentNTracksPV) { + } else if (doprocessDataWithMlAndCentFT0C || doprocessDataWithMlAndCentFT0M || doprocessDataWithMlAndCentNTracksPV || doprocessDataWithMl || doprocessMcWithMlAndCentFT0C || doprocessMcWithMlAndCentFT0M || doprocessMcWithMlAndCentNTracksPV || doprocessMcWithMl) { if (i == DataType::Data) { // If data do not fill PV contributors in sparse histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, centralitybins, axisMlScore0, axisMlScore1, axisMlScore2}); } else { histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, centralitybins, axisMlScore0, axisMlScore1, axisMlScore2, axisNPvContributors}); } - histosPtr[i]["hNPvContribCands"] = registry.add((folders[i] + "hNPvContribCands").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - histosPtr[i]["hNPvContribCandsInSignalRegionDs"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDs").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - histosPtr[i]["hNPvContribCandsInSignalRegionDplus"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDplus").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); - } else if (doprocessData || doprocessMc) { - if (i == DataType::Data) { // If data do not fill PV contributors in sparse - histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins}); - } else { - histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, axisNPvContributors}); - } - } else if (doprocessDataWithMl || doprocessMcWithMl) { - if (i == DataType::Data) { // If data do not fill PV contributors in sparse - histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, axisMlScore0, axisMlScore1, axisMlScore2}); - } else { - histosPtr[i]["hSparseMass"] = registry.add((folders[i] + "hSparseMass").c_str(), "THn for Ds", HistType::kTHnSparseF, {massbins, ptbins, axisMlScore0, axisMlScore1, axisMlScore2, axisNPvContributors}); - } } + histosPtr[i]["hNPvContribCands"] = registry.add((folders[i] + "hNPvContribCands").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); + histosPtr[i]["hNPvContribCandsInSignalRegionDs"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDs").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); + histosPtr[i]["hNPvContribCandsInSignalRegionDplus"] = registry.add((folders[i] + "hNPvContribCandsInSignalRegionDplus").c_str(), "3-prong candidates;NPvContributors;Centrality;Entries", HistType::kTH2F, {axisNPvContributors, centralitybins}); histosPtr[i]["hPt"] = registry.add((folders[i] + "hPt").c_str(), "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); histosPtr[i]["hPtProng0"] = registry.add((folders[i] + "hPtProng0").c_str(), "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); histosPtr[i]["hPtProng1"] = registry.add((folders[i] + "hPtProng1").c_str(), "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -256,40 +236,28 @@ struct HfTaskDs { return std::abs(candidate.flagMcMatchRec()) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi)); } - /// Evaluate centrality/multiplicity percentile + /// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table) /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision - template - int evaluateCentralityColl(const Coll& collision) + template + float evaluateCentralityColl(const Coll& collision) { - if constexpr (centDetector == CentralityEstimator::FT0C) { - return collision.centFT0C(); - } else if constexpr (centDetector == CentralityEstimator::FT0M) { - return collision.centFT0M(); - } else if constexpr (centDetector == CentralityEstimator::NTracksPV) { - return collision.centNTPV(); - } + return o2::hf_centrality::getCentralityColl(collision); } /// Evaluate centrality/multiplicity percentile /// \param candidate is candidate /// \return centrality/multiplicity percentile of the collision associated to the candidate - template - int evaluateCentralityCand(const T1& candidate) + template + float evaluateCentralityCand(const T1& candidate) { - if constexpr (centDetector == CentralityEstimator::FT0C) { - return evaluateCentralityColl(candidate.template collision_as()); - } else if constexpr (centDetector == CentralityEstimator::FT0M) { - return evaluateCentralityColl(candidate.template collision_as()); - } else if constexpr (centDetector == CentralityEstimator::NTracksPV) { - return evaluateCentralityColl(candidate.template collision_as()); - } + return evaluateCentralityColl(candidate.template collision_as()); } /// Fill histograms of quantities independent from the daugther-mass hypothesis /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum - template + template void fillHisto(const T1& candidate, DataType dataType) { auto pt = candidate.pt(); @@ -322,7 +290,7 @@ struct HfTaskDs { /// Fill histograms of quantities for the KKPi daugther-mass hypothesis /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum - template + template void fillHistoKKPi(const T1& candidate, DataType dataType) { auto pt = candidate.pt(); @@ -335,17 +303,9 @@ struct HfTaskDs { } outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)]; } - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, outputMl[0], outputMl[1], outputMl[2]); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); } else { - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate)); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate)); } } else { if constexpr (useMl) { @@ -356,17 +316,9 @@ struct HfTaskDs { } outputMl[iclass] = candidate.mlProbDsToKKPi()[classMl->at(iclass)]; } - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); } else { - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, candidate.template collision_as().numContrib()); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToKKPi(candidate), pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); } } @@ -381,7 +333,7 @@ struct HfTaskDs { /// Fill histograms of quantities for the PiKK daugther-mass hypothesis /// \param candidate is candidate /// \param dataType is data class, as defined in DataType enum - template + template void fillHistoPiKK(const T1& candidate, DataType dataType) { auto pt = candidate.pt(); @@ -395,17 +347,9 @@ struct HfTaskDs { } outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)]; } - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, outputMl[0], outputMl[1], outputMl[2]); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2]); } else { - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate)); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate)); } } else { if constexpr (useMl) { @@ -416,17 +360,9 @@ struct HfTaskDs { } outputMl[iclass] = candidate.mlProbDsToPiKK()[classMl->at(iclass)]; } - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as().numContrib()); } else { - if constexpr (centDetector != CentralityEstimator::None) { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); - } else { - std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, candidate.template collision_as().numContrib()); - } + std::get(histosPtr[dataType]["hSparseMass"])->Fill(hfHelper.invMassDsToPiKK(candidate), pt, evaluateCentralityCand(candidate), candidate.template collision_as().numContrib()); } } @@ -442,7 +378,7 @@ struct HfTaskDs { /// \param candidate is candidate /// \param mcParticles are particles with MC information /// \param whichSpeciesDecay defines which histogram to fill - template + template void fillHistoMCRec(const T1& candidate, const CandDsMcGen& mcParticles, DataType dataType) { @@ -470,12 +406,12 @@ struct HfTaskDs { auto pt = candidate.pt(); // rec. level pT if (candidate.isSelDsToKKPi() >= selectionFlagDs) { // KKPi - fillHisto(candidate, dataType); - fillHistoKKPi(candidate, dataType); + fillHisto(candidate, dataType); + fillHistoKKPi(candidate, dataType); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { // PiKK - fillHisto(candidate, dataType); - fillHistoPiKK(candidate, dataType); + fillHisto(candidate, dataType); + fillHistoPiKK(candidate, dataType); } std::get(histosPtr[dataType]["hPtRecSig"])->Fill(pt); @@ -493,23 +429,23 @@ struct HfTaskDs { return; } - template + template void runDataAnalysis(CandDs const& candidate) { if (yCandRecoMax >= 0. && std::abs(hfHelper.yDs(candidate)) > yCandRecoMax) { return; } if constexpr (decayChannel == FinalState::KKPi) { // KKPi - fillHisto(candidate, DataType::Data); - fillHistoKKPi(candidate, DataType::Data); + fillHisto(candidate, DataType::Data); + fillHistoKKPi(candidate, DataType::Data); } if constexpr (decayChannel == FinalState::PiKK) { // PiKK - fillHisto(candidate, DataType::Data); - fillHistoPiKK(candidate, DataType::Data); + fillHisto(candidate, DataType::Data); + fillHistoPiKK(candidate, DataType::Data); } } - template + template void runMcAnalysis(CandDs const& candidate, CandDsMcGen const& mcParticles) { @@ -525,7 +461,7 @@ struct HfTaskDs { for (int i = DataType::McDsPrompt; i <= DataType::McDplusBkg; i++) { // Check what type of MC signal candidate it is, and fill the corresponding histograms if ((this->*isOfType[i - DataType::McDsPrompt])(candidate)) { isBkg = false; - fillHistoMCRec(candidate, mcParticles, static_cast(i)); + fillHistoMCRec(candidate, mcParticles, static_cast(i)); break; } } @@ -536,12 +472,12 @@ struct HfTaskDs { if (candidate.isSelDsToKKPi() >= selectionFlagDs || candidate.isSelDsToPiKK() >= selectionFlagDs) { if (candidate.isSelDsToKKPi() >= selectionFlagDs) { // KKPi - fillHisto(candidate, DataType::McBkg); - fillHistoKKPi(candidate, DataType::McBkg); + fillHisto(candidate, DataType::McBkg); + fillHistoKKPi(candidate, DataType::McBkg); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { // PiKK - fillHisto(candidate, DataType::McBkg); - fillHistoPiKK(candidate, DataType::McBkg); + fillHisto(candidate, DataType::McBkg); + fillHistoPiKK(candidate, DataType::McBkg); } } } @@ -691,23 +627,23 @@ struct HfTaskDs { } } - template + template void fillNPvContribHisto(const Coll& collision, std::array& nCandsPerType, std::array& nCandsInSignalRegionDsPerType, std::array& nCandsInSignalRegionDplusPerType) { int numPvContributors = collision.numContrib(); - std::get(histosPtr[DataType::Data]["hNPvContribAll"])->Fill(numPvContributors, evaluateCentralityColl(collision)); + std::get(histosPtr[DataType::Data]["hNPvContribAll"])->Fill(numPvContributors, evaluateCentralityColl(collision)); for (int i = 0; i < DataType::kDataTypes; i++) { if (nCandsPerType[i]) { - std::get(histosPtr[i]["hNPvContribCands"])->Fill(numPvContributors, evaluateCentralityColl(collision)); + std::get(histosPtr[i]["hNPvContribCands"])->Fill(numPvContributors, evaluateCentralityColl(collision)); } if (nCandsInSignalRegionDsPerType[i]) { - std::get(histosPtr[i]["hNPvContribCandsInSignalRegionDs"])->Fill(numPvContributors, evaluateCentralityColl(collision)); + std::get(histosPtr[i]["hNPvContribCandsInSignalRegionDs"])->Fill(numPvContributors, evaluateCentralityColl(collision)); } if (nCandsInSignalRegionDplusPerType[i]) { - std::get(histosPtr[i]["hNPvContribCandsInSignalRegionDplus"])->Fill(numPvContributors, evaluateCentralityColl(collision)); + std::get(histosPtr[i]["hNPvContribCandsInSignalRegionDplus"])->Fill(numPvContributors, evaluateCentralityColl(collision)); } } } @@ -730,13 +666,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithCentFT0C, "Process data w/o ML information on Ds, with information on centrality from FT0C", false); @@ -759,13 +695,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithCentFT0M, "Process data w/o ML information on Ds, with information on centrality from FT0M", false); @@ -788,13 +724,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithCentNTracksPV, "Process data w/o ML information on Ds, with information on centrality from NTracksPV", false); @@ -812,10 +748,10 @@ struct HfTaskDs { } if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis>(candidate); + runDataAnalysis>(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis>(candidate); + runDataAnalysis>(candidate); } } } @@ -840,13 +776,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithMlAndCentFT0C, "Process data with ML information on Ds, with information on centrality from FT0C", false); @@ -869,13 +805,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithMlAndCentFT0M, "Process data with ML information on Ds, with information on centrality from FT0M", false); @@ -898,13 +834,13 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } } PROCESS_SWITCH(HfTaskDs, processDataWithMlAndCentNTracksPV, "Process data with ML information on Ds, with information on centrality", false); @@ -922,10 +858,10 @@ struct HfTaskDs { } if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis>(candidate); + runDataAnalysis>(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis>(candidate); + runDataAnalysis>(candidate); } } } @@ -951,16 +887,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -985,16 +921,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -1019,16 +955,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -1048,17 +984,17 @@ struct HfTaskDs { continue; } - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } } - fillMcGenHistos(mcParticles, collisions); + fillMcGenHistos(mcParticles, collisions); } PROCESS_SWITCH(HfTaskDs, processMc, "Process MC w/o ML information on Ds, w/o information on centrality", false); @@ -1081,16 +1017,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -1115,16 +1051,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -1149,16 +1085,16 @@ struct HfTaskDs { incrementCandCounters(candidate, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } - fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); + fillNPvContribHisto(collision, nCandsPerType, nCandsInSignalRegionDsPerType, nCandsInSignalRegionDplusPerType); } fillMcGenHistos(mcParticles, collisions); } @@ -1178,13 +1114,13 @@ struct HfTaskDs { continue; } - runMcAnalysis(candidate, mcParticles); + runMcAnalysis(candidate, mcParticles); if (candidate.isSelDsToKKPi() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } if (candidate.isSelDsToPiKK() >= selectionFlagDs) { - runDataAnalysis(candidate); + runDataAnalysis(candidate); } } } From ad254bb8449c2cb0236befbcad7093d530b23993 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 16 Aug 2024 16:34:07 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGHF/Core/CentralityEstimation.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PWGHF/Core/CentralityEstimation.h b/PWGHF/Core/CentralityEstimation.h index 7e4cdeac9d8..ea9d1f257b6 100644 --- a/PWGHF/Core/CentralityEstimation.h +++ b/PWGHF/Core/CentralityEstimation.h @@ -30,27 +30,32 @@ enum CentralityEstimator { }; template -concept hasFT0ACent = requires(T collision) { +concept hasFT0ACent = requires(T collision) +{ collision.centFT0A(); }; template -concept hasFT0CCent = requires(T collision) { +concept hasFT0CCent = requires(T collision) +{ collision.centFT0C(); }; template -concept hasFT0MCent = requires(T collision) { +concept hasFT0MCent = requires(T collision) +{ collision.centFT0M(); }; template -concept hasFV0ACent = requires(T collision) { +concept hasFV0ACent = requires(T collision) +{ collision.centFV0A(); }; template -concept hasNTracksPVCent = requires(T collision) { +concept hasNTracksPVCent = requires(T collision) +{ collision.centNTPV(); };