Skip to content

Commit d4a7afa

Browse files
authored
[PWGCF] add dpt cut, modify dpt vs cent (#13684)
1 parent 0ee4f27 commit d4a7afa

File tree

1 file changed

+38
-24
lines changed

1 file changed

+38
-24
lines changed

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,15 @@ struct FlowTask {
155155
O2_DEFINE_CONFIGURABLE(cfgTPCPhiCutPtMin, float, 2.0f, "start point of phi-pt cut")
156156
TF1* fPhiCutLow = nullptr;
157157
TF1* fPhiCutHigh = nullptr;
158-
// for deltaPt/<pT> vs c22 vs centrality
158+
// for deltaPt/<pT> vs centrality
159159
O2_DEFINE_CONFIGURABLE(cfgDptDisEnable, bool, false, "Produce deltaPt/meanPt vs c22 vs centrality")
160-
O2_DEFINE_CONFIGURABLE(cfgDptDisCorrConfigIndex, int, 7, "Index in CorrConfig, this decide which correlation is filled")
160+
O2_DEFINE_CONFIGURABLE(cfgDptDisSelectionSwitch, int, 0, "0: disable, 1: use low cut, 2:use high cut")
161161
TH1D* hEvAvgMeanPt = nullptr;
162+
TH1D* fDptDisCutLow = nullptr;
163+
TH1D* fDptDisCutHigh = nullptr;
162164
O2_DEFINE_CONFIGURABLE(cfgDptDishEvAvgMeanPt, std::string, "", "CCDB path to hMeanPt object")
163-
ConfigurableAxis cfgDptDisAxisCorr{"cfgDptDisAxisCorr", {50, 0., 0.005}, "pt axis for histograms"};
165+
O2_DEFINE_CONFIGURABLE(cfgDptDisCutLow, std::string, "", "CCDB path to dpt lower boundary")
166+
O2_DEFINE_CONFIGURABLE(cfgDptDisCutHigh, std::string, "", "CCDB path to dpt higher boundary")
164167
ConfigurableAxis cfgDptDisAxisNormal{"cfgDptDisAxisNormal", {200, -1., 1.}, "normalized axis"};
165168
} cfgFuncParas;
166169

@@ -223,6 +226,11 @@ struct FlowTask {
223226
kReco,
224227
kGen
225228
};
229+
enum DptCut {
230+
kNoDptCut = 0,
231+
kLowDptCut = 1,
232+
kHighDptCut = 2
233+
};
226234
int mRunNumber{-1};
227235
uint64_t mSOR{0};
228236
double mMinSeconds{-1.};
@@ -324,7 +332,7 @@ struct FlowTask {
324332
registry.add("PtVariance_partA_WithinGap08", "", {HistType::kTProfile, {axisIndependent}});
325333
registry.add("PtVariance_partB_WithinGap08", "", {HistType::kTProfile, {axisIndependent}});
326334
if (cfgFuncParas.cfgDptDisEnable) {
327-
registry.add("hNormDeltaPt_Corr_X", " #delta p_{T}/[p_{T}]; Corr; X", {HistType::kTH3D, {cfgFuncParas.cfgDptDisAxisNormal, cfgFuncParas.cfgDptDisAxisCorr, axisIndependent}});
335+
registry.add("hNormDeltaPt_X", "; #delta p_{T}/[p_{T}]; X", {HistType::kTH2D, {cfgFuncParas.cfgDptDisAxisNormal, axisIndependent}});
328336
}
329337
if (doprocessMCGen) {
330338
registry.add("MCGen/MChPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}});
@@ -603,25 +611,6 @@ struct FlowTask {
603611
return;
604612
}
605613

606-
template <char... chars>
607-
void fillDeltaPtvsCorr(const GFW::CorrConfig& corrconf, const double& sum_pt, const double& WeffEvent, const ConstStr<chars...>& histo, const double& cent)
608-
{
609-
double dnx, val;
610-
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
611-
if (dnx == 0)
612-
return;
613-
if (!corrconf.pTDif) {
614-
val = fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx;
615-
if (std::fabs(val) < 1) {
616-
double meanPt = sum_pt / WeffEvent;
617-
double deltaPt = meanPt - cfgFuncParas.hEvAvgMeanPt->GetBinContent(cfgFuncParas.hEvAvgMeanPt->FindBin(cent));
618-
registry.fill(histo, deltaPt / meanPt, val, cent, dnx * WeffEvent);
619-
}
620-
return;
621-
}
622-
return;
623-
}
624-
625614
template <DataType dt>
626615
void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm)
627616
{
@@ -702,6 +691,22 @@ struct FlowTask {
702691
}
703692
LOGF(info, "Loaded mean pT histogram from %s (%p)", cfgFuncParas.cfgDptDishEvAvgMeanPt.value.c_str(), (void*)cfgFuncParas.hEvAvgMeanPt);
704693
}
694+
if (cfgFuncParas.cfgDptDisEnable && cfgFuncParas.cfgDptDisSelectionSwitch > kNoDptCut) {
695+
if (cfgFuncParas.cfgDptDisCutLow.value.empty() == false) {
696+
cfgFuncParas.fDptDisCutLow = ccdb->getForTimeStamp<TH1D>(cfgFuncParas.cfgDptDisCutLow, timestamp);
697+
if (cfgFuncParas.fDptDisCutLow == nullptr) {
698+
LOGF(fatal, "Could not load dptDis low cut histogram from %s", cfgFuncParas.cfgDptDisCutLow.value.c_str());
699+
}
700+
LOGF(info, "Loaded dptDis low cut histogram from %s (%p)", cfgFuncParas.cfgDptDisCutLow.value.c_str(), (void*)cfgFuncParas.fDptDisCutLow);
701+
}
702+
if (cfgFuncParas.cfgDptDisCutHigh.value.empty() == false) {
703+
cfgFuncParas.fDptDisCutHigh = ccdb->getForTimeStamp<TH1D>(cfgFuncParas.cfgDptDisCutHigh, timestamp);
704+
if (cfgFuncParas.fDptDisCutHigh == nullptr) {
705+
LOGF(fatal, "Could not load dptDis high cut histogram from %s", cfgFuncParas.cfgDptDisCutHigh.value.c_str());
706+
}
707+
LOGF(info, "Loaded dptDis high cut histogram from %s (%p)", cfgFuncParas.cfgDptDisCutHigh.value.c_str(), (void*)cfgFuncParas.fDptDisCutHigh);
708+
}
709+
}
705710
correctionsLoaded = true;
706711
}
707712

@@ -1101,7 +1106,16 @@ struct FlowTask {
11011106
registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected);
11021107

11031108
if (cfgFuncParas.cfgDptDisEnable) {
1104-
fillDeltaPtvsCorr(corrconfigs.at(cfgFuncParas.cfgDptDisCorrConfigIndex), ptSum, weffEvent, HIST("hNormDeltaPt_Corr_X"), independent);
1109+
double meanPt = ptSum / weffEvent;
1110+
double deltaPt = meanPt - cfgFuncParas.hEvAvgMeanPt->GetBinContent(cfgFuncParas.hEvAvgMeanPt->FindBin(independent));
1111+
registry.fill(HIST("hNormDeltaPt_X"), meanPt, independent, weffEvent);
1112+
if (cfgFuncParas.cfgDptDisSelectionSwitch == kLowDptCut && deltaPt > cfgFuncParas.fDptDisCutLow->GetBinContent(cfgFuncParas.fDptDisCutLow->FindBin(independent))) {
1113+
// only keep low 10% dpt event
1114+
return;
1115+
} else if (cfgFuncParas.cfgDptDisSelectionSwitch == kHighDptCut && deltaPt < cfgFuncParas.fDptDisCutHigh->GetBinContent(cfgFuncParas.fDptDisCutHigh->FindBin(independent))) {
1116+
// only keep high 10% dpt event
1117+
return;
1118+
}
11051119
}
11061120

11071121
double weffEventDiffWithGap08 = weffEventWithinGap08 * weffEventWithinGap08 - weffEventSquareWithinGap08;

0 commit comments

Comments
 (0)