diff --git a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx index 5f2ee67ac07..d797a29b592 100644 --- a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -73,17 +72,8 @@ #include #include -#define C_CS(cs) /* NOLINT(cppcoreguidelines-macro-usage) */ \ - [](const std::index_sequence&) constexpr noexcept -> ConstStr<(cs)[indices]...> { \ - static_assert(std::is_array_v> && \ - std::same_as>, char>); \ - return ConstStr<(cs)[indices]...>{}; \ - }(std::make_index_sequence{}) -#define C_SV(sv) /* NOLINT(cppcoreguidelines-macro-usage) */ \ - [](const std::index_sequence&) constexpr noexcept -> ConstStr<(sv)[indices]...> { \ - static_assert(std::same_as, std::string_view>); \ - return ConstStr<(sv)[indices]...>{}; \ - }(std::make_index_sequence<(sv).size()>{}) +#define C_CS(cs) HIST(cs) // NOLINT(cppcoreguidelines-macro-usage) +#define C_SV(sv) HIST(sv) // NOLINT(cppcoreguidelines-macro-usage) using namespace o2; using namespace o2::framework; diff --git a/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx b/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx index 1f886490fcb..6802041b7e0 100644 --- a/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx +++ b/PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx @@ -767,8 +767,9 @@ struct FlowGfwOmegaXi { } // input HIST("name") - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -799,8 +800,9 @@ struct FlowGfwOmegaXi { return; } - template - void fillProfilepT(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const int& ptbin, const double& cent) + template + requires is_const_str::value + void fillProfilepT(const GFW::CorrConfig& corrconf, const TName& tarName, const int& ptbin, const double& cent) { float dnx = 0; float val = 0; @@ -814,8 +816,9 @@ struct FlowGfwOmegaXi { return; } - template - void fillProfilepTMC(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const int& ptbin, const int& PDGCode, const double& cent) + template + requires is_const_str::value + void fillProfilepTMC(const GFW::CorrConfig& corrconf, const TName& tarName, const int& ptbin, const int& PDGCode, const double& cent) { TAxis* fpt = nullptr; if (PDGCode == kXiMinus) { @@ -843,8 +846,9 @@ struct FlowGfwOmegaXi { } // input HIST("name") - template - void fillProfilepTMass(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const int& ptbin, const int& PDGCode, const float& cent) + template + requires is_const_str::value + void fillProfilepTMass(const GFW::CorrConfig& corrconf, const TName& tarName, const int& ptbin, const int& PDGCode, const float& cent) { int nMassBins = 0; int nptbins = 0; diff --git a/PWGCF/Flow/Tasks/flowGfwTask.cxx b/PWGCF/Flow/Tasks/flowGfwTask.cxx index 3e43254956c..a0e5abdc8f0 100644 --- a/PWGCF/Flow/Tasks/flowGfwTask.cxx +++ b/PWGCF/Flow/Tasks/flowGfwTask.cxx @@ -646,8 +646,9 @@ struct FlowGfwTask { } // end of Initialization - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); diff --git a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx index 8abf37f3f09..b6052035985 100644 --- a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx +++ b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx @@ -601,8 +601,9 @@ struct FlowPbpbPikp { return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton } - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; if (!corrconf.pTDif) { diff --git a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx index e22a4c36566..80cb37c6a13 100644 --- a/PWGCF/Flow/Tasks/flowPtEfficiency.cxx +++ b/PWGCF/Flow/Tasks/flowPtEfficiency.cxx @@ -271,8 +271,9 @@ struct FlowPtEfficiency { myTrackSel.SetMaxDcaZ(cfgCutDCAz); } - template - void fillProfile(GFW* fGFW, const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(GFW* fGFW, const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); diff --git a/PWGCF/Flow/Tasks/flowQa.cxx b/PWGCF/Flow/Tasks/flowQa.cxx index 2221f27a321..08c86f623c3 100644 --- a/PWGCF/Flow/Tasks/flowQa.cxx +++ b/PWGCF/Flow/Tasks/flowQa.cxx @@ -402,8 +402,9 @@ struct FlowQa { } } - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index 2471b77f282..fd24d4e2f32 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -837,8 +837,9 @@ struct FlowTask { th3sPerRun.insert(std::make_pair(runNumber, histPhiEtaVtxz)); } - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); @@ -853,8 +854,9 @@ struct FlowTask { return; } - template - void fillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr& vnWeff, const ConstStr& vnpT, const double& cent) + template + requires(is_const_str::value && is_const_str::value) + void fillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const TName& vnWeff, const TName2& vnpT, const double& cent) { double meanPt = sum_pt / WeffEvent; double dnx, val; diff --git a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx index 5189ecd236d..d4c5bf7c3d7 100644 --- a/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx +++ b/PWGCF/Flow/Tasks/pidFlowPtCorr.cxx @@ -2380,13 +2380,14 @@ struct PidFlowPtCorr { /** * @brief fill graphs like c22, c24, etc. * - * @tparam chars + * @tparam TName * @param corrconf * @param tarName graph name * @param cent */ - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { // calculate #sum exp{i * 0 (#phi_{i} - #phi_{j})} == N_{pairs} // note that weight is ignored in the formula but not in the calculation, for c24 is similar @@ -2453,7 +2454,7 @@ struct PidFlowPtCorr { * @note why we need weightedc22? when calculating cov(v2,pt), we need N_{pair} * N_{charged} to be weight * NOTICE!!! when filling weighted, value gave to param ptSum is nch, when filling diffpt, its just ptsum * - * @tparam chars + * @tparam TName * @param corrconf * @param tarName * @param cent @@ -2461,8 +2462,9 @@ struct PidFlowPtCorr { * @param nch * @param meanPt */ - template - void fillProfilevnpt(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent, const double& ptSum, const double& nch, const double& meanPt = 0) + template + requires is_const_str::value + void fillProfilevnpt(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent, const double& ptSum, const double& nch, const double& meanPt = 0) { double dnx = 0.0, val = 0.0; dnx = fGFW->Calculate(corrconf, 0, true).real(); @@ -2475,8 +2477,9 @@ struct PidFlowPtCorr { } } - template - void fillProfilePOIvnpt(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent, const double& ptSum, const double& nch, const double& rndm) + template + requires is_const_str::value + void fillProfilePOIvnpt(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent, const double& ptSum, const double& nch, const double& rndm) { double dnx = 0.0, val = 0.0; dnx = fGFW->Calculate(corrconf, 0, true).real(); @@ -2496,8 +2499,9 @@ struct PidFlowPtCorr { * counts are added before division. The PID mean pT is only the profile * coordinate, so the profile is weighted by the combined pair count alone. */ - template - void fillProfilePOIvnpt(const GFW::CorrConfig& corrconfA, const GFW::CorrConfig& corrconfB, const ConstStr& tarName, const double& cent, const double& ptSum, const double& nPid, const double& rndm) + template + requires is_const_str::value + void fillProfilePOIvnpt(const GFW::CorrConfig& corrconfA, const GFW::CorrConfig& corrconfB, const TName& tarName, const double& cent, const double& ptSum, const double& nPid, const double& rndm) { const double dnxA = fGFW->Calculate(corrconfA, 0, true).real(); const double dnxB = fGFW->Calculate(corrconfB, 0, true).real(); diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index 9909d54112d..791cd36d014 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -921,8 +921,9 @@ struct ResonancesGfwFlow { return true; } - template - void resurrectPhi(const TTrack& trackplus, const TTrack& trackminus, const TCollision& collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr& hist) + template + requires is_const_str::value + void resurrectPhi(const TTrack& trackplus, const TTrack& trackminus, const TCollision& collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const TName& hist) { for (auto const& [partplus, partminus] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(trackplus, trackminus))) { histos.fill(HIST("hPhiCount"), 0.5); @@ -981,8 +982,9 @@ struct ResonancesGfwFlow { return; } - template - void likeSignPhi(const TTrack& track, const TCollision& collision, double plusmass, const ConstStr& hist) + template + requires is_const_str::value + void likeSignPhi(const TTrack& track, const TCollision& collision, double plusmass, const TName& hist) { ROOT::Math::PxPyPzMVector daug1, daug2, mom; for (auto const& [part1, part2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(track, track))) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index 8f66d3bfb27..69b1691a7b9 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -835,8 +835,9 @@ struct LongRangeDihadronCor { return true; } - template - void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real(); diff --git a/PWGDQ/Tasks/dqCorrelation.cxx b/PWGDQ/Tasks/dqCorrelation.cxx index 30c0bc1a38b..47971fdcdb5 100644 --- a/PWGDQ/Tasks/dqCorrelation.cxx +++ b/PWGDQ/Tasks/dqCorrelation.cxx @@ -255,8 +255,9 @@ struct DqCumulantFlow { fGFW->CreateRegions(); } - template - void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& axis) + template + requires is_const_str::value + void FillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& axis) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real(); diff --git a/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx b/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx index 49dfc3e4a81..349c0e3005b 100644 --- a/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx +++ b/Tutorials/PWGCF/FlowGenericFramework/src/flowGFWTutorial.cxx @@ -100,8 +100,9 @@ struct GfwTutorial { fGFW->CreateRegions(); } - template - void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + template + requires is_const_str::value + void FillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent) { double dnx, val; dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();