Skip to content

Commit e164201

Browse files
committed
add bootstrap sample for mean pT hist
1 parent 87eb287 commit e164201

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ struct FlowTask {
110110
O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object")
111111
O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode")
112112
O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction")
113+
O2_DEFINE_CONFIGURABLE(cfgUseUnityEventWeightForPt, bool, true, "Use unity event weight for mean pT")
113114
O2_DEFINE_CONFIGURABLE(cfgUseCentralMoments, bool, true, "Use central moments in vn-pt calculations")
114115
O2_DEFINE_CONFIGURABLE(cfgUsePtRef, bool, true, "Use refernce pt range for pt container (if you are checking the spectra, you need to extent it)")
115116
O2_DEFINE_CONFIGURABLE(cfgMpar, int, 4, "Highest order of pt-pt correlations")
@@ -218,6 +219,7 @@ struct FlowTask {
218219
std::vector<GFW::CorrConfig> corrconfigsPtVn;
219220
TAxis* fPtAxis;
220221
TRandom3* fRndm = new TRandom3(0);
222+
std::vector<std::vector<std::shared_ptr<TProfile>>> bootstrapArray;
221223
int lastRunNumber = -1;
222224
std::vector<int> runNumbers;
223225
std::map<int, std::shared_ptr<TH3>> th3sPerRun; // map of TH3 histograms for all runs
@@ -238,6 +240,10 @@ struct FlowTask {
238240
kLowDptCut = 1,
239241
kHighDptCut = 2
240242
};
243+
enum BootstrapHist {
244+
kMeanPtWithinGap08 = 0,
245+
kCount_BootstrapHist
246+
};
241247
int mRunNumber{-1};
242248
uint64_t mSOR{0};
243249
double mMinSeconds{-1.};
@@ -334,6 +340,14 @@ struct FlowTask {
334340
registry.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisNch, axisNch}});
335341
registry.add("hMeanPt", "", {HistType::kTProfile, {axisIndependent}});
336342
registry.add("hMeanPtWithinGap08", "", {HistType::kTProfile, {axisIndependent}});
343+
// initial array
344+
bootstrapArray.resize(cfgNbootstrap);
345+
for (int i = 0; i < cfgNbootstrap; i++) {
346+
bootstrapArray[i].resize(kCount_ExtraProfile);
347+
}
348+
for (auto i = 0; i < cfgNbootstrap; i++) {
349+
bootstrapArray[i][kMeanPtWithinGap08] = registry.add<TProfile>(Form("BootstrapContainer_%d/hMeanPtWithinGap08", i), "", {HistType::kTProfile, {axisIndependent}});
350+
}
337351
registry.add("c22_gap08_Weff", "", {HistType::kTProfile, {axisIndependent}});
338352
registry.add("c22_gap08_trackMeanPt", "", {HistType::kTProfile, {axisIndependent}});
339353
registry.add("PtVariance_partA_WithinGap08", "", {HistType::kTProfile, {axisIndependent}});
@@ -1157,7 +1171,10 @@ struct FlowTask {
11571171
registry.fill(HIST("hMeanPt"), independent, ptSum / weffEvent, weffEvent);
11581172
}
11591173
if (weffEventWithinGap08)
1160-
registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, weffEventWithinGap08);
1174+
registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, cfgUseUnityEventWeightForPt ? 1.0 : weffEventWithinGap08);
1175+
int sampleIndex = static_cast<int>(cfgNbootstrap * lRandom);
1176+
if (weffEventWithinGap08)
1177+
bootstrapArray[sampleIndex][kMeanPtWithinGap08]->Fill(independent, ptSum_Gap08 / weffEventWithinGap08, cfgUseUnityEventWeightForPt ? 1.0 : weffEventWithinGap08);
11611178
// c22_gap8 * pt_withGap8
11621179
if (weffEventWithinGap08)
11631180
fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent);

0 commit comments

Comments
 (0)