Skip to content

Commit 58c2424

Browse files
committed
modify the usage of pt-pt corr since FlowPtContainer was changed
1 parent 6cf398f commit 58c2424

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ using namespace o2::framework;
5757
using namespace o2::framework::expressions;
5858

5959
#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
60+
static constexpr double LongArrayDouble[4][2] = {{-2.0, -2.0}, {-2.0, -2.0}, {-2.0, -2.0}, {-2.0, -2.0}};
6061

6162
struct FlowTask {
6263

@@ -73,8 +74,7 @@ struct FlowTask {
7374
O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 10.0f, "Maximal pT for all tracks")
7475
O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks")
7576
O2_DEFINE_CONFIGURABLE(cfgEtaPtPt, float, 0.4, "eta range for pt-pt correlations")
76-
O2_DEFINE_CONFIGURABLE(cfgEtaSubPtPt, float, 0.8, "eta range for subevent pt-pt correlations")
77-
O2_DEFINE_CONFIGURABLE(cfgEtaGapPtPt, float, 0.2, "eta gap for pt-pt correlations, cfgEtaGapPtPt<|eta|<cfgEtaSubPtPt")
77+
Configurable<LabeledArray<double>> cfgPtPtGaps{"cfgPtPtGaps", {LongArrayDouble[0], 4, 2, {"subevent 1", "subevent 2", "subevent 3", "subevent 4"}, {"etamin", "etamax"}}, "{etamin,etamax} for all ptpt-subevents"};
7878
O2_DEFINE_CONFIGURABLE(cfgEtaGapPtPtEnabled, bool, false, "switch of subevent pt-pt correlations")
7979
O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5f, "max chi2 per TPC clusters")
8080
O2_DEFINE_CONFIGURABLE(cfgCutTPCclu, float, 50.0f, "minimum TPC clusters")
@@ -219,6 +219,7 @@ struct FlowTask {
219219
std::vector<GFW::CorrConfig> corrconfigsPtVn;
220220
TAxis* fPtAxis;
221221
TRandom3* fRndm = new TRandom3(0);
222+
std::vector<std::pair<double, double>> etagapsPtPt;
222223
std::vector<std::vector<std::shared_ptr<TProfile>>> bootstrapArray;
223224
int lastRunNumber = -1;
224225
std::vector<int> runNumbers;
@@ -553,8 +554,17 @@ struct FlowTask {
553554
fFCpt->setUseCentralMoments(cfgUseCentralMoments);
554555
fFCpt->setUseGapMethod(true);
555556
fFCpt->initialise(axisIndependent, cfgMpar, gfwConfigs, cfgNbootstrap);
556-
if (cfgEtaGapPtPtEnabled)
557-
fFCpt->initialiseSubevent(axisIndependent, cfgMpar, cfgNbootstrap);
557+
if (cfgEtaGapPtPtEnabled) {
558+
for (int i = 0; i < 4; ++i) { // o2-linter: disable=magic-number (maximum of 4 subevents)
559+
if (cfgPtPtGaps->getData()[i][0] < -1. || cfgPtPtGaps->getData()[i][1] < -1.)
560+
continue;
561+
etagapsPtPt.push_back(std::make_pair(cfgPtPtGaps->getData()[i][0], cfgPtPtGaps->getData()[i][1]));
562+
}
563+
for (const auto& [etamin, etamax] : etagapsPtPt) {
564+
LOGF(info, "pt-pt subevent: {%.1f,%.1f}", etamin, etamax);
565+
}
566+
fFCpt->initialiseSubevent(axisIndependent, cfgMpar, etagapsPtPt.size(), cfgNbootstrap);
567+
}
558568
for (auto i = 0; i < gfwConfigs.GetSize(); ++i) {
559569
corrconfigsPtVn.push_back(fGFW->GetCorrelatorConfig(gfwConfigs.GetCorrs()[i], gfwConfigs.GetHeads()[i], gfwConfigs.GetpTDifs()[i]));
560570
}
@@ -563,7 +573,7 @@ struct FlowTask {
563573
fFCptgen->setUseGapMethod(true);
564574
fFCptgen->initialise(axisIndependent, cfgMpar, gfwConfigs, cfgNbootstrap);
565575
if (cfgEtaGapPtPtEnabled)
566-
fFCptgen->initialiseSubevent(axisIndependent, cfgMpar, cfgNbootstrap);
576+
fFCptgen->initialiseSubevent(axisIndependent, cfgMpar, etagapsPtPt.size(), cfgNbootstrap);
567577
}
568578
fGFW->CreateRegions();
569579

@@ -703,14 +713,13 @@ struct FlowTask {
703713
if (std::abs(track.eta()) < cfgEtaPtPt) {
704714
(dt == kGen) ? fFCptgen->fill(1., track.pt()) : fFCpt->fill(weff, track.pt());
705715
}
706-
if (std::abs(track.eta()) < cfgEtaSubPtPt) {
707-
if (cfgEtaGapPtPtEnabled) {
708-
if (track.eta() < -1. * cfgEtaGapPtPt) {
709-
(dt == kGen) ? fFCptgen->fillSub1(1., track.pt()) : fFCpt->fillSub1(weff, track.pt());
710-
}
711-
if (track.eta() > cfgEtaGapPtPt) {
712-
(dt == kGen) ? fFCptgen->fillSub2(1., track.pt()) : fFCpt->fillSub2(weff, track.pt());
716+
std::size_t index = 0;
717+
if (cfgEtaGapPtPtEnabled) {
718+
for (const auto& [etamin, etamax] : etagapsPtPt) {
719+
if (etamin < track.eta() && track.eta() < etamax) {
720+
(dt == kGen) ? fFCptgen->fillSub(1., track.pt(), index) : fFCpt->fillSub(weff, track.pt(), index);
713721
}
722+
++index;
714723
}
715724
}
716725
}

0 commit comments

Comments
 (0)