Skip to content

Commit 7eff1a0

Browse files
committed
reduce number of task members
1 parent 02f83b9 commit 7eff1a0

1 file changed

Lines changed: 51 additions & 46 deletions

File tree

‎PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationsMpi.cxx‎

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,30 @@ struct TwoParticleCorrelationsMpi {
116116
Configurable<bool> cfgDropStepRECO{"cfgDropStepRECO", false, "choice to drop step RECO if efficiency correction is used"};
117117
Configurable<int> cfgCentBinsForMC{"cfgCentBinsForMC", 0, "0 = generated multiplicity; 1 = reconstructed multiplicity and all associated collisions"};
118118
} cfgGeneral;
119+
struct : ConfigurableGroup {
120+
Configurable<float> dcaxymax{"dcaxymax", 999.f, "maximum dcaxy of tracks"};
121+
Configurable<float> dcazmax{"dcazmax", 999.f, "maximum dcaz of tracks"};
122+
Configurable<bool> enablePtDepDCAxy{"enablePtDepDCAxy", false, "Enable pT-dependent DCAxy cut: |DCAxy| < a + b/pT"};
123+
Configurable<float> dcaXyConst{"dcaXyConst", 0.004f, "Constant term 'a' for pT-dependent DCAxy cut: |DCAxy| < a + b/pT (cm)"};
124+
Configurable<float> dcaXySlope{"dcaXySlope", 0.013f, "Slope term 'b' for pT-dependent DCAxy cut: |DCAxy| < a + b/pT (cm x GeV/c)"};
125+
} cfgDCA;
119126
Configurable<uint16_t> cfgTrackBitMask{"cfgTrackBitMask", 0, "BitMask for track selection systematics; refer to the enum TrackSelectionCuts in filtering task"};
120-
Configurable<float> dcaxymax{"dcaxymax", 999.f, "maximum dcaxy of tracks"};
121-
Configurable<float> dcazmax{"dcazmax", 999.f, "maximum dcaz of tracks"};
122-
Configurable<bool> enablePtDepDCAxy{"enablePtDepDCAxy", false, "Enable pT-dependent DCAxy cut: |DCAxy| < a + b/pT"};
123-
Configurable<float> dcaXyConst{"dcaXyConst", 0.004f, "Constant term 'a' for pT-dependent DCAxy cut: |DCAxy| < a + b/pT (cm)"};
124-
Configurable<float> dcaXySlope{"dcaXySlope", 0.013f, "Slope term 'b' for pT-dependent DCAxy cut: |DCAxy| < a + b/pT (cm x GeV/c)"};
125127
Configurable<uint16_t> cfgMultCorrelationsMask{"cfgMultCorrelationsMask", 0, "Selection bitmask for the multiplicity correlations. This should match the filter selection cfgEstimatorBitMask."};
126128
Configurable<std::string> cfgMultCutFormula{"cfgMultCutFormula", "", "Multiplicity correlations cut formula. A result greater than zero results in accepted event. Parameters: [cFT0C] FT0C centrality, [mFV0A] V0A multiplicity, [mGlob] global track multiplicity, [mPV] PV track multiplicity, [cFT0M] FT0M centrality"};
127129

128130
// Suggested values: Photon: 0.004; K0 and Lambda: 0.005
129131
Configurable<LabeledArray<float>> cfgPairCut{"cfgPairCut", {CfgPairCutDefaults.front().data(), 5, {"Photon", "K0", "Lambda", "Phi", "Rho"}}, "Pair cuts on various particles"};
130132

131-
Configurable<std::string> cfgEfficiencyTrigger{"cfgEfficiencyTrigger", "", "CCDB path to efficiency object for trigger particles"};
132-
Configurable<std::string> cfgEfficiencyAssociated{"cfgEfficiencyAssociated", "", "CCDB path to efficiency object for associated particles"};
133-
Configurable<std::string> cfgAcceptance{"cfgAcceptance", "", "CCDB path to the GFW acceptance object"};
134-
Configurable<bool> cfgFillAcceptanceWeights{"cfgFillAcceptanceWeights", false, "Fill acceptance maps instead of physics outputs"};
135-
Configurable<bool> cfgAcceptanceRunByRun{"cfgAcceptanceRunByRun", false, "Fill or load run-by-run acceptance weights"};
136-
Configurable<int> cfgAcceptancePhiBins{"cfgAcceptancePhiBins", int{DefaultAcceptancePhiBins}, "Number of phi bins in acceptance maps"};
137-
Configurable<int> cfgAcceptanceEtaBins{"cfgAcceptanceEtaBins", int{DefaultAcceptanceEtaBins}, "Number of eta bins in acceptance maps"};
133+
struct : ConfigurableGroup {
134+
Configurable<std::string> cfgEfficiencyTrigger{"cfgEfficiencyTrigger", "", "CCDB path to efficiency object for trigger particles"};
135+
Configurable<std::string> cfgEfficiencyAssociated{"cfgEfficiencyAssociated", "", "CCDB path to efficiency object for associated particles"};
136+
Configurable<std::string> cfgAcceptance{"cfgAcceptance", "", "CCDB path to the GFW acceptance object"};
137+
Configurable<bool> cfgFillAcceptanceWeights{"cfgFillAcceptanceWeights", false, "Fill acceptance maps instead of physics outputs"};
138+
Configurable<bool> cfgAcceptanceRunByRun{"cfgAcceptanceRunByRun", false, "Fill or load run-by-run acceptance weights"};
139+
Configurable<int> cfgAcceptancePhiBins{"cfgAcceptancePhiBins", int{DefaultAcceptancePhiBins}, "Number of phi bins in acceptance maps"};
140+
Configurable<int> cfgAcceptanceEtaBins{"cfgAcceptanceEtaBins", int{DefaultAcceptanceEtaBins}, "Number of eta bins in acceptance maps"};
141+
} cfgCorrections;
142+
138143
Configurable<std::string> cfgNuncSeedsTemplateFile{"cfgNuncSeedsTemplateFile", "", "Local ROOT file containing ensembleYieldTemplates"};
139144
Configurable<std::string> cfgNuncSeedsTemplate{"cfgNuncSeedsTemplate", "", "CCDB path to the ensemble-yield template ccdb_object"};
140145
Configurable<float> cfgMinPairAcceptance{"cfgMinPairAcceptance", 0.05f, "Minimum pair acceptance used by the event seed estimator"};
@@ -188,10 +193,10 @@ struct TwoParticleCorrelationsMpi {
188193

189194
// Track filters
190195
Filter trackFilter = (nabs(aod::track::eta) < cfgGeneral.cfgCutEta) && (aod::track::pt > cfgGeneral.cfgCutPt) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) &&
191-
(nabs(aod::track::dcaZ) < dcazmax) &&
192-
ifnode(enablePtDepDCAxy.node() == true,
193-
nabs(aod::track::dcaXY) < (dcaXyConst + dcaXySlope / aod::track::pt),
194-
nabs(aod::track::dcaXY) < dcaxymax);
196+
(nabs(aod::track::dcaZ) < cfgDCA.dcazmax) &&
197+
ifnode(cfgDCA.enablePtDepDCAxy.node() == true,
198+
nabs(aod::track::dcaXY) < (cfgDCA.dcaXyConst + cfgDCA.dcaXySlope / aod::track::pt),
199+
nabs(aod::track::dcaXY) < cfgDCA.dcaxymax);
195200
Filter cfTrackFilter = (nabs(aod::cftrack::eta) < cfgGeneral.cfgCutEta) && (aod::cftrack::pt > cfgGeneral.cfgCutPt) && ncheckbit(aod::track::trackType, as<uint8_t>(cfgTrackBitMask));
196201

197202
// MC filters
@@ -370,16 +375,16 @@ struct TwoParticleCorrelationsMpi {
370375
(!(doprocessSameGenMC || doprocessMCSameDerived) ||
371376
doprocessSameAOD || enabledDerivedSameProcesses > 0 ||
372377
doprocessMixedAOD || enabledDerivedMixedProcesses > 0 || doprocessMCMixedDerived ||
373-
cfgGeneral.cfgCentBinsForMC != 0 || cfgFillAcceptanceWeights)) {
378+
cfgGeneral.cfgCentBinsForMC != 0 || cfgCorrections.cfgFillAcceptanceWeights)) {
374379
LOGF(fatal, "cfgUserAxis=3 supports generated MC same events only: enable processSameGenMC or processMCSameDerived and disable all other same/mixed processes");
375380
}
376-
if (cfgFillAcceptanceWeights && !cfgAcceptance.value.empty()) {
381+
if (cfgCorrections.cfgFillAcceptanceWeights && !cfgCorrections.cfgAcceptance.value.empty()) {
377382
LOGF(fatal, "cfgFillAcceptanceWeights and cfgAcceptance are mutually exclusive: produce and apply acceptance weights in separate jobs");
378383
}
379-
if (cfgFillAcceptanceWeights && !(doprocessSameDerived || doprocessSameDerivedCorrected || doprocessSameDerivedMultSet || doprocessSame DerivedMultSetCorrected || doprocessMCSameDerived)) {
384+
if (cfgCorrections.cfgFillAcceptanceWeights && !(doprocessSameDerived || doprocessSameDerivedCorrected || doprocessSameDerivedMultSet || doprocessSameDerivedMultSetCorrected || doprocessMCSameDerived)) {
380385
LOGF(fatal, "cfgFillAcceptanceWeights requires a reconstructed derived same-event process");
381386
}
382-
if (cfgAcceptancePhiBins < 1 || cfgAcceptanceEtaBins < 1) {
387+
if (cfgCorrections.cfgAcceptancePhiBins < 1 || cfgCorrections.cfgAcceptanceEtaBins < 1) {
383388
LOGF(fatal, "Acceptance-map bin counts must be positive");
384389
}
385390
if (!cfgNuncSeedsTemplateFile.value.empty() && !cfgNuncSeedsTemplate.value.empty()) {
@@ -540,9 +545,9 @@ struct TwoParticleCorrelationsMpi {
540545
registry.add("eventcount_mixed", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}});
541546
registry.add("trackcount_same", "bin", {HistType::kTH2F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}, {10, -0.5, 9.5}}});
542547
registry.add("trackcount_mixed", "bin", {HistType::kTH3F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}, {10, -0.5, 9.5}, {10, -0.5, 9.5}}});
543-
if (cfgFillAcceptanceWeights && !cfgAcceptanceRunByRun) {
544-
AxisSpec phiAxis{cfgAcceptancePhiBins, 0., o2::constants::math::TwoPI, "#varphi"};
545-
AxisSpec etaAxis{cfgAcceptanceEtaBins, -cfgGeneral.cfgCutEta.value, cfgGeneral.cfgCutEta.value, "#eta"};
548+
if (cfgCorrections.cfgFillAcceptanceWeights && !cfgCorrections.cfgAcceptanceRunByRun) {
549+
AxisSpec phiAxis{cfgCorrections.cfgAcceptancePhiBins, 0., o2::constants::math::TwoPI, "#varphi"};
550+
AxisSpec etaAxis{cfgCorrections.cfgAcceptanceEtaBins, -cfgGeneral.cfgCutEta.value, cfgGeneral.cfgCutEta.value, "#eta"};
546551
mAcceptanceWeights = registry.add<TH3>("phi_eta_vtxz_ref", "Reference-track acceptance;#varphi;#eta;z_{vtx} (cm)", {HistType::kTH3D, {phiAxis, etaAxis, axisVertex}});
547552
}
548553

@@ -615,7 +620,7 @@ struct TwoParticleCorrelationsMpi {
615620
same->setTrackEtaCut(cfgGeneral.cfgCutEta);
616621
mixed->setTrackEtaCut(cfgGeneral.cfgCutEta);
617622

618-
if (!cfgEfficiencyAssociated.value.empty()) {
623+
if (!cfgCorrections.cfgEfficiencyAssociated.value.empty()) {
619624
efficiencyAssociatedCache.reserve(512);
620625
}
621626

@@ -664,7 +669,7 @@ struct TwoParticleCorrelationsMpi {
664669
++nPtPtSubevents;
665670
}
666671

667-
if (!cfgFillAcceptanceWeights && (doprocessMCSameDerived || doprocessSameDerived || doprocessSameDerivedCorrected || doprocessSameDerivedMultSet || doprocessSameDerivedMultSetCorrected)) {
672+
if (!cfgCorrections.cfgFillAcceptanceWeights && (doprocessMCSameDerived || doprocessSameDerived || doprocessSameDerivedCorrected || doprocessSameDerivedMultSet || doprocessSameDerivedMultSetCorrected)) {
668673
auto recoProfiles = std::make_unique<TObjArray>();
669674
addConfigObjectsToObjArray(recoProfiles.get(), mCorrConfigs, cfgUserAxis == EventSeedAxis && eventClassifierPercentileAxisEnabled);
670675
fFC.setObject(new FlowContainer("FlowContainer"));
@@ -678,7 +683,7 @@ struct TwoParticleCorrelationsMpi {
678683
fFCpt->initialise(axisMultiplicity, MaxPtCorrelationOrder, cfgCorrConfig.value, FlowNBootstrap);
679684
fFCpt->initialiseSubevent(axisMultiplicity, MaxPtCorrelationOrder, nPtPtSubevents, FlowNBootstrap);
680685
}
681-
if (!cfgFillAcceptanceWeights && (doprocessMCSameDerived || doprocessSameGenMC)) {
686+
if (!cfgCorrections.cfgFillAcceptanceWeights && (doprocessMCSameDerived || doprocessSameGenMC)) {
682687
auto generatedProfiles = std::make_unique<TObjArray>();
683688
addConfigObjectsToObjArray(generatedProfiles.get(), mCorrConfigs, cfgUserAxis == NMPIAxis && eventClassifierPercentileAxisEnabled);
684689
fFCGen.setObject(new FlowContainer("FlowContainer_gen"));
@@ -871,8 +876,8 @@ struct TwoParticleCorrelationsMpi {
871876
return existing->second;
872877
}
873878

874-
AxisSpec phiAxis{cfgAcceptancePhiBins, 0., o2::constants::math::TwoPI, "#varphi"};
875-
AxisSpec etaAxis{cfgAcceptanceEtaBins, -cfgGeneral.cfgCutEta.value, cfgGeneral.cfgCutEta.value, "#eta"};
879+
AxisSpec phiAxis{cfgCorrections.cfgAcceptancePhiBins, 0., o2::constants::math::TwoPI, "#varphi"};
880+
AxisSpec etaAxis{cfgCorrections.cfgAcceptanceEtaBins, -cfgGeneral.cfgCutEta.value, cfgGeneral.cfgCutEta.value, "#eta"};
876881
const std::string histogramName = Form("%d/phi_eta_vtxz_ref", runNumber);
877882
const auto histogram = registry.add<TH3>(histogramName.c_str(), "Reference-track acceptance;#varphi;#eta;z_{vtx} (cm)", {HistType::kTH3D, {phiAxis, etaAxis, axisVertex}});
878883
mAcceptanceWeightsByRun.emplace(runNumber, histogram);
@@ -885,7 +890,7 @@ struct TwoParticleCorrelationsMpi {
885890
if (track.pt() <= fPtAxis->GetXmin() || track.pt() >= fPtAxis->GetXmax()) {
886891
return;
887892
}
888-
const auto histogram = cfgAcceptanceRunByRun ? getAcceptanceWeightsForRun(runNumber) : mAcceptanceWeights;
893+
const auto histogram = cfgCorrections.cfgAcceptanceRunByRun ? getAcceptanceWeightsForRun(runNumber) : mAcceptanceWeights;
889894
histogram->Fill(track.phi(), track.eta(), posZ);
890895
}
891896

@@ -1992,46 +1997,46 @@ struct TwoParticleCorrelationsMpi {
19921997
if (cfg.efficiencyLoaded) {
19931998
return;
19941999
}
1995-
if (!cfgEfficiencyTrigger.value.empty()) {
2000+
if (!cfgCorrections.cfgEfficiencyTrigger.value.empty()) {
19962001
if (cfgGeneral.cfgLocalEfficiency > 0) {
1997-
TFile* fEfficiencyTrigger = TFile::Open(cfgEfficiencyTrigger.value.c_str(), "READ");
2002+
TFile* fEfficiencyTrigger = TFile::Open(cfgCorrections.cfgEfficiencyTrigger.value.c_str(), "READ");
19982003
cfg.mEfficiencyTrigger = dynamic_cast<THn*>(fEfficiencyTrigger->Get("ccdb_object"));
19992004
} else {
2000-
cfg.mEfficiencyTrigger = ccdb->getForTimeStamp<THnT<float>>(cfgEfficiencyTrigger, timestamp);
2005+
cfg.mEfficiencyTrigger = ccdb->getForTimeStamp<THnT<float>>(cfgCorrections.cfgEfficiencyTrigger, timestamp);
20012006
}
20022007
if (cfg.mEfficiencyTrigger == nullptr) {
2003-
LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgEfficiencyTrigger.value.c_str());
2008+
LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgCorrections.cfgEfficiencyTrigger.value.c_str());
20042009
}
2005-
LOGF(info, "Loaded efficiency histogram for trigger particles from %s", cfgEfficiencyTrigger.value.c_str());
2010+
LOGF(info, "Loaded efficiency histogram for trigger particles from %s", cfgCorrections.cfgEfficiencyTrigger.value.c_str());
20062011
}
2007-
if (!cfgEfficiencyAssociated.value.empty()) {
2012+
if (!cfgCorrections.cfgEfficiencyAssociated.value.empty()) {
20082013
if (cfgGeneral.cfgLocalEfficiency > 0) {
2009-
TFile* fEfficiencyAssociated = TFile::Open(cfgEfficiencyAssociated.value.c_str(), "READ");
2014+
TFile* fEfficiencyAssociated = TFile::Open(cfgCorrections.cfgEfficiencyAssociated.value.c_str(), "READ");
20102015
cfg.mEfficiencyAssociated = dynamic_cast<THn*>(fEfficiencyAssociated->Get("ccdb_object"));
20112016
} else {
2012-
cfg.mEfficiencyAssociated = ccdb->getForTimeStamp<THnT<float>>(cfgEfficiencyAssociated, timestamp);
2017+
cfg.mEfficiencyAssociated = ccdb->getForTimeStamp<THnT<float>>(cfgCorrections.cfgEfficiencyAssociated, timestamp);
20132018
}
20142019
if (cfg.mEfficiencyAssociated == nullptr) {
2015-
LOGF(fatal, "Could not load efficiency histogram for associated particles from %s", cfgEfficiencyAssociated.value.c_str());
2020+
LOGF(fatal, "Could not load efficiency histogram for associated particles from %s", cfgCorrections.cfgEfficiencyAssociated.value.c_str());
20162021
}
2017-
LOGF(info, "Loaded efficiency histogram for associated particles from %s", cfgEfficiencyAssociated.value.c_str());
2022+
LOGF(info, "Loaded efficiency histogram for associated particles from %s", cfgCorrections.cfgEfficiencyAssociated.value.c_str());
20182023
}
20192024
cfg.efficiencyLoaded = true;
20202025
}
20212026

20222027
void loadAcceptance(const uint64_t timestamp, const int runNumber)
20232028
{
2024-
if (cfgFillAcceptanceWeights || cfgAcceptance.value.empty()) {
2029+
if (cfgCorrections.cfgFillAcceptanceWeights || cfgCorrections.cfgAcceptance.value.empty()) {
20252030
cfg.mAcceptance = nullptr;
20262031
cfg.acceptanceLoaded = true;
20272032
return;
20282033
}
2029-
if (cfg.acceptanceLoaded && (!cfgAcceptanceRunByRun || cfg.acceptanceRunNumber == runNumber)) {
2034+
if (cfg.acceptanceLoaded && (!cfgCorrections.cfgAcceptanceRunByRun || cfg.acceptanceRunNumber == runNumber)) {
20302035
return;
20312036
}
20322037

2033-
std::string path = cfgAcceptance.value;
2034-
if (cfgAcceptanceRunByRun) {
2038+
std::string path = cfgCorrections.cfgAcceptance.value;
2039+
if (cfgCorrections.cfgAcceptanceRunByRun) {
20352040
if (path.back() != '/') {
20362041
path += '/';
20372042
}
@@ -2108,7 +2113,7 @@ struct TwoParticleCorrelationsMpi {
21082113
soa::Filtered<aod::CFMcParticles> const& mcParticles,
21092114
soa::SmallGroups<aod::CFCollisionsWithLabel> const& collisions)
21102115
{
2111-
if (cfgFillAcceptanceWeights) {
2116+
if (cfgCorrections.cfgFillAcceptanceWeights) {
21122117
return;
21132118
}
21142119
if (cfgUserAxis == NMPIAxis && mcCollision.nMPI() < 0) {
@@ -2177,7 +2182,7 @@ struct TwoParticleCorrelationsMpi {
21772182
if (cfgVerbosity > 0) {
21782183
LOGF(info, "processSameDerivedT: Tracks for collision: %d/%d | Vertex: %.1f | Multiplicity/Centrality: %.1f", tracks1.size(), tracks2.size(), collision.posZ(), multiplicity);
21792184
}
2180-
if (cfgFillAcceptanceWeights) {
2185+
if (cfgCorrections.cfgFillAcceptanceWeights) {
21812186
for (const auto& track : tracks2) {
21822187
fillAcceptanceWeights(track, collision.posZ(), collision.runNumber());
21832188
}
@@ -2442,7 +2447,7 @@ struct TwoParticleCorrelationsMpi {
24422447
template <class McCollision, class Particles1, class Particles2>
24432448
void processMCSameDerivedT(McCollision const& mcCollision, Particles1 const& mcParticles1, Particles2 const& mcParticles2, soa::SmallGroups<aod::CFCollisionsWithLabel> const& collisions)
24442449
{
2445-
if (cfgFillAcceptanceWeights) {
2450+
if (cfgCorrections.cfgFillAcceptanceWeights) {
24462451
return;
24472452
}
24482453
if (cfgUserAxis == NMPIAxis && mcCollision.nMPI() < 0) {

0 commit comments

Comments
 (0)