Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <Framework/InitContext.h>
#include <Framework/O2DatabasePDGPlugin.h>
#include <Framework/OutputObjHeader.h>
#include <Framework/StringHelpers.h>
#include <Framework/runDataProcessing.h>

#include <TFormula.h>
Expand Down Expand Up @@ -73,17 +72,8 @@
#include <utility>
#include <vector>

#define C_CS(cs) /* NOLINT(cppcoreguidelines-macro-usage) */ \
[]<std::size_t... indices>(const std::index_sequence<indices...>&) constexpr noexcept -> ConstStr<(cs)[indices]...> { \
static_assert(std::is_array_v<std::remove_cvref_t<decltype(cs)>> && \
std::same_as<std::remove_extent_t<std::remove_cvref_t<decltype(cs)>>, char>); \
return ConstStr<(cs)[indices]...>{}; \
}(std::make_index_sequence<sizeof(cs) - 1>{})
#define C_SV(sv) /* NOLINT(cppcoreguidelines-macro-usage) */ \
[]<std::size_t... indices>(const std::index_sequence<indices...>&) constexpr noexcept -> ConstStr<(sv)[indices]...> { \
static_assert(std::same_as<std::remove_cvref_t<decltype(sv)>, 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;
Expand Down
20 changes: 12 additions & 8 deletions PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,9 @@ struct FlowGfwOmegaXi {
}

// input HIST("name")
template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down Expand Up @@ -799,8 +800,9 @@ struct FlowGfwOmegaXi {
return;
}

template <char... chars>
void fillProfilepT(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int& ptbin, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfilepT(const GFW::CorrConfig& corrconf, const TName& tarName, const int& ptbin, const double& cent)
{
float dnx = 0;
float val = 0;
Expand All @@ -814,8 +816,9 @@ struct FlowGfwOmegaXi {
return;
}

template <char... chars>
void fillProfilepTMC(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int& ptbin, const int& PDGCode, const double& cent)
template <typename TName>
requires is_const_str<TName>::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) {
Expand Down Expand Up @@ -843,8 +846,9 @@ struct FlowGfwOmegaXi {
}

// input HIST("name")
template <char... chars>
void fillProfilepTMass(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const int& ptbin, const int& PDGCode, const float& cent)
template <typename TName>
requires is_const_str<TName>::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;
Expand Down
5 changes: 3 additions & 2 deletions PWGCF/Flow/Tasks/flowGfwTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,9 @@ struct FlowGfwTask {

} // end of Initialization

template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down
5 changes: 3 additions & 2 deletions PWGCF/Flow/Tasks/flowPbpbPikp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,9 @@ struct FlowPbpbPikp {
return pid + 1; // shift the pid by 1, 1 = pion, 2 = kaon, 3 = proton
}

template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
if (!corrconf.pTDif) {
Expand Down
5 changes: 3 additions & 2 deletions PWGCF/Flow/Tasks/flowPtEfficiency.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ struct FlowPtEfficiency {
myTrackSel.SetMaxDcaZ(cfgCutDCAz);
}

template <char... chars>
void fillProfile(GFW* fGFW, const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::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();
Expand Down
5 changes: 3 additions & 2 deletions PWGCF/Flow/Tasks/flowQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ struct FlowQa {
}
}

template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down
10 changes: 6 additions & 4 deletions PWGCF/Flow/Tasks/flowTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,9 @@ struct FlowTask {
th3sPerRun.insert(std::make_pair(runNumber, histPhiEtaVtxz));
}

template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand All @@ -853,8 +854,9 @@ struct FlowTask {
return;
}

template <char... chars, char... chars2>
void fillpTvnProfile(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr<chars...>& vnWeff, const ConstStr<chars2...>& vnpT, const double& cent)
template <typename TName, typename TName2>
requires(is_const_str<TName>::value && is_const_str<TName2>::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;
Expand Down
24 changes: 14 additions & 10 deletions PWGCF/Flow/Tasks/pidFlowPtCorr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::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
Expand Down Expand Up @@ -2453,16 +2454,17 @@ 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
* @param ptSum
* @param nch
* @param meanPt
*/
template <char... chars>
void fillProfilevnpt(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent, const double& ptSum, const double& nch, const double& meanPt = 0)
template <typename TName>
requires is_const_str<TName>::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();
Expand All @@ -2475,8 +2477,9 @@ struct PidFlowPtCorr {
}
}

template <char... chars>
void fillProfilePOIvnpt(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent, const double& ptSum, const double& nch, const double& rndm)
template <typename TName>
requires is_const_str<TName>::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();
Expand All @@ -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 <char... chars>
void fillProfilePOIvnpt(const GFW::CorrConfig& corrconfA, const GFW::CorrConfig& corrconfB, const ConstStr<chars...>& tarName, const double& cent, const double& ptSum, const double& nPid, const double& rndm)
template <typename TName>
requires is_const_str<TName>::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();
Expand Down
10 changes: 6 additions & 4 deletions PWGCF/Flow/Tasks/resonancesGfwFlow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,9 @@ struct ResonancesGfwFlow {
return true;
}

template <typename TTrack, typename vector, char... chars, typename TCollision>
void resurrectPhi(const TTrack& trackplus, const TTrack& trackminus, const TCollision& collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr<chars...>& hist)
template <typename TTrack, typename vector, typename TName, typename TCollision>
requires is_const_str<TName>::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);
Expand Down Expand Up @@ -981,8 +982,9 @@ struct ResonancesGfwFlow {
return;
}

template <typename TTrack, char... chars, typename TCollision>
void likeSignPhi(const TTrack& track, const TCollision& collision, double plusmass, const ConstStr<chars...>& hist)
template <typename TTrack, typename TName, typename TCollision>
requires is_const_str<TName>::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))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,9 @@ struct LongRangeDihadronCor {
return true;
}

template <char... chars>
void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void fillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down
5 changes: 3 additions & 2 deletions PWGDQ/Tasks/dqCorrelation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ struct DqCumulantFlow {
fGFW->CreateRegions();
}

template <char... chars>
void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& axis)
template <typename TName>
requires is_const_str<TName>::value
void FillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& axis)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ struct GfwTutorial {
fGFW->CreateRegions();
}

template <char... chars>
void FillProfile(const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double& cent)
template <typename TName>
requires is_const_str<TName>::value
void FillProfile(const GFW::CorrConfig& corrconf, const TName& tarName, const double& cent)
{
double dnx, val;
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
Expand Down
Loading