Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 58 additions & 19 deletions PWGCF/Flow/Tasks/flowTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ struct FlowTask {
std::vector<float> nPt; // fraction of particles in each pT bin in one event
std::vector<std::shared_ptr<TProfile2D>> listNptV2;
std::vector<std::shared_ptr<TH2>> listPtX;
O2_DEFINE_CONFIGURABLE(cfgManualCk, bool, false, "Produce pt-pt variance")
} cfgAdditionObs;

ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, "pt axis for histograms"};
Expand Down Expand Up @@ -287,7 +288,7 @@ struct FlowTask {
std::vector<GFW::CorrConfig> corrconfigs;
GFWCorrConfigs gfwConfigs;
std::vector<GFW::CorrConfig> corrconfigsPtVn;
TAxis* fPtAxis;
TAxis* fPtAxis = nullptr;
TRandom3* fRndm = new TRandom3(0);
std::vector<std::pair<double, double>> etagapsPtPt;
std::vector<std::vector<std::shared_ptr<TProfile>>> bootstrapArray;
Expand Down Expand Up @@ -324,15 +325,15 @@ struct FlowTask {
double mMinSeconds{-1.};
std::unordered_map<int, TH2*> gHadronicRate;
ctpRateFetcher mRateFetcher;
TH2* gCurrentHadronicRate;
TH2* gCurrentHadronicRate = nullptr;
RCTFlagsChecker rctChecker{"CBT"};

// phi-EP correction
std::vector<TF1*> funcEff;
TH1D* hFindPtBin;
TF1* funcV2;
TF1* funcV3;
TF1* funcV4;
TH1D* hFindPtBin = nullptr;
TF1* funcV2 = nullptr;
TF1* funcV3 = nullptr;
TF1* funcV4 = nullptr;

void init(InitContext const&)
{
Expand Down Expand Up @@ -439,6 +440,13 @@ struct FlowTask {
registry.add("hPtA_afterDptCut", "p_{T} distribution", {HistType::kTH1D, {axisPt}});
registry.add("hPtB_afterDptCut", "p_{T} distribution", {HistType::kTH1D, {axisPt}});
}
if (cfgAdditionObs.cfgManualCk) {
registry.add("ptpt_1sub1_1sub3_2pc", "", {HistType::kTProfile, {axisIndependent}});
registry.add("pt_1sub1_1pc", "", {HistType::kTProfile, {axisIndependent}});
registry.add("pt_1sub1_2pc", "", {HistType::kTProfile, {axisIndependent}});
registry.add("pt_1sub3_1pc", "", {HistType::kTProfile, {axisIndependent}});
registry.add("pt_1sub3_2pc", "", {HistType::kTProfile, {axisIndependent}});
}
if (doprocessMCGen) {
registry.add("MCGen/MChPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}});
registry.add("MCGen/MChEta", "#eta distribution", {HistType::kTH1D, {axisEta}});
Expand Down Expand Up @@ -910,45 +918,45 @@ struct FlowTask {
if (cfgUserIO.cfgAcceptance.value.empty() == false) {
mAcceptance = ccdb->getForTimeStamp<GFWWeights>(cfgUserIO.cfgAcceptance, timestamp);
if (mAcceptance)
LOGF(info, "Loaded acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), (void*)mAcceptance);
LOGF(info, "Loaded acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), static_cast<void*>(mAcceptance));
else
LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), (void*)mAcceptance);
LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgUserIO.cfgAcceptance.value.c_str(), static_cast<void*>(mAcceptance));
}
if (cfgUserIO.cfgEfficiency.value.empty() == false) {
mEfficiency = ccdb->getForTimeStamp<TH1D>(cfgUserIO.cfgEfficiency, timestamp);
if (mEfficiency == nullptr) {
LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgUserIO.cfgEfficiency.value.c_str());
}
LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiency.value.c_str(), (void*)mEfficiency);
LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiency.value.c_str(), static_cast<void*>(mEfficiency));
}
if (cfgUserIO.cfgEfficiencyForNch.value.empty() == false) {
mEfficiencyForNch = ccdb->getForTimeStamp<TH1D>(cfgUserIO.cfgEfficiencyForNch, timestamp);
if (mEfficiencyForNch == nullptr) {
LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgUserIO.cfgEfficiencyForNch.value.c_str());
}
LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiencyForNch.value.c_str(), (void*)mEfficiencyForNch);
LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgUserIO.cfgEfficiencyForNch.value.c_str(), static_cast<void*>(mEfficiencyForNch));
}
if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.empty() == false) {
cfgAdditionObs.hEvAvgMeanPt = ccdb->getForTimeStamp<TH1D>(cfgAdditionObs.cfgDptDishEvAvgMeanPt, timestamp);
if (cfgAdditionObs.hEvAvgMeanPt == nullptr) {
LOGF(fatal, "Could not load mean pT histogram from %s", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str());
}
LOGF(info, "Loaded mean pT histogram from %s (%p)", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str(), (void*)cfgAdditionObs.hEvAvgMeanPt);
LOGF(info, "Loaded mean pT histogram from %s (%p)", cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.c_str(), static_cast<void*>(cfgAdditionObs.hEvAvgMeanPt));
}
if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDisSelectionSwitch > kNoDptCut) {
if (cfgAdditionObs.cfgDptDisCutLow.value.empty() == false) {
cfgAdditionObs.fDptDisCutLow = ccdb->getForTimeStamp<TH1D>(cfgAdditionObs.cfgDptDisCutLow, timestamp);
if (cfgAdditionObs.fDptDisCutLow == nullptr) {
LOGF(fatal, "Could not load dptDis low cut histogram from %s", cfgAdditionObs.cfgDptDisCutLow.value.c_str());
}
LOGF(info, "Loaded dptDis low cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutLow.value.c_str(), (void*)cfgAdditionObs.fDptDisCutLow);
LOGF(info, "Loaded dptDis low cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutLow.value.c_str(), static_cast<void*>(cfgAdditionObs.fDptDisCutLow));
}
if (cfgAdditionObs.cfgDptDisCutHigh.value.empty() == false) {
cfgAdditionObs.fDptDisCutHigh = ccdb->getForTimeStamp<TH1D>(cfgAdditionObs.cfgDptDisCutHigh, timestamp);
if (cfgAdditionObs.fDptDisCutHigh == nullptr) {
LOGF(fatal, "Could not load dptDis high cut histogram from %s", cfgAdditionObs.cfgDptDisCutHigh.value.c_str());
}
LOGF(info, "Loaded dptDis high cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutHigh.value.c_str(), (void*)cfgAdditionObs.fDptDisCutHigh);
LOGF(info, "Loaded dptDis high cut histogram from %s (%p)", cfgAdditionObs.cfgDptDisCutHigh.value.c_str(), static_cast<void*>(cfgAdditionObs.fDptDisCutHigh));
}
}
correctionsLoaded = true;
Expand Down Expand Up @@ -1289,6 +1297,10 @@ struct FlowTask {
double weffEventWithinGap08 = 0., weffEventSquareWithinGap08 = 0.;
double sumPtsquareWsquareWithinGap08 = 0., sumPtWsquareWithinGap08 = 0.;
double nTracksCorrected = 0;
double mpt_sub1 = 0;
double mpt_sub1_weffEv = 0;
double mpt_sub3 = 0;
double mpt_sub3_weffEv = 0;
int magnetfield = 0;
float independent = cent;
float nTracksUncorrected = 0;
Expand Down Expand Up @@ -1405,6 +1417,16 @@ struct FlowTask {
weffEventWithinGap08 += weff;
weffEventSquareWithinGap08 += weff * weff;
}
if (cfgAdditionObs.cfgManualCk) {
if (track.eta() >= etagapsPtPt[0].first && track.eta() <= etagapsPtPt[0].second) {
mpt_sub1 += weff * track.pt();
mpt_sub1_weffEv += weff;
}
if (track.eta() >= etagapsPtPt[2].first && track.eta() <= etagapsPtPt[2].second) {
mpt_sub3 += weff * track.pt();
mpt_sub3_weffEv += weff;
}
}
}
if (cfgUserIO.cfgConsistentEventFlag && consistentEventVector.size() == 6) { // o2-linter: disable=magic-number (size match)
acceptedTracks.nFull += 1;
Expand Down Expand Up @@ -1477,13 +1499,12 @@ struct FlowTask {
if (weffEvent) {
registry.fill(HIST("hMeanPt"), independent, ptSum / weffEvent, weffEvent);
}
if (weffEventWithinGap08)
if (weffEventWithinGap08) {
registry.fill(HIST("hMeanPtWithinGap08"), independent, ptSum_Gap08 / weffEventWithinGap08, cfgUserIO.cfgUserPtVnEvWeightEnabled ? weffEventWithinGap08 : 1.);
if (weffEventWithinGap08)
bootstrapArray[sampleIndex][kMeanPtWithinGap08]->Fill(independent, ptSum_Gap08 / weffEventWithinGap08, 1.0);
// c22_gap8 * pt_withGap8
if (weffEventWithinGap08)
// c22_gap8 * pt_withGap8
fillpTvnProfile(corrconfigs.at(7), ptSum_Gap08, weffEventWithinGap08, HIST("c22_gap08_Weff"), HIST("c22_gap08_trackMeanPt"), independent);
}
// PtVariance
if (weffEventDiffWithGap08) {
registry.fill(HIST("PtVariance_partA_WithinGap08"), independent,
Expand All @@ -1494,6 +1515,25 @@ struct FlowTask {
weffEventDiffWithGap08);
}

if (cfgAdditionObs.cfgManualCk) {
// 2pc event weight:
double ev2pc = mpt_sub1_weffEv * mpt_sub3_weffEv;
// manual pt-pt variance
if (mpt_sub1_weffEv) {
mpt_sub1 = mpt_sub1 / mpt_sub1_weffEv;
registry.fill(HIST("pt_1sub1_1pc"), independent, mpt_sub1, mpt_sub1_weffEv);
}
if (mpt_sub3_weffEv) {
mpt_sub3 = mpt_sub3 / mpt_sub3_weffEv;
registry.fill(HIST("pt_1sub3_1pc"), independent, mpt_sub3, mpt_sub3_weffEv);
}
if (mpt_sub1_weffEv && mpt_sub3_weffEv) {
registry.fill(HIST("ptpt_1sub1_1sub3_2pc"), independent, mpt_sub1 * mpt_sub3, ev2pc);
registry.fill(HIST("pt_1sub1_2pc"), independent, mpt_sub1, ev2pc);
registry.fill(HIST("pt_1sub3_2pc"), independent, mpt_sub3, ev2pc);
}
}

// v02
if (cfgAdditionObs.cfgV02Enabled && weffEventFrac > 0) {
for (auto ipt = 0; ipt < fPtAxis->GetNbins(); ipt++) {
Expand Down Expand Up @@ -1569,9 +1609,8 @@ struct FlowTask {
ptSum_Gap08 += mcParticle.pt();
count_Gap08 += 1.;
}
}
if (withinPtRef)
fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 1);
}
if (withinPtPOI)
fGFW->Fill(mcParticle.eta(), fPtAxis->FindBin(mcParticle.pt()) - 1, mcParticle.phi(), 1., 2);
if (withinPtPOI && withinPtRef)
Expand Down
Loading