diff --git a/PWGCF/Femto/Core/baseSelection.h b/PWGCF/Femto/Core/baseSelection.h index 9ecf9edfe6d..469c1f6c521 100644 --- a/PWGCF/Femto/Core/baseSelection.h +++ b/PWGCF/Femto/Core/baseSelection.h @@ -257,7 +257,7 @@ class BaseSelection /// \brief Check whether all required and optional cuts are passed. /// \return True if all minimal cuts pass and, if optional cuts are present, at least one of them passes. - bool passesAllRequiredSelections() const + [[nodiscard]] bool passesAllRequiredSelections() const { if (mHasMinimalSelection && !mHasOptionalSelection) { return mPassesMinimalSelections; @@ -275,14 +275,14 @@ class BaseSelection /// \brief Check whether the optional selection for a specific observable is passed. /// \param observableIndex Index of the observable. /// \return True if at least one optional selection for this observable is fulfilled. - bool passesOptionalSelection(int observableIndex) const + [[nodiscard]] bool passesOptionalSelection(int observableIndex) const { return mSelectionContainers.at(observableIndex).passesAsOptionalCut(); } /// \brief Assemble the global selection bitmask from all individual observable selections. /// \tparam HistName Name of the histogram used to track selection statistics. - template + template void assembleBitmask() { mHistRegistry->fill(HIST(HistName), mNSelection); @@ -391,7 +391,7 @@ class BaseSelection /// \brief Initialize histograms and set bitmask offsets for all configured observables. /// \tparam HistName Name of the histogram to create in the registry. /// \param registry Pointer to the histogram registry. - template + template void setupContainers(o2::framework::HistogramRegistry* registry) { mHistRegistry = registry; diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index 4b2fb7863b0..2a7e7f0180a 100644 --- a/PWGCF/Femto/Core/cascadeBuilder.h +++ b/PWGCF/Femto/Core/cascadeBuilder.h @@ -37,11 +37,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::cascadebuilder { -namespace cascadebuilder -{ - struct ConfCascadeFilters : o2::framework::ConfigurableGroup { std::string prefix = std::string("CascadeFilters"); o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; @@ -62,7 +59,9 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup { o2::framework::Configurable massLambdaMax{"massLambdaMax", 1.2f, "Maximum Lambda mass"}; }; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define CASCADE_DEFAULT_BITS \ + o2::framework::Configurable passThrough{"passThrough", false, "If true, all Cascades are passed through. Bits for all selections are stored."}; \ o2::framework::Configurable> cascadeCpaMin{"cascadeCpaMin", {0.95f}, "Minimum cosine of pointing angle"}; \ o2::framework::Configurable> cascadeTransRadMin{"cascadeTransRadMin", {0.9f}, "Minimum transverse radius (cm)"}; \ o2::framework::Configurable> cascadeDcaDauMax{"cascadeDcaDauMax", {0.25f}, "Maximum DCA between the daughters at decay vertex (cm)"}; \ @@ -90,18 +89,19 @@ struct ConfOmegaBits : o2::framework::ConfigurableGroup { #undef CASCADE_DEFAULT_BITS -#define CASCADE_DEFAULT_SELECTION(defaultMassMin, defaultMassMax, defaultPdgCode) \ - o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "Cascade PDG code. Set sign to +1 to select antiparticle"}; \ - o2::framework::Configurable sign{"sign", -1, "Sign of the charge of the Cascade"}; \ - o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ - o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ - o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ - o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ - o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum eta"}; \ - o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ - o2::framework::Configurable massMin{"massMin", defaultMassMin, "Minimum invariant mass for Cascade"}; \ - o2::framework::Configurable massMax{"massMax", defaultMassMax, "Maximum invariant mass for Cascade"}; \ - o2::framework::Configurable mask{"mask", 0x0, "Bitmask for cascade selection"}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define CASCADE_DEFAULT_SELECTION(defaultMassMin, defaultMassMax, defaultPdgCode) \ + o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "Cascade PDG code. Set sign to +1 to select antiparticle"}; \ + o2::framework::Configurable sign{"sign", -1, "Sign of the charge of the Cascade"}; \ + o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ + o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ + o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ + o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ + o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum eta"}; \ + o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ + o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Cascade"}; \ + o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Cascade"}; \ + o2::framework::Configurable mask{"mask", 0x0, "Bitmask for cascade selection"}; struct ConfXiSelection : o2::framework::ConfigurableGroup { std::string prefix = std::string("XiSelection"); @@ -113,6 +113,8 @@ struct ConfOmegaSelection : o2::framework::ConfigurableGroup { CASCADE_DEFAULT_SELECTION(1.57, 1.77, 3334) }; +#undef CASCADE_DEFAULT_SELECTION + /// The different selections this task is capable of doing enum CascadeSels { // selections for cascades @@ -169,29 +171,37 @@ const std::unordered_map cascadeSelectionNames = { /// \class FemtoDreamTrackCuts /// \brief Cut class to contain and execute all cuts applied to tracks -template -class CascadeSelection : public BaseSelection +template +class CascadeSelection : public BaseSelection { public: CascadeSelection() = default; - ~CascadeSelection() = default; + ~CascadeSelection() override = default; template void configure(o2::framework::HistogramRegistry* registry, T1 const& config, T2 const& filter) { + // check for pass through mode + mPassThrough = config.passThrough.value; + + // if pass through mode is activated, each cut is neutral (i.e. neither minimal nor optional and we do + // store all bits, so the most permissive bit is not skipped for minimal selections) + const bool isMinimalCut = !mPassThrough; + const bool skipMostPermissiveBit = !mPassThrough; + if constexpr (modes::isEqual(cascadeType, modes::Cascade::kXi)) { mXiMassLowerLimit = filter.massXiMin.value; mXiMassUpperLimit = filter.massXiMax.value; mOmegaMassLowerLimit = filter.rejectMassOmegaMin.value; mOmegaMassUpperLimit = filter.rejectMassOmegaMax.value; - this->addSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kBachelorTpcPion, cascadeSelectionNames.at(kBachelorTpcPion), config.bachelorTpcPion.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); } if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) { mOmegaMassLowerLimit = filter.massOmegaMin.value; mOmegaMassUpperLimit = filter.massOmegaMax.value; mXiMassLowerLimit = filter.rejectMassXiMin.value; mXiMassUpperLimit = filter.rejectMassXiMax.value; - this->addSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kBachelorTpcKaon, cascadeSelectionNames.at(kBachelorTpcKaon), config.bachelorTpcKaon.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); } mPtMin = filter.ptMin.value; @@ -203,19 +213,19 @@ class CascadeSelection : public BaseSelectionaddSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kNegDauTpc, cascadeSelectionNames.at(kNegDauTpc), config.negDauTpc.value, limits::kAbsUpperLimit, true, true, false); + this->addSelection(kPosDauTpc, cascadeSelectionNames.at(kPosDauTpc), config.posDauTpc.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kNegDauTpc, cascadeSelectionNames.at(kNegDauTpc), config.negDauTpc.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); - this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, true, true, false); - this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, true, true, false); - this->addSelection(kCascadeDcaDaughMax, cascadeSelectionNames.at(kCascadeDcaDaughMax), config.cascadeDcaDauMax.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kLambdaCpaMin, cascadeSelectionNames.at(kLambdaCpaMin), config.lambdaCpaMin.value, limits::kLowerLimit, true, true, false); - this->addSelection(kLambdaTransRadMin, cascadeSelectionNames.at(kLambdaTransRadMin), config.lambdaTransRadMin.value, limits::kLowerLimit, true, true, false); - this->addSelection(kLambdaDcaDauMax, cascadeSelectionNames.at(kLambdaDcaDauMax), config.lambdaDcaDauMax.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kLambdaDcaToPvMin, cascadeSelectionNames.at(kLambdaDcaToPvMin), config.lambdaDcaToPvMin.value, limits::kLowerLimit, true, true, false); - this->addSelection(kDauAbsEtaMax, cascadeSelectionNames.at(kDauAbsEtaMax), config.dauAbsEtaMax.value, limits::kAbsUpperLimit, true, true, false); - this->addSelection(kDauDcaMin, cascadeSelectionNames.at(kDauDcaMin), config.dauDcaMin.value, limits::kAbsLowerLimit, true, true, false); - this->addSelection(kDauTpcClsMin, cascadeSelectionNames.at(kDauTpcClsMin), config.dauTpcClustersMin.value, limits::kLowerLimit, true, true, false); + this->addSelection(kCascadeCpaMin, cascadeSelectionNames.at(kCascadeCpaMin), config.cascadeCpaMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kCascadeTransRadMin, cascadeSelectionNames.at(kCascadeTransRadMin), config.cascadeTransRadMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kCascadeDcaDaughMax, cascadeSelectionNames.at(kCascadeDcaDaughMax), config.cascadeDcaDauMax.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kLambdaCpaMin, cascadeSelectionNames.at(kLambdaCpaMin), config.lambdaCpaMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kLambdaTransRadMin, cascadeSelectionNames.at(kLambdaTransRadMin), config.lambdaTransRadMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kLambdaDcaDauMax, cascadeSelectionNames.at(kLambdaDcaDauMax), config.lambdaDcaDauMax.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kLambdaDcaToPvMin, cascadeSelectionNames.at(kLambdaDcaToPvMin), config.lambdaDcaToPvMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kDauAbsEtaMax, cascadeSelectionNames.at(kDauAbsEtaMax), config.dauAbsEtaMax.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kDauDcaMin, cascadeSelectionNames.at(kDauDcaMin), config.dauDcaMin.value, limits::kAbsLowerLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kDauTpcClsMin, cascadeSelectionNames.at(kDauTpcClsMin), config.dauTpcClustersMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); this->setupContainers(registry); }; @@ -307,6 +317,8 @@ class CascadeSelection : public BaseSelection produceOmegaExtras{"produceOmegaExtras", -1, "Produce OmegaExtras (-1: auto; 0 off; 1 on)"}; }; -template +template class CascadeBuilder { public: @@ -390,11 +404,11 @@ class CascadeBuilder int64_t posDaughterIndex = 0; int64_t negDaughterIndex = 0; for (const auto& cascade : cascades) { - if (!mCascadeSelection.checkFilters(cascade)) { + if (!mCascadeSelection.passThroughAllCascades() && !mCascadeSelection.checkFilters(cascade)) { continue; } mCascadeSelection.applySelections(cascade, tracks, col); - if (!mCascadeSelection.passesAllRequiredSelections()) { + if (!mCascadeSelection.passThroughAllCascades() && !mCascadeSelection.passesAllRequiredSelections()) { continue; } @@ -424,11 +438,11 @@ class CascadeBuilder int64_t posDaughterIndex = 0; int64_t negDaughterIndex = 0; for (const auto& cascade : cascades) { - if (!mCascadeSelection.checkFilters(cascade)) { + if (!mCascadeSelection.passThroughAllCascades() && !mCascadeSelection.checkFilters(cascade)) { continue; } mCascadeSelection.applySelections(cascade, tracks, col); - if (!mCascadeSelection.passesAllRequiredSelections()) { + if (!mCascadeSelection.passThroughAllCascades() && !mCascadeSelection.passesAllRequiredSelections()) { continue; } @@ -438,19 +452,17 @@ class CascadeBuilder bachelorIndex = trackBuilder.template getDaughterIndex(col, collisionProducts, mcCols, bachelor, trackProducts, mcParticles, mcBuilder, mcProducts); auto posDaughter = cascade.template posTrack_as(); - posDaughterIndex = trackBuilder.template getDaughterIndex(col, collisionProducts, mcCols, posDaughter, trackProducts, mcParticles, mcBuilder, mcProducts); + posDaughterIndex = trackBuilder.template getDaughterIndex(col, collisionProducts, mcCols, posDaughter, trackProducts, mcParticles, mcBuilder, mcProducts); auto negDaughter = cascade.template negTrack_as(); - negDaughterIndex = trackBuilder.template getDaughterIndex(col, collisionProducts, mcCols, negDaughter, trackProducts, mcParticles, mcBuilder, mcProducts); + negDaughterIndex = trackBuilder.template getDaughterIndex(col, collisionProducts, mcCols, negDaughter, trackProducts, mcParticles, mcBuilder, mcProducts); fillCascade(collisionProducts, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex); if constexpr (modes::isEqual(cascadeType, modes::Cascade::kXi)) { mcBuilder.template fillMcXiWithLabel(col, mcCols, cascade, mcParticles, mcProducts); - ; } if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) { mcBuilder.template fillMcOmegaWithLabel(col, mcCols, cascade, mcParticles, mcProducts); - ; } } } @@ -481,7 +493,7 @@ class CascadeBuilder cascade.v0cosPA(col.posX(), col.posY(), col.posZ()), cascade.dcaV0daughters(), cascade.v0radius(), - cascade.dcav0topv(col.posY(), col.posY(), col.posZ())); + cascade.dcav0topv(col.posX(), col.posY(), col.posZ())); } } if constexpr (modes::isEqual(cascadeType, modes::Cascade::kOmega)) { @@ -507,7 +519,7 @@ class CascadeBuilder cascade.v0cosPA(col.posX(), col.posY(), col.posZ()), cascade.dcaV0daughters(), cascade.v0radius(), - cascade.dcav0topv(col.posY(), col.posY(), col.posZ())); + cascade.dcav0topv(col.posX(), col.posY(), col.posZ())); } } } @@ -525,6 +537,5 @@ class CascadeBuilder bool mProduceOmegaExtras = false; }; -} // namespace cascadebuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::cascadebuilder #endif // PWGCF_FEMTO_CORE_CASCADEBUILDER_H_ diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index 85e6010c5bd..686a46cd29f 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -36,9 +36,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace cascadehistmanager +namespace o2::analysis::femto::cascadehistmanager { // enum for track histograms enum CascadeHist { @@ -90,7 +88,7 @@ enum CascadeHist { constexpr std::size_t MaxSecondary = 3; -template +template struct ConfCascadeBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; @@ -106,7 +104,7 @@ using ConfXiBinning = ConfCascadeBinning; constexpr const char PrefixOmegaBinning[] = "OmegaBinning"; using ConfOmegaBinning = ConfCascadeBinning; -template +template struct ConfCascadeQaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable plot2d{"plot2d", true, "Enable 2d Qa histograms"}; @@ -136,7 +134,7 @@ constexpr std::array, kCascadeHistLast> HistT {kEta, o2::framework::HistType::kTH1F, "hEta", "Pseudorapdity; #eta; Entries"}, {kPhi, o2::framework::HistType::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"}, {kMass, o2::framework::HistType::kTH1F, "hMass", "Invariant Mass; m_{Inv} (GeV/#it{c}^{2}); Entries"}, - {kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> antiparticle, 0 -> self conjugate, +1 -> particle); sign; Entries"}, + {kSign, o2::framework::HistType::kTH1F, "hSign", "Sign (-1 -> particle, 0 -> self conjugate, +1 -> antiparticle); sign; Entries"}, {kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "Transverse momentum vs invariant mass; p_{T} (GeV/#it{c}); m_{Inv} (GeV/#it{c}^{2})"}, {kMassXi, o2::framework::HistType::kTH1F, "hMassXi", "Mass #Xi; m_{#Lambda#pi} (GeV/#it{c}^{2}); Entries"}, {kMassOmega, o2::framework::HistType::kTH1F, "hMassOmega", "mass #Omega; m_{#LambdaK} (GeV/#it{c}^{2}); Entries"}, @@ -172,50 +170,54 @@ constexpr std::array, kCascadeHistLast> HistT {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, }; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define CASCADE_HIST_ANALYSIS_MAP(conf) \ - {kPt, {conf.pt}}, \ - {kEta, {conf.eta}}, \ - {kPhi, {conf.phi}}, \ - {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, \ - {kPtVsMass, {conf.pt, conf.mass}}, - -#define CASCADE_HIST_MC_MAP(conf) \ - {kTruePtVsPt, {conf.pt, conf.pt}}, \ - {kTrueEtaVsEta, {conf.eta, conf.eta}}, \ - {kTruePhiVsPhi, {conf.phi, conf.phi}}, \ - {kPdg, {conf.pdgCodes}}, \ - {kPdgMother, {conf.pdgCodes}}, \ - {kPdgPartonicMother, {conf.pdgCodes}}, - -#define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \ - {kCosPa, {confQa.cosPa}}, \ - {kDecayDauDca, {confQa.dauDcaAtDecay}}, \ - {kTransRadius, {confQa.transRadius}}, \ - {kLambdaCosPa, {confQa.lambdaCosPa}}, \ - {kLambdaDauDca, {confQa.lambdaDauDca}}, \ - {kLambdaTransRadius, {confQa.lambdaTransRadius}}, \ - {kLambdaDcaToPv, {confQa.lambdaDcaToPv}}, \ - {kPtVsEta, {confAnalysis.pt, confAnalysis.eta}}, \ - {kPtVsPhi, {confAnalysis.pt, confAnalysis.phi}}, \ - {kPhiVsEta, {confAnalysis.phi, confAnalysis.eta}}, \ - {kPtVsCosPa, {confAnalysis.pt, confQa.cosPa}}, \ - {kMassXi, {confQa.massXi}}, \ - {kMassOmega, {confQa.massOmega}}, \ - {kPtVsMassXi, {confAnalysis.pt, confQa.massXi}}, \ - {kPtVsMassOmega, {confAnalysis.pt, confQa.massOmega}}, \ - {kMassXiVsMassOmega, {confQa.massXi, confQa.massOmega}}, - -#define CASCADE_HIST_MC_QA_MAP(confAnalysis, confQa) \ - {kNoMcParticle, {confAnalysis.pt, confQa.cosPa}}, \ - {kPrimary, {confAnalysis.pt, confQa.cosPa}}, \ - {kFromWrongCollision, {confAnalysis.pt, confQa.cosPa}}, \ - {kFromMaterial, {confAnalysis.pt, confQa.cosPa}}, \ - {kMissidentified, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary1, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary2, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary3, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondaryOther, {confAnalysis.pt, confQa.cosPa}}, + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kMass, {(conf).mass}}, \ + {kSign, {(conf).sign}}, \ + {kPtVsMass, {(conf).pt, (conf).mass}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define CASCADE_HIST_MC_MAP(conf) \ + {kTruePtVsPt, {(conf).pt, (conf).pt}}, \ + {kTrueEtaVsEta, {(conf).eta, (conf).eta}}, \ + {kTruePhiVsPhi, {(conf).phi, (conf).phi}}, \ + {kPdg, {(conf).pdgCodes}}, \ + {kPdgMother, {(conf).pdgCodes}}, \ + {kPdgPartonicMother, {(conf).pdgCodes}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define CASCADE_HIST_QA_MAP(confAnalysis, confQa) \ + {kCosPa, {(confQa).cosPa}}, \ + {kDecayDauDca, {(confQa).dauDcaAtDecay}}, \ + {kTransRadius, {(confQa).transRadius}}, \ + {kLambdaCosPa, {(confQa).lambdaCosPa}}, \ + {kLambdaDauDca, {(confQa).lambdaDauDca}}, \ + {kLambdaTransRadius, {(confQa).lambdaTransRadius}}, \ + {kLambdaDcaToPv, {(confQa).lambdaDcaToPv}}, \ + {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ + {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ + {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ + {kPtVsCosPa, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kMassXi, {(confQa).massXi}}, \ + {kMassOmega, {(confQa).massOmega}}, \ + {kPtVsMassXi, {(confAnalysis).pt, (confQa).massXi}}, \ + {kPtVsMassOmega, {(confAnalysis).pt, (confQa).massOmega}}, \ + {kMassXiVsMassOmega, {(confQa).massXi, (confQa).massOmega}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define CASCADE_HIST_MC_QA_MAP(confAnalysis, confQa) \ + {kNoMcParticle, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kPrimary, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kFromWrongCollision, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kFromMaterial, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kMissidentified, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary1, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary2, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary3, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondaryOther, {(confAnalysis).pt, (confQa).cosPa}}, template auto makeCascadeHistSpecMap(const T& confBinningAnalysis) @@ -269,10 +271,10 @@ constexpr std::string_view McDir = "MC/"; /// \class FemtoDreamEventHisto /// \brief Class for histogramming event properties // template -template class CascadeHistManager { @@ -687,6 +689,5 @@ class CascadeHistManager trackhistmanager::TrackHistManager mPosDauManager; trackhistmanager::TrackHistManager mNegDauManager; }; -}; // namespace cascadehistmanager -}; // namespace o2::analysis::femto +} // namespace o2::analysis::femto::cascadehistmanager #endif // PWGCF_FEMTO_CORE_CASCADEHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/closePairRejection.h b/PWGCF/Femto/Core/closePairRejection.h index 31a28593954..3747ebd633e 100644 --- a/PWGCF/Femto/Core/closePairRejection.h +++ b/PWGCF/Femto/Core/closePairRejection.h @@ -1,4 +1,4 @@ -// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// Copyright 2019-2025 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // @@ -38,9 +38,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace closepairrejection +namespace o2::analysis::femto::closepairrejection { // enum for track histograms enum CprHist { @@ -61,7 +59,7 @@ enum CprHist { }; // template configurable group for Cpr -template +template struct ConfCpr : o2::framework::ConfigurableGroup { std::string prefix = std::string(Prefix); o2::framework::Configurable cutAverage{"cutAverage", true, "Apply CPR if the average deta-dphistar is below the configured values"}; @@ -165,7 +163,7 @@ auto makeCprHistSpecMap(const T& confCpr) }; }; -template +template class CloseTrackRejection { public: @@ -205,7 +203,7 @@ class CloseTrackRejection mPlotAngularCorrelation = confCpr.plotAngularCorrelation.value; if (confCpr.seed.value >= 0) { - uint64_t randomSeed; + uint64_t randomSeed = 0; mRandomizeTracks = true; if (confCpr.seed.value == 0) { randomSeed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); @@ -346,7 +344,7 @@ class CloseTrackRejection } } - bool isClosePair() const + [[nodiscard]] bool isClosePair() const { if (!mIsActivated) { return false; @@ -371,7 +369,7 @@ class CloseTrackRejection return isCloseAverage || isCloseAnyRadius; } - bool isActivated() const { return mIsActivated; } + [[nodiscard]] bool isActivated() const { return mIsActivated; } private: std::optional phistar(float magfield, float radius, float signedPt, float phi) @@ -421,7 +419,7 @@ class CloseTrackRejection std::uniform_int_distribution mSwapDist{0, 1}; }; -template +template class ClosePairRejectionTrackTrack { public: @@ -441,14 +439,14 @@ class ClosePairRejectionTrackTrack { mCtr.compute(track1, track2); } - bool isClosePair() const { return mCtr.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } void fill(float kstar) { mCtr.fill(kstar); } private: CloseTrackRejection mCtr; }; -template +template class ClosePairRejectionV0V0 { public: @@ -481,7 +479,7 @@ class ClosePairRejectionV0V0 mCtrNeg.compute(negDau1, negDau2); } - bool isClosePair() const { return mCtrPos.isClosePair() || mCtrNeg.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtrPos.isClosePair() || mCtrNeg.isClosePair(); } void fill(float kstar) { @@ -494,7 +492,7 @@ class ClosePairRejectionV0V0 CloseTrackRejection mCtrNeg; }; -template +template class ClosePairRejectionTrackV0 // can also be used for any particle type that has pos/neg daughters, like resonances { public: @@ -521,7 +519,7 @@ class ClosePairRejectionTrackV0 // can also be used for any particle type that h } } - bool isClosePair() const { return mCtr.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } void fill(float kstar) { mCtr.fill(kstar); } @@ -529,7 +527,7 @@ class ClosePairRejectionTrackV0 // can also be used for any particle type that h CloseTrackRejection mCtr; }; -template +template class ClosePairRejectionTrackCascade { public: @@ -566,11 +564,7 @@ class ClosePairRejectionTrackCascade } } - bool - isClosePair() const - { - return mCtrBachelor.isClosePair(); - } + [[nodiscard]] bool isClosePair() const { return mCtrBachelor.isClosePair(); } void fill(float kstar) { @@ -583,7 +577,7 @@ class ClosePairRejectionTrackCascade CloseTrackRejection mCtrV0Daughter; }; -template +template class ClosePairRejectionTrackKink { public: @@ -608,14 +602,14 @@ class ClosePairRejectionTrackKink mCtr.compute(track, daughter); } - bool isClosePair() const { return mCtr.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } void fill(float kstar) { mCtr.fill(kstar); } private: CloseTrackRejection mCtr; }; -template +template class ClosePairRejectionMcParticleMcParticle { public: @@ -632,13 +626,12 @@ class ClosePairRejectionMcParticleMcParticle { mCtr.compute(mcParticle1, mcParticle2); } - bool isClosePair() const { return mCtr.isClosePair(); } + [[nodiscard]] bool isClosePair() const { return mCtr.isClosePair(); } void fill(float kstar) { mCtr.fill(kstar); } private: CloseTrackRejection mCtr; }; -}; // namespace closepairrejection -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::closepairrejection #endif // PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ diff --git a/PWGCF/Femto/Core/closeTripletRejection.h b/PWGCF/Femto/Core/closeTripletRejection.h index 871490207d6..f9b5b788762 100644 --- a/PWGCF/Femto/Core/closeTripletRejection.h +++ b/PWGCF/Femto/Core/closeTripletRejection.h @@ -24,11 +24,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::closetripletrejection { -namespace closetripletrejection -{ - constexpr const char PrefixCtrTrackTrackTrack[] = "CtrTrackTrackTrack"; using ConfCtrTrackTrackTrack = closepairrejection::ConfCpr; @@ -60,9 +57,9 @@ constexpr char PrefixTrack2CascadeBachelorSe[] = "CPR_Track2CascadeBachelor/SE/" constexpr char PrefixTrack1CascadeBachelorMe[] = "CPR_Track1CascadeBachelor/ME/"; constexpr char PrefixTrack2CascadeBachelorMe[] = "CPR_Track2CascadeBachelor/ME/"; -template +template class CloseTripletRejectionTrackTrackTrack { public: @@ -95,7 +92,7 @@ class CloseTripletRejectionTrackTrackTrack mCtrTrack23.setPair(track2, track3, trackTable); mCtrTrack13.setPair(track1, track3, trackTable); } - bool isCloseTriplet() const + [[nodiscard]] bool isCloseTriplet() const { return mCtrTrack12.isClosePair() || mCtrTrack23.isClosePair() || mCtrTrack13.isClosePair(); } @@ -113,9 +110,9 @@ class CloseTripletRejectionTrackTrackTrack closepairrejection::ClosePairRejectionTrackTrack mCtrTrack13; }; -template +template class CloseTripletRejectionTrackTrackV0 { public: @@ -147,7 +144,7 @@ class CloseTripletRejectionTrackTrackV0 mCtrTrack1V0.setPair(track1, v0, trackTable); mCtrTrack2V0.setPair(track2, v0, trackTable); } - bool isCloseTriplet() const + [[nodiscard]] bool isCloseTriplet() const { return mCtrTrack12.isClosePair() || mCtrTrack1V0.isClosePair() || mCtrTrack2V0.isClosePair(); } @@ -165,11 +162,11 @@ class CloseTripletRejectionTrackTrackV0 closepairrejection::ClosePairRejectionTrackV0 mCtrTrack2V0; }; -template +template class CloseTripletRejectionTrackTrackCascade { public: @@ -205,7 +202,7 @@ class CloseTripletRejectionTrackTrackCascade mCtrTrack1Cascade.setPair(track1, cascade, trackTable); mCtrTrack2Cascade.setPair(track2, cascade, trackTable); } - bool isCloseTriplet() const + [[nodiscard]] bool isCloseTriplet() const { return mCtrTrack12.isClosePair() || mCtrTrack1Cascade.isClosePair() || mCtrTrack2Cascade.isClosePair(); } @@ -223,6 +220,5 @@ class CloseTripletRejectionTrackTrackCascade closepairrejection::ClosePairRejectionTrackCascade mCtrTrack2Cascade; }; -} // namespace closetripletrejection -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::closetripletrejection #endif // PWGCF_FEMTO_CORE_CLOSETRIPLETREJECTION_H_ diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index 7eababf75a5..8bce654f441 100644 --- a/PWGCF/Femto/Core/collisionBuilder.h +++ b/PWGCF/Femto/Core/collisionBuilder.h @@ -41,11 +41,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::collisionbuilder { -namespace collisionbuilder -{ - // configurables for collision selection struct ConfCollisionFilters : o2::framework::ConfigurableGroup { std::string prefix = std::string("CollisionFilter"); @@ -112,7 +109,7 @@ struct ConfCollisionSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable centMax{"centMax", 100.f, "Maximum centrality (multiplicity percentile)"}; o2::framework::Configurable magFieldMin{"magFieldMin", -5, "Minimum magnetic field strength (kG)"}; o2::framework::Configurable magFieldMax{"magFieldMax", 5, "Maximum magnetic field strength (kG)"}; - o2::framework::Configurable collisionMask{"collisionMask", 0x0, "Bitmask for collision"}; + o2::framework::Configurable collisionMask{"collisionMask", 0x0, "Bitmask for collision"}; }; /// enum for all collision selections @@ -166,12 +163,12 @@ const std::unordered_map collisionSelectionNames = { }; -template -class CollisionSelection : public BaseSelection +template +class CollisionSelection : public BaseSelection { public: CollisionSelection() = default; - ~CollisionSelection() = default; + ~CollisionSelection() override = default; template void configure(o2::framework::HistogramRegistry* registry, T1 const& filter, T2 const& config) @@ -219,9 +216,9 @@ class CollisionSelection : public BaseSelectionaddSelection(kIsGoodItsLayersAll, collisionSelectionNames.at(kIsGoodItsLayersAll), config.isGoodItsLayersAll.value); } - const bool isMinimalCut = mPassThrough ? false : true; - const bool isOptionalCut = mPassThrough ? false : true; - const bool skipMostPermissiveBit = mPassThrough ? false : true; + const bool isMinimalCut = !mPassThrough; + const bool isOptionalCut = !mPassThrough; + const bool skipMostPermissiveBit = !mPassThrough; this->addSelection(kOccupancyMin, collisionSelectionNames.at(kOccupancyMin), config.occupancyMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); this->addSelection(kOccupancyMax, collisionSelectionNames.at(kOccupancyMax), config.occupancyMax.value, limits::kUpperLimit, skipMostPermissiveBit, isMinimalCut, false); @@ -251,7 +248,7 @@ class CollisionSelection : public BaseSelection void setCentrality(const T& col) @@ -263,7 +260,7 @@ class CollisionSelection : public BaseSelection void setMultiplicity(const T& col) @@ -276,7 +273,7 @@ class CollisionSelection : public BaseSelection bool checkFilters(T const& col) const @@ -334,7 +331,7 @@ class CollisionSelection : public BaseSelectionassembleBitmask(); }; - bool passThroughAllCollisions() const { return mPassThrough; } + [[nodiscard]] bool passThroughAllCollisions() const { return mPassThrough; } protected: template @@ -411,7 +408,7 @@ struct ConfCollisionTables : o2::framework::ConfigurableGroup { o2::framework::Configurable produceQns{"produceQns", -1, "Produce Qn (-1: auto; 0 off; 1 on)"}; }; -template +template class CollisionBuilder { public: @@ -652,7 +649,6 @@ class CollisionBuilderDerivedToDerived } }; -} // namespace collisionbuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::collisionbuilder ; #endif // PWGCF_FEMTO_CORE_COLLISIONBUILDER_H_ diff --git a/PWGCF/Femto/Core/collisionHistManager.h b/PWGCF/Femto/Core/collisionHistManager.h index d2837db0303..338da0ac63c 100644 --- a/PWGCF/Femto/Core/collisionHistManager.h +++ b/PWGCF/Femto/Core/collisionHistManager.h @@ -29,11 +29,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::colhistmanager { -namespace colhistmanager -{ - enum ColHist { kPosZ, kMult, @@ -92,31 +89,34 @@ constexpr std::array, kColHistLast> HistTable = { {kTrueMultVsMult, o2::framework::HistType::kTH2F, "hTrueMultVsMult", "True multiplicity vs multiplicity; Multiplicity_{True}; Multiplicity"}, }}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define COL_HIST_ANALYSIS_MAP(conf) \ - {kPosZ, {conf.vtxZ}}, \ - {kMult, {conf.mult}}, \ - {kCent, {conf.cent}}, \ - {kMagField, {conf.magField}}, - -#define COL_HIST_QA_MAP(confAnalysis, confQa) \ - {kPosX, {confQa.vtxXY}}, \ - {kPosY, {confQa.vtxXY}}, \ - {kPos, {confQa.vtx}}, \ - {kSphericity, {confQa.sphericity}}, \ - {kOccupancy, {confQa.occupancy}}, \ - {kPoszVsMult, {confAnalysis.vtxZ, confAnalysis.mult}}, \ - {kPoszVsCent, {confAnalysis.vtxZ, confAnalysis.cent}}, \ - {kCentVsMult, {confAnalysis.cent, confAnalysis.mult}}, \ - {kMultVsSphericity, {confAnalysis.mult, confQa.sphericity}}, \ - {kCentVsSphericity, {confBinningAnalysis.cent, confQa.sphericity}}, - -#define COL_HIST_MC_MAP(conf) \ - {kTruePosZ, {conf.vtxZ}}, \ - {kTrueCent, {conf.cent}}, \ - {kTrueMult, {conf.mult}}, \ - {kTruePosZVsPosZ, {conf.vtxZ, conf.vtxZ}}, \ - {kTrueCentVsCent, {conf.cent, conf.cent}}, \ - {kTrueMultVsMult, {conf.mult, conf.mult}}, + {kPosZ, {(conf).vtxZ}}, \ + {kMult, {(conf).mult}}, \ + {kCent, {(conf).cent}}, \ + {kMagField, {(conf).magField}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define COL_HIST_QA_MAP(confAnalysis, confQa) \ + {kPosX, {(confQa).vtxXY}}, \ + {kPosY, {(confQa).vtxXY}}, \ + {kPos, {(confQa).vtx}}, \ + {kSphericity, {(confQa).sphericity}}, \ + {kOccupancy, {(confQa).occupancy}}, \ + {kPoszVsMult, {(confAnalysis).vtxZ, (confAnalysis).mult}}, \ + {kPoszVsCent, {(confAnalysis).vtxZ, (confAnalysis).cent}}, \ + {kCentVsMult, {(confAnalysis).cent, (confAnalysis).mult}}, \ + {kMultVsSphericity, {(confAnalysis).mult, (confQa).sphericity}}, \ + {kCentVsSphericity, {confBinningAnalysis.cent, (confQa).sphericity}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define COL_HIST_MC_MAP(conf) \ + {kTruePosZ, {(conf).vtxZ}}, \ + {kTrueCent, {(conf).cent}}, \ + {kTrueMult, {(conf).mult}}, \ + {kTruePosZVsPosZ, {(conf).vtxZ, (conf).vtxZ}}, \ + {kTrueCentVsCent, {(conf).cent, (conf).cent}}, \ + {kTrueMultVsMult, {(conf).mult, (conf).mult}}, template auto makeColHistSpecMap(const T& confBinningAnalysis) @@ -345,6 +345,5 @@ class CollisionHistManager o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; bool mPlot2d = false; }; -} // namespace colhistmanager -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::colhistmanager #endif // PWGCF_FEMTO_CORE_COLLISIONHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/dataTypes.h b/PWGCF/Femto/Core/dataTypes.h index c873bf14020..19e39de5828 100644 --- a/PWGCF/Femto/Core/dataTypes.h +++ b/PWGCF/Femto/Core/dataTypes.h @@ -18,9 +18,7 @@ #include -namespace o2::aod -{ -namespace femtodatatypes +namespace o2::analysis::femto::datatypes { // Note: Length of the bitmask is the limit of how many selections can be configured @@ -59,8 +57,6 @@ using ParticleType = uint16_t; using MomentumType = uint16_t; using TransverseMassType = uint16_t; -} // namespace femtodatatypes - -} // namespace o2::aod +} // namespace o2::analysis::femto::datatypes #endif // PWGCF_FEMTO_CORE_DATATYPES_H_ diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index f0a72abf4bd..1e0e87fb4e3 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -142,8 +142,9 @@ inline float calcPtnew(float pxMother, float pyMother, float pzMother, float pxD // Calculate mother momentum and direction versor float pMother = std::sqrt(pxMother * pxMother + pyMother * pyMother + pzMother * pzMother); - if (pMother < almost0) + if (pMother < almost0) { return -999.f; + } float versorX = pxMother / pMother; float versorY = pyMother / pMother; @@ -161,22 +162,26 @@ inline float calcPtnew(float pxMother, float pyMother, float pzMother, float pxD float b = -4.f * scalarProduct * k; float c = 4.f * ePi * ePi * massSigmaMinus * massSigmaMinus - k * k; - if (std::abs(a) < almost0) + if (std::abs(a) < almost0) { return -999.f; + } float d = b * b - 4.f * a * c; - if (d < 0.f) + if (d < 0.f) { return -999.f; + } float sqrtD = std::sqrt(d); float p1 = (-b + sqrtD) / (2.f * a); float p2 = (-b - sqrtD) / (2.f * a); // Pick physical solution: prefer P2 if positive, otherwise P1 - if (p2 < 0.f && p1 < 0.f) + if (p2 < 0.f && p1 < 0.f) { return -999.f; - if (p2 < 0.f) + } + if (p2 < 0.f) { return p1; + } // Choose solution closest to original momentum float p1Diff = std::abs(p1 - pMother); diff --git a/PWGCF/Femto/Core/histManager.h b/PWGCF/Femto/Core/histManager.h index ceadf18f38a..a0070a08f9f 100644 --- a/PWGCF/Femto/Core/histManager.h +++ b/PWGCF/Femto/Core/histManager.h @@ -21,11 +21,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::histmanager { -namespace histmanager -{ - // plot level for secondaries during mc processing enum SecondaryPlotLevel { kSecondaryPlotLevel1 = 1, @@ -35,8 +32,16 @@ enum SecondaryPlotLevel { template struct HistInfo { - Hist hist; - o2::framework::HistType histtype; + constexpr HistInfo(Hist h, + o2::framework::HistType t, + std::string_view n, + std::string_view d) + : hist(h), histtype(t), histname(n), histdesc(d) + { + } + + Hist hist{}; + o2::framework::HistType histtype{o2::framework::kUndefinedHist}; std::string_view histname; std::string_view histdesc; }; @@ -80,6 +85,5 @@ constexpr const char* getHistDesc(EnumType variable, const ArrayType& array) return it != array.end() ? it->histdesc.data() : ""; } -} // namespace histmanager -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::histmanager #endif // PWGCF_FEMTO_CORE_HISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/kinkBuilder.h b/PWGCF/Femto/Core/kinkBuilder.h index 99e87514824..f8bc0e310f1 100644 --- a/PWGCF/Femto/Core/kinkBuilder.h +++ b/PWGCF/Femto/Core/kinkBuilder.h @@ -41,11 +41,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::kinkbuilder { -namespace kinkbuilder -{ - // filters applied in the producer task struct ConfKinkFilters : o2::framework::ConfigurableGroup { std::string prefix = std::string("KinkFilters"); @@ -62,6 +59,7 @@ struct ConfKinkFilters : o2::framework::ConfigurableGroup { }; // selections bits for all kinks +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define KINK_DEFAULT_BITS \ o2::framework::Configurable> kinkTopoDcaMax{"kinkTopoDcaMax", {2.0f}, "Maximum kink topological DCA"}; \ o2::framework::Configurable> transRadMin{"transRadMin", {20.f}, "Minimum transverse radius (cm)"}; \ @@ -94,20 +92,21 @@ struct ConfSigmaPlusBits : o2::framework::ConfigurableGroup { #undef KINK_DEFAULT_BITS // base selection for analysis task for kinks -#define KINK_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \ - o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "PDG code. Select antipartilce via sign"}; \ - o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ - o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ - o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ - o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ - o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ - o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ - o2::framework::Configurable massMin{"massMin", defaultMassMin, "Minimum invariant mass for Sigma"}; \ - o2::framework::Configurable massMax{"massMax", defaultMassMax, "Maximum invariant mass for Sigma"}; \ - o2::framework::Configurable mask{"mask", 0x0, "Bitmask for kink selection"}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define KINK_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \ + o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "PDG code. Select antipartilce via sign"}; \ + o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ + o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ + o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ + o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ + o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ + o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ + o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Sigma"}; \ + o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Sigma"}; \ + o2::framework::Configurable mask{"mask", 0x0, "Bitmask for kink selection"}; // base selection for analysis task for sigmas -template +template struct ConfSigmaSelection : o2::framework::ConfigurableGroup { std::string prefix = Prefix; KINK_DEFAULT_SELECTIONS(1.1, 1.3, 3112) @@ -115,7 +114,7 @@ struct ConfSigmaSelection : o2::framework::ConfigurableGroup { }; // base selection for analysis task for sigma plus -template +template struct ConfSigmaPlusSelection : o2::framework::ConfigurableGroup { std::string prefix = Prefix; KINK_DEFAULT_SELECTIONS(1.1, 1.3, 3222) @@ -177,12 +176,12 @@ const std::unordered_map kinkSelectionNames = { /// \class KinkCuts /// \brief Cut class to contain and execute all cuts applied to kinks -template -class KinkSelection : public BaseSelection +template +class KinkSelection : public BaseSelection { public: KinkSelection() = default; - ~KinkSelection() = default; + ~KinkSelection() override = default; template void configure(o2::framework::HistogramRegistry* registry, T1& config, T2& filter) @@ -339,13 +338,13 @@ class KinkSelection : public BaseSelection produceSigmaPlusExtras{"produceSigmaPlusExtras", -1, "Produce SigmaPlusExtras (-1: auto; 0 off; 1 on)"}; }; -template +template class KinkBuilder { public: @@ -606,20 +605,14 @@ class KinkBuilderDerivedToDerived bool collisionHasTooFewSigma(T1 const& col, T2 const& /*sigmaTable*/, T3& partitionSigma, T4& cache) { auto sigmaSlice = partitionSigma->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); - if (sigmaSlice.size() >= mLimitSigma) { - return false; - } - return true; + return sigmaSlice.size() < mLimitSigma; } template bool collisionHasTooFewSigmaPlus(T1 const& col, T2 const& /*sigmaPlusTable*/, T3& partitionSigmaPlus, T4& cache) { auto sigmaPlusSlice = partitionSigmaPlus->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); - if (sigmaPlusSlice.size() >= mLimitSigmaPlus) { - return false; - } - return true; + return sigmaPlusSlice.size() < mLimitSigmaPlus; } template @@ -668,7 +661,5 @@ class KinkBuilderDerivedToDerived int mLimitSigma = 0; int mLimitSigmaPlus = 0; }; - -} // namespace kinkbuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::kinkbuilder #endif // PWGCF_FEMTO_CORE_KINKBUILDER_H_ diff --git a/PWGCF/Femto/Core/kinkHistManager.h b/PWGCF/Femto/Core/kinkHistManager.h index 7339434e00e..1ffe73e272b 100644 --- a/PWGCF/Femto/Core/kinkHistManager.h +++ b/PWGCF/Femto/Core/kinkHistManager.h @@ -37,9 +37,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace kinkhistmanager +namespace o2::analysis::femto::kinkhistmanager { // enum for kink histograms enum KinkHist { @@ -88,24 +86,26 @@ enum KinkHist { constexpr std::size_t MaxSecondary = 3; -#define KINK_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ - o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ - o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ - o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ - o2::framework::ConfigurableAxis mass{"mass", {{200, defaultMassMin, defaultMassMax}}, "Mass"}; \ - o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; \ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define KINK_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ + o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ + o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ + o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ + o2::framework::ConfigurableAxis mass{"mass", {{200, (defaultMassMin), (defaultMassMax)}}, "Mass"}; \ + o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; \ o2::framework::ConfigurableAxis pdgCodes{"pdgCodes", {{8001, -4000.5, 4000.5}}, "PDG codes of selected V0s"}; -template +template struct ConfSigmaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; KINK_DEFAULT_BINNING(1.1, 1.3) }; -template +template struct ConfSigmaPlusBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; KINK_DEFAULT_BINNING(1.1, 1.3) }; + #undef KINK_DEFAULT_BINNING constexpr const char PrefixSigmaBinning1[] = "SigmaBinning1"; @@ -114,7 +114,7 @@ using ConfSigmaBinning1 = ConfSigmaBinning; constexpr const char PrefixSigmaPlusBinning1[] = "SigmaPlusBinning1"; using ConfSigmaPlusBinning1 = ConfSigmaPlusBinning; -template +template struct ConfKinkQaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable plot2d{"plot2d", true, "Enable 2d QA h histograms"}; @@ -171,46 +171,50 @@ constexpr std::array, kKinkHistLast> HistTable = {kSecondary3, o2::framework::HistType::kTH2F, "hFromSecondary3", "Particles from seconary decay; p_{T} (GeV/#it{c}); kink angle"}, {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); kink angle"}}}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define KINK_HIST_ANALYSIS_MAP(conf) \ - {kPt, {conf.pt}}, \ - {kEta, {conf.eta}}, \ - {kPhi, {conf.phi}}, \ - {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, - -#define KINK_HIST_MC_MAP(conf) \ - {kTruePt, {conf.pt}}, \ - {kTrueEta, {conf.eta}}, \ - {kTruePhi, {conf.phi}}, \ - {kPdg, {conf.pdgCodes}}, \ - {kPdgMother, {conf.pdgCodes}}, \ - {kPdgPartonicMother, {conf.pdgCodes}}, - -#define KINK_HIST_QA_MAP(confAnalysis, confQa) \ - {kKinkAngle, {confQa.kinkAngle}}, \ - {kDcaMothToPV, {confQa.dcaMothToPV}}, \ - {kDcaDaugToPV, {confQa.dcaDaugToPV}}, \ - {kDecayVtxX, {confQa.decayVertex}}, \ - {kDecayVtxY, {confQa.decayVertex}}, \ - {kDecayVtxZ, {confQa.decayVertex}}, \ - {kDecayVtx, {confQa.decayVertex}}, \ - {kTransRadius, {confQa.transRadius}}, \ - {kPtVsEta, {confAnalysis.pt, confAnalysis.eta}}, \ - {kPtVsPhi, {confAnalysis.pt, confAnalysis.phi}}, \ - {kPhiVsEta, {confAnalysis.phi, confAnalysis.eta}}, \ - {kPtVsKinkAngle, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kPtVsDecayRadius, {confAnalysis.pt, confQa.transRadius}}, - -#define KINK_HIST_MC_QA_MAP(confAnalysis, confQa) \ - {kNoMcParticle, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kPrimary, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kFromWrongCollision, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kFromMaterial, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kMissidentified, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kSecondary1, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kSecondary2, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kSecondary3, {confAnalysis.pt, confQa.kinkAngle}}, \ - {kSecondaryOther, {confAnalysis.pt, confQa.kinkAngle}}, + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kMass, {(conf).mass}}, \ + {kSign, {(conf).sign}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define KINK_HIST_MC_MAP(conf) \ + {kTruePt, {(conf).pt}}, \ + {kTrueEta, {(conf).eta}}, \ + {kTruePhi, {(conf).phi}}, \ + {kPdg, {(conf).pdgCodes}}, \ + {kPdgMother, {(conf).pdgCodes}}, \ + {kPdgPartonicMother, {(conf).pdgCodes}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define KINK_HIST_QA_MAP(confAnalysis, confQa) \ + {kKinkAngle, {(confQa).kinkAngle}}, \ + {kDcaMothToPV, {(confQa).dcaMothToPV}}, \ + {kDcaDaugToPV, {(confQa).dcaDaugToPV}}, \ + {kDecayVtxX, {(confQa).decayVertex}}, \ + {kDecayVtxY, {(confQa).decayVertex}}, \ + {kDecayVtxZ, {(confQa).decayVertex}}, \ + {kDecayVtx, {(confQa).decayVertex}}, \ + {kTransRadius, {(confQa).transRadius}}, \ + {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ + {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ + {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ + {kPtVsKinkAngle, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kPtVsDecayRadius, {(confAnalysis).pt, (confQa).transRadius}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define KINK_HIST_MC_QA_MAP(confAnalysis, confQa) \ + {kNoMcParticle, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kPrimary, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kFromWrongCollision, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kFromMaterial, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kMissidentified, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kSecondary1, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kSecondary2, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kSecondary3, {(confAnalysis).pt, (confQa).kinkAngle}}, \ + {kSecondaryOther, {(confAnalysis).pt, (confQa).kinkAngle}}, template auto makeKinkHistSpecMap(const T& confBinningAnalysis) @@ -263,8 +267,8 @@ constexpr std::string_view McDir = "MC/"; constexpr int AbsChargeDaughters = 1; -template class KinkHistManager { @@ -625,6 +629,5 @@ class KinkHistManager int mPlotNSecondaries = 0; std::array mPdgCodesSecondaryMother = {0}; }; -}; // namespace kinkhistmanager -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::kinkhistmanager #endif // PWGCF_FEMTO_CORE_KINKHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/mcBuilder.h b/PWGCF/Femto/Core/mcBuilder.h index 7b25e4ab27e..425f391e4c5 100644 --- a/PWGCF/Femto/Core/mcBuilder.h +++ b/PWGCF/Femto/Core/mcBuilder.h @@ -34,11 +34,11 @@ #include #include -namespace o2::analysis::femto -{ -namespace mcbuilder +namespace o2::analysis::femto::mcbuilder { +constexpr int ProducedByDecay = 4; + struct ConfMc : o2::framework::ConfigurableGroup { std::string prefix = std::string("MonteCarlo"); o2::framework::Configurable passThrough{"passThrough", false, "Passthrough all MC collisions and particles"}; @@ -92,7 +92,7 @@ struct ConfMcCollisionFilters : o2::framework::ConfigurableGroup { o2::framework::Configurable centMax{"centMax", 100.f, "Maximum centrality (multiplicity percentile)"}; }; -template +template struct ConfMcParticleSelection : o2::framework::ConfigurableGroup { std::string prefix = std::string(Prefix); // kinematic cuts for filtering tracks @@ -309,34 +309,35 @@ class McBuilder { // whether a particle is misidentified or not can only be checked by qa/pair task later so it is not set here - // constants - const int producedByDecay = 4; // check if reconstructed collision has a generated collision - if (col.has_mcCollision()) { - // now check collision ids, if they do not match, then the track belongs to another collision - if (col.mcCollisionId() != mcParticle.mcCollisionId()) { - return modes::McOrigin::kFromWrongCollision; - } - if (mcParticle.isPhysicalPrimary()) { - return modes::McOrigin::kPhysicalPrimary; - } else if (mcParticle.has_mothers() && mcParticle.getProcess() == producedByDecay) { - return modes::McOrigin::kFromSecondaryDecay; - } else { - // not a primary and not from a decay, we label as material - return modes::McOrigin::kFromMaterial; - } + if (!col.has_mcCollision()) { + return modes::McOrigin::kFromWrongCollision; + } + + // now check collision ids, if they do not match, then the track belongs to another collision + if (col.mcCollisionId() != mcParticle.mcCollisionId()) { + return modes::McOrigin::kFromWrongCollision; + } + + if (mcParticle.isPhysicalPrimary()) { + return modes::McOrigin::kPhysicalPrimary; + } + + if (mcParticle.has_mothers() && mcParticle.getProcess() == ProducedByDecay) { + return modes::McOrigin::kFromSecondaryDecay; } - return modes::McOrigin::kFromWrongCollision; + + // not a primary and not from a decay and not from a wrong collision, we label as material + return modes::McOrigin::kFromMaterial; } template modes::McOrigin getOrigin(T1 const& mcParticle) { - const int producedByDecay = 4; if (mcParticle.isPhysicalPrimary()) { return modes::McOrigin::kPhysicalPrimary; } - if (mcParticle.has_mothers() && mcParticle.getProcess() == producedByDecay) { + if (mcParticle.has_mothers() && mcParticle.getProcess() == ProducedByDecay) { return modes::McOrigin::kFromSecondaryDecay; } return modes::McOrigin::kFromMaterial; @@ -392,7 +393,7 @@ class McBuilder mcProducts.producedMcParticles( mcColId, - static_cast(origin), + static_cast(origin), mcParticle.pdgCode(), mcParticle.pt() * utils::signum(mcParticle.pdgCode()), mcParticle.eta(), @@ -414,7 +415,7 @@ class McBuilder } else { auto motherOrigin = this->getOrigin(motherParticle); mcProducts.producedMothers( - static_cast(motherOrigin), + static_cast(motherOrigin), motherParticle.pdgCode(), motherParticle.pt() * utils::signum(motherParticle.pdgCode()), motherParticle.eta(), @@ -496,18 +497,21 @@ class McBuilder // keep for now, might be needed later // && ((80 < std::abs(o2::mcgenstatus::getGenStatusCode(p.statusCode())) && std::abs(o2::mcgenstatus::getGenStatusCode(p.statusCode())) < 90) || (100 < std::abs(o2::mcgenstatus::getGenStatusCode(p.statusCode())) && std::abs(o2::mcgenstatus::getGenStatusCode(p.statusCode())) < 110))) { // Pythia: mother range - for (int i = motherIds[0]; i <= motherIds[1]; i++) + for (int i = motherIds[0]; i <= motherIds[1]; i++) { allMotherIds.push_back(i); + } } else { // Otherwise just use them as given - for (const int& id : motherIds) + for (const int& id : motherIds) { allMotherIds.push_back(id); + } } // Loop over all mothers for (const int& i : allMotherIds) { - if (i < 0 || i >= mcParticles.size()) + if (i < 0 || i >= mcParticles.size()) { continue; + } const auto& mother = mcParticles.iteratorAt(i); int pdgAbs = std::abs(mother.pdgCode()); // Is it a parton? (quark or gluon) @@ -516,8 +520,9 @@ class McBuilder } // Recurse upward int64_t found = this->findFirstPartonicMother(mother, mcParticles); - if (found != -1) + if (found != -1) { return found; + } } // No partonic ancestor found return -1; @@ -530,8 +535,9 @@ class McBuilder int64_t currentIndex = mcParticle.globalIndex(); while (currentIndex >= 0 && currentIndex < mcParticles.size()) { const auto& current = mcParticles.iteratorAt(currentIndex); - if (!current.has_mothers()) + if (!current.has_mothers()) { break; + } auto motherIds = current.mothersIds(); int nextIndex = -1; const int defaultMotherSize = 2; @@ -545,8 +551,10 @@ class McBuilder } } } - if (nextIndex < 0 || nextIndex >= mcParticles.size()) + + if (nextIndex < 0 || nextIndex >= mcParticles.size()) { break; + } const auto& mother = mcParticles.iteratorAt(nextIndex); int pdgAbs = std::abs(mother.pdgCode()); int status = std::abs(o2::mcgenstatus::getGenStatusCode(mother.statusCode())); @@ -554,11 +562,12 @@ class McBuilder const int isBeamParticleLowerLimit = 11; const int isBeamParticleUpperLimit = 19; bool isBeam = (status >= isBeamParticleLowerLimit && status <= isBeamParticleUpperLimit); - if (isBeam) + if (isBeam) { return lastPartonIndex; - if (isParton) + } + if (isParton) { lastPartonIndex = nextIndex; - + } currentIndex = nextIndex; } return -1; @@ -588,9 +597,6 @@ class McBuilder std::unordered_map mMcMotherMap; std::unordered_map mMcPartonicMotherMap; }; - -} // namespace mcbuilder -// -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::mcbuilder #endif // PWGCF_FEMTO_CORE_MCBUILDER_H_ diff --git a/PWGCF/Femto/Core/mcParticleHistManager.h b/PWGCF/Femto/Core/mcParticleHistManager.h index 5e9830645bc..b226e10459a 100644 --- a/PWGCF/Femto/Core/mcParticleHistManager.h +++ b/PWGCF/Femto/Core/mcParticleHistManager.h @@ -34,11 +34,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::mcparticlehistmanager { -namespace mcparticlehistmanager -{ - // enum for mc particle histograms enum McParticleHist { // kinemtics @@ -73,7 +70,7 @@ enum McParticleHist { constexpr std::size_t MaxSecondary = 3; -template +template struct ConfMcParticleBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; @@ -145,12 +142,12 @@ auto makeMcParticleHistSpecMap(const T& confBinning) }; } -constexpr char PrefixMcParticle1[] = "McParticle1/"; -constexpr char PrefixMcParticle2[] = "McParticle2/"; +inline constexpr char PrefixMcParticle1[] = "McParticle1/"; +inline constexpr char PrefixMcParticle2[] = "McParticle2/"; constexpr std::string_view McDir = "MC/"; -template +template class McParticleHistManager { public: @@ -311,6 +308,5 @@ class McParticleHistManager int mPlotNSecondaries = 0; std::array mPdgCodesSecondaryMother = {0}; }; -} // namespace mcparticlehistmanager -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::mcparticlehistmanager #endif // PWGCF_FEMTO_CORE_MCPARTICLEHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/modes.h b/PWGCF/Femto/Core/modes.h index 5ee80e64787..e3694abbf53 100644 --- a/PWGCF/Femto/Core/modes.h +++ b/PWGCF/Femto/Core/modes.h @@ -21,12 +21,15 @@ #include #include -namespace o2::analysis::femto -{ -namespace modes +namespace o2::analysis::femto::modes { -#define BIT(n) (1ULL << (n)) +template +constexpr std::underlying_type_t bit(uint64_t n) +{ + using U = std::underlying_type_t; + return static_cast(U{1} << n); +} // check if flag is set template @@ -45,11 +48,11 @@ constexpr bool isEqual(T lhs, T rhs) } enum class Mode : uint32_t { - kReco = BIT(0), - kQa = BIT(1), - kMc = BIT(2), - kSe = BIT(3), - kMe = BIT(4), + kReco = bit(0), + kQa = bit(1), + kMc = bit(2), + kSe = bit(3), + kMe = bit(4), kReco_Qa = kReco | kQa, kReco_Mc = kReco | kMc, kReco_Qa_Mc = kReco | kQa | kMc, @@ -62,11 +65,11 @@ enum class Mode : uint32_t { }; enum class System : uint32_t { - kPP = BIT(0), - kPbPb = BIT(1), - kMC = BIT(2), - kRun3 = BIT(3), - kRun2 = BIT(4), + kPP = bit(0), + kPbPb = bit(1), + kMC = bit(2), + kRun3 = bit(3), + kRun2 = bit(4), kPP_Run3 = kPP | kRun3, kPP_Run3_MC = kPP | kRun3 | kMC, kPP_Run2 = kPP | kRun2, @@ -75,19 +78,19 @@ enum class System : uint32_t { kPbPb_Run2 = kPbPb | kRun2, }; -enum class MomentumType : o2::aod::femtodatatypes::MomentumType { +enum class MomentumType : o2::analysis::femto::datatypes::MomentumType { kPt = 0, // transverse momentum kPAtPv = 1, // momentum at primary vertex kPTpc = 2, // momentum at inner wall of tpc }; -enum class TransverseMassType : o2::aod::femtodatatypes::TransverseMassType { +enum class TransverseMassType : o2::analysis::femto::datatypes::TransverseMassType { kAveragePdgMass = 0, kReducedPdgMass = 1, kMt4Vector = 2 }; -enum class Particle : o2::aod::femtodatatypes::ParticleType { +enum class Particle : o2::analysis::femto::datatypes::ParticleType { mcParticle = 0, kTrack = 1, kTwoTrackResonance = 2, @@ -96,7 +99,7 @@ enum class Particle : o2::aod::femtodatatypes::ParticleType { kCascade = 5, }; -enum class McOrigin : o2::aod::femtodatatypes::McOriginType { +enum class McOrigin : o2::analysis::femto::datatypes::McOriginType { kNoMcParticle = 0, // no associated mc particle normally indicated a wrongly reconstruced partilce kFromWrongCollision = 1, // partilce originates from the wrong collision or a collision which was wrongly reconstructed (like a split vertex) kPhysicalPrimary = 2, // primary particle @@ -128,7 +131,7 @@ constexpr const char* mcOriginToString(McOrigin origin) } } -enum class Track : o2::aod::femtodatatypes::TrackType { +enum class Track : o2::analysis::femto::datatypes::TrackType { kTrack, kV0Daughter, kCascadeBachelor, @@ -136,30 +139,29 @@ enum class Track : o2::aod::femtodatatypes::TrackType { kKinkDaughter }; -enum class V0 : o2::aod::femtodatatypes::V0Type { +enum class V0 : o2::analysis::femto::datatypes::V0Type { kLambda, kAntiLambda, kK0short }; -enum class Kink : o2::aod::femtodatatypes::KinkType { +enum class Kink : o2::analysis::femto::datatypes::KinkType { kSigma, kSigmaPlus }; -enum class Cascade : o2::aod::femtodatatypes::CascadeType { +enum class Cascade : o2::analysis::femto::datatypes::CascadeType { kXi, kOmega }; // enum of supported resonances -enum class TwoTrackResonance : o2::aod::femtodatatypes::TwoTrackResonanceType { +enum class TwoTrackResonance : o2::analysis::femto::datatypes::TwoTrackResonanceType { kRho0, kPhi, kKstar0, kKstar0Bar }; -}; // namespace modes -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::modes #endif // PWGCF_FEMTO_CORE_MODES_H_ diff --git a/PWGCF/Femto/Core/pairBuilder.h b/PWGCF/Femto/Core/pairBuilder.h index 6569bc43ea2..879cd2486ba 100644 --- a/PWGCF/Femto/Core/pairBuilder.h +++ b/PWGCF/Femto/Core/pairBuilder.h @@ -43,15 +43,12 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::pairbuilder { -namespace pairbuilder -{ - const int64_t nLimitPartitionIdenticalParticles = 2; const int64_t nLimitPartitionParticles = 1; -template +template class PairTrackTrackBuilder { public: @@ -288,18 +285,18 @@ class PairTrackTrackBuilder std::uniform_int_distribution<> mDist; }; -template class PairV0V0Builder @@ -543,14 +540,14 @@ class PairV0V0Builder std::uniform_int_distribution<> mDist; }; -template class PairTrackV0Builder { @@ -710,14 +707,14 @@ class PairTrackV0Builder int mMixingDepth = 5; }; -template class PairTrackTwoTrackResonanceBuilder { @@ -821,18 +818,18 @@ class PairTrackTwoTrackResonanceBuilder int mMixingDepth = 5; }; -template class PairV0TwoTrackResonanceBuilder @@ -945,13 +942,13 @@ class PairV0TwoTrackResonanceBuilder int mMixingDepth = 5; }; -template class PairTrackKinkBuilder { @@ -1094,17 +1091,17 @@ class PairTrackKinkBuilder int mMixingDepth = 5; }; -template class PairTrackCascadeBuilder { @@ -1254,7 +1251,7 @@ class PairTrackCascadeBuilder int mMixingDepth = 5; }; -template +template class PairMcParticleMcParticleBuilder { public: @@ -1431,7 +1428,6 @@ class PairMcParticleMcParticleBuilder std::uniform_int_distribution<> mDist; }; -} // namespace pairbuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::pairbuilder #endif // PWGCF_FEMTO_CORE_PAIRBUILDER_H_ diff --git a/PWGCF/Femto/Core/pairCleaner.h b/PWGCF/Femto/Core/pairCleaner.h index c67f9ce3b6a..bb795a6332f 100644 --- a/PWGCF/Femto/Core/pairCleaner.h +++ b/PWGCF/Femto/Core/pairCleaner.h @@ -20,11 +20,8 @@ #include -namespace o2::analysis::femto +namespace o2::analysis::femto::paircleaner { -namespace paircleaner -{ - class BasePairCleaner { public: @@ -298,7 +295,6 @@ class McParticleMcParticlePairCleaner : public BasePairCleaner } }; -} // namespace paircleaner -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::paircleaner #endif // PWGCF_FEMTO_CORE_PAIRCLEANER_H_ diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index e3e72d752ab..2d9365d8de0 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -42,9 +42,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace pairhistmanager +namespace o2::analysis::femto::pairhistmanager { // enum for pair histograms enum PairHist { @@ -319,95 +317,99 @@ constexpr std::array, kPairHistogramLast> {kQoutQsideQlong, o2::framework::HistType::kTH3F, "hQoutQsideQlong", "Bertsch-Pratt 3D; q_{out} (GeV/#it{c}); q_{side} (GeV/#it{c}); q_{long} (GeV/#it{c})"}, }}; -#define PAIR_HIST_ANALYSIS_MAP(confAnalysis) \ - {kKstar, {confAnalysis.kstar}}, \ - {kKt, {confAnalysis.kt}}, \ - {kMt, {confAnalysis.mt}}, \ - {kMinv, {confAnalysis.massInv}}, \ - {kPt1VsPt2, {confAnalysis.pt1, confAnalysis.pt2}}, \ - {kPt1VsKstar, {confAnalysis.pt1, confAnalysis.kstar}}, \ - {kPt2VsKstar, {confAnalysis.pt2, confAnalysis.kstar}}, \ - {kPt1VsKt, {confAnalysis.pt1, confAnalysis.kt}}, \ - {kPt2VsKt, {confAnalysis.pt2, confAnalysis.kt}}, \ - {kPt1VsMt, {confAnalysis.pt1, confAnalysis.mt}}, \ - {kPt2VsMt, {confAnalysis.pt2, confAnalysis.mt}}, \ - {kKstarVsKt, {confAnalysis.kstar, confAnalysis.kt}}, \ - {kKstarVsMt, {confAnalysis.kstar, confAnalysis.mt}}, \ - {kKstarVsMult, {confAnalysis.kstar, confAnalysis.multiplicity}}, \ - {kKstarVsCent, {confAnalysis.kstar, confAnalysis.centrality}}, \ - {kKstarVsMass1, {confAnalysis.kstar, confAnalysis.mass1}}, \ - {kKstarVsMass2, {confAnalysis.kstar, confAnalysis.mass2}}, \ - {kMass1VsMass2, {confAnalysis.mass1, confAnalysis.mass2}}, \ - {kKstarVsMinv, {confAnalysis.kstar, confAnalysis.massInv}}, \ - {kPt1VsMinv, {confAnalysis.pt1, confAnalysis.massInv}}, \ - {kPt2VsMinv, {confAnalysis.pt2, confAnalysis.massInv}}, \ - {kKstarVsMtVsMult, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.multiplicity}}, \ - {kKstarVsMtVsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.multiplicity, confAnalysis.centrality}}, \ - {kKstarVsMtVsPt1VsPt2, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.pt1, confAnalysis.pt2}}, \ - {kKstarVsMtVsPt1VsPt2VsMult, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity}}, \ - {kKstarVsMtVsPt1VsPt2VsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity, confAnalysis.centrality}}, \ - {kKstarVsMtVsMass1VsMass2, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2}}, \ - {kKstarVsMtVsMass1VsMass2VsMult, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2, confAnalysis.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2, confAnalysis.multiplicity, confAnalysis.centrality}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2, confAnalysis.pt1, confAnalysis.pt2}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.mass1, confAnalysis.mass2, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity, confAnalysis.centrality}}, \ - {kKstarVsMtVsMinvVsPt1VsPt2, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.massInv, confAnalysis.pt1, confAnalysis.pt2}}, \ - {kKstarVsMtVsMinvVsPt1VsPt2VsMult, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.massInv, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity}}, \ - {kKstarVsMtVsMinvVsPt1VsPt2VsMultVsCent, {confAnalysis.kstar, confAnalysis.mt, confAnalysis.massInv, confAnalysis.pt1, confAnalysis.pt2, confAnalysis.multiplicity, confAnalysis.centrality}}, \ - {kDalitz, {confAnalysis.kstar, confAnalysis.dalitzMtot, confAnalysis.dalitzM12, confAnalysis.dalitzM13}}, \ - {kDeltaEtaDeltaPhi, {confAnalysis.binningDeltaPhi, confAnalysis.binningDeltaEta}}, \ - {kQout, {confAnalysis.qout}}, \ - {kQside, {confAnalysis.qside}}, \ - {kQlong, {confAnalysis.qlong}}, \ - {kQoutQsideQlong, {confAnalysis.qout, confAnalysis.qside, confAnalysis.qlong}}, +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define PAIR_HIST_ANALYSIS_MAP(confAnalysis) \ + {kKstar, {(confAnalysis).kstar}}, \ + {kKt, {(confAnalysis).kt}}, \ + {kMt, {(confAnalysis).mt}}, \ + {kMinv, {(confAnalysis).massInv}}, \ + {kPt1VsPt2, {(confAnalysis).pt1, (confAnalysis).pt2}}, \ + {kPt1VsKstar, {(confAnalysis).pt1, (confAnalysis).kstar}}, \ + {kPt2VsKstar, {(confAnalysis).pt2, (confAnalysis).kstar}}, \ + {kPt1VsKt, {(confAnalysis).pt1, (confAnalysis).kt}}, \ + {kPt2VsKt, {(confAnalysis).pt2, (confAnalysis).kt}}, \ + {kPt1VsMt, {(confAnalysis).pt1, (confAnalysis).mt}}, \ + {kPt2VsMt, {(confAnalysis).pt2, (confAnalysis).mt}}, \ + {kKstarVsKt, {(confAnalysis).kstar, (confAnalysis).kt}}, \ + {kKstarVsMt, {(confAnalysis).kstar, (confAnalysis).mt}}, \ + {kKstarVsMult, {(confAnalysis).kstar, (confAnalysis).multiplicity}}, \ + {kKstarVsCent, {(confAnalysis).kstar, (confAnalysis).centrality}}, \ + {kKstarVsMass1, {(confAnalysis).kstar, (confAnalysis).mass1}}, \ + {kKstarVsMass2, {(confAnalysis).kstar, (confAnalysis).mass2}}, \ + {kMass1VsMass2, {(confAnalysis).mass1, (confAnalysis).mass2}}, \ + {kKstarVsMinv, {(confAnalysis).kstar, (confAnalysis).massInv}}, \ + {kPt1VsMinv, {(confAnalysis).pt1, (confAnalysis).massInv}}, \ + {kPt2VsMinv, {(confAnalysis).pt2, (confAnalysis).massInv}}, \ + {kKstarVsMtVsMult, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).multiplicity}}, \ + {kKstarVsMtVsMultVsCent, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).multiplicity, (confAnalysis).centrality}}, \ + {kKstarVsMtVsPt1VsPt2, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).pt1, (confAnalysis).pt2}}, \ + {kKstarVsMtVsPt1VsPt2VsMult, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity}}, \ + {kKstarVsMtVsPt1VsPt2VsMultVsCent, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity, (confAnalysis).centrality}}, \ + {kKstarVsMtVsMass1VsMass2, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2}}, \ + {kKstarVsMtVsMass1VsMass2VsMult, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2, (confAnalysis).multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsMultVsCent, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2, (confAnalysis).multiplicity, (confAnalysis).centrality}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2, (confAnalysis).pt1, (confAnalysis).pt2}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).mass1, (confAnalysis).mass2, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity, (confAnalysis).centrality}}, \ + {kKstarVsMtVsMinvVsPt1VsPt2, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).massInv, (confAnalysis).pt1, (confAnalysis).pt2}}, \ + {kKstarVsMtVsMinvVsPt1VsPt2VsMult, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).massInv, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity}}, \ + {kKstarVsMtVsMinvVsPt1VsPt2VsMultVsCent, {(confAnalysis).kstar, (confAnalysis).mt, (confAnalysis).massInv, (confAnalysis).pt1, (confAnalysis).pt2, (confAnalysis).multiplicity, (confAnalysis).centrality}}, \ + {kDalitz, {(confAnalysis).kstar, (confAnalysis).dalitzMtot, (confAnalysis).dalitzM12, (confAnalysis).dalitzM13}}, \ + {kDeltaEtaDeltaPhi, {(confAnalysis).binningDeltaPhi, (confAnalysis).binningDeltaEta}}, \ + {kQout, {(confAnalysis).qout}}, \ + {kQside, {(confAnalysis).qside}}, \ + {kQlong, {(confAnalysis).qlong}}, \ + {kQoutQsideQlong, {(confAnalysis).qout, (confAnalysis).qside, (confAnalysis).qlong}}, // mixing-qa entries are independent of reco vs mc-truth status — both the reco // analysis path and the pure mc-truth path need them whenever kSe/kMe is set -#define PAIR_HIST_MIXING_QA_MAP(confMixing) \ - {kSeNpart1VsNpart2, {confMixing.particleBinning, confMixing.particleBinning}}, \ - {kMeMixingWindowRaw, {confMixing.particleBinning}}, \ - {kMeMixingWindowEffective, {confMixing.particleBinning}}, \ - {kMeNpart1VsNpart2, {confMixing.particleBinning, confMixing.particleBinning}}, \ - {kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2, {confMixing.vtxBins, confMixing.multBins, confMixing.centBins, confMixing.vtxBins, confMixing.multBins, confMixing.centBins}}, - -#define PAIR_HIST_MC_MAP(conf) \ - {kTrueKstarVsKstar, {conf.kstar, conf.kstar}}, \ - {kTrueKtVsKt, {conf.kt, conf.kt}}, \ - {kTrueMtVsMt, {conf.mt, conf.mt}}, \ - {kTrueMinvVsMinv, {conf.massInv, conf.massInv}}, \ - {kTrueMultVsMult, {conf.multiplicity, conf.multiplicity}}, \ - {kTrueCentVsCent, {conf.centrality, conf.centrality}}, +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define PAIR_HIST_MIXING_QA_MAP(confMixing) \ + {kSeNpart1VsNpart2, {(confMixing).particleBinning, (confMixing).particleBinning}}, \ + {kMeMixingWindowRaw, {(confMixing).particleBinning}}, \ + {kMeMixingWindowEffective, {(confMixing).particleBinning}}, \ + {kMeNpart1VsNpart2, {(confMixing).particleBinning, (confMixing).particleBinning}}, \ + {kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2, {(confMixing).vtxBins, (confMixing).multBins, (confMixing).centBins, (confMixing).vtxBins, (confMixing).multBins, (confMixing).centBins}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define PAIR_HIST_MC_MAP(conf) \ + {kTrueKstarVsKstar, {(conf).kstar, (conf).kstar}}, \ + {kTrueKtVsKt, {(conf).kt, (conf).kt}}, \ + {kTrueMtVsMt, {(conf).mt, (conf).mt}}, \ + {kTrueMinvVsMinv, {(conf).massInv, (conf).massInv}}, \ + {kTrueMultVsMult, {(conf).multiplicity, (conf).multiplicity}}, \ + {kTrueCentVsCent, {(conf).centrality, (conf).centrality}}, // pure mc-truth pair (no reco counterpart) — reuses the same analysis binning, -// since there is no separate "true" axis configuration: the truth value IS the +// since there is no separate "true" axis (conf)iguration: the truth value IS the // analysis-level value for this path. -#define PAIR_HIST_MC_TRUTH_MAP(conf) \ - {kTrueKstar, {conf.kstar}}, \ - {kTrueKt, {conf.kt}}, \ - {kTrueMt, {conf.mt}}, \ - {kTrueMinv1D, {conf.massInv}}, \ - {kTruePt1VsPt2, {conf.pt1, conf.pt2}}, \ - {kTruePt1VsKstar, {conf.pt1, conf.kstar}}, \ - {kTruePt2VsKstar, {conf.pt2, conf.kstar}}, \ - {kTruePt1VsKt, {conf.pt1, conf.kt}}, \ - {kTruePt2VsKt, {conf.pt2, conf.kt}}, \ - {kTruePt1VsMt, {conf.pt1, conf.mt}}, \ - {kTruePt2VsMt, {conf.pt2, conf.mt}}, \ - {kTrueKstarVsKt, {conf.kstar, conf.kt}}, \ - {kTrueKstarVsMt, {conf.kstar, conf.mt}}, \ - {kTrueKstarVsMult, {conf.kstar, conf.multiplicity}}, \ - {kTrueKstarVsCent, {conf.kstar, conf.centrality}}, \ - {kTrueDeltaEtaDeltaPhi, {conf.binningDeltaPhi, conf.binningDeltaEta}}, \ - {kTrueQout, {conf.qout}}, \ - {kTrueQside, {conf.qside}}, \ - {kTrueQlong, {conf.qlong}}, \ - {kTrueQoutQsideQlong, {conf.qout, conf.qside, conf.qlong}}, \ - {kTrueKstarVsMtVsMult, {conf.kstar, conf.mt, conf.multiplicity}}, \ - {kTrueKstarVsMtVsMultVsCent, {conf.kstar, conf.mt, conf.multiplicity, conf.centrality}}, \ - {kTrueKstarVsMtVsPt1VsPt2, {conf.kstar, conf.mt, conf.pt1, conf.pt2}}, \ - {kTrueKstarVsMtVsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity}}, \ - {kTrueKstarVsMtVsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define PAIR_HIST_MC_TRUTH_MAP(conf) \ + {kTrueKstar, {(conf).kstar}}, \ + {kTrueKt, {(conf).kt}}, \ + {kTrueMt, {(conf).mt}}, \ + {kTrueMinv1D, {(conf).massInv}}, \ + {kTruePt1VsPt2, {(conf).pt1, (conf).pt2}}, \ + {kTruePt1VsKstar, {(conf).pt1, (conf).kstar}}, \ + {kTruePt2VsKstar, {(conf).pt2, (conf).kstar}}, \ + {kTruePt1VsKt, {(conf).pt1, (conf).kt}}, \ + {kTruePt2VsKt, {(conf).pt2, (conf).kt}}, \ + {kTruePt1VsMt, {(conf).pt1, (conf).mt}}, \ + {kTruePt2VsMt, {(conf).pt2, (conf).mt}}, \ + {kTrueKstarVsKt, {(conf).kstar, (conf).kt}}, \ + {kTrueKstarVsMt, {(conf).kstar, (conf).mt}}, \ + {kTrueKstarVsMult, {(conf).kstar, (conf).multiplicity}}, \ + {kTrueKstarVsCent, {(conf).kstar, (conf).centrality}}, \ + {kTrueDeltaEtaDeltaPhi, {(conf).binningDeltaPhi, (conf).binningDeltaEta}}, \ + {kTrueQout, {(conf).qout}}, \ + {kTrueQside, {(conf).qside}}, \ + {kTrueQlong, {(conf).qlong}}, \ + {kTrueQoutQsideQlong, {(conf).qout, (conf).qside, (conf).qlong}}, \ + {kTrueKstarVsMtVsMult, {(conf).kstar, (conf).mt, (conf).multiplicity}}, \ + {kTrueKstarVsMtVsMultVsCent, {(conf).kstar, (conf).mt, (conf).multiplicity, (conf).centrality}}, \ + {kTrueKstarVsMtVsPt1VsPt2, {(conf).kstar, (conf).mt, (conf).pt1, (conf).pt2}}, \ + {kTrueKstarVsMtVsPt1VsPt2VsMult, {(conf).kstar, (conf).mt, (conf).pt1, (conf).pt2, (conf).multiplicity}}, \ + {kTrueKstarVsMtVsPt1VsPt2VsMultVsCent, {(conf).kstar, (conf).mt, (conf).pt1, (conf).pt2, (conf).multiplicity, (conf).centrality}}, template auto makePairHistSpecMap(T1 const& confPairBinning, T2 const& confMixing) @@ -471,7 +473,7 @@ constexpr std::string_view AnalysisDir = "Analysis/"; constexpr std::string_view MixingQaDir = "MixingQA/"; constexpr std::string_view McDir = "MC/"; -template class PairHistManager @@ -1249,9 +1251,9 @@ class PairHistManager const double kside2 = (p2.Py() * tPx - p2.Px() * tPy) / tPt; const double klong2 = gammaL * (p2.Pz() - betaL * p2.E()); - float qOut = static_cast(kout1 - kout2); - float qSide = static_cast(kside1 - kside2); - float qLong = static_cast(klong1 - klong2); + auto qOut = static_cast(kout1 - kout2); + auto qSide = static_cast(kside1 - kside2); + auto qLong = static_cast(klong1 - klong2); return {qOut, qSide, qLong}; } @@ -1269,8 +1271,8 @@ class PairHistManager int mAbsCharge1 = 1; int mAbsCharge2 = 1; - ROOT::Math::PtEtaPhiMVector mParticle1{}; - ROOT::Math::PtEtaPhiMVector mParticle2{}; + ROOT::Math::PtEtaPhiMVector mParticle1; + ROOT::Math::PtEtaPhiMVector mParticle2; float mRecoMass1 = 0.f; float mRecoMass2 = 0.f; float mKstar = 0.f; @@ -1286,8 +1288,8 @@ class PairHistManager // mc (used for both reco-vs-truth correlation AND pure mc-truth-only pairs — // for the latter, these are simply the primary/only kinematic values, not a // "true" comparison against anything) - ROOT::Math::PtEtaPhiMVector mTrueParticle1{}; - ROOT::Math::PtEtaPhiMVector mTrueParticle2{}; + ROOT::Math::PtEtaPhiMVector mTrueParticle1; + ROOT::Math::PtEtaPhiMVector mTrueParticle2; float mTrueKstar = 0.f; float mTrueKt = 0.f; float mTrueMt = 0.f; @@ -1351,10 +1353,8 @@ class PairHistManager bool mPairCorrelationQa = false; bool mEventMixingQa = false; - std::unordered_set mParticles1PerEvent = {}; - std::unordered_set mParticles2PerEvent = {}; + std::unordered_set mParticles1PerEvent; + std::unordered_set mParticles2PerEvent; }; - -}; // namespace pairhistmanager -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::pairhistmanager #endif // PWGCF_FEMTO_CORE_PAIRHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/pairProcessHelpers.h b/PWGCF/Femto/Core/pairProcessHelpers.h index f9e235276b4..b4d05f37be5 100644 --- a/PWGCF/Femto/Core/pairProcessHelpers.h +++ b/PWGCF/Femto/Core/pairProcessHelpers.h @@ -25,11 +25,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::pairprocesshelpers { -namespace pairprocesshelpers -{ - enum PairOrder : uint8_t { kOrder12, kOrder21 @@ -724,7 +721,6 @@ void processMixedEvent(T1 const& Collisions, } } -} // namespace pairprocesshelpers -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::pairprocesshelpers #endif // PWGCF_FEMTO_CORE_PAIRPROCESSHELPERS_H_ diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index f7b0cd1745a..9974c20cb47 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -21,12 +21,9 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::particlecleaner { -namespace particlecleaner -{ - -template +template struct ConfParticleCleaner : o2::framework::ConfigurableGroup { std::string prefix = std::string(Prefix); o2::framework::Configurable activate{"activate", false, "Activate particle cleaner"}; @@ -122,12 +119,9 @@ class ParticleCleaner // No MC particle at all → no mother/partonic-mother info is reachable either, // since that lookup now goes through the mc particle row. if (!particle.has_fMcParticle()) { - if (mRejectParticleWithoutMcParticle || !mRequiredPdgCodes.empty() || - mRejectParticleWithoutMcMother || !mRequiredMotherPdgCodes.empty() || - mRejectParticleWithoutMcPartonicMother || !mRequiredPartonicMotherPdgCodes.empty()) { - return false; - } - return true; + return !mRejectParticleWithoutMcParticle && mRequiredPdgCodes.empty() && + !mRejectParticleWithoutMcMother && mRequiredMotherPdgCodes.empty() && + !mRejectParticleWithoutMcPartonicMother && mRequiredPartonicMotherPdgCodes.empty(); } auto mcParticle = particle.template fMcParticle_as(); @@ -241,15 +235,14 @@ class ParticleCleaner bool mRejectParticleWithoutMcParticle = true; bool mRejectParticleWithoutMcMother = true; bool mRejectParticleWithoutMcPartonicMother = true; - std::vector mRequiredPdgCodes{}; - std::vector mRejectedPdgCodes{}; - std::vector mRequiredMotherPdgCodes{}; - std::vector mRejectedMotherPdgCodes{}; - std::vector mRequiredPartonicMotherPdgCodes{}; - std::vector mRejectedPartonicMotherPdgCodes{}; + std::vector mRequiredPdgCodes; + std::vector mRejectedPdgCodes; + std::vector mRequiredMotherPdgCodes; + std::vector mRejectedMotherPdgCodes; + std::vector mRequiredPartonicMotherPdgCodes; + std::vector mRejectedPartonicMotherPdgCodes; }; -} // namespace particlecleaner -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::particlecleaner #endif // PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ diff --git a/PWGCF/Femto/Core/partitions.h b/PWGCF/Femto/Core/partitions.h index edcfe33db65..cb32840b0d7 100644 --- a/PWGCF/Femto/Core/partitions.h +++ b/PWGCF/Femto/Core/partitions.h @@ -17,157 +17,169 @@ #define PWGCF_FEMTO_CORE_PARTITIONS_H_ // collsion selection -#define MAKE_COLLISION_FILTER(selection) \ - (o2::aod::femtocollisions::posZ >= selection.vtxZMin && o2::aod::femtocollisions::posZ <= selection.vtxZMax) && \ - (o2::aod::femtocollisions::mult >= selection.multMin && o2::aod::femtocollisions::mult <= selection.multMax) && \ - (o2::aod::femtocollisions::cent >= selection.centMin && o2::aod::femtocollisions::cent <= selection.centMax) && \ - (o2::aod::femtocollisions::magField >= o2::framework::expressions::as(selection.magFieldMin) && \ - o2::aod::femtocollisions::magField <= o2::framework::expressions::as(selection.magFieldMax)) && \ - ncheckbit(o2::aod::femtocollisions::mask, selection.collisionMask) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_COLLISION_FILTER(selection) \ + (o2::aod::femtocollisions::posZ >= (selection).vtxZMin && o2::aod::femtocollisions::posZ <= (selection).vtxZMax) && \ + (o2::aod::femtocollisions::mult >= (selection).multMin && o2::aod::femtocollisions::mult <= (selection).multMax) && \ + (o2::aod::femtocollisions::cent >= (selection).centMin && o2::aod::femtocollisions::cent <= (selection).centMax) && \ + (o2::aod::femtocollisions::magField >= o2::framework::expressions::as((selection).magFieldMin) && \ + o2::aod::femtocollisions::magField <= o2::framework::expressions::as((selection).magFieldMax)) && \ + ncheckbit(o2::aod::femtocollisions::mask, (selection).collisionMask) // macro for track momentum, i.e. ||q|*pT/q| * cosh(eta) // there is no ncosh function, so we have to make our own, i.e. cosh(x) = (exp(x)+exp(-x))/2 +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define TRACK_MOMENTUM(chargeAbs, signedPt, eta) (nabs((chargeAbs) * (signedPt)) * (nexp(eta) + nexp(-1.f * (eta))) / 2.f) // standard track partition -#define MAKE_TRACK_PARTITION(selection) \ - ifnode(selection.chargeSign.node() != 0, ifnode(selection.chargeSign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(selection.chargeAbs * o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(selection.chargeAbs * o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - ifnode(TRACK_MOMENTUM(selection.chargeAbs, o2::aod::femtobase::stored::signedPt, o2::aod::femtobase::stored::eta) <= selection.pidThres, \ - ncheckbit(o2::aod::femtotracks::mask, selection.maskLowMomentum) && \ - (o2::aod::femtotracks::mask & selection.rejectionMaskLowMomentum) == static_cast(0), \ - ncheckbit(o2::aod::femtotracks::mask, selection.maskHighMomentum) && \ - (o2::aod::femtotracks::mask & selection.rejectionMaskHighMomentum) == static_cast(0)) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_TRACK_PARTITION(selection) \ + ifnode((selection).chargeSign.node() != 0, ifnode((selection).chargeSign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs((selection).chargeAbs * o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs((selection).chargeAbs * o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + ifnode(TRACK_MOMENTUM((selection).chargeAbs, o2::aod::femtobase::stored::signedPt, o2::aod::femtobase::stored::eta) <= (selection).pidThres, \ + ncheckbit(o2::aod::femtotracks::mask, (selection).maskLowMomentum) && \ + (o2::aod::femtotracks::mask & (selection).rejectionMaskLowMomentum) == static_cast(0), \ + ncheckbit(o2::aod::femtotracks::mask, (selection).maskHighMomentum) && \ + (o2::aod::femtotracks::mask & (selection).rejectionMaskHighMomentum) == static_cast(0)) // track partition with optional mass cut -#define MAKE_TRACK_PARTITION_WITH_MASS(selection) \ - MAKE_TRACK_PARTITION(selection) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_TRACK_PARTITION_WITH_MASS(selection) \ + MAKE_TRACK_PARTITION((selection)) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) // partition for phis and rhos, i.e. resonance that are their own antiparticle -#define MAKE_RESONANCE_0_PARTITON(selection) \ - (o2::aod::femtobase::stored::pt > selection.ptMin) && \ - (o2::aod::femtobase::stored::pt < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ifnode(o2::aod::femtotwotrackresonances::posDauHasHighMomentum, \ - ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, selection.posDauMaskAboveThres), \ - ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, selection.posDauMaskBelowThres)) && \ - ifnode(o2::aod::femtotwotrackresonances::negDauHasHighMomentum, \ - ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, selection.negDauMaskAboveThres), \ - ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, selection.negDauMaskBelowThres)) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_RESONANCE_0_PARTITON(selection) \ + (o2::aod::femtobase::stored::pt > (selection).ptMin) && \ + (o2::aod::femtobase::stored::pt < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ifnode(o2::aod::femtotwotrackresonances::posDauHasHighMomentum, \ + ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, (selection).posDauMaskAboveThres), \ + ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, (selection).posDauMaskBelowThres)) && \ + ifnode(o2::aod::femtotwotrackresonances::negDauHasHighMomentum, \ + ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, (selection).negDauMaskAboveThres), \ + ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, (selection).negDauMaskBelowThres)) // partition for kstars, they have distinct antiparticle -#define MAKE_RESONANCE_1_PARTITON(selection) \ - ifnode(selection.sign.node() != 0, \ - ifnode(selection.sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ifnode(o2::aod::femtotwotrackresonances::posDauHasHighMomentum, \ - ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, selection.posDauMaskAboveThres), \ - ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, selection.posDauMaskBelowThres)) && \ - ifnode(o2::aod::femtotwotrackresonances::negDauHasHighMomentum, \ - ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, selection.negDauMaskAboveThres), \ - ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, selection.negDauMaskBelowThres)) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_RESONANCE_1_PARTITON(selection) \ + ifnode((selection).sign.node() != 0, \ + ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ifnode(o2::aod::femtotwotrackresonances::posDauHasHighMomentum, \ + ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, (selection).posDauMaskAboveThres), \ + ncheckbit(o2::aod::femtotwotrackresonances::maskPosDau, (selection).posDauMaskBelowThres)) && \ + ifnode(o2::aod::femtotwotrackresonances::negDauHasHighMomentum, \ + ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, (selection).negDauMaskAboveThres), \ + ncheckbit(o2::aod::femtotwotrackresonances::maskNegDau, (selection).negDauMaskBelowThres)) // partition for lambdas -#define MAKE_LAMBDA_PARTITION(selection) \ - ifnode(selection.sign.node() != 0, \ - ifnode(selection.sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ncheckbit(o2::aod::femtov0s::mask, selection.mask) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_LAMBDA_PARTITION(selection) \ + ifnode((selection).sign.node() != 0, \ + ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ncheckbit(o2::aod::femtov0s::mask, (selection).mask) // partition for k0shorts // need special partition since k0shorts have no antiparticle -#define MAKE_K0SHORT_PARTITION(selection) \ - (o2::aod::femtobase::stored::pt > selection.ptMin) && \ - (o2::aod::femtobase::stored::pt < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ncheckbit(o2::aod::femtov0s::mask, selection.mask) - -#define MAKE_CASCADE_PARTITION(selection) \ - ifnode(selection.sign.node() != 0, \ - ifnode(selection.sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ncheckbit(o2::aod::femtocascades::mask, selection.mask) - -#define MAKE_SIGMA_PARTITION(selection) \ - ifnode(selection.sign.node() != 0, \ - ifnode(selection.sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ncheckbit(o2::aod::femtokinks::mask, selection.mask) - -#define MAKE_SIGMAPLUS_PARTITION(selection) \ - ifnode(selection.sign.node() != 0, \ - ifnode(selection.sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) && \ - (o2::aod::femtobase::stored::mass > selection.massMin) && \ - (o2::aod::femtobase::stored::mass < selection.massMax) && \ - ncheckbit(o2::aod::femtokinks::mask, selection.mask) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_K0SHORT_PARTITION(selection) \ + (o2::aod::femtobase::stored::pt > (selection).ptMin) && \ + (o2::aod::femtobase::stored::pt < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ncheckbit(o2::aod::femtov0s::mask, (selection).mask) + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_CASCADE_PARTITION(selection) \ + ifnode((selection).sign.node() != 0, \ + ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ncheckbit(o2::aod::femtocascades::mask, (selection).mask) + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_SIGMA_PARTITION(selection) \ + ifnode((selection).sign.node() != 0, \ + ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ncheckbit(o2::aod::femtokinks::mask, (selection).mask) + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_SIGMAPLUS_PARTITION(selection) \ + ifnode((selection).sign.node() != 0, \ + ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) && \ + (o2::aod::femtobase::stored::mass > (selection).massMin) && \ + (o2::aod::femtobase::stored::mass < (selection).massMax) && \ + ncheckbit(o2::aod::femtokinks::mask, (selection).mask) // macros for mc collisions (mc only) -#define MAKE_MC_COLLISION_FILTER(selection) \ - (o2::aod::femtocollisions::posZ >= selection.vtxZMin && o2::aod::femtocollisions::posZ <= selection.vtxZMax) && \ - (o2::aod::femtocollisions::mult >= selection.multMin && o2::aod::femtocollisions::mult <= selection.multMax) && \ - (o2::aod::femtocollisions::cent >= selection.centMin && o2::aod::femtocollisions::cent <= selection.centMax) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_MC_COLLISION_FILTER(selection) \ + (o2::aod::femtocollisions::posZ >= (selection).vtxZMin && o2::aod::femtocollisions::posZ <= (selection).vtxZMax) && \ + (o2::aod::femtocollisions::mult >= (selection).multMin && o2::aod::femtocollisions::mult <= (selection).multMax) && \ + (o2::aod::femtocollisions::cent >= (selection).centMin && o2::aod::femtocollisions::cent <= (selection).centMax) // macros for mc particle (mc only) -#define MAKE_MC_PARTICLE_PARTITION(selection) \ - ifnode(selection.pdgCodeAbs.node() == 0, true, selection.pdgCodeAbs == nabs(o2::aod::femtomcparticle::pdgCode)) && \ - ifnode(selection.chargeSign.node() != 0, ifnode(selection.chargeSign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ - (nabs(o2::aod::femtobase::stored::signedPt) > selection.ptMin) && \ - (nabs(o2::aod::femtobase::stored::signedPt) < selection.ptMax) && \ - (o2::aod::femtobase::stored::eta > selection.etaMin) && \ - (o2::aod::femtobase::stored::eta < selection.etaMax) && \ - (o2::aod::femtobase::stored::phi > selection.phiMin) && \ - (o2::aod::femtobase::stored::phi < selection.phiMax) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define MAKE_MC_PARTICLE_PARTITION(selection) \ + ifnode((selection).pdgCodeAbs.node() == 0, true, (selection).pdgCodeAbs == nabs(o2::aod::femtomcparticle::pdgCode)) && \ + ifnode((selection).chargeSign.node() != 0, ifnode((selection).chargeSign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \ + (nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \ + (nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \ + (o2::aod::femtobase::stored::eta > (selection).etaMin) && \ + (o2::aod::femtobase::stored::eta < (selection).etaMax) && \ + (o2::aod::femtobase::stored::phi > (selection).phiMin) && \ + (o2::aod::femtobase::stored::phi < (selection).phiMax) #endif // PWGCF_FEMTO_CORE_PARTITIONS_H_ -// diff --git a/PWGCF/Femto/Core/selectionContainer.h b/PWGCF/Femto/Core/selectionContainer.h index fe5616f8302..4e9e1718e16 100644 --- a/PWGCF/Femto/Core/selectionContainer.h +++ b/PWGCF/Femto/Core/selectionContainer.h @@ -228,17 +228,17 @@ class SelectionContainer /// \brief Get comments attached to the selection thresholds. /// \return Vector of comment strings. - std::string getComment(int selectionIndex) const + [[nodiscard]] std::string getComment(int selectionIndex) const { if (mComments.empty()) { - return std::string(""); + return std::string{""}; } return mComments.at(selectionIndex); } /// \brief Get the name of this selection. /// \return Selection name string. - std::string const& getSelectionName() const { return mSelectionName; } + [[nodiscard]] std::string const& getSelectionName() const { return mSelectionName; } /// \brief Update threshold values by re-evaluating the internal TF1 functions at a given point. /// \param value Input value at which to evaluate the functions. @@ -354,10 +354,9 @@ class SelectionContainer { if (!mSkipMostPermissiveBit) { return mBitmask; - } else { - // remove the first (most permissive) bit since it corresponds to the minimal selection and is always true - return mBitmask >> 1; } + // remove the first (most permissive) bit since it corresponds to the minimal selection and is always true + return mBitmask >> 1; } /// \brief Manually set the internal bitmask. @@ -374,7 +373,7 @@ class SelectionContainer /// \brief Check whether the mandatory (minimal) cut condition is fulfilled. /// \return True if the minimal selection passes or if this container is not marked as a minimal cut. - bool passesAsMinimalCut() const + [[nodiscard]] bool passesAsMinimalCut() const { if (mIsMinimalCut) { // if any bit is set the loosest threshold passed; since thresholds are ordered, @@ -387,7 +386,7 @@ class SelectionContainer /// \brief Check whether any optional cut is fulfilled. /// \return True if at least one optional threshold is passed, false if this container is not marked as optional. - bool passesAsOptionalCut() const + [[nodiscard]] bool passesAsOptionalCut() const { if (mIsOptionalCut) { // if any bit is set the loosest threshold passed @@ -411,12 +410,12 @@ class SelectionContainer /// For function-based selections, mSelectionValues is always populated (initialised at the midpoint), /// so this check is safe for both static and function-based containers. /// \return True if no thresholds are configured. - bool isEmpty() const { return mSelectionValues.empty(); } + [[nodiscard]] bool isEmpty() const { return mSelectionValues.empty(); } /// \brief Get the number of bits this container contributes to the global bitmask. /// If the most permissive bit is skipped, the contribution is reduced by one. /// \return Number of bits to add to the global bitmask offset. - int getShift() const + [[nodiscard]] int getShift() const { if (mSelectionValues.empty()) { return 0; @@ -433,16 +432,16 @@ class SelectionContainer /// \brief Get the bit offset of this container within the global bitmask. /// \return Bit offset. - int getOffset() const { return mOffset; } + [[nodiscard]] int getOffset() const { return mOffset; } /// \brief Get the total number of configured selection thresholds. /// \return Number of thresholds. - std::size_t getNSelections() const { return mSelectionValues.size(); } + [[nodiscard]] std::size_t getNSelections() const { return mSelectionValues.size(); } /// \brief Build a histogram bin label string encoding the full configuration of a single threshold. /// \param selectionIndex Index of the threshold within this container. /// \return Encoded label string. - std::string getBinLabel(int selectionIndex) const + [[nodiscard]] std::string getBinLabel(int selectionIndex) const { std::ostringstream oss; std::string sectionDelimiter = ":::"; @@ -477,10 +476,10 @@ class SelectionContainer return oss.str(); } - std::string getValueAsString(int selectionIndex) const + [[nodiscard]] std::string getValueAsString(int selectionIndex) const { if (this->isEmpty()) { - return std::string("No value configured"); + return std::string{"No value configured"}; } if (!mSelectionFunctions.empty()) { return std::string(mSelectionFunctions.at(selectionIndex).GetExpFormula().Data()); @@ -497,7 +496,7 @@ class SelectionContainer /// Calling this for the skipped most-permissive threshold is a fatal error. /// \param selectionIndex Index of the threshold within this container. /// \return Global bit position. - int getBitPosition(int selectionIndex) const + [[nodiscard]] int getBitPosition(int selectionIndex) const { if (selectionIndex == 0 && mSkipMostPermissiveBit) { LOG(fatal) << "Trying to accessed the bit position of a skipped selection. Breaking..."; @@ -505,14 +504,13 @@ class SelectionContainer } if (mSkipMostPermissiveBit) { return mOffset + selectionIndex - 1; - } else { - return mOffset + selectionIndex; } + return mOffset + selectionIndex; } /// \brief Get the string representation of the configured limit type. /// \return Human-readable limit type name. - std::string getLimitTypeAsString() const { return limits::limitTypeAsStrings.at(mLimitType); } + [[nodiscard]] std::string getLimitTypeAsString() const { return limits::limitTypeAsStrings.at(mLimitType); } /// \brief Get the configured static threshold values. /// \return Const reference to the vector of threshold values. @@ -520,19 +518,19 @@ class SelectionContainer /// \brief Get the configured TF1 threshold functions. /// \return Const reference to the vector of TF1 functions. - std::vector const& getSelectionFunction() const { return mSelectionFunctions; } + [[nodiscard]] std::vector const& getSelectionFunction() const { return mSelectionFunctions; } /// \brief Check whether this container is marked as a mandatory (minimal) cut. /// \return True if this is a minimal cut. - bool isMinimalCut() const { return mIsMinimalCut; } + [[nodiscard]] bool isMinimalCut() const { return mIsMinimalCut; } /// \brief Check whether this container is marked as an optional cut. /// \return True if this is an optional cut. - bool isOptionalCut() const { return mIsOptionalCut; } + [[nodiscard]] bool isOptionalCut() const { return mIsOptionalCut; } /// \brief Check whether the most permissive threshold bit is skipped when assembling the bitmask. /// \return True if the most permissive bit is skipped. - bool skipMostPermissiveBit() const { return mSkipMostPermissiveBit; } + [[nodiscard]] [[nodiscard]] bool skipMostPermissiveBit() const { return mSkipMostPermissiveBit; } private: /// \brief Sort static threshold values from most permissive to most restrictive based on the limit type. @@ -600,15 +598,15 @@ class SelectionContainer } } - std::string mSelectionName = ""; + std::string mSelectionName; std::vector mSelectionValues = {}; ///< Threshold values, sorted from most permissive to most restrictive - std::vector mSelectionFunctions = {}; ///< TF1 threshold functions (empty for static selections) + std::vector mSelectionFunctions; ///< TF1 threshold functions (empty for static selections) std::vector> mSelectionRanges = {}; ///< Lower and upper bounds for kRange selections, one pair per threshold limits::LimitType mLimitType = limits::kLimitTypeLast; ///< Comparison type applied during evaluation bool mSkipMostPermissiveBit = false; ///< If true, the most permissive threshold does not occupy a bit in the global bitmask bool mIsMinimalCut = false; ///< If true, this selection is mandatory; failing it rejects the candidate bool mIsOptionalCut = false; ///< If true, this selection is optional; passing it accepts the candidate - std::vector mComments = {}; ///< Optional comments per threshold, in the same order as mSelectionValues + std::vector mComments; ///< Optional comments per threshold, in the same order as mSelectionValues std::bitset mBitmask = {}; ///< Bitmask indicating which thresholds were passed during the last evaluation int mOffset = 0; ///< Bit offset of this container within the global bitmask }; diff --git a/PWGCF/Femto/Core/trackBuilder.h b/PWGCF/Femto/Core/trackBuilder.h index 54e395c97cd..7a8d4147a93 100644 --- a/PWGCF/Femto/Core/trackBuilder.h +++ b/PWGCF/Femto/Core/trackBuilder.h @@ -35,11 +35,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::trackbuilder { -namespace trackbuilder -{ - struct ConfTrackFilters : o2::framework::ConfigurableGroup { std::string prefix = std::string("TrackFilters"); // kinematic cuts for filtering tracks @@ -130,7 +127,7 @@ struct ConfTrackBits : o2::framework::ConfigurableGroup { }; // define the template structure for TrackSelection -template +template struct ConfTrackSelection : public o2::framework::ConfigurableGroup { std::string prefix = Prefix; // Unique prefix based on the template argument // configuration parameters @@ -147,11 +144,11 @@ struct ConfTrackSelection : public o2::framework::ConfigurableGroup { o2::framework::Configurable massMin{"massMin", 0.f, "Minimum TOF mass (only used if enabled)"}; o2::framework::Configurable massMax{"massMax", 99.f, "Maximum TOF mass (only used if enabled)"}; // track selection masks - o2::framework::Configurable maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"}; - o2::framework::Configurable maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"}; + o2::framework::Configurable maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"}; + o2::framework::Configurable maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"}; // track rejection masks - o2::framework::Configurable rejectionMaskLowMomentum{"rejectionMaskLowMomentum", 0ul, "Bitmask for rejections below momentum threshold"}; - o2::framework::Configurable rejectionMaskHighMomentum{"rejectionMaskHighMomentum", 0ul, "Bitmask for rejections above momentum threshold"}; + o2::framework::Configurable rejectionMaskLowMomentum{"rejectionMaskLowMomentum", 0ul, "Bitmask for rejections below momentum threshold"}; + o2::framework::Configurable rejectionMaskHighMomentum{"rejectionMaskHighMomentum", 0ul, "Bitmask for rejections above momentum threshold"}; // momentum threshold for PID usage o2::framework::Configurable pidThres{"pidThres", 1.2f, "Momentum threshold for using TPCTOF/TOF pid for tracks with large momentum (GeV/c)"}; }; @@ -241,7 +238,7 @@ const std::unordered_map trackSelectionNames = { {kTPCcRowsMin, "Min. number of crossed TPC rows"}, {kTPCnClsOvercRowsMin, "Min. fraction of TPC clusters over TPC crossed rows"}, {kTPCsClsMax, "Max. number of shared TPC clusters"}, - {kTPCsClsMax, "Max. number of shared TPC clusters"}, + // NOTE: removed duplicate {kTPCsClsMax, ...} entry that was here (harmless but dead duplicate key). {kTPCsClsFracMax, "Max. fractions of shared TPC clusters"}, {kITSnClsMin, "Min. number of ITS clusters"}, {kITSnClsIbMin, "Min. number of ITS clusters in the inner barrel"}, @@ -290,12 +287,12 @@ const std::unordered_map trackSelectionNames = { /// \class FemtoDreamTrackCuts /// \brief Cut class to contain and execute all cuts applied to tracks -template -class TrackSelection : public BaseSelection +template +class TrackSelection : public BaseSelection { public: TrackSelection() = default; - ~TrackSelection() = default; + ~TrackSelection() override = default; template void configure(o2::framework::HistogramRegistry* registry, T1& config, T2& filter) @@ -312,9 +309,9 @@ class TrackSelection : public BaseSelectionaddSelection(kTPCnClsMin, trackSelectionNames.at(kTPCnClsMin), config.tpcClustersMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); @@ -474,11 +471,7 @@ class TrackSelection : public BaseSelectionassembleBitmask(); } - bool - passThroughAllTracks() const - { - return mPassThrough; - } + [[nodiscard]] bool passThroughAllTracks() const { return mPassThrough; } protected: float mElectronTofThres = 99.f; @@ -530,7 +523,7 @@ struct ConfTrackTables : o2::framework::ConfigurableGroup { o2::framework::Configurable produceHeliumPids{"produceHeliumPids", -1, "Produce HeliumPids (-1: auto; 0 off; 1 on)"}; }; -template +template class TrackBuilder { public: @@ -588,20 +581,23 @@ class TrackBuilder } template - void fillTrack(T1 const& track, T2& trackProducts, T3& collisionProducts) + bool fillTrack(T1 const& track, T2& trackProducts, T3& collisionProducts) { - if (mProduceTracks) { - trackProducts.producedTracks(collisionProducts.producedCollision.lastIndex(), - track.pt() * track.sign(), - track.eta(), - track.phi()); - indexMap.emplace(track.globalIndex(), trackProducts.producedTracks.lastIndex()); + if (!mProduceTracks) { + return false; } + + trackProducts.producedTracks(collisionProducts.producedCollision.lastIndex(), + track.pt() * track.sign(), + track.eta(), + track.phi()); + indexMap.emplace(track.globalIndex(), trackProducts.producedTracks.lastIndex()); + if (mProduceTrackMasks) { if constexpr (type == modes::Track::kTrack) { trackProducts.producedTrackMasks(mTrackSelection.getBitmask()); } else { - trackProducts.producedTrackMasks(static_cast(0u)); + trackProducts.producedTrackMasks(static_cast(0u)); } } if (mProduceTrackMass) { @@ -672,6 +668,7 @@ class TrackBuilder } trackProducts.producedHeliumPids(itsHe, track.tpcNSigmaHe(), track.tofNSigmaHe()); } + return true; } template @@ -681,6 +678,7 @@ class TrackBuilder return; } for (const auto& trackWithItsPid : tracksWithItsPid) { + // NOTE: passThrough is intentionally not wired in here yet for the MC path (to be added later). if (!mTrackSelection.checkFilters(trackWithItsPid)) { continue; } @@ -696,13 +694,16 @@ class TrackBuilder } template - void fillMcTrack(T1 const& col, T2& collisionProducts, T3 const& mcCols, T4 const& track, T5 const& trackWithItsPid, T6& trackProducts, T7 const& mcParticles, T8& mcBuilder, T9& mcProducts) + bool fillMcTrack(T1 const& col, T2& collisionProducts, T3 const& mcCols, T4 const& track, T5 const& trackWithItsPid, T6& trackProducts, T7 const& mcParticles, T8& mcBuilder, T9& mcProducts) { + // NOTE: return value added, mirroring fillTrack(), so getDaughterIndex can detect + // whether a row was actually added before trusting lastIndex(). if (!mProduceTracks) { - return; + return false; } this->template fillTrack(trackWithItsPid, trackProducts, collisionProducts); mcBuilder.template fillMcTrackWithLabel(col, mcCols, track, mcParticles, mcProducts); + return true; } template @@ -711,11 +712,13 @@ class TrackBuilder auto result = utils::getIndex(daughter.globalIndex(), indexMap); if (result) { return result.value(); - } else { - this->fillTrack(daughter, trackProducts, collisionProducts); - int64_t idx = trackProducts.producedTracks.lastIndex(); - return idx; } + if (!this->template fillTrack(daughter, trackProducts, collisionProducts)) { + LOG(fatal) << "Trying to register a daughter track, but FTracks table is disabled. " + << "Enable TrackTables.produceTracks when V0/Cascade/Kink tables that need daughter indices are enabled."; + } + // daughter is last track which was added added + return trackProducts.producedTracks.lastIndex(); } template @@ -725,11 +728,13 @@ class TrackBuilder if (result) { // daugher already in track table return result.value(); - } else { - this->fillMcTrack(col, collisionProducts, mcCols, daughter, daughter, trackProducts, mcParticles, mcBuilder, mcProducts); - // daughter is last track which was added added - return trackProducts.producedTracks.lastIndex(); } + if (!this->template fillMcTrack(col, collisionProducts, mcCols, daughter, daughter, trackProducts, mcParticles, mcBuilder, mcProducts)) { + LOG(fatal) << "Trying to register a MC daughter track, but FTracks table is disabled. " + << "Enable TrackTables.produceTracks when V0/Cascade/Kink tables that need daughter indices are enabled."; + } + // daughter is last track which was added added + return trackProducts.producedTracks.lastIndex(); } template @@ -833,11 +838,10 @@ class TrackBuilderDerivedToDerived auto result = utils::getIndex(daughter.globalIndex(), indexMap); if (result) { return result.value(); - } else { - this->fillTrack(daughter, trackProducts, collisionProducts); - int64_t idx = trackProducts.producedTracks.lastIndex(); - return idx; } + this->fillTrack(daughter, trackProducts, collisionProducts); + int64_t idx = trackProducts.producedTracks.lastIndex(); + return idx; } private: @@ -846,9 +850,6 @@ class TrackBuilderDerivedToDerived std::unordered_map indexMap; // for mapping tracks to daughers of lambdas, cascades and resonances ... }; - -} // namespace trackbuilder -// -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::trackbuilder #endif // PWGCF_FEMTO_CORE_TRACKBUILDER_H_ diff --git a/PWGCF/Femto/Core/trackHistManager.h b/PWGCF/Femto/Core/trackHistManager.h index d49af80e328..af36c02acf6 100644 --- a/PWGCF/Femto/Core/trackHistManager.h +++ b/PWGCF/Femto/Core/trackHistManager.h @@ -35,11 +35,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::trackhistmanager { -namespace trackhistmanager -{ - // enum for track histograms enum TrackHist { // kinemtics @@ -143,7 +140,7 @@ enum TrackHist { constexpr std::size_t MaxSecondary = 3; -template +template struct ConfTrackBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; @@ -187,7 +184,7 @@ using ConfPionMinusBinning = ConfTrackBinning; using ConfKaonPlusBinning = ConfTrackBinning; using ConfKaonMinusBinning = ConfTrackBinning; -template +template struct ConfTrackQaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable momentumType{"momentumType", static_cast(modes::MomentumType::kPAtPv), "Momentum on x-axis (0->Pt, 1->P at PV, 2->P at TPC inner wall)"}; @@ -368,97 +365,101 @@ constexpr std::array, kTrackHistLast> {kSecondaryOther, o2::framework::HistType::kTHnSparseF, "hFromSecondaryOther", "Particles from every other seconary decay; p_{T} (GeV/#it{c}); DCA_{xy} (cm); DCA_{z} (cm);"}, }}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define TRACK_HIST_ANALYSIS_MAP(conf) \ - {kPt, {conf.pt}}, \ - {kEta, {conf.eta}}, \ - {kPhi, {conf.phi}}, \ - {kSign, {conf.sign}}, \ - {kMass, {conf.mass}}, - -#define TRACK_HIST_QA_MAP(confAnalysis, confQa) \ - {kPAtPv, {confQa.p}}, \ - {kPTpc, {confQa.p}}, \ - {kItsCluster, {confQa.itsCluster}}, \ - {kItsClusterIb, {confQa.itsClusterIb}}, \ - {kPtVsEta, {confAnalysis.pt, confAnalysis.eta}}, \ - {kPtVsPhi, {confAnalysis.pt, confAnalysis.phi}}, \ - {kPhiVsEta, {confAnalysis.phi, confAnalysis.eta}}, \ - {kPtVsItsCluster, {confAnalysis.pt, confQa.itsCluster}}, \ - {kPtVsTpcCluster, {confAnalysis.pt, confQa.tpcCluster}}, \ - {kPtVsTpcCrossedRows, {confAnalysis.pt, confQa.tpcCrossedRows}}, \ - {kPtVsTpcClusterOverCrossedRows, {confAnalysis.pt, confQa.tpcClusterOverCrossedRows}}, \ - {kPtVsTpcClusterShared, {confAnalysis.pt, confQa.tpcClusterShared}}, \ - {kPtVsTpcClusterFractionShared, {confAnalysis.pt, confQa.tpcClusterFractionShared}}, \ - {kTpcClusterVsTpcCrossedRows, {confQa.tpcCluster, confQa.tpcCrossedRows}}, \ - {kTpcClusterVsTpcClusterShared, {confQa.tpcCluster, confQa.tpcClusterShared}}, \ - {kTpcCrossedRows, {confQa.tpcCrossedRows}}, \ - {kTpcCluster, {confQa.tpcCluster}}, \ - {kTpcClusterOverCrossedRows, {confQa.tpcClusterOverCrossedRows}}, \ - {kTpcClusterShared, {confQa.tpcClusterShared}}, \ - {kTpcClusterFractionShared, {confQa.tpcClusterFractionShared}}, \ - {kPtVsDcaxy, {confAnalysis.pt, confQa.dcaXy}}, \ - {kPtVsDcaz, {confAnalysis.pt, confQa.dcaZ}}, \ - {kPtVsDca, {confAnalysis.pt, confQa.dca}}, \ - {kPtVsDcaxyVsDcaz, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kPVsPTpc, {confQa.p, confQa.p}}, \ - {kItsSignal, {confQa.p, confQa.itsSignal}}, \ - {kItsElectron, {confQa.p, confQa.itsElectron}}, \ - {kItsPion, {confQa.p, confQa.itsPion}}, \ - {kItsKaon, {confQa.p, confQa.itsKaon}}, \ - {kItsProton, {confQa.p, confQa.itsProton}}, \ - {kItsDeuteron, {confQa.p, confQa.itsDeuteron}}, \ - {kItsTriton, {confQa.p, confQa.itsTriton}}, \ - {kItsHelium, {confQa.p, confQa.itsHelium}}, \ - {kTpcSignal, {confQa.p, confQa.tpcSignal}}, \ - {kTpcElectron, {confQa.p, confQa.tpcElectron}}, \ - {kTpcPion, {confQa.p, confQa.tpcPion}}, \ - {kTpcKaon, {confQa.p, confQa.tpcKaon}}, \ - {kTpcProton, {confQa.p, confQa.tpcProton}}, \ - {kTpcDeuteron, {confQa.p, confQa.tpcDeuteron}}, \ - {kTpcTriton, {confQa.p, confQa.tpcTriton}}, \ - {kTpcHelium, {confQa.p, confQa.tpcHelium}}, \ - {kTofBeta, {confQa.p, confQa.tofBeta}}, \ - {kTofMass, {confQa.p, confQa.tofMass}}, \ - {kTofElectron, {confQa.p, confQa.tofElectron}}, \ - {kTofPion, {confQa.p, confQa.tofPion}}, \ - {kTofKaon, {confQa.p, confQa.tofKaon}}, \ - {kTofProton, {confQa.p, confQa.tofProton}}, \ - {kTofDeuteron, {confQa.p, confQa.tofDeuteron}}, \ - {kTofTriton, {confQa.p, confQa.tofTriton}}, \ - {kTofHelium, {confQa.p, confQa.tofHelium}}, \ - {kTpcitsElectron, {confQa.p, confQa.tpcitsElectron}}, \ - {kTpcitsPion, {confQa.p, confQa.tpcitsPion}}, \ - {kTpcitsKaon, {confQa.p, confQa.tpcitsKaon}}, \ - {kTpcitsProton, {confQa.p, confQa.tpcitsProton}}, \ - {kTpcitsDeuteron, {confQa.p, confQa.tpcitsDeuteron}}, \ - {kTpcitsTriton, {confQa.p, confQa.tpcitsTriton}}, \ - {kTpcitsHelium, {confQa.p, confQa.tpcitsHelium}}, \ - {kTpctofElectron, {confQa.p, confQa.tpctofElectron}}, \ - {kTpctofPion, {confQa.p, confQa.tpctofPion}}, \ - {kTpctofKaon, {confQa.p, confQa.tpctofKaon}}, \ - {kTpctofProton, {confQa.p, confQa.tpctofProton}}, \ - {kTpctofDeuteron, {confQa.p, confQa.tpctofDeuteron}}, \ - {kTpctofTriton, {confQa.p, confQa.tpctofTriton}}, \ - {kTpctofHelium, {confQa.p, confQa.tpctofHelium}}, - -#define TRACK_HIST_MC_MAP(conf) \ - {kTruePtVsPt, {conf.pt, conf.pt}}, \ - {kTrueEtaVsEta, {conf.eta, conf.eta}}, \ - {kTruePhiVsPhi, {conf.phi, conf.phi}}, \ - {kPdg, {conf.pdgCodes}}, \ - {kPdgMother, {conf.pdgCodes}}, \ - {kPdgPartonicMother, {conf.pdgCodes}}, - -#define TRACK_HIST_MC_QA_MAP(confAnalysis, confQa) \ - {kNoMcParticle, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kPrimary, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kFromWrongCollision, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kFromMaterial, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kMissidentified, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kSecondary1, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kSecondary2, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kSecondary3, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, \ - {kSecondaryOther, {confAnalysis.pt, confQa.dcaXy, confQa.dcaZ}}, + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kSign, {(conf).sign}}, \ + {kMass, {(conf).mass}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TRACK_HIST_QA_MAP(confAnalysis, confQa) \ + {kPAtPv, {(confQa).p}}, \ + {kPTpc, {(confQa).p}}, \ + {kItsCluster, {(confQa).itsCluster}}, \ + {kItsClusterIb, {(confQa).itsClusterIb}}, \ + {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ + {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ + {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ + {kPtVsItsCluster, {(confAnalysis).pt, (confQa).itsCluster}}, \ + {kPtVsTpcCluster, {(confAnalysis).pt, (confQa).tpcCluster}}, \ + {kPtVsTpcCrossedRows, {(confAnalysis).pt, (confQa).tpcCrossedRows}}, \ + {kPtVsTpcClusterOverCrossedRows, {(confAnalysis).pt, (confQa).tpcClusterOverCrossedRows}}, \ + {kPtVsTpcClusterShared, {(confAnalysis).pt, (confQa).tpcClusterShared}}, \ + {kPtVsTpcClusterFractionShared, {(confAnalysis).pt, (confQa).tpcClusterFractionShared}}, \ + {kTpcClusterVsTpcCrossedRows, {(confQa).tpcCluster, (confQa).tpcCrossedRows}}, \ + {kTpcClusterVsTpcClusterShared, {(confQa).tpcCluster, (confQa).tpcClusterShared}}, \ + {kTpcCrossedRows, {(confQa).tpcCrossedRows}}, \ + {kTpcCluster, {(confQa).tpcCluster}}, \ + {kTpcClusterOverCrossedRows, {(confQa).tpcClusterOverCrossedRows}}, \ + {kTpcClusterShared, {(confQa).tpcClusterShared}}, \ + {kTpcClusterFractionShared, {(confQa).tpcClusterFractionShared}}, \ + {kPtVsDcaxy, {(confAnalysis).pt, (confQa).dcaXy}}, \ + {kPtVsDcaz, {(confAnalysis).pt, (confQa).dcaZ}}, \ + {kPtVsDca, {(confAnalysis).pt, (confQa).dca}}, \ + {kPtVsDcaxyVsDcaz, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kPVsPTpc, {(confQa).p, (confQa).p}}, \ + {kItsSignal, {(confQa).p, (confQa).itsSignal}}, \ + {kItsElectron, {(confQa).p, (confQa).itsElectron}}, \ + {kItsPion, {(confQa).p, (confQa).itsPion}}, \ + {kItsKaon, {(confQa).p, (confQa).itsKaon}}, \ + {kItsProton, {(confQa).p, (confQa).itsProton}}, \ + {kItsDeuteron, {(confQa).p, (confQa).itsDeuteron}}, \ + {kItsTriton, {(confQa).p, (confQa).itsTriton}}, \ + {kItsHelium, {(confQa).p, (confQa).itsHelium}}, \ + {kTpcSignal, {(confQa).p, (confQa).tpcSignal}}, \ + {kTpcElectron, {(confQa).p, (confQa).tpcElectron}}, \ + {kTpcPion, {(confQa).p, (confQa).tpcPion}}, \ + {kTpcKaon, {(confQa).p, (confQa).tpcKaon}}, \ + {kTpcProton, {(confQa).p, (confQa).tpcProton}}, \ + {kTpcDeuteron, {(confQa).p, (confQa).tpcDeuteron}}, \ + {kTpcTriton, {(confQa).p, (confQa).tpcTriton}}, \ + {kTpcHelium, {(confQa).p, (confQa).tpcHelium}}, \ + {kTofBeta, {(confQa).p, (confQa).tofBeta}}, \ + {kTofMass, {(confQa).p, (confQa).tofMass}}, \ + {kTofElectron, {(confQa).p, (confQa).tofElectron}}, \ + {kTofPion, {(confQa).p, (confQa).tofPion}}, \ + {kTofKaon, {(confQa).p, (confQa).tofKaon}}, \ + {kTofProton, {(confQa).p, (confQa).tofProton}}, \ + {kTofDeuteron, {(confQa).p, (confQa).tofDeuteron}}, \ + {kTofTriton, {(confQa).p, (confQa).tofTriton}}, \ + {kTofHelium, {(confQa).p, (confQa).tofHelium}}, \ + {kTpcitsElectron, {(confQa).p, (confQa).tpcitsElectron}}, \ + {kTpcitsPion, {(confQa).p, (confQa).tpcitsPion}}, \ + {kTpcitsKaon, {(confQa).p, (confQa).tpcitsKaon}}, \ + {kTpcitsProton, {(confQa).p, (confQa).tpcitsProton}}, \ + {kTpcitsDeuteron, {(confQa).p, (confQa).tpcitsDeuteron}}, \ + {kTpcitsTriton, {(confQa).p, (confQa).tpcitsTriton}}, \ + {kTpcitsHelium, {(confQa).p, (confQa).tpcitsHelium}}, \ + {kTpctofElectron, {(confQa).p, (confQa).tpctofElectron}}, \ + {kTpctofPion, {(confQa).p, (confQa).tpctofPion}}, \ + {kTpctofKaon, {(confQa).p, (confQa).tpctofKaon}}, \ + {kTpctofProton, {(confQa).p, (confQa).tpctofProton}}, \ + {kTpctofDeuteron, {(confQa).p, (confQa).tpctofDeuteron}}, \ + {kTpctofTriton, {(confQa).p, (confQa).tpctofTriton}}, \ + {kTpctofHelium, {(confQa).p, (confQa).tpctofHelium}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TRACK_HIST_MC_MAP(conf) \ + {kTruePtVsPt, {(conf).pt, (conf).pt}}, \ + {kTrueEtaVsEta, {(conf).eta, (conf).eta}}, \ + {kTruePhiVsPhi, {(conf).phi, (conf).phi}}, \ + {kPdg, {(conf).pdgCodes}}, \ + {kPdgMother, {(conf).pdgCodes}}, \ + {kPdgPartonicMother, {(conf).pdgCodes}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TRACK_HIST_MC_QA_MAP(confAnalysis, confQa) \ + {kNoMcParticle, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kPrimary, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kFromWrongCollision, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kFromMaterial, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kMissidentified, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kSecondary1, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kSecondary2, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kSecondary3, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, \ + {kSecondaryOther, {(confAnalysis).pt, (confQa).dcaXy, (confQa).dcaZ}}, template auto makeTrackHistSpecMap(const T& confBinningAnalysis) @@ -530,7 +531,7 @@ constexpr std::string_view QaDir = "QA/"; constexpr std::string_view PidDir = "PID/"; constexpr std::string_view McDir = "MC/"; -template +template class TrackHistManager { public: @@ -1038,7 +1039,5 @@ class TrackHistManager std::array mPdgCodesSecondaryMother = {0}; modes::MomentumType mMomentumType = modes::MomentumType::kPAtPv; }; -}; // namespace trackhistmanager -// aespace trackhistmanager -}; // namespace o2::analysis::femto +} // namespace o2::analysis::femto::trackhistmanager #endif // PWGCF_FEMTO_CORE_TRACKHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/tripletBuilder.h b/PWGCF/Femto/Core/tripletBuilder.h index 279afb54d74..0184d442ea7 100644 --- a/PWGCF/Femto/Core/tripletBuilder.h +++ b/PWGCF/Femto/Core/tripletBuilder.h @@ -39,26 +39,23 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::tripletbuilder { -namespace tripletbuilder -{ - const int64_t nLimitPartitionIdenticalParticles123 = 3; const int64_t nLimitPartitionIdenticalParticles12 = 2; const int64_t nLimitPartitionParticles = 1; -template +template class TripletTrackTrackTrackBuilder { public: @@ -371,19 +368,19 @@ class TripletTrackTrackTrackBuilder }; template + auto& prefixTrack1, + auto& prefixTrack2, + auto& prefixV0, + auto& prefixPosDau, + auto& prefixNegDau, + auto& prefixSe, + auto& prefixMe, + auto& prefixCtrSeTrack1Track2, + auto& prefixCtrSeTrack1V0, + auto& prefixCtrSeTrack2V0, + auto& prefixCtrMeTrack1Track2, + auto& prefixCtrMeTrack1V0, + auto& prefixCtrMeTrack2V0> class TripletTrackTrackV0Builder { public: @@ -628,24 +625,24 @@ class TripletTrackTrackV0Builder }; template + auto& prefixTrack1, + auto& prefixTrack2, + auto& prefixCascade, + auto& prefixBachelor, + auto& prefixPosDau, + auto& prefixNegDau, + auto& prefixSe, + auto& prefixMe, + auto& prefixCtrTrack1Track2Se, + auto& prefixCprBachelorTrack1Se, + auto& prefixCprBachelorTrack2Se, + auto& prefixCprV0DaughterTrack1Se, + auto& prefixCprV0DaughterTrack2Se, + auto& prefixCtrTrack1Track2Me, + auto& prefixCprBachelorTrack1Me, + auto& prefixCprBachelorTrack2Me, + auto& prefixCprV0DaughterTrack1Me, + auto& prefixCprV0DaughterTrack2Me> class TripletTrackTrackCascadeBuilder { public: @@ -904,7 +901,6 @@ class TripletTrackTrackCascadeBuilder std::uniform_int_distribution<> mDist; }; -} // namespace tripletbuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::tripletbuilder #endif // PWGCF_FEMTO_CORE_TRIPLETBUILDER_H_ diff --git a/PWGCF/Femto/Core/tripletCleaner.h b/PWGCF/Femto/Core/tripletCleaner.h index 7b02d959e5d..c40a0760bbb 100644 --- a/PWGCF/Femto/Core/tripletCleaner.h +++ b/PWGCF/Femto/Core/tripletCleaner.h @@ -18,16 +18,13 @@ #include "PWGCF/Femto/Core/pairCleaner.h" -namespace o2::analysis::femto +namespace o2::analysis::femto::tripletcleaner { -namespace tripletcleaner -{ - class TrackTrackTrackTripletCleaner : public paircleaner::BasePairCleaner { public: TrackTrackTrackTripletCleaner() = default; - ~TrackTrackTrackTripletCleaner() = default; + ~TrackTrackTrackTripletCleaner() override = default; template bool isCleanTriplet(T1 const& track1, T2 const& track2, T3 const& track3, T4 const& /*trackTable*/) const @@ -63,7 +60,7 @@ class TrackTrackV0TripletCleaner : public paircleaner::BasePairCleaner { public: TrackTrackV0TripletCleaner() = default; - ~TrackTrackV0TripletCleaner() = default; + ~TrackTrackV0TripletCleaner() override = default; template bool isCleanTriplet(T1 const& track1, T2 const& track2, T3 const& v0, T4 const& trackTable) const @@ -103,7 +100,7 @@ class TrackTrackCascadeTripletCleaner : public paircleaner::BasePairCleaner { public: TrackTrackCascadeTripletCleaner() = default; - ~TrackTrackCascadeTripletCleaner() = default; + ~TrackTrackCascadeTripletCleaner() override = default; template bool isCleanTriplet(T1 const& track1, T2 const& track2, T3 const& cascade, T4 const& trackTable) const @@ -142,7 +139,6 @@ class TrackTrackCascadeTripletCleaner : public paircleaner::BasePairCleaner } }; -} // namespace tripletcleaner -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::tripletcleaner #endif // PWGCF_FEMTO_CORE_TRIPLETCLEANER_H_ diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index d34ca1230fc..ca1e0779369 100644 --- a/PWGCF/Femto/Core/tripletHistManager.h +++ b/PWGCF/Femto/Core/tripletHistManager.h @@ -37,9 +37,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace triplethistmanager +namespace o2::analysis::femto::triplethistmanager { // enum for pair histograms enum TripletHist { @@ -171,32 +169,34 @@ constexpr std::array, kTripletHistogramLast> {kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2VsVtz3VsMult3VsCent3, o2::framework::HistType::kTHnSparseF, "hVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2VsVtz3VsMult3VsCent3", "Mixing bins; V_{z,1} (cm); mult_{1}; cent_{1} (%); V_{z,2} (cm); mult_{2}; cent_{2} (%); V_{z,3} (cm); mult_{3}; cent_{3} (%);"}, }}; -#define TRIPLET_HIST_ANALYSIS_MAP(conf, confMixing) \ - {kQ3, {conf.q3}}, \ - {kMt, {conf.mt}}, \ - {kPt1VsQ3, {conf.pt1, conf.q3}}, \ - {kPt2VsQ3, {conf.pt2, conf.q3}}, \ - {kPt3VsQ3, {conf.pt3, conf.q3}}, \ - {kQ3VsMt, {conf.q3, conf.mt}}, \ - {kQ3VsMult, {conf.q3, conf.multiplicity}}, \ - {kQ3VsCent, {conf.q3, conf.centrality}}, \ - {kPt1VsPt2VsPt3, {conf.pt1, conf.pt2, conf.pt3}}, \ - {kQ3VsPt1VsPt2VsPt3, {conf.q3, conf.pt1, conf.pt2, conf.pt3}}, \ - {kQ3VsMtVsMult, {conf.q3, conf.mt, conf.multiplicity}}, \ - {kQ3VsMtVsMultVsCent, {conf.q3, conf.mt, conf.multiplicity, conf.centrality}}, \ - {kQ3VsMtVsPt1VsPt2VsPt3VsMult, {conf.q3, conf.mt, conf.pt1, conf.pt2, conf.pt3, conf.multiplicity}}, \ - {kQ3VsMtVsPt1VsPt2VsPt3VsMultVsCent, {conf.q3, conf.mt, conf.pt1, conf.pt2, conf.pt3, conf.multiplicity, conf.centrality}}, \ - {kSeNpart1VsNpart2VsNpart3, {confMixing.particleBinning, confMixing.particleBinning, confMixing.particleBinning}}, \ - {kMeMixingWindowRaw, {confMixing.particleBinning}}, \ - {kMeMixingWindowEffective, {confMixing.particleBinning}}, \ - {kMeNpart1VsNpart2VsNpart3, {confMixing.particleBinning, confMixing.particleBinning, confMixing.particleBinning}}, \ - {kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2VsVtz3VsMult3VsCent3, {confMixing.vtxBins, confMixing.multBins, confMixing.centBins, confMixing.vtxBins, confMixing.multBins, confMixing.centBins, confMixing.vtxBins, confMixing.multBins, confMixing.centBins}}, - -#define TRIPLET_HIST_MC_MAP(conf) \ - {kTrueQ3VsQ3, {conf.q3, conf.q3}}, \ - {kTrueMtVsMt, {conf.mt, conf.mt}}, \ - {kTrueMultVsMult, {conf.multiplicity, conf.multiplicity}}, \ - {kTrueCentVsCent, {conf.centrality, conf.centrality}}, +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TRIPLET_HIST_ANALYSIS_MAP(conf, confMixing) \ + {kQ3, {(conf).q3}}, \ + {kMt, {(conf).mt}}, \ + {kPt1VsQ3, {(conf).pt1, (conf).q3}}, \ + {kPt2VsQ3, {(conf).pt2, (conf).q3}}, \ + {kPt3VsQ3, {(conf).pt3, (conf).q3}}, \ + {kQ3VsMt, {(conf).q3, (conf).mt}}, \ + {kQ3VsMult, {(conf).q3, (conf).multiplicity}}, \ + {kQ3VsCent, {(conf).q3, (conf).centrality}}, \ + {kPt1VsPt2VsPt3, {(conf).pt1, (conf).pt2, (conf).pt3}}, \ + {kQ3VsPt1VsPt2VsPt3, {(conf).q3, (conf).pt1, (conf).pt2, (conf).pt3}}, \ + {kQ3VsMtVsMult, {(conf).q3, (conf).mt, (conf).multiplicity}}, \ + {kQ3VsMtVsMultVsCent, {(conf).q3, (conf).mt, (conf).multiplicity, (conf).centrality}}, \ + {kQ3VsMtVsPt1VsPt2VsPt3VsMult, {(conf).q3, (conf).mt, (conf).pt1, (conf).pt2, (conf).pt3, (conf).multiplicity}}, \ + {kQ3VsMtVsPt1VsPt2VsPt3VsMultVsCent, {(conf).q3, (conf).mt, (conf).pt1, (conf).pt2, (conf).pt3, (conf).multiplicity, (conf).centrality}}, \ + {kSeNpart1VsNpart2VsNpart3, {(confMixing).particleBinning, (confMixing).particleBinning, (confMixing).particleBinning}}, \ + {kMeMixingWindowRaw, {(confMixing).particleBinning}}, \ + {kMeMixingWindowEffective, {(confMixing).particleBinning}}, \ + {kMeNpart1VsNpart2VsNpart3, {(confMixing).particleBinning, (confMixing).particleBinning, (confMixing).particleBinning}}, \ + {kMeVtz1VsMult1VsCent1VsVtz2VsMult2VsCent2VsVtz3VsMult3VsCent3, {(confMixing).vtxBins, (confMixing).multBins, (confMixing).centBins, (confMixing).vtxBins, (confMixing).multBins, (confMixing).centBins, (confMixing).vtxBins, (confMixing).multBins, (confMixing).centBins}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TRIPLET_HIST_MC_MAP(conf) \ + {kTrueQ3VsQ3, {(conf).q3, (conf).q3}}, \ + {kTrueMtVsMt, {(conf).mt, (conf).mt}}, \ + {kTrueMultVsMult, {(conf).multiplicity, (conf).multiplicity}}, \ + {kTrueCentVsCent, {(conf).centrality, (conf).centrality}}, template auto makeTripletHistSpecMap(T1 const& confPairBinning, T2 const& confMixing) @@ -229,7 +229,7 @@ constexpr std::string_view AnalysisDir = "Analysis/"; constexpr std::string_view QaDir = "QA/"; constexpr std::string_view McDir = "MC/"; -template @@ -648,9 +648,9 @@ class TripletHistManager int mAbsCharge1 = 1; int mAbsCharge2 = 1; int mAbsCharge3 = 1; - ROOT::Math::PtEtaPhiMVector mParticle1{}; - ROOT::Math::PtEtaPhiMVector mParticle2{}; - ROOT::Math::PtEtaPhiMVector mParticle3{}; + ROOT::Math::PtEtaPhiMVector mParticle1; + ROOT::Math::PtEtaPhiMVector mParticle2; + ROOT::Math::PtEtaPhiMVector mParticle3; float mMass1 = 0.f; float mMass2 = 0.f; float mMass3 = 0.f; @@ -660,9 +660,9 @@ class TripletHistManager float mCent = 0.f; // mc - ROOT::Math::PtEtaPhiMVector mTrueParticle1{}; - ROOT::Math::PtEtaPhiMVector mTrueParticle2{}; - ROOT::Math::PtEtaPhiMVector mTrueParticle3{}; + ROOT::Math::PtEtaPhiMVector mTrueParticle1; + ROOT::Math::PtEtaPhiMVector mTrueParticle2; + ROOT::Math::PtEtaPhiMVector mTrueParticle3; float mTrueQ3 = 0.f; float mTrueMt = 0.f; float mTrueMult = 0.f; @@ -691,11 +691,9 @@ class TripletHistManager bool mPairCorrelationQa = false; bool mEventMixingQa = false; - std::unordered_set mParticles1PerEvent = {}; - std::unordered_set mParticles2PerEvent = {}; - std::unordered_set mParticles3PerEvent = {}; + std::unordered_set mParticles1PerEvent; + std::unordered_set mParticles2PerEvent; + std::unordered_set mParticles3PerEvent; }; - -} // namespace triplethistmanager -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::triplethistmanager #endif // PWGCF_FEMTO_CORE_TRIPLETHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/tripletProcessHelpers.h b/PWGCF/Femto/Core/tripletProcessHelpers.h index 3eb74cb4085..4d02566c120 100644 --- a/PWGCF/Femto/Core/tripletProcessHelpers.h +++ b/PWGCF/Femto/Core/tripletProcessHelpers.h @@ -24,11 +24,8 @@ #include -namespace o2::analysis::femto +namespace o2::analysis::femto::tripletprocesshelpers { -namespace tripletprocesshelpers -{ - enum TripletOrder : uint8_t { kOrder123, // no swap kOrder213, // swap 1&2: for the case that particle 1 & 2 are the same species, particle 3 is something else @@ -639,7 +636,6 @@ void processMixedEvent(T1 const& Collisions, } } -} // namespace tripletprocesshelpers -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::tripletprocesshelpers #endif // PWGCF_FEMTO_CORE_TRIPLETPROCESSHELPERS_H_ diff --git a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h index dba3d529acf..126f447b7d0 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h +++ b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h @@ -35,12 +35,9 @@ #include -namespace o2::analysis::femto +namespace o2::analysis::femto::twotrackresonancebuilder { -namespace twotrackresonancebuilder -{ - -template +template struct ConfTwoTrackResonanceFilters : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable ptMin{"ptMin", 0.2f, "Minimum pT"}; @@ -60,20 +57,21 @@ using ConfRhoFilters = ConfTwoTrackResonanceFilters; using ConfPhiFilters = ConfTwoTrackResonanceFilters; using ConfKstarFilters = ConfTwoTrackResonanceFilters; -#define TWOTRACKRESONANCE_DEFAULT_SELECTION(defaultPdgCode, defaultMassMin, defaultMassMax) \ - o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "Resonance PDG code. Set sign to minus 1 for antiparticle"}; \ - o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ - o2::framework::Configurable ptMax{"ptMax", 6.f, "Maximum pT"}; \ - o2::framework::Configurable etaMin{"etaMin", -0.9f, "Minimum eta"}; \ - o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; \ - o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ - o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ - o2::framework::Configurable massMin{"massMin", defaultMassMin, "Minimum invariant mass for Resonance"}; \ - o2::framework::Configurable massMax{"massMax", defaultMassMax, "Maximum invariant mass for Resonance"}; \ - o2::framework::Configurable posDauMaskBelowThres{"posDauMaskBelowThres", 0x10u, "Bitmask for positive daughter below threshold"}; \ - o2::framework::Configurable posDauMaskAboveThres{"posDauMaskAboveThres", 0x8u, "Bitmask for positive daughter above threshold"}; \ - o2::framework::Configurable negDauMaskBelowThres{"negDauMaskBelowThres", 0x2u, "Bitmask for negative daughter below threshold"}; \ - o2::framework::Configurable negDauMaskAboveThres{"negDauMaskAboveThres", 0x1u, "Bitmask for negative daughter above threshold"}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TWOTRACKRESONANCE_DEFAULT_SELECTION(defaultPdgCode, defaultMassMin, defaultMassMax) \ + o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "Resonance PDG code. Set sign to minus 1 for antiparticle"}; \ + o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ + o2::framework::Configurable ptMax{"ptMax", 6.f, "Maximum pT"}; \ + o2::framework::Configurable etaMin{"etaMin", -0.9f, "Minimum eta"}; \ + o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; \ + o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; \ + o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ + o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Resonance"}; \ + o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Resonance"}; \ + o2::framework::Configurable posDauMaskBelowThres{"posDauMaskBelowThres", 0x10u, "Bitmask for positive daughter below threshold"}; \ + o2::framework::Configurable posDauMaskAboveThres{"posDauMaskAboveThres", 0x8u, "Bitmask for positive daughter above threshold"}; \ + o2::framework::Configurable negDauMaskBelowThres{"negDauMaskBelowThres", 0x2u, "Bitmask for negative daughter below threshold"}; \ + o2::framework::Configurable negDauMaskAboveThres{"negDauMaskAboveThres", 0x1u, "Bitmask for negative daughter above threshold"}; struct ConfPhiSelection : o2::framework::ConfigurableGroup { std::string prefix = std::string("PhiSelection"); @@ -204,7 +202,7 @@ class TwoTrackResonanceBuilder mMass = vecResonance.M(); } - bool checkFilters() const + [[nodiscard]] bool checkFilters() const { return ((mMass > mMassMin && mMass < mMassMax) && (mPt > mPtMin && mPt < mPtMax) && @@ -324,6 +322,5 @@ class TwoTrackResonanceBuilder }; // namespace twotrackresonancebuilder -} // namespace twotrackresonancebuilder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::twotrackresonancebuilder #endif // PWGCF_FEMTO_CORE_TWOTRACKRESONANCEBUILDER_H_ diff --git a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h index b2640b6629e..a683dbf1d4c 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h +++ b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h @@ -35,9 +35,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace twotrackresonancehistmanager +namespace o2::analysis::femto::twotrackresonancehistmanager { // enum for track histograms enum TwoTrackResonanceHist { @@ -55,11 +53,12 @@ enum TwoTrackResonanceHist { kTwoTrackResonanceHistLast }; -#define TWOTRACKRESONANCE_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ - o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ - o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ - o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ - o2::framework::ConfigurableAxis mass{"mass", {{200, defaultMassMin, defaultMassMax}}, "Mass"}; \ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define TWOTRACKRESONANCE_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ + o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ + o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ + o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ + o2::framework::ConfigurableAxis mass{"mass", {{200, (defaultMassMin), (defaultMassMax)}}, "Mass"}; \ o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; struct ConfPhiBinning : o2::framework::ConfigurableGroup { @@ -89,19 +88,21 @@ constexpr std::array, kTwoTrackReso {kPhiVsEta, o2::framework::HistType::kTH2F, "hPhiVsEta", "#varphi vs #eta; #varphi ; #eta"}, {kPtVsMass, o2::framework::HistType::kTH2F, "hPtVsMass", "p_{T} vs invariant mass; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})"}}}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define TWOTRACKRESONANCE_HIST_ANALYSIS_MAP(conf) \ - {kPt, {conf.pt}}, \ - {kEta, {conf.eta}}, \ - {kPhi, {conf.phi}}, \ - {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, \ - {kPtVsMass, {conf.pt, conf.mass}}, - + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kMass, {(conf).mass}}, \ + {kSign, {(conf).sign}}, \ + {kPtVsMass, {(conf).pt, (conf).mass}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define TWOTRACKRESONANCE_HIST_QA_MAP(conf) \ - {kPtVsEta, {conf.pt, conf.eta}}, \ - {kPtVsPhi, {conf.pt, conf.phi}}, \ - {kPhiVsEta, {conf.phi, conf.eta}}, \ - {kPtVsMass, {conf.pt, conf.mass}}, + {kPtVsEta, {(conf).pt, (conf).eta}}, \ + {kPtVsPhi, {(conf).pt, (conf).phi}}, \ + {kPhiVsEta, {(conf).phi, (conf).eta}}, \ + {kPtVsMass, {(conf).pt, (conf).mass}}, template std::map> makeTwoTrackResonanceHistSpecMap(const T& confBinningAnalysis) @@ -118,6 +119,9 @@ auto makeTwoTrackResonanceQaHistSpecMap(const T& confBinningAnalysis) TWOTRACKRESONANCE_HIST_QA_MAP(confBinningAnalysis)}; }; +#undef TWOTRACKRESONANCE_HIST_ANALYSIS_MAP +#undef TWOTRACKRESONANCE_HIST_QA_MAP + constexpr char PrefixRho[] = "Rho0/"; constexpr char PrefixPhi[] = "Phi/"; constexpr char PrefixKstar[] = "Kstar0/"; @@ -125,9 +129,9 @@ constexpr char PrefixKstar[] = "Kstar0/"; constexpr std::string_view AnalysisDir = "Analysis/"; constexpr std::string_view QaDir = "QA/"; -template class TwoTrackResonanceHistManager { @@ -295,6 +299,5 @@ class TwoTrackResonanceHistManager trackhistmanager::TrackHistManager mNegDauManager; int mPdgCode = 0; }; -}; // namespace twotrackresonancehistmanager -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::twotrackresonancehistmanager #endif // PWGCF_FEMTO_CORE_TWOTRACKRESONANCEHISTMANAGER_H_ diff --git a/PWGCF/Femto/Core/v0Builder.h b/PWGCF/Femto/Core/v0Builder.h index 6277283f8b8..8ce1b3888bf 100644 --- a/PWGCF/Femto/Core/v0Builder.h +++ b/PWGCF/Femto/Core/v0Builder.h @@ -37,11 +37,8 @@ #include #include -namespace o2::analysis::femto +namespace o2::analysis::femto::v0builder { -namespace v0builder -{ - // filters applied in the producer task struct ConfV0Filters : o2::framework::ConfigurableGroup { std::string prefix = std::string("V0Filters"); @@ -53,15 +50,18 @@ struct ConfV0Filters : o2::framework::ConfigurableGroup { o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; o2::framework::Configurable massMinLambda{"massMinLambda", 1.f, "Minimum mass for Lambda hypothesis"}; o2::framework::Configurable massMaxLambda{"massMaxLambda", 1.2f, "Maximum mass for Lambda hypothesis"}; + o2::framework::Configurable rejectHypothesisK0short{"rejectHypothesisK0short", true, "Rejection of K0short hypothesis for Lambda candidates"}; + o2::framework::Configurable rejectMassMinK0short{"rejectMassMinK0short", 0.48f, "Minimum mass to rejection K0short hypothesis for Lambda candidates"}; + o2::framework::Configurable rejectMassMaxK0short{"rejectMassMaxK0short", 0.5f, "Maximum mass to rejection K0short hypothesis for Lambda candidates"}; o2::framework::Configurable massMinK0short{"massMinK0short", 0.45f, "Minimum mass for K0Short hypothesis"}; o2::framework::Configurable massMaxK0short{"massMaxK0short", 0.53f, "Maximum mass for K0Short hypothesis"}; + o2::framework::Configurable rejectHypothesisLambda{"rejectHypothesisLambda", true, "Rejection of Lambda hypothesis for K0short candidates"}; o2::framework::Configurable rejectMassMinLambda{"rejectMassMinLambda", 1.11f, "Minimum mass to rejection K0short hypothesis for Lambda candidates"}; o2::framework::Configurable rejectMassMaxLambda{"rejectMassMaxLambda", 1.12f, "Maximum mass to rejection K0short hypothesis for Lambda candidates"}; - o2::framework::Configurable rejectMassMinK0short{"rejectMassMinK0short", 0.48f, "Minimum mass to rejection K0short hypothesis for Lambda candidates"}; - o2::framework::Configurable rejectMassMaxK0short{"rejectMassMaxK0short", 0.5f, "Maximum mass to rejection K0short hypothesis for Lambda candidates"}; }; // selections bits for all v0s +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define V0_DEFAULT_BITS \ o2::framework::Configurable passThrough{"passThrough", false, "If true, all V0s are passed through. Bits for all selections are stored."}; \ o2::framework::Configurable> dcaDauMax{"dcaDauMax", {1.5f}, "Maximum DCA between the daughters at decay vertex (cm)"}; \ @@ -94,20 +94,21 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup { #undef V0_DEFAULT_BITS // base selection for analysis task for v0s -#define V0_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \ - o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", defaultPdgCode, "PDG code. Set sign to -1 for antiparticle"}; \ - o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ - o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ - o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ - o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ - o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum eta"}; \ - o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ - o2::framework::Configurable massMin{"massMin", defaultMassMin, "Minimum invariant mass for Lambda"}; \ - o2::framework::Configurable massMax{"massMax", defaultMassMax, "Maximum invariant mass for Lambda"}; \ - o2::framework::Configurable mask{"mask", 0, "Bitmask for v0 selection"}; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define V0_DEFAULT_SELECTIONS(defaultMassMin, defaultMassMax, defaultPdgCode) \ + o2::framework::Configurable pdgCodeAbs{"pdgCodeAbs", (defaultPdgCode), "PDG code. Set sign to -1 for antiparticle"}; \ + o2::framework::Configurable ptMin{"ptMin", 0.f, "Minimum pT"}; \ + o2::framework::Configurable ptMax{"ptMax", 999.f, "Maximum pT"}; \ + o2::framework::Configurable etaMin{"etaMin", -10.f, "Minimum eta"}; \ + o2::framework::Configurable etaMax{"etaMax", 10.f, "Maximum eta"}; \ + o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum eta"}; \ + o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \ + o2::framework::Configurable massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Lambda"}; \ + o2::framework::Configurable massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Lambda"}; \ + o2::framework::Configurable mask{"mask", 0, "Bitmask for v0 selection"}; // base selection for analysis task for lambdas -template +template struct ConfLambdaSelection : o2::framework::ConfigurableGroup { std::string prefix = Prefix; V0_DEFAULT_SELECTIONS(1.0, 1.2, 3122) @@ -115,7 +116,7 @@ struct ConfLambdaSelection : o2::framework::ConfigurableGroup { }; // base selection for analysis task for k0short -template +template struct ConfK0shortSelection : o2::framework::ConfigurableGroup { std::string prefix = Prefix; V0_DEFAULT_SELECTIONS(0.47, 0.51, 310) @@ -178,12 +179,12 @@ const std::unordered_map v0SelectionNames = { /// \class FemtoDreamTrackCuts /// \brief Cut class to contain and execute all cuts applied to tracks -template -class V0Selection : public BaseSelection +template +class V0Selection : public BaseSelection { public: V0Selection() = default; - ~V0Selection() = default; + ~V0Selection() override = default; template void configure(o2::framework::HistogramRegistry* registry, T1& config, T2& filter) @@ -200,12 +201,13 @@ class V0Selection : public BaseSelectionaddSelection(kPosDaughTpcPion, v0SelectionNames.at(kPosDaughTpcPion), config.posDauTpcPion.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); @@ -233,7 +236,7 @@ class V0Selection : public BaseSelectionaddSelection(kTransRadMin, v0SelectionNames.at(kTransRadMin), config.transRadMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); this->addSelection(kTransRadMax, v0SelectionNames.at(kTransRadMax), config.transRadMax.value, limits::kUpperLimit, skipMostPermissiveBit, isMinimalCut, false); this->addSelection(kDauAbsEtaMax, v0SelectionNames.at(kDauAbsEtaMax), config.dauAbsEtaMax.value, limits::kAbsUpperLimit, skipMostPermissiveBit, isMinimalCut, false); - this->addSelection(kDauDcaMin, v0SelectionNames.at(kDauDcaMin), config.dauDcaMin.value, limits::kAbsLowerFunctionLimit, skipMostPermissiveBit, isMinimalCut, false); + this->addSelection(kDauDcaMin, v0SelectionNames.at(kDauDcaMin), config.dauDcaMin.value, limits::kAbsLowerLimit, skipMostPermissiveBit, isMinimalCut, false); this->addSelection(kDauTpcClsMin, v0SelectionNames.at(kDauTpcClsMin), config.dauTpcClustersMin.value, limits::kLowerLimit, skipMostPermissiveBit, isMinimalCut, false); this->setupContainers(registry); @@ -290,31 +293,33 @@ class V0Selection : public BaseSelection mMassLambdaLowerLimit && v0.mLambda() < mMassLambdaUpperLimit) && // inside Λ - (v0.mK0Short() < mMassK0shortLowerLimit || v0.mK0Short() > mMassK0shortUpperLimit); // outside K0s + return (v0.mLambda() > mMassLambdaLowerLimit && v0.mLambda() < mMassLambdaUpperLimit) && // inside Λ + (!mRejectK0shortHypothesis || (v0.mK0Short() < mMassK0shortLowerLimit || v0.mK0Short() > mMassK0shortUpperLimit)); // outside K0s } if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) { - return (v0.mAntiLambda() > mMassLambdaLowerLimit && v0.mAntiLambda() < mMassLambdaUpperLimit) && // inside Λbar - (v0.mK0Short() < mMassK0shortLowerLimit || v0.mK0Short() > mMassK0shortUpperLimit); // outside K0s + return (v0.mAntiLambda() > mMassLambdaLowerLimit && v0.mAntiLambda() < mMassLambdaUpperLimit) && // inside Λbar + (!mRejectK0shortHypothesis || (v0.mK0Short() < mMassK0shortLowerLimit || v0.mK0Short() > mMassK0shortUpperLimit)); // outside K0s } if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) { - return (v0.mK0Short() > mMassK0shortLowerLimit && v0.mK0Short() < mMassK0shortUpperLimit) && // inside K0s - (v0.mLambda() < mMassLambdaLowerLimit || v0.mLambda() > mMassLambdaUpperLimit) && // outside Λ - (v0.mAntiLambda() < mMassLambdaLowerLimit || v0.mAntiLambda() > mMassLambdaUpperLimit); // outside Λbar + return (v0.mK0Short() > mMassK0shortLowerLimit && v0.mK0Short() < mMassK0shortUpperLimit) && // inside K0s + (!mRejectLambdaHypothesis || (v0.mLambda() < mMassLambdaLowerLimit || v0.mLambda() > mMassLambdaUpperLimit)) && // outside Λ + (!mRejectLambdaHypothesis || (v0.mAntiLambda() < mMassLambdaLowerLimit || v0.mAntiLambda() > mMassLambdaUpperLimit)); // outside Λbar } return false; } - bool passThroughAllV0s() const { return mPassThrough; } + [[nodiscard]] bool passThroughAllV0s() const { return mPassThrough; } protected: float mMassK0shortLowerLimit = 0.483f; float mMassK0shortUpperLimit = 0.503f; + bool mRejectK0shortHypothesis = false; float mMassLambdaLowerLimit = 1.105f; float mMassLambdaUpperLimit = 1.125f; + bool mRejectLambdaHypothesis = false; bool mPassThrough = false; @@ -346,7 +351,7 @@ struct ConfV0Tables : o2::framework::ConfigurableGroup { o2::framework::Configurable produceK0shortExtras{"produceK0shortExtras", -1, "Produce K0shortExtras (-1: auto; 0 off; 1 on)"}; }; -template +template class V0Builder { public: @@ -466,7 +471,8 @@ class V0Builder template void fillLambda(T1& collisionProducts, T2& v0Products, T3 const& v0, float sign, int64_t posDaughterIndex, int64_t negDaughterIndex) { - float mass, massAnti; + float mass = 0; + float massAnti = 0; if (sign > 0.f) { mass = v0.mLambda(); massAnti = v0.mAntiLambda(); @@ -527,7 +533,7 @@ class V0Builder } } - bool fillAnyTable() const { return mFillAnyTable; } + [[nodiscard]] bool fillAnyTable() const { return mFillAnyTable; } private: V0Selection mV0Selection; @@ -574,20 +580,14 @@ class V0BuilderDerivedToDerived bool collisionHasTooFewLambdas(T1 const& col, T2 const& /*lambdaTable*/, T3& partitionLambda, T4& cache) { auto lambdaSlice = partitionLambda->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); - if (lambdaSlice.size() >= mLimitLambda) { - return false; - } - return true; + return lambdaSlice.size() < mLimitLambda; } template bool collisionHasTooFewK0shorts(T1 const& col, T2 const& /*k0shortTable*/, T3& partitionK0short, T4& cache) { auto k0shortSlice = partitionK0short->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); - if (k0shortSlice.size() >= mLimitK0short) { - return false; - } - return true; + return k0shortSlice.size() < mLimitK0short; } template @@ -647,6 +647,5 @@ class V0BuilderDerivedToDerived int mLimitK0short = 0; }; -} // namespace v0builder -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::v0builder #endif // PWGCF_FEMTO_CORE_V0BUILDER_H_ diff --git a/PWGCF/Femto/Core/v0HistManager.h b/PWGCF/Femto/Core/v0HistManager.h index d78b0086f75..faf6d057195 100644 --- a/PWGCF/Femto/Core/v0HistManager.h +++ b/PWGCF/Femto/Core/v0HistManager.h @@ -36,9 +36,7 @@ #include #include -namespace o2::analysis::femto -{ -namespace v0histmanager +namespace o2::analysis::femto::v0histmanager { // enum for track histograms enum V0Hist { @@ -95,24 +93,26 @@ enum V0Hist { constexpr std::size_t MaxSecondary = 3; -#define V0_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ - o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ - o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ - o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ - o2::framework::ConfigurableAxis mass{"mass", {{200, defaultMassMin, defaultMassMax}}, "Mass"}; \ - o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; \ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define V0_DEFAULT_BINNING(defaultMassMin, defaultMassMax) \ + o2::framework::ConfigurableAxis pt{"pt", {{600, 0, 6}}, "Pt"}; \ + o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; \ + o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; \ + o2::framework::ConfigurableAxis mass{"mass", {{200, (defaultMassMin), (defaultMassMax)}}, "Mass"}; \ + o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; \ o2::framework::ConfigurableAxis pdgCodes{"pdgCodes", {{8001, -4000.5, 4000.5}}, "MC ONLY: PDG codes of reconstructed V0s"}; -template +template struct ConfLambdaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; V0_DEFAULT_BINNING(1.0, 1.2) }; -template +template struct ConfK0shortBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; V0_DEFAULT_BINNING(0.475, 0.515) }; + #undef V0_DEFAULT_BINNING constexpr const char PrefixLambdaBinning1[] = "LambdaBinning1"; @@ -120,7 +120,7 @@ using ConfLambdaBinning1 = ConfLambdaBinning; constexpr const char PrefixK0shortBinning1[] = "K0shortBinning1"; using ConfK0shortBinning1 = ConfK0shortBinning; -template +template struct ConfV0QaBinning : o2::framework::ConfigurableGroup { std::string prefix = Prefix; o2::framework::Configurable plot2d{"plot2d", true, "Generate various 2D QA plots"}; @@ -188,54 +188,58 @@ constexpr std::array, kV0HistLast> HistTable = { {kSecondaryOther, o2::framework::HistType::kTH2F, "hFromSecondaryOther", "Particles from every other secondary decay; p_{T} (GeV/#it{c}); cos(#alpha)"}}, }; +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define V0_HIST_ANALYSIS_MAP(conf) \ - {kPt, {conf.pt}}, \ - {kEta, {conf.eta}}, \ - {kPhi, {conf.phi}}, \ - {kMass, {conf.mass}}, \ - {kSign, {conf.sign}}, \ - {kPtVsMass, {conf.pt, conf.mass}}, - -#define V0_HIST_MC_MAP(conf) \ - {kTruePtVsPt, {conf.pt, conf.pt}}, \ - {kTrueEtaVsEta, {conf.eta, conf.eta}}, \ - {kTruePhiVsPhi, {conf.phi, conf.phi}}, \ - {kPdg, {conf.pdgCodes}}, \ - {kPdgMother, {conf.pdgCodes}}, \ - {kPdgPartonicMother, {conf.pdgCodes}}, - -#define V0_HIST_QA_MAP(confAnalysis, confQa) \ - {kCosPa, {confQa.cosPa}}, \ - {kDecayDauDca, {confQa.dauDcaAtDecay}}, \ - {kDecayVtxX, {confQa.decayVertex}}, \ - {kDecayVtxY, {confQa.decayVertex}}, \ - {kDecayVtxZ, {confQa.decayVertex}}, \ - {kDecayVtx, {confQa.decayVertex}}, \ - {kTransRadius, {confQa.transRadius}}, \ - {kPtVsEta, {confAnalysis.pt, confAnalysis.eta}}, \ - {kPtVsPhi, {confAnalysis.pt, confAnalysis.phi}}, \ - {kPhiVsEta, {confAnalysis.phi, confAnalysis.eta}}, \ - {kPtVsCosPa, {confAnalysis.pt, confQa.cosPa}}, \ - {kMassLambda, {confQa.massLambda}}, \ - {kMassAntiLambda, {confQa.massAntiLambda}}, \ - {kMassK0short, {confQa.massK0short}}, \ - {kPtVsLambdaMass, {confAnalysis.pt, confQa.massLambda}}, \ - {kPtVsAntiLambdaMass, {confAnalysis.pt, confQa.massAntiLambda}}, \ - {kPtVsK0shortMass, {confAnalysis.pt, confQa.massK0short}}, \ - {kLambdaMassVsAntiLambdaMass, {confQa.massLambda, confQa.massAntiLambda}}, \ - {kK0shortMassVsLambdaMass, {confQa.massK0short, confQa.massLambda}}, \ - {kK0shortMassVsAntiLambdaMass, {confQa.massK0short, confQa.massAntiLambda}}, - -#define V0_HIST_MC_QA_MAP(confAnalysis, confQa) \ - {kNoMcParticle, {confAnalysis.pt, confQa.cosPa}}, \ - {kPrimary, {confAnalysis.pt, confQa.cosPa}}, \ - {kFromWrongCollision, {confAnalysis.pt, confQa.cosPa}}, \ - {kFromMaterial, {confAnalysis.pt, confQa.cosPa}}, \ - {kMissidentified, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary1, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary2, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondary3, {confAnalysis.pt, confQa.cosPa}}, \ - {kSecondaryOther, {confAnalysis.pt, confQa.cosPa}}, + {kPt, {(conf).pt}}, \ + {kEta, {(conf).eta}}, \ + {kPhi, {(conf).phi}}, \ + {kMass, {(conf).mass}}, \ + {kSign, {(conf).sign}}, \ + {kPtVsMass, {(conf).pt, (conf).mass}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define V0_HIST_MC_MAP(conf) \ + {kTruePtVsPt, {(conf).pt, (conf).pt}}, \ + {kTrueEtaVsEta, {(conf).eta, (conf).eta}}, \ + {kTruePhiVsPhi, {(conf).phi, (conf).phi}}, \ + {kPdg, {(conf).pdgCodes}}, \ + {kPdgMother, {(conf).pdgCodes}}, \ + {kPdgPartonicMother, {(conf).pdgCodes}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define V0_HIST_QA_MAP(confAnalysis, confQa) \ + {kCosPa, {(confQa).cosPa}}, \ + {kDecayDauDca, {(confQa).dauDcaAtDecay}}, \ + {kDecayVtxX, {(confQa).decayVertex}}, \ + {kDecayVtxY, {(confQa).decayVertex}}, \ + {kDecayVtxZ, {(confQa).decayVertex}}, \ + {kDecayVtx, {(confQa).decayVertex}}, \ + {kTransRadius, {(confQa).transRadius}}, \ + {kPtVsEta, {(confAnalysis).pt, (confAnalysis).eta}}, \ + {kPtVsPhi, {(confAnalysis).pt, (confAnalysis).phi}}, \ + {kPhiVsEta, {(confAnalysis).phi, (confAnalysis).eta}}, \ + {kPtVsCosPa, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kMassLambda, {(confQa).massLambda}}, \ + {kMassAntiLambda, {(confQa).massAntiLambda}}, \ + {kMassK0short, {(confQa).massK0short}}, \ + {kPtVsLambdaMass, {(confAnalysis).pt, (confQa).massLambda}}, \ + {kPtVsAntiLambdaMass, {(confAnalysis).pt, (confQa).massAntiLambda}}, \ + {kPtVsK0shortMass, {(confAnalysis).pt, (confQa).massK0short}}, \ + {kLambdaMassVsAntiLambdaMass, {(confQa).massLambda, (confQa).massAntiLambda}}, \ + {kK0shortMassVsLambdaMass, {(confQa).massK0short, (confQa).massLambda}}, \ + {kK0shortMassVsAntiLambdaMass, {(confQa).massK0short, (confQa).massAntiLambda}}, + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define V0_HIST_MC_QA_MAP(confAnalysis, confQa) \ + {kNoMcParticle, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kPrimary, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kFromWrongCollision, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kFromMaterial, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kMissidentified, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary1, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary2, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondary3, {(confAnalysis).pt, (confQa).cosPa}}, \ + {kSecondaryOther, {(confAnalysis).pt, (confQa).cosPa}}, template auto makeV0HistSpecMap(const T& confBinningAnalysis) @@ -291,9 +295,9 @@ constexpr std::string_view McDir = "MC/"; /// \class FemtoDreamEventHisto /// \brief Class for histogramming event properties // template -template class V0HistManager { @@ -563,7 +567,8 @@ class V0HistManager mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kPtVsCosPa, HistTable)), v0candidate.pt(), v0candidate.cosPa()); if constexpr (modes::isEqual(v0, modes::V0::kLambda) || modes::isEqual(v0, modes::V0::kAntiLambda)) { - float massLambda, massAntiLambda; + float massLambda = 0; + float massAntiLambda = 0; if (v0candidate.sign() > 0) { massLambda = v0candidate.mass(); massAntiLambda = v0candidate.massAnti(); @@ -697,6 +702,5 @@ class V0HistManager trackhistmanager::TrackHistManager mPosDauManager; trackhistmanager::TrackHistManager mNegDauManager; }; -}; // namespace v0histmanager -}; // namespace o2::analysis::femto +}; // namespace o2::analysis::femto::v0histmanager #endif // PWGCF_FEMTO_CORE_V0HISTMANAGER_H_ diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index a5622de6cc2..b47bd33f9ca 100644 --- a/PWGCF/Femto/DataModel/FemtoTables.h +++ b/PWGCF/Femto/DataModel/FemtoTables.h @@ -33,8 +33,8 @@ namespace o2::aod { namespace femtocollisions { -DECLARE_SOA_COLUMN(Mask, mask, femtodatatypes::CollisionMaskType); //! Bitmask for collision selections -DECLARE_SOA_COLUMN(CollisionTag, collisionTag, femtodatatypes::CollisionTagType); //! Bitmask for collision selections +DECLARE_SOA_COLUMN(Mask, mask, o2::analysis::femto::datatypes::CollisionMaskType); //! Bitmask for collision selections +DECLARE_SOA_COLUMN(CollisionTag, collisionTag, o2::analysis::femto::datatypes::CollisionTagType); //! Bitmask for collision selections DECLARE_SOA_COLUMN(PosX, posX, float); //! x coordinate of vertex DECLARE_SOA_COLUMN(PosY, posY, float); //! y coordinate of vertex @@ -146,7 +146,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Theta, theta, //! theta namespace femtotracks { // columns for track selections -DECLARE_SOA_COLUMN(Mask, mask, femtodatatypes::TrackMaskType); //! Bitmask for track selections +DECLARE_SOA_COLUMN(Mask, mask, o2::analysis::femto::datatypes::TrackMaskType); //! Bitmask for track selections // columns for DCA DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); //! Dca in XY plane @@ -331,11 +331,11 @@ using FTrackPids = soa::Join; using Run3PpMcRecoCollisions = o2::soa::Join; @@ -79,12 +77,11 @@ using Run3Kinks = o2::aod::KinkCands; using Run3McGenParticles = o2::aod::McParticles; -} // namespace consumeddata -} // namespace o2::analysis::femto +} // namespace o2::analysis::femto::rawinputs struct FemtoProducer { - o2::framework::Preslice perMcCollision = o2::aod::mcparticle::mcCollisionId; + o2::framework::Preslice perMcCollision = o2::aod::mcparticle::mcCollisionId; // ccdb collisionbuilder::ConfCcdb confCcdb; @@ -143,7 +140,7 @@ struct FemtoProducer { o2::framework::HistogramRegistry hRegistry{"FemtoProducer", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject}; // data members - o2::framework::Service ccdb; /// Accessing the CCDB + o2::framework::Service ccdb = {}; /// Accessing the CCDB void init(o2::framework::InitContext& context) { @@ -211,13 +208,11 @@ struct FemtoProducer { collisionBuilder.reset(); auto bc = col.template bc_as(); collisionBuilder.initCollision(bc, col, tracks, ccdb, hRegistry); - if (!collisionBuilder.checkCollision(col)) { - return false; - } // do not fill collsions into the table here // collisions are filled if at least one partilce is found in the collisions - return true; + return collisionBuilder.checkCollision(col); } + template bool processMcCollisions(T1 const& col, T2 const& mcCols, T3 const& /* bcs*/, T4 const& tracks, T5 const& mcParticles) { @@ -225,12 +220,9 @@ struct FemtoProducer { mcBuilder.reset(mcCols, mcParticles); // we call this function always first so we reset the mcBuilder here auto bc = col.template bc_as(); collisionBuilder.initCollision(bc, col, tracks, ccdb, hRegistry); - if (!collisionBuilder.checkCollision(col, mcCols)) { - return false; - } // do not fill collsions into the table here // collisions are filled if at least one partilce is found in the collisions - return true; + return collisionBuilder.checkCollision(col, mcCols); } // processing tracks @@ -294,57 +286,57 @@ struct FemtoProducer { } // proccess functions - void processTracksRun3pp(consumeddata::Run3PpCollisions::iterator const& col, + void processTracksRun3pp(rawinputs::Run3PpCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks) + rawinputs::Run3FullPidTracks const& tracks) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); } PROCESS_SWITCH(FemtoProducer, processTracksRun3pp, "Process tracks", true); - void processTracksRun3PbPb(consumeddata::Run3PbPbCollisions::iterator const& col, + void processTracksRun3PbPb(rawinputs::Run3PbPbCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks) + rawinputs::Run3FullPidTracks const& tracks) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); } PROCESS_SWITCH(FemtoProducer, processTracksRun3PbPb, "Process tracks in PbPB collisions", false); // process tracks and v0s - void processTracksV0sRun3pp(consumeddata::Run3PpCollisions::iterator const& col, + void processTracksV0sRun3pp(rawinputs::Run3PpCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks, - consumeddata::Run3Vzeros const& v0s) + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Vzeros const& v0s) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); processV0s(col, tracks, v0s); }; PROCESS_SWITCH(FemtoProducer, processTracksV0sRun3pp, "Process tracks and v0s", false); - void processTracksV0sRun3PbPb(consumeddata::Run3PbPbCollisions::iterator const& col, + void processTracksV0sRun3PbPb(rawinputs::Run3PbPbCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks, - consumeddata::Run3Vzeros const& v0s) + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Vzeros const& v0s) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); processV0s(col, tracks, v0s); @@ -352,15 +344,15 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksV0sRun3PbPb, "Process tracks and v0s in PbPB collisions", false); // process tracks and kinks - void processTracksKinksRun3pp(consumeddata::Run3PpCollisions::iterator const& col, + void processTracksKinksRun3pp(rawinputs::Run3PpCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks, - consumeddata::Run3Kinks const& kinks) + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Kinks const& kinks) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); processKinks(col, tracks, kinks); @@ -368,16 +360,16 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksKinksRun3pp, "Process tracks and kinks", false); // process tracks, v0s and cascades - void processTracksV0sCascadesRun3pp(consumeddata::Run3PpCollisions::iterator const& col, + void processTracksV0sCascadesRun3pp(rawinputs::Run3PpCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks, - consumeddata::Run3Vzeros const& v0s, - consumeddata::Run3Cascades const& cascades) + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Vzeros const& v0s, + rawinputs::Run3Cascades const& cascades) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); processV0s(col, tracks, v0s); @@ -386,17 +378,17 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesRun3pp, "Provide Tracks, V0s and Cascades for Run3", false); // process tracks, v0s, cascades and kinks - void processTracksV0sCascadesKinksRun3pp(consumeddata::Run3PpCollisions::iterator const& col, + void processTracksV0sCascadesKinksRun3pp(rawinputs::Run3PpCollisions::iterator const& col, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3FullPidTracks const& tracks, - consumeddata::Run3Vzeros const& v0s, - consumeddata::Run3Cascades const& cascades, - consumeddata::Run3Kinks const& kinks) + rawinputs::Run3FullPidTracks const& tracks, + rawinputs::Run3Vzeros const& v0s, + rawinputs::Run3Cascades const& cascades, + rawinputs::Run3Kinks const& kinks) { if (!processCollisions(col, bcs, tracks)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processTracks(col, tracksWithItsPid); processV0s(col, tracks, v0s); @@ -406,65 +398,65 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksV0sCascadesKinksRun3pp, "Provide Tracks, V0s and Cascades for Run3", false); // process monte carlo tracks - void processTracksRun3ppMc(consumeddata::Run3PpMcRecoCollisions::iterator const& col, - consumeddata::Run3PpMcGenCollisions const& mcCols, + void processTracksRun3ppMc(rawinputs::Run3PpMcRecoCollisions::iterator const& col, + rawinputs::Run3PpMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); } PROCESS_SWITCH(FemtoProducer, processTracksRun3ppMc, "Provide reconstructed and generated Tracks", false); - void processTracksRun3PbPbMc(consumeddata::Run3PbPbMcRecoCollisions::iterator const& col, - consumeddata::Run3PbPbMcGenCollisions const& mcCols, + void processTracksRun3PbPbMc(rawinputs::Run3PbPbMcRecoCollisions::iterator const& col, + rawinputs::Run3PbPbMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); } PROCESS_SWITCH(FemtoProducer, processTracksRun3PbPbMc, "Provide reconstructed and generated Tracks in PbPb collisions", false); // process monte carlo tracks and v0s - void processTracksV0sRun3ppMc(consumeddata::Run3PpMcRecoCollisions::iterator const& col, - consumeddata::Run3PpMcGenCollisions const& mcCols, + void processTracksV0sRun3ppMc(rawinputs::Run3PpMcRecoCollisions::iterator const& col, + rawinputs::Run3PpMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3RecoVzeros const& v0s, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3RecoVzeros const& v0s, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); processMcV0s(col, mcCols, tracks, v0s, mcParticles); } PROCESS_SWITCH(FemtoProducer, processTracksV0sRun3ppMc, "Provide reconstructed and generated tracks and v0s", false); - void processTracksV0sRun3PbPbMc(consumeddata::Run3PbPbMcRecoCollisions::iterator const& col, - consumeddata::Run3PbPbMcGenCollisions const& mcCols, + void processTracksV0sRun3PbPbMc(rawinputs::Run3PbPbMcRecoCollisions::iterator const& col, + rawinputs::Run3PbPbMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3RecoVzeros const& v0s, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3RecoVzeros const& v0s, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); processMcV0s(col, mcCols, tracks, v0s, mcParticles); @@ -472,17 +464,17 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksV0sRun3PbPbMc, "Provide reconstructed and generated tracks and v0s in PbPb collisions", false); // process monte carlo tracks and kinks - void processTracksKinksRun3ppMc(consumeddata::Run3PpMcRecoCollisions::iterator const& col, - consumeddata::Run3PpMcGenCollisions const& mcCols, + void processTracksKinksRun3ppMc(rawinputs::Run3PpMcRecoCollisions::iterator const& col, + rawinputs::Run3PpMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3Kinks const& kinks, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3Kinks const& kinks, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); processMcKinks(col, mcCols, tracks, kinks, mcParticles); @@ -490,18 +482,18 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksKinksRun3ppMc, "Provide reconstructed and generated tracks and kinks", false); // process monte carlo tracks and v0s and kinks (adding cascades later here) - void processTracksV0sKinksRun3ppMc(consumeddata::Run3PpMcRecoCollisions::iterator const& col, - consumeddata::Run3PpMcGenCollisions const& mcCols, + void processTracksV0sKinksRun3ppMc(rawinputs::Run3PpMcRecoCollisions::iterator const& col, + rawinputs::Run3PpMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3RecoVzeros const& v0s, - consumeddata::Run3Kinks const& kinks, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3RecoVzeros const& v0s, + rawinputs::Run3Kinks const& kinks, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); processMcV0s(col, mcCols, tracks, v0s, mcParticles); @@ -510,18 +502,18 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processTracksV0sKinksRun3ppMc, "Provide reconstructed and generated tracks and v0s and kinks", false); // process monte carlo tracks and v0s - void processTracksV0sCascadesRun3ppMc(consumeddata::Run3PpMcRecoCollisions::iterator const& col, - consumeddata::Run3PpMcGenCollisions const& mcCols, + void processTracksV0sCascadesRun3ppMc(rawinputs::Run3PpMcRecoCollisions::iterator const& col, + rawinputs::Run3PpMcGenCollisions const& mcCols, o2::aod::BCsWithTimestamps const& bcs, - consumeddata::Run3McRecoTracks const& tracks, - consumeddata::Run3RecoVzeros const& v0s, - consumeddata::Run3RecoCascades const& cascades, - consumeddata::Run3McGenParticles const& mcParticles) + rawinputs::Run3McRecoTracks const& tracks, + rawinputs::Run3RecoVzeros const& v0s, + rawinputs::Run3RecoCascades const& cascades, + rawinputs::Run3McGenParticles const& mcParticles) { if (!processMcCollisions(col, mcCols, bcs, tracks, mcParticles)) { return; } - auto tracksWithItsPid = o2::soa::Attach(tracks); processMcTracks(col, mcCols, tracks, tracksWithItsPid, mcParticles); processMcV0s(col, mcCols, tracks, v0s, mcParticles); @@ -545,8 +537,8 @@ struct FemtoProducer { PROCESS_SWITCH(FemtoProducer, processMcOnly, "Provide generated particles", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { - o2::framework::WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + o2::framework::WorkflowSpec workflow{adaptAnalysisTask(context)}; return workflow; } diff --git a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx index f64ae54b657..6b1d326ac32 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx @@ -96,7 +96,7 @@ struct FemtoProducerDerivedToDerived { v0Builder.init(confV0Builder); kinkBuilder.init(confKinkBuilder); - if ((doprocessTracks + doprocessTracksLambdas + doprocessTracksK0shorts + doprocessTracksSigma + doprocessTracksSigmaPlus) > 1) { + if ((static_cast(doprocessTracks) + static_cast(doprocessTracksLambdas) + static_cast(doprocessTracksK0shorts) + static_cast(doprocessTracksSigma) + static_cast(doprocessTracksSigmaPlus)) > 1) { LOG(fatal) << "Only one proccess function can be activated"; } } @@ -167,8 +167,8 @@ struct FemtoProducerDerivedToDerived { PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksSigmaPlus, "Process sigmaPlus and tracks", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { - o2::framework::WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + o2::framework::WorkflowSpec workflow{adaptAnalysisTask(context)}; return workflow; } diff --git a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx index 46dfd292186..8f61ef26d16 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx @@ -106,8 +106,8 @@ struct FemtoProducerKinkPtConverter { } }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { - o2::framework::WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + o2::framework::WorkflowSpec workflow{adaptAnalysisTask(context)}; return workflow; } diff --git a/PWGCF/Femto/TableProducer/femtoProducerResonances.cxx b/PWGCF/Femto/TableProducer/femtoProducerResonances.cxx index 1eaba0fa6bd..38b787c2c0e 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerResonances.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerResonances.cxx @@ -103,8 +103,8 @@ struct FemtoProducerResonances { PROCESS_SWITCH(FemtoProducerResonances, processKstar0, "Build Kstar0/Kstar0bar candidates", true); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { - o2::framework::WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + o2::framework::WorkflowSpec workflow{adaptAnalysisTask(context)}; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx index d401a4b6577..9b627838165 100644 --- a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx +++ b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx @@ -124,7 +124,7 @@ struct FemtoCascadeQa { void init(o2::framework::InitContext&) { - if ((doprocessXi + doprocessXiMc + doprocessOmega + doprocessOmegaMc) > 1) { + if ((static_cast(doprocessXi) + static_cast(doprocessXiMc) + static_cast(doprocessOmega) + static_cast(doprocessOmegaMc)) > 1) { LOG(fatal) << "Only one process can be activated"; } bool processData = doprocessXi || doprocessOmega; @@ -230,10 +230,10 @@ struct FemtoCascadeQa { PROCESS_SWITCH(FemtoCascadeQa, processOmegaMc, "Process Omegas with MC information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoKinkQa.cxx b/PWGCF/Femto/Tasks/femtoKinkQa.cxx index 09297ea0fdc..877c0905b83 100644 --- a/PWGCF/Femto/Tasks/femtoKinkQa.cxx +++ b/PWGCF/Femto/Tasks/femtoKinkQa.cxx @@ -120,7 +120,7 @@ struct FemtoKinkQa { void init(o2::framework::InitContext&) { - if ((doprocessSigma + doprocessSigmaMc + doprocessSigmaPlus + doprocessSigmaPlusMc) > 1) { + if ((static_cast(doprocessSigma) + static_cast(doprocessSigmaMc) + static_cast(doprocessSigmaPlus) + static_cast(doprocessSigmaPlusMc)) > 1) { LOG(fatal) << "Only one process can be activated"; } @@ -221,10 +221,10 @@ struct FemtoKinkQa { PROCESS_SWITCH(FemtoKinkQa, processSigmaPlusMc, "Process sigmas", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoMcParticleQa.cxx b/PWGCF/Femto/Tasks/femtoMcParticleQa.cxx index 4cf4568cbf5..22e96ddaedb 100644 --- a/PWGCF/Femto/Tasks/femtoMcParticleQa.cxx +++ b/PWGCF/Femto/Tasks/femtoMcParticleQa.cxx @@ -98,10 +98,10 @@ struct FemtoMcParticleQa { }; o2::framework::WorkflowSpec - defineDataProcessing(o2::framework::ConfigContext const& cfgc) + defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairMcParticleMcParticle.cxx b/PWGCF/Femto/Tasks/femtoPairMcParticleMcParticle.cxx index 9e35a6aa545..0c0a4553359 100644 --- a/PWGCF/Femto/Tasks/femtoPairMcParticleMcParticle.cxx +++ b/PWGCF/Femto/Tasks/femtoPairMcParticleMcParticle.cxx @@ -140,10 +140,10 @@ struct FemtoPairMcParticleMcParticle { PROCESS_SWITCH(FemtoPairMcParticleMcParticle, processMixedEvent, "Enable processing mixed event processing", true); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx index 797aab1b9e6..e9433fb4f2b 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx @@ -274,10 +274,10 @@ struct FemtoPairTrackCascade { PROCESS_SWITCH(FemtoPairTrackCascade, processOmegaMixedEventMc, "Enable processing mixed event processing for tracks and omegas with mc information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx index abe08b0a51c..dd7ac4bfbb1 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx @@ -256,10 +256,10 @@ struct FemtoPairTrackKink { PROCESS_SWITCH(FemtoPairTrackKink, processSigmaPlusMixedEventMc, "Enable processing mixed event processing for tracks and sigma plus with MC information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx index cc03f17cae4..ddf110af478 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx @@ -118,7 +118,7 @@ struct FemtoPairTrackTrack { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventWithMass + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventWithMass + doprocessMixedEventMc) > 1) { + if ((static_cast(doprocessSameEvent) + static_cast(doprocessSameEventWithMass) + static_cast(doprocessSameEventMc)) > 1 || (static_cast(doprocessMixedEvent) + static_cast(doprocessMixedEventWithMass) + static_cast(doprocessMixedEventMc)) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } bool processData = doprocessSameEvent || doprocessMixedEvent || doprocessSameEventWithMass || doprocessMixedEventWithMass; @@ -193,10 +193,10 @@ struct FemtoPairTrackTrack { PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEventMc, "Enable processing mixed event processing", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx index f17d27f2b75..f5fb9088aa5 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx @@ -151,7 +151,7 @@ struct FemtoPairTrackTwoTrackResonance { void init(o2::framework::InitContext&) { - if (((doprocessPhiSameEvent || doprocessPhiMixedEvent) + (doprocessKstar0SameEvent || doprocessKstar0MixedEvent)) + (doprocessRho0SameEvent || doprocessRho0MixedEvent) > 1) { + if ((static_cast(doprocessPhiSameEvent || doprocessPhiMixedEvent) + static_cast(doprocessKstar0SameEvent || doprocessKstar0MixedEvent)) + static_cast(doprocessRho0SameEvent || doprocessRho0MixedEvent) > 1) { LOG(fatal) << "Can only process SE/ME for phi-tracks, rho-tracks or k0*-tracks"; } @@ -227,10 +227,10 @@ struct FemtoPairTrackTwoTrackResonance { PROCESS_SWITCH(FemtoPairTrackTwoTrackResonance, processRho0MixedEvent, "Enable processing mixed event processing for tracks and rho0s", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx index 5bcce0a3cb8..69087f58180 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx @@ -261,10 +261,10 @@ struct FemtoPairTrackV0 { PROCESS_SWITCH(FemtoPairTrackV0, processK0shortMixedEventMc, "Enable processing mixed event processing for tracks and k0shorts with mc information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairV0TwoTrackResonance.cxx b/PWGCF/Femto/Tasks/femtoPairV0TwoTrackResonance.cxx index 33387d14e2d..6a0e25e40d2 100644 --- a/PWGCF/Femto/Tasks/femtoPairV0TwoTrackResonance.cxx +++ b/PWGCF/Femto/Tasks/femtoPairV0TwoTrackResonance.cxx @@ -243,12 +243,12 @@ struct FemtoPairV0TwoTrackResonance { { // all pair combinations share the same histogram prefixes, so only one combination can be processed per workflow instance - if ((doprocessLambdaPhiSameEvent || doprocessLambdaPhiMixedEvent) + - (doprocessLambdaKstar0SameEvent || doprocessLambdaKstar0MixedEvent) + - (doprocessLambdaRho0SameEvent || doprocessLambdaRho0MixedEvent) + - (doprocessK0shortPhiSameEvent || doprocessK0shortPhiMixedEvent) + - (doprocessK0shortKstar0SameEvent || doprocessK0shortKstar0MixedEvent) + - (doprocessK0shortRho0SameEvent || doprocessK0shortRho0MixedEvent) > + if (static_cast(doprocessLambdaPhiSameEvent || doprocessLambdaPhiMixedEvent) + + static_cast(doprocessLambdaKstar0SameEvent || doprocessLambdaKstar0MixedEvent) + + static_cast(doprocessLambdaRho0SameEvent || doprocessLambdaRho0MixedEvent) + + static_cast(doprocessK0shortPhiSameEvent || doprocessK0shortPhiMixedEvent) + + static_cast(doprocessK0shortKstar0SameEvent || doprocessK0shortKstar0MixedEvent) + + static_cast(doprocessK0shortRho0SameEvent || doprocessK0shortRho0MixedEvent) > 1) { LOG(fatal) << "Can only process one v0-resonance combination (lambda/k0short x phi/kstar0/rho0)"; } @@ -395,10 +395,10 @@ struct FemtoPairV0TwoTrackResonance { PROCESS_SWITCH(FemtoPairV0TwoTrackResonance, processK0shortRho0MixedEvent, "Enable processing mixed event processing for k0shorts and rho0s", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx index 11d4bb4814d..9fc0e01a639 100644 --- a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx @@ -267,10 +267,10 @@ struct FemtoPairV0V0 { PROCESS_SWITCH(FemtoPairV0V0, processK0shortK0shortMixedEventMc, "Enable processing mixed event processing for k0short-k0short with mc information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoTrackQa.cxx b/PWGCF/Femto/Tasks/femtoTrackQa.cxx index 4ecc0790464..7a460bb3c15 100644 --- a/PWGCF/Femto/Tasks/femtoTrackQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTrackQa.cxx @@ -83,7 +83,7 @@ struct FemtoTrackQa { void init(o2::framework::InitContext&) { - if ((doprocessData + doprocessMc) > 1) { + if ((static_cast(doprocessData) + static_cast(doprocessMc)) > 1) { LOG(fatal) << "More than 1 process function is activated. Breaking..."; } bool processData = doprocessData; @@ -137,10 +137,10 @@ struct FemtoTrackQa { }; o2::framework::WorkflowSpec - defineDataProcessing(o2::framework::ConfigContext const& cfgc) + defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx index a3dd2ceb72c..013d9a3eb6c 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackCascade.cxx @@ -181,7 +181,7 @@ struct FemtoTripletTrackTrackCascade { void init(o2::framework::InitContext&) { - if ((doprocessXiSameEvent + doprocessXiSameEventMc) > 1 || (doprocessXiMixedEvent + doprocessXiMixedEventMc) > 1 || (doprocessOmegaSameEvent + doprocessOmegaSameEventMc) > 1 || (doprocessOmegaMixedEvent + doprocessOmegaMixedEventMc) > 1) { + if ((static_cast(doprocessXiSameEvent) + static_cast(doprocessXiSameEventMc)) > 1 || (static_cast(doprocessXiMixedEvent) + static_cast(doprocessXiMixedEventMc)) > 1 || (static_cast(doprocessOmegaSameEvent) + static_cast(doprocessOmegaSameEventMc)) > 1 || (static_cast(doprocessOmegaMixedEvent) + static_cast(doprocessOmegaMixedEventMc)) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } bool processData = doprocessXiSameEvent || doprocessXiMixedEvent || doprocessOmegaSameEvent || doprocessOmegaMixedEvent; @@ -302,10 +302,10 @@ struct FemtoTripletTrackTrackCascade { PROCESS_SWITCH(FemtoTripletTrackTrackCascade, processOmegaMixedEventMc, "Enable processing mixed event processing for tracks and omegas with mc information", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx index 9a79c4fc336..16e780089d7 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx @@ -117,7 +117,7 @@ struct FemtoTripletTrackTrackTrack { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) { + if ((static_cast(doprocessSameEvent) + static_cast(doprocessSameEventMc)) > 1 || (static_cast(doprocessMixedEvent) + static_cast(doprocessMixedEventMc)) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } bool processData = doprocessSameEvent || doprocessMixedEvent; @@ -184,10 +184,10 @@ struct FemtoTripletTrackTrackTrack { PROCESS_SWITCH(FemtoTripletTrackTrackTrack, processMixedEventMc, "Enable processing mixed event processing", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx index 8280f5a7716..a6c74f1c4c1 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx @@ -137,7 +137,7 @@ struct FemtoTripletTrackTrackV0 { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) { + if ((static_cast(doprocessSameEvent) + static_cast(doprocessSameEventMc)) > 1 || (static_cast(doprocessMixedEvent) + static_cast(doprocessMixedEventMc)) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } bool processData = doprocessSameEvent || doprocessMixedEvent; @@ -210,10 +210,10 @@ struct FemtoTripletTrackTrackV0 { PROCESS_SWITCH(FemtoTripletTrackTrackV0, processMixedEventMc, "Enable processing mixed event processing", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx index 8ec17ee9756..7e22720b6c6 100644 --- a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx @@ -35,38 +35,35 @@ #include #include -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; using namespace o2::analysis::femto; struct FemtoTwotrackresonanceQa { // setup tables - using FemtoCollisions = o2::soa::Join; + using FemtoCollisions = o2::soa::Join; using FemtoCollision = FemtoCollisions::iterator; using FilteredFemtoCollisions = o2::soa::Filtered; using FilteredFemtoCollision = FilteredFemtoCollisions::iterator; - using FemtoPhis = o2::soa::Join; - using FemtoRho0s = o2::soa::Join; - using FemtoKstar0s = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoPhis = o2::soa::Join; + using FemtoRho0s = o2::soa::Join; + using FemtoKstar0s = o2::soa::Join; + using FemtoTracks = o2::soa::Join; - SliceCache cache; + o2::framework::SliceCache cache; // setup for collisions collisionbuilder::ConfCollisionSelection collisionSelection; - Filter collisionFilter = MAKE_COLLISION_FILTER(collisionSelection); + o2::framework::expressions::Filter collisionFilter = MAKE_COLLISION_FILTER(collisionSelection); colhistmanager::CollisionHistManager colHistManager; colhistmanager::ConfCollisionBinning confCollisionBinning; colhistmanager::ConfCollisionQaBinning confCollisionQaBinning; // setup for phis twotrackresonancebuilder::ConfPhiSelection confPhiSelection; - Partition phiPartition = MAKE_RESONANCE_0_PARTITON(confPhiSelection); - Preslice perColPhis = femtobase::stored::fColId; + o2::framework::Partition phiPartition = MAKE_RESONANCE_0_PARTITON(confPhiSelection); + o2::framework::Preslice perColPhis = o2::aod::femtobase::stored::fColId; twotrackresonancehistmanager::ConfPhiBinning confPhiBinning; twotrackresonancehistmanager::TwoTrackResonanceHistManager< @@ -78,8 +75,8 @@ struct FemtoTwotrackresonanceQa { // setup for rho0s twotrackresonancebuilder::ConfRho0Selection confRho0Selection; - Partition rho0Partition = MAKE_RESONANCE_0_PARTITON(confRho0Selection); - Preslice perColRhos = femtobase::stored::fColId; + o2::framework::Partition rho0Partition = MAKE_RESONANCE_0_PARTITON(confRho0Selection); + o2::framework::Preslice perColRhos = o2::aod::femtobase::stored::fColId; twotrackresonancehistmanager::ConfRho0Binning confRho0Binning; twotrackresonancehistmanager::TwoTrackResonanceHistManager< @@ -91,8 +88,8 @@ struct FemtoTwotrackresonanceQa { // setup for kstar0s twotrackresonancebuilder::ConfKstar0Selection confKstar0Selection; - Partition kstar0Partition = MAKE_RESONANCE_1_PARTITON(confKstar0Selection); - Preslice perColKstars = femtobase::stored::fColId; + o2::framework::Partition kstar0Partition = MAKE_RESONANCE_1_PARTITON(confKstar0Selection); + o2::framework::Preslice perColKstars = o2::aod::femtobase::stored::fColId; twotrackresonancehistmanager::ConfKstar0Binning confKstar0Binning; twotrackresonancehistmanager::TwoTrackResonanceHistManager< @@ -108,9 +105,9 @@ struct FemtoTwotrackresonanceQa { trackhistmanager::ConfResonanceNegDauBinning confNegDaughterBinning; trackhistmanager::ConfResonanceNegDauQaBinning confNegDaughterQaBinning; - HistogramRegistry hRegistry{"ResonanceQA", {}, OutputObjHandlingPolicy::AnalysisObject}; + o2::framework::HistogramRegistry hRegistry{"ResonanceQA", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject}; - void init(InitContext&) + void init(o2::framework::InitContext&) { // create a map for histogram specs auto colHistSpec = colhistmanager::makeColQaHistSpecMap(confCollisionBinning, confCollisionQaBinning); @@ -119,7 +116,7 @@ struct FemtoTwotrackresonanceQa { auto posDaughterHistSpec = trackhistmanager::makeTrackQaHistSpecMap(confPosDaughterBinning, confPosDaughterQaBinning); auto negDaughterHistSpec = trackhistmanager::makeTrackQaHistSpecMap(confNegDaughterBinning, confNegDaughterQaBinning); - if ((doprocessPhis + doprocessRho0s + doprocessKstar0s) > 1) { + if ((static_cast(doprocessPhis) + static_cast(doprocessRho0s) + static_cast(doprocessKstar0s)) > 1) { LOG(fatal) << "Only one process can be activated"; } @@ -140,7 +137,7 @@ struct FemtoTwotrackresonanceQa { void processPhis(FilteredFemtoCollision const& col, FemtoPhis const& /*phis*/, FemtoTracks const& tracks) { - auto phiSlice = phiPartition->sliceByCached(femtobase::stored::fColId, col.globalIndex(), cache); + auto phiSlice = phiPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); if (phiSlice.size() == 0) { return; } @@ -153,7 +150,7 @@ struct FemtoTwotrackresonanceQa { void processRho0s(FilteredFemtoCollision const& col, FemtoRho0s const& /*rho0s*/, FemtoTracks const& tracks) { - auto rho0Slice = rho0Partition->sliceByCached(femtobase::stored::fColId, col.globalIndex(), cache); + auto rho0Slice = rho0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); if (rho0Slice.size() == 0) { return; } @@ -166,7 +163,7 @@ struct FemtoTwotrackresonanceQa { void processKstar0s(FilteredFemtoCollision const& col, FemtoKstar0s const& /*kstar0s*/, FemtoTracks const& tracks) { - auto kstar0Slice = kstar0Partition->sliceByCached(femtobase::stored::fColId, col.globalIndex(), cache); + auto kstar0Slice = kstar0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache); if (kstar0Slice.size() == 0) { return; } @@ -178,10 +175,10 @@ struct FemtoTwotrackresonanceQa { PROCESS_SWITCH(FemtoTwotrackresonanceQa, processKstar0s, "Process Kstar0s", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { - WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + o2::framework::WorkflowSpec workflow{ + adaptAnalysisTask(context), }; return workflow; } diff --git a/PWGCF/Femto/Tasks/femtoV0Qa.cxx b/PWGCF/Femto/Tasks/femtoV0Qa.cxx index 00a71e910cc..bcd8aa7a246 100644 --- a/PWGCF/Femto/Tasks/femtoV0Qa.cxx +++ b/PWGCF/Femto/Tasks/femtoV0Qa.cxx @@ -122,7 +122,7 @@ struct FemtoV0Qa { void init(o2::framework::InitContext&) { - if ((doprocessLambda + doprocessLambdaMc + doprocessK0short + doprocessK0shortMc) != 1) { + if ((static_cast(doprocessLambda) + static_cast(doprocessLambdaMc) + static_cast(doprocessK0short) + static_cast(doprocessK0shortMc)) != 1) { LOG(fatal) << "Only one process can be activated"; } bool processData = doprocessLambda || doprocessK0short; @@ -225,10 +225,10 @@ struct FemtoV0Qa { PROCESS_SWITCH(FemtoV0Qa, processLambdaMc, "Process lambdas with MC informaton", false); }; -o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) +o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context) { o2::framework::WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(context), }; return workflow; }