Skip to content

Commit cf24f82

Browse files
authored
[PWGCF] mean-pt implemented (#13860)
1 parent 9a53688 commit cf24f82

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

PWGCF/Flow/Tasks/flowGfwEse.cxx

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ struct FlowGfwEse {
240240
int density;
241241
DensityCorr() : psi2Est(0.), psi3Est(0.), psi4Est(0.), v2(0.), v3(0.), v4(0.), density(0) {}
242242
};
243+
244+
O2_DEFINE_CONFIGURABLE(cfgAnalysisType, bool, true, "true for ese, false for mean-pT");
245+
const std::string shapesel = cfgAnalysisType ? "ese" : "mpt";
243246
static constexpr int EseBins = 100;
244247

245248
// region indices for consistency flag
@@ -367,6 +370,12 @@ struct FlowGfwEse {
367370
int ptbins = o2::analysis::gfwflowese::ptbinning.size() - 1;
368371
fSecondAxis = (cfgTimeDependent) ? new TAxis(timeAxis.binEdges.size() - 1, &(timeAxis.binEdges[0])) : new TAxis(ptbins, &o2::analysis::gfwflowese::ptbinning[0]);
369372

373+
if (doprocessMptq2) {
374+
registry.add("mptcorr/eventcounter", "", HistType::kTH1F, {{3, 0, 3}});
375+
registry.add("mptcorr/h3_cent_q2_meanptperc", ";Centrality;#it{q}_{2};mean-#it{p}_{T}", HistType::kTH3D, {{100, 0, 100}, {100, 0, 100}, {100, 0, 100}});
376+
registry.add("mptcorr/h3_cent_q2_mptvalue", ";Centrality;#it{q}_{2};mean-#it{p}_{T}", HistType::kTH3D, {{100, 0, 100}, {100, 0, 100}, {200, -1, 1}});
377+
}
378+
370379
if (doprocessData) {
371380
registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}});
372381
registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}});
@@ -541,12 +550,12 @@ struct FlowGfwEse {
541550
for (int jese = 0; jese < EseBins; ++jese) {
542551
if (it->pTDif) {
543552
for (int i = 0; i < fSecondAxis->GetNbins(); ++i) {
544-
std::string name = Form("ese_%d_%s_pt_%d", jese, it->Head.c_str(), i + 1);
553+
std::string name = Form("%s_%d_%s_pt_%d", shapesel.c_str(), jese, it->Head.c_str(), i + 1);
545554
std::string title = it->Head + std::string("_ptDiff");
546555
oba->Add(new TNamed(name.c_str(), title.c_str()));
547556
}
548557
} else {
549-
std::string name = Form("ese_%d_%s", jese, it->Head.c_str());
558+
std::string name = Form("%s_%d_%s", shapesel.c_str(), jese, it->Head.c_str());
550559
std::string title = it->Head + std::string("_ese");
551560
oba->Add(new TNamed(name.c_str(), title.c_str()));
552561
}
@@ -773,20 +782,20 @@ struct FlowGfwEse {
773782
}
774783

775784
template <DataType dt>
776-
void fillOutputContainers(const float& centmult, const double& rndm, const int& run = 0, const float& qPerc = -1.0f)
785+
void fillOutputContainers(const float& centmult, const double& rndm, const int& run = 0, const float& fPerc = -1.0f)
777786
{
778787
(dt == kGen) ? fFCptgen->calculateCorrelations() : fFCpt->calculateCorrelations();
779788
(dt == kGen) ? fFCptgen->fillPtProfiles(centmult, rndm) : fFCpt->fillPtProfiles(centmult, rndm);
780789
(dt == kGen) ? fFCptgen->fillCMProfiles(centmult, rndm) : fFCpt->fillCMProfiles(centmult, rndm);
781-
int qPtmp = static_cast<int>(qPerc);
790+
int qPtmp = static_cast<int>(fPerc);
782791
for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) {
783792
if (!corrconfigs.at(l_ind).pTDif) {
784793
auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real();
785794
if (dnx == 0)
786795
continue;
787796
auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx;
788797
if (std::abs(val) < 1) {
789-
(dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("ese_%i_%s", qPtmp, corrconfigs.at(l_ind).Head.c_str()), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
798+
(dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_%i_%s", shapesel.c_str(), qPtmp, corrconfigs.at(l_ind).Head.c_str()), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
790799
(dt == kGen) ? fFCptgen->fillVnPtProfiles(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm, o2::analysis::gfwflowese::configs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm, o2::analysis::gfwflowese::configs.GetpTCorrMasks()[l_ind]);
791800
if (cfgRunByRun && cfgFillFlowRunByRun && dt != kGen && l_ind == 0) {
792801
tpfsList[run][pfCorr22]->Fill(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0);
@@ -800,7 +809,7 @@ struct FlowGfwEse {
800809
continue;
801810
auto val = fGFW->Calculate(corrconfigs.at(l_ind), i - 1, kFALSE).real() / dnx;
802811
if (std::abs(val) < 1)
803-
(dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("ese_%i_%s_pt_%i", qPtmp, corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
812+
(dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_%i_%s_pt_%i", shapesel.c_str(), qPtmp, corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
804813
// (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm);
805814
}
806815
}
@@ -898,11 +907,11 @@ struct FlowGfwEse {
898907
if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in all three subevents)
899908
return;
900909
}
901-
const auto qPerc{collision.qPERCFT0C()};
910+
const auto fPerc = cfgAnalysisType ? collision.qPERCFT0C() : collision.fMEANPTSHAPE();
902911
if (!cfgFillWeights)
903912
fillOutputContainers<dt>((cfgTimeDependent) ? xaxis.time : (cfgUseNch) ? xaxis.multiplicity
904913
: xaxis.centrality,
905-
lRandom, run, qPerc[0]);
914+
lRandom, run, fPerc[0]);
906915
}
907916

908917
bool isStable(int pdg)
@@ -1134,7 +1143,7 @@ struct FlowGfwEse {
11341143
return static_cast<double>(diff) / 3600000.0;
11351144
}
11361145

1137-
void processData(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs, aod::Qvectors, aod::QPercentileFT0Cs>>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks)
1146+
void processData(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs, aod::Qvectors, aod::QPercentileFT0Cs, aod::MeanPtShapes>>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks)
11381147
{
11391148
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
11401149
int run = bc.runNumber();
@@ -1168,8 +1177,8 @@ struct FlowGfwEse {
11681177
if (occupancy < 0 || occupancy > cfgOccupancySelection)
11691178
return;
11701179
}
1171-
const auto qPerc{collision.qPERCFT0C()};
1172-
if (qPerc[0] < 0)
1180+
const auto fPerc = cfgAnalysisType ? collision.qPERCFT0C() : collision.fMEANPTSHAPE();
1181+
if (fPerc[0] < 0)
11731182
return;
11741183
registry.fill(HIST("eventQA/eventSel"), kOccupancy);
11751184
if (cfgRunByRun)
@@ -1190,6 +1199,24 @@ struct FlowGfwEse {
11901199
processCollision<kReco>(collision, tracks, xaxis, run);
11911200
}
11921201
PROCESS_SWITCH(FlowGfwEse, processData, "Process analysis for non-derived data", true);
1202+
1203+
// void processMptq2(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs, aod::Qvectors, aod::QPercentileFT0Cs/*, aod::MeanPtShape*/>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks)
1204+
1205+
void processMptq2(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs, aod::Qvectors, aod::QPercentileFT0Cs, aod::MeanPtShapes, aod::MeanPts>>::iterator const& collision, aod::BCsWithTimestamps const& /*, GFWTracks const& tracks*/)
1206+
{
1207+
float count{0.5};
1208+
registry.fill(HIST("mptcorr/eventcounter"), count++);
1209+
const auto centr = collision.centFT0C();
1210+
const auto qPerc = collision.qPERCFT0C();
1211+
const auto mPt = collision.fMEANPTSHAPE();
1212+
const auto mPtv = collision.fMEANPT();
1213+
if (qPerc[0] < 0 || mPt[0] < 0)
1214+
return;
1215+
registry.fill(HIST("mptcorr/eventcounter"), count++);
1216+
registry.fill(HIST("mptcorr/h3_cent_q2_meanptperc"), centr, qPerc[0], mPt[0]);
1217+
registry.fill(HIST("mptcorr/h3_cent_q2_mptvalue"), centr, qPerc[0], mPtv[0]);
1218+
}
1219+
PROCESS_SWITCH(FlowGfwEse, processMptq2, "Process analysis for mpt-q2 correlation", false);
11931220
};
11941221

11951222
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)