Skip to content

Commit 8ae3d18

Browse files
authored
[PWGCF] add MC mean pt (#14192)
1 parent b720195 commit 8ae3d18

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ struct FlowTask {
242242
};
243243
enum BootstrapHist {
244244
kMeanPtWithinGap08 = 0,
245+
kMeanPtWithinGap08_MC,
245246
kCount_BootstrapHist
246247
};
247248
int mRunNumber{-1};
@@ -359,6 +360,10 @@ struct FlowTask {
359360
registry.add("MCGen/MChPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}});
360361
registry.add("MCGen/MChEta", "#eta distribution", {HistType::kTH1D, {axisEta}});
361362
registry.add("MCGen/MChPtRef", "p_{T} distribution after cut", {HistType::kTH1D, {axisPtHist}});
363+
registry.add("hMeanPtWithinGap08_MC", "mean p_{T}", {HistType::kTProfile, {axisIndependent}});
364+
for (auto i = 0; i < cfgNbootstrap; i++) {
365+
bootstrapArray[i][kMeanPtWithinGap08_MC] = registry.add<TProfile>(Form("BootstrapContainer_%d/hMeanPtWithinGap08_MC", i), "", {HistType::kTProfile, {axisIndependent}});
366+
}
362367
}
363368

364369
o2::framework::AxisSpec axis = axisPt;
@@ -1248,16 +1253,23 @@ struct FlowTask {
12481253
fGFW->Clear();
12491254
fFCptgen->clearVector();
12501255

1256+
double ptSum_Gap08 = 0.;
1257+
double count_Gap08 = 0.;
12511258
for (const auto& mcParticle : mcParticles) {
12521259
if (!mcParticle.isPhysicalPrimary())
12531260
continue;
12541261
bool withinPtPOI = (cfgCutPtPOIMin < mcParticle.pt()) && (mcParticle.pt() < cfgCutPtPOIMax); // within POI pT range
12551262
bool withinPtRef = (cfgCutPtRefMin < mcParticle.pt()) && (mcParticle.pt() < cfgCutPtRefMax); // within RF pT range
1263+
bool withinEtaGap08 = (std::abs(mcParticle.eta()) < cfgEtaPtPt);
12561264

12571265
if (withinPtRef) {
12581266
registry.fill(HIST("MCGen/MChPhi"), mcParticle.phi());
12591267
registry.fill(HIST("MCGen/MChEta"), mcParticle.eta());
12601268
registry.fill(HIST("MCGen/MChPtRef"), mcParticle.pt());
1269+
if (withinEtaGap08) {
1270+
ptSum_Gap08 += mcParticle.pt();
1271+
count_Gap08 += 1.;
1272+
}
12611273
}
12621274
if (withinPtRef)
12631275
fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 1);
@@ -1271,6 +1283,12 @@ struct FlowTask {
12711283
fillPtSums<kGen>(mcParticle, 1.);
12721284
}
12731285

1286+
if (count_Gap08 > 0)
1287+
registry.fill(HIST("hMeanPtWithinGap08_MC"), independent, ptSum_Gap08 / count_Gap08, 1.0);
1288+
int sampleIndex = static_cast<int>(cfgNbootstrap * lRandom);
1289+
if (count_Gap08 > 0)
1290+
bootstrapArray[sampleIndex][kMeanPtWithinGap08_MC]->Fill(independent, ptSum_Gap08 / count_Gap08, 1.0);
1291+
12741292
// Filling Flow Container
12751293
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {
12761294
fillFC<kGen>(corrconfigs.at(l_ind), independent, lRandom);

0 commit comments

Comments
 (0)