Skip to content

Commit 16b9b30

Browse files
committed
reduce task members
1 parent 6980279 commit 16b9b30

1 file changed

Lines changed: 32 additions & 33 deletions

File tree

PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,17 @@ struct FlowGenericFramework {
123123
O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Do correlations as function of Nch")
124124
O2_DEFINE_CONFIGURABLE(cfgUseNchCorrection, int, 1, "Use correction for Nch; 0: Use size of tracks table, 1: Use efficiency-corrected Nch values, 2: Use uncorrected Nch values");
125125
O2_DEFINE_CONFIGURABLE(cfgRunByRun, bool, false, "Use run-by-run NUA")
126-
struct : ConfigurableGroup{
127-
O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights")
128-
O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms")
129-
O2_DEFINE_CONFIGURABLE(cfgFillV0QA, bool, true, "Fill QA histograms for V0 reconstruction")
130-
O2_DEFINE_CONFIGURABLE(cfgFillRunByRunQA, bool, false, "Fill histograms on a run-by-run basis")} cfgFill;
131-
O2_DEFINE_CONFIGURABLE(cfgUseCentralMoments, bool, true, "Use central moments in vn-pt calculations")
132-
O2_DEFINE_CONFIGURABLE(cfgUsePID, bool, true, "Enable PID information")
133-
O2_DEFINE_CONFIGURABLE(cfgUseGapMethod, bool, false, "Use gap method in vn-pt calculations")
134126
struct : ConfigurableGroup {
127+
O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights");
128+
O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms");
129+
O2_DEFINE_CONFIGURABLE(cfgFillV0QA, bool, true, "Fill QA histograms for V0 reconstruction");
130+
O2_DEFINE_CONFIGURABLE(cfgFillRunByRunQA, bool, false, "Fill histograms on a run-by-run basis");
135131
O2_DEFINE_CONFIGURABLE(cfgAnalyseChargedHadrons, bool, true, "Store radial-flow and fraction outputs for charged tracks, pions, kaons, and protons");
136132
O2_DEFINE_CONFIGURABLE(cfgAnalyseK0Lambda, bool, true, "Store radial-flow and fraction outputs for K0 and Lambda candidates");
137-
} cfgAnalysisChannels;
133+
} cfgFill;
134+
O2_DEFINE_CONFIGURABLE(cfgUseCentralMoments, bool, true, "Use central moments in vn-pt calculations")
135+
O2_DEFINE_CONFIGURABLE(cfgUsePID, bool, true, "Enable PID information")
136+
O2_DEFINE_CONFIGURABLE(cfgUseGapMethod, bool, false, "Use gap method in vn-pt calculations")
138137
struct : ConfigurableGroup {
139138
O2_DEFINE_CONFIGURABLE(cfgUsePtCorrWeights, bool, true, "Enable or disable the use of multiplicity-based event weighting for pt-pt correlations");
140139
O2_DEFINE_CONFIGURABLE(cfgUseMultiplicityFlowWeights, bool, true, "Enable or disable the use of multiplicity-based event weighting for azimuthal correlations");
@@ -535,7 +534,7 @@ struct FlowGenericFramework {
535534
void init(InitContext const&)
536535
{
537536
LOGF(info, "FlowGenericFramework::init()");
538-
if (!cfgAnalysisChannels.cfgAnalyseChargedHadrons && !cfgAnalysisChannels.cfgAnalyseK0Lambda) {
537+
if (!cfgFill.cfgAnalyseChargedHadrons && !cfgFill.cfgAnalyseK0Lambda) {
539538
LOGF(fatal, "Enable at least one radial-flow analysis channel");
540539
}
541540
gfwMemberCache.regions.SetNames(cfgRegions->GetNames());
@@ -741,11 +740,11 @@ struct FlowGenericFramework {
741740
AxisSpec axisLambdaMass = {resoSwitchVals[MassBins][Lambda], resoCutVals[MassMin][Lambda], resoCutVals[MassMax][Lambda]};
742741
AxisSpec yAxis = {100, -1, 1};
743742
// QA histograms for V0s
744-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda && cfgFill.cfgFillV0QA && (resoSwitchVals[UseParticle][K0] != 0 || resoSwitchVals[UseParticle][Lambda] != 0)) {
743+
if (cfgFill.cfgAnalyseK0Lambda && cfgFill.cfgFillV0QA && (resoSwitchVals[UseParticle][K0] != 0 || resoSwitchVals[UseParticle][Lambda] != 0)) {
745744
registryQA.add("trackQA/after/etaV02", "; #eta; Counts", {HistType::kTH1D, {etaAxis}});
746745
registryQA.add("trackQA/after/etaV0", "; #eta; Counts", {HistType::kTH1D, {etaAxis}});
747746
}
748-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda && resoSwitchVals[UseParticle][K0] != 0) {
747+
if (cfgFill.cfgAnalyseK0Lambda && resoSwitchVals[UseParticle][K0] != 0) {
749748
if (cfgFill.cfgFillV0QA) {
750749
registryQA.add("K0/PiPlusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}});
751750
registryQA.add("K0/PiMinusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}});
@@ -775,7 +774,7 @@ struct FlowGenericFramework {
775774
registryQA.get<TH1>(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(FillV0DaughterTrackSelection, "v0 Daughter eta selection");
776775
}
777776

778-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda && resoSwitchVals[UseParticle][Lambda] != 0) {
777+
if (cfgFill.cfgAnalyseK0Lambda && resoSwitchVals[UseParticle][Lambda] != 0) {
779778
if (cfgFill.cfgFillV0QA) {
780779
registryQA.add("Lambda/PrPlusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}});
781780
registryQA.add("Lambda/PiMinusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}});
@@ -815,7 +814,7 @@ struct FlowGenericFramework {
815814
}
816815
if (!doprocessEfficiency) {
817816
if (doprocessData || doprocessRun2 || doprocessMCReco || doprocessMC) {
818-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
817+
if (cfgFill.cfgAnalyseChargedHadrons) {
819818
registry.add("npt_v02_ch", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
820819
registry.add("npt_v02_pi", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
821820
registry.add("npt_v02_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
@@ -825,7 +824,7 @@ struct FlowGenericFramework {
825824
registry.add("npt_v0_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
826825
registry.add("npt_v0_pr", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
827826
}
828-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
827+
if (cfgFill.cfgAnalyseK0Lambda) {
829828
registry.add("npt_v02_K0_sig", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
830829
registry.add("npt_v02_K0_sb1", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
831830
registry.add("npt_v02_K0_sb2", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
@@ -841,7 +840,7 @@ struct FlowGenericFramework {
841840
}
842841
}
843842
if (doprocessMCGen || doprocessOnTheFly || doprocessMC) {
844-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
843+
if (cfgFill.cfgAnalyseChargedHadrons) {
845844
registryGen.add("MCGen/npt_v02_ch", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
846845
registryGen.add("MCGen/npt_v02_pi", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
847846
registryGen.add("MCGen/npt_v02_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
@@ -851,7 +850,7 @@ struct FlowGenericFramework {
851850
registryGen.add("MCGen/npt_v0_ka", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
852851
registryGen.add("MCGen/npt_v0_pr", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
853852
}
854-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
853+
if (cfgFill.cfgAnalyseK0Lambda) {
855854
registryGen.add("MCGen/npt_v02_K0_sig", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
856855
registryGen.add("MCGen/npt_v02_K0_sb1", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
857856
registryGen.add("MCGen/npt_v02_K0_sb2", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}});
@@ -875,7 +874,7 @@ struct FlowGenericFramework {
875874
"npt_v0_Lambda_sig", "npt_v0_Lambda_sb1", "npt_v0_Lambda_sb2"}) {
876875
const std::string source{name};
877876
const bool resonance = source.find("_K0") != std::string::npos || source.find("_Lambda") != std::string::npos;
878-
if (resonance ? !cfgAnalysisChannels.cfgAnalyseK0Lambda : !cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
877+
if (resonance ? !cfgFill.cfgAnalyseK0Lambda : !cfgFill.cfgAnalyseChargedHadrons) {
879878
continue;
880879
}
881880
const std::string target = source + (source.rfind("npt_v02_", 0) == 0 ? "_w3pc" : "_w2pc");
@@ -896,7 +895,7 @@ struct FlowGenericFramework {
896895
histosNpt[setup][KaonID] = std::make_unique<TH1D>(Form("npt%sKa", setupName), "; #it{p}_{T} (GeV/#it{c}; Count)", ptAxis.binEdges.size() - 1, ptAxis.binEdges.data());
897896
histosNpt[setup][ProtonID] = std::make_unique<TH1D>(Form("npt%sPr", setupName), "; #it{p}_{T} (GeV/#it{c}; Count)", ptAxis.binEdges.size() - 1, ptAxis.binEdges.data());
898897

899-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
898+
if (cfgFill.cfgAnalyseK0Lambda) {
900899
histosResoNpt[setup].resize(ResonanceCount);
901900
histosResoNpt[setup][K0Sideband1] = std::make_unique<TH1D>(Form("npt%sK0SB1", setupName), "; #it{p}_{T} (GeV/#it{c}; Count", ptAxis.binEdges.size() - 1, ptAxis.binEdges.data());
902901
histosResoNpt[setup][K0Signal] = std::make_unique<TH1D>(Form("npt%sK0Sig", setupName), "; #it{p}_{T} (GeV/#it{c}; Count", ptAxis.binEdges.size() - 1, ptAxis.binEdges.data());
@@ -946,16 +945,16 @@ struct FlowGenericFramework {
946945
fGFW->CreateRegions();
947946
auto oba = new TObjArray();
948947
addConfigObjectsToObjArray(oba, corrconfigs, 0, corrconfigs.size());
949-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
948+
if (cfgFill.cfgAnalyseChargedHadrons) {
950949
addConfigObjectsToObjArray(oba, corrconfigsV02, 0, std::min<size_t>(SpeciesCount, corrconfigsV02.size()));
951950
}
952-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
951+
if (cfgFill.cfgAnalyseK0Lambda) {
953952
addConfigObjectsToObjArray(oba, corrconfigsV02, std::min<size_t>(SpeciesCount, corrconfigsV02.size()), corrconfigsV02.size());
954953
}
955-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
954+
if (cfgFill.cfgAnalyseChargedHadrons) {
956955
addConfigObjectsToObjArray(oba, corrconfigsV0, 0, std::min<size_t>(SpeciesCount, corrconfigsV0.size()));
957956
}
958-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
957+
if (cfgFill.cfgAnalyseK0Lambda) {
959958
addConfigObjectsToObjArray(oba, corrconfigsV0, std::min<size_t>(SpeciesCount, corrconfigsV0.size()), corrconfigsV0.size());
960959
}
961960

@@ -971,7 +970,7 @@ struct FlowGenericFramework {
971970
fFCpt->initialise(multAxis, cfgMpar, gfwMemberCache.configs, cfgNbootstrap);
972971
if (cfgEventWeight.cfgStoreCombinedFractionWeights) {
973972
for (const auto& name : {"mpt1_w2pc_ch", "mpt1_w2pc_pi", "mpt1_w2pc_ka", "mpt1_w2pc_pr"}) {
974-
if (!cfgAnalysisChannels.cfgAnalyseChargedHadrons && std::string_view{name} != "mpt1_w2pc_ch") {
973+
if (!cfgFill.cfgAnalyseChargedHadrons && std::string_view{name} != "mpt1_w2pc_ch") {
975974
continue;
976975
}
977976
if (!fFCpt->addPtProfile(name, 1)) {
@@ -993,7 +992,7 @@ struct FlowGenericFramework {
993992
fFCptGen->initialise(multAxis, cfgMpar, gfwMemberCache.configs, cfgNbootstrap);
994993
if (cfgEventWeight.cfgStoreCombinedFractionWeights) {
995994
for (const auto& name : {"mpt1_w2pc_ch", "mpt1_w2pc_pi", "mpt1_w2pc_ka", "mpt1_w2pc_pr"}) {
996-
if (!cfgAnalysisChannels.cfgAnalyseChargedHadrons && std::string_view{name} != "mpt1_w2pc_ch") {
995+
if (!cfgFill.cfgAnalyseChargedHadrons && std::string_view{name} != "mpt1_w2pc_ch") {
997996
continue;
998997
}
999998
if (!fFCptGen->addPtProfile(name, 1)) {
@@ -1661,7 +1660,7 @@ struct FlowGenericFramework {
16611660
void fillCombinedFractionProfile(FractionSetup setup, int index, bool resonance, double pt, double centmult, double fraction, double weight)
16621661
{
16631662
if (!cfgEventWeight.cfgStoreCombinedFractionWeights || weight <= 0. ||
1664-
(resonance ? !cfgAnalysisChannels.cfgAnalyseK0Lambda : !cfgAnalysisChannels.cfgAnalyseChargedHadrons)) {
1663+
(resonance ? !cfgFill.cfgAnalyseK0Lambda : !cfgFill.cfgAnalyseChargedHadrons)) {
16651664
return;
16661665
}
16671666
if (setup == FractionV02) {
@@ -1746,7 +1745,7 @@ struct FlowGenericFramework {
17461745
template <DataType dt>
17471746
void fillNptRegistry(FractionSetup setup, const float& centmult, const NptHistos& nptHistos, const NptDenominators& dns)
17481747
{
1749-
if (!cfgAnalysisChannels.cfgAnalyseChargedHadrons || dns[ChargedID] <= 0) {
1748+
if (!cfgFill.cfgAnalyseChargedHadrons || dns[ChargedID] <= 0) {
17501749
return;
17511750
}
17521751

@@ -1865,18 +1864,18 @@ struct FlowGenericFramework {
18651864
if (cfgEventWeight.cfgStoreCombinedFractionWeights && flowPtContainer->corrDen[1] > 0.) {
18661865
constexpr std::array<const char*, SpeciesCount> ProfileNames = {"mpt1_w2pc_ch", "mpt1_w2pc_pi", "mpt1_w2pc_ka", "mpt1_w2pc_pr"};
18671866
for (int species = 0; species < SpeciesCount; ++species) {
1868-
if (species != ChargedID && !cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
1867+
if (species != ChargedID && !cfgFill.cfgAnalyseChargedHadrons) {
18691868
continue;
18701869
}
18711870
flowPtContainer->fillPtProfile(ProfileNames[species], 1, centmult, flowPtContainer->corrDen[1] * dnsV0[species], rndm);
18721871
}
18731872
}
18741873

1875-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons && corrconfigsV02.size() < SpeciesCount) {
1874+
if (cfgFill.cfgAnalyseChargedHadrons && corrconfigsV02.size() < SpeciesCount) {
18761875
return;
18771876
}
18781877

1879-
if (cfgAnalysisChannels.cfgAnalyseChargedHadrons && dnsV02[ChargedID] > 0) {
1878+
if (cfgFill.cfgAnalyseChargedHadrons && dnsV02[ChargedID] > 0) {
18801879
for (uint l_ind = 0; l_ind < SpeciesCount; ++l_ind) {
18811880
for (int i = 1; i <= fPtAxis->GetNbins(); i++) {
18821881
auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real();
@@ -1895,7 +1894,7 @@ struct FlowGenericFramework {
18951894
}
18961895
}
18971896

1898-
if (!cfgAnalysisChannels.cfgAnalyseChargedHadrons) {
1897+
if (!cfgFill.cfgAnalyseChargedHadrons) {
18991898
return;
19001899
}
19011900
if (corrconfigsV0.size() < SpeciesCount) {
@@ -1928,7 +1927,7 @@ struct FlowGenericFramework {
19281927
template <DataType dt>
19291928
void fillResonanceOutput(FractionSetup setup, const float& centmult, const double& rndm)
19301929
{
1931-
if (!cfgAnalysisChannels.cfgAnalyseK0Lambda) {
1930+
if (!cfgFill.cfgAnalyseK0Lambda) {
19321931
return;
19331932
}
19341933
auto& flowContainer = (dt == Gen) ? fFCgen : fFC;
@@ -2180,7 +2179,7 @@ struct FlowGenericFramework {
21802179

21812180
fillOutputContainers<dt>((cfgUseNch) ? multiplicity : centrality, lRandom);
21822181

2183-
if (cfgAnalysisChannels.cfgAnalyseK0Lambda) {
2182+
if (cfgFill.cfgAnalyseK0Lambda) {
21842183
// Reset fraction histograms per event
21852184
for (const auto& vec : histosResoNpt) {
21862185
for (const auto& h : vec) {

0 commit comments

Comments
 (0)