diff --git a/PWGCF/Flow/Tasks/flowTask.cxx b/PWGCF/Flow/Tasks/flowTask.cxx index 447ceeaa5d6..ec583bdabd8 100644 --- a/PWGCF/Flow/Tasks/flowTask.cxx +++ b/PWGCF/Flow/Tasks/flowTask.cxx @@ -243,6 +243,7 @@ struct FlowTask { std::vector nPt; // fraction of particles in each pT bin in one event std::vector> listNptV2; std::vector> 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"}; @@ -287,7 +288,7 @@ struct FlowTask { std::vector corrconfigs; GFWCorrConfigs gfwConfigs; std::vector corrconfigsPtVn; - TAxis* fPtAxis; + TAxis* fPtAxis = nullptr; TRandom3* fRndm = new TRandom3(0); std::vector> etagapsPtPt; std::vector>> bootstrapArray; @@ -324,15 +325,15 @@ struct FlowTask { double mMinSeconds{-1.}; std::unordered_map gHadronicRate; ctpRateFetcher mRateFetcher; - TH2* gCurrentHadronicRate; + TH2* gCurrentHadronicRate = nullptr; RCTFlagsChecker rctChecker{"CBT"}; // phi-EP correction std::vector 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&) { @@ -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}}); @@ -910,30 +918,30 @@ struct FlowTask { if (cfgUserIO.cfgAcceptance.value.empty() == false) { mAcceptance = ccdb->getForTimeStamp(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(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(mAcceptance)); } if (cfgUserIO.cfgEfficiency.value.empty() == false) { mEfficiency = ccdb->getForTimeStamp(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(mEfficiency)); } if (cfgUserIO.cfgEfficiencyForNch.value.empty() == false) { mEfficiencyForNch = ccdb->getForTimeStamp(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(mEfficiencyForNch)); } if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDishEvAvgMeanPt.value.empty() == false) { cfgAdditionObs.hEvAvgMeanPt = ccdb->getForTimeStamp(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(cfgAdditionObs.hEvAvgMeanPt)); } if (cfgAdditionObs.cfgDptDisEnable && cfgAdditionObs.cfgDptDisSelectionSwitch > kNoDptCut) { if (cfgAdditionObs.cfgDptDisCutLow.value.empty() == false) { @@ -941,14 +949,14 @@ struct FlowTask { 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(cfgAdditionObs.fDptDisCutLow)); } if (cfgAdditionObs.cfgDptDisCutHigh.value.empty() == false) { cfgAdditionObs.fDptDisCutHigh = ccdb->getForTimeStamp(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(cfgAdditionObs.fDptDisCutHigh)); } } correctionsLoaded = true; @@ -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; @@ -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; @@ -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, @@ -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++) { @@ -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)