Skip to content

Commit e8a1a3b

Browse files
authored
[PWGCF] use narrow pT for track density correction (#10476)
1 parent 111872d commit e8a1a3b

File tree

2 files changed

+83
-22
lines changed

2 files changed

+83
-22
lines changed

PWGCF/Flow/Tasks/flowQa.cxx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ struct FlowQa {
9595
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy")
9696
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
9797
O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode")
98-
O2_DEFINE_CONFIGURABLE(cfgUseEPcorrection, bool, false, "Use event plane efficiency correction")
99-
O2_DEFINE_CONFIGURABLE(cfgUseEPEffSlopeFactor, float, 1.0f, "A factor to scale the EP efficiency slope")
98+
O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction")
99+
O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrSlopeFactor, float, 1.0f, "A factor to scale the track density efficiency slope")
100100
Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector<std::string>{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"};
101101
Configurable<std::vector<std::string>> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector<std::string>{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"};
102102
Configurable<std::vector<int>> cfgRunRemoveList{"cfgRunRemoveList", std::vector<int>{-1}, "excluded run numbers"};
@@ -237,6 +237,7 @@ struct FlowQa {
237237
// Track QA
238238
registry.add("hPhi", "#phi distribution", {HistType::kTH1D, {axisPhi}});
239239
registry.add("hPhiWeighted", "corrected #phi distribution", {HistType::kTH1D, {axisPhi}});
240+
registry.add("hPhiWeightedTrDen", "corrected #phi distribution, considering track density", {HistType::kTH1D, {axisPhi}});
240241
registry.add("hEta", "#eta distribution", {HistType::kTH1D, {axisEta}});
241242
registry.add("hPt", "p_{T} distribution before cut", {HistType::kTH1D, {axisPtHist}});
242243
registry.add("hPtRef", "p_{T} distribution after cut", {HistType::kTH1D, {axisPtHist}});
@@ -364,23 +365,16 @@ struct FlowQa {
364365
}
365366
fGFW->CreateRegions();
366367

367-
if (cfgUseEPcorrection) {
368-
hFindPtBin = new TH1D("hFindPtBin", "hFindPtBin", 7, 0.2, 3.0);
369-
funcEff.resize(7);
370-
funcEff[0] = new TF1("funcEff0", "[0]+[1]*x", 0, 3000);
371-
funcEff[0]->SetParameters(0.736274, -2.26721e-05 * cfgUseEPEffSlopeFactor);
372-
funcEff[1] = new TF1("funcEff1", "[0]+[1]*x", 0, 3000);
373-
funcEff[1]->SetParameters(0.773396, -2.79496e-05 * cfgUseEPEffSlopeFactor);
374-
funcEff[2] = new TF1("funcEff2", "[0]+[1]*x", 0, 3000);
375-
funcEff[2]->SetParameters(0.792831, -2.69748e-05 * cfgUseEPEffSlopeFactor);
376-
funcEff[3] = new TF1("funcEff3", "[0]+[1]*x", 0, 3000);
377-
funcEff[3]->SetParameters(0.808402, -2.48438e-05 * cfgUseEPEffSlopeFactor);
378-
funcEff[4] = new TF1("funcEff4", "[0]+[1]*x", 0, 3000);
379-
funcEff[4]->SetParameters(0.817907, -2.31138e-05 * cfgUseEPEffSlopeFactor);
380-
funcEff[5] = new TF1("funcEff5", "[0]+[1]*x", 0, 3000);
381-
funcEff[5]->SetParameters(0.82473, -2.20517e-05 * cfgUseEPEffSlopeFactor);
382-
funcEff[6] = new TF1("funcEff6", "[0]+[1]*x", 0, 3000);
383-
funcEff[6]->SetParameters(0.829151, -2.0758e-05 * cfgUseEPEffSlopeFactor);
368+
if (cfgTrackDensityCorrUse) {
369+
std::vector<double> pTEffBins = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0};
370+
hFindPtBin = new TH1D("hFindPtBin", "hFindPtBin", pTEffBins.size() - 1, &pTEffBins[0]);
371+
funcEff.resize(pTEffBins.size() - 1);
372+
std::vector<double> f1p0 = {0.713412, 0.73259, 0.749925, 0.760693, 0.767321, 0.772874, 0.777889, 0.782172, 0.792831, 0.808402, 0.817907, 0.82473, 0.829151};
373+
std::vector<double> f1p1 = {-2.15831e-05, -2.19538e-05, -2.2958e-05, -2.55123e-05, -2.75207e-05, -2.81486e-05, -2.839e-05, -2.83713e-05, -2.69748e-05, -2.48438e-05, -2.31138e-05, -2.20517e-05, -2.0758e-05};
374+
for (uint ifunc = 0; ifunc < pTEffBins.size() - 1; ifunc++) {
375+
funcEff[ifunc] = new TF1(Form("funcEff%i", ifunc), "[0]+[1]*x", 0, 3000);
376+
funcEff[ifunc]->SetParameters(f1p0[ifunc], f1p1[ifunc] * cfgTrackDensityCorrSlopeFactor);
377+
}
384378
funcV2 = new TF1("funcV2", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
385379
funcV2->SetParameters(0.0186111, 0.00351907, -4.38264e-05, 1.35383e-07, -3.96266e-10);
386380
funcV3 = new TF1("funcV3", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
@@ -706,7 +700,7 @@ struct FlowQa {
706700
double psi2Est = 0, psi3Est = 0, psi4Est = 0;
707701
float wEPeff = 1;
708702
double v2 = 0, v3 = 0, v4 = 0;
709-
if (cfgUseEPcorrection) {
703+
if (cfgTrackDensityCorrUse) {
710704
double q2x = 0, q2y = 0;
711705
double q3x = 0, q3y = 0;
712706
double q4x = 0, q4y = 0;
@@ -744,15 +738,16 @@ struct FlowQa {
744738
}
745739
if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz))
746740
continue;
747-
if (cfgUseEPcorrection && withinPtRef) {
741+
if (cfgTrackDensityCorrUse && withinPtRef) {
748742
double fphi = v2 * std::cos(2 * (track.phi() - psi2Est)) + v3 * std::cos(3 * (track.phi() - psi3Est)) + v4 * std::cos(4 * (track.phi() - psi4Est));
749743
fphi = (1 + 2 * fphi);
750744
int pTBinForEff = hFindPtBin->FindBin(track.pt());
751-
if (pTBinForEff >= 1 && pTBinForEff <= 7) {
745+
if (pTBinForEff >= 1 && pTBinForEff <= hFindPtBin->GetNbinsX()) {
752746
wEPeff = funcEff[pTBinForEff - 1]->Eval(fphi * tracks.size());
753747
if (wEPeff > 0.) {
754748
wEPeff = 1. / wEPeff;
755749
weff *= wEPeff;
750+
registry.fill(HIST("hPhiWeightedTrDen"), track.phi(), wacc * wEPeff);
756751
}
757752
}
758753
}

PWGCF/Flow/Tasks/flowTask.cxx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ struct FlowTask {
9797
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyHigh, int, 500, "High cut on TPC occupancy")
9898
O2_DEFINE_CONFIGURABLE(cfgCutOccupancyLow, int, 0, "Low cut on TPC occupancy")
9999
O2_DEFINE_CONFIGURABLE(cfgUseSmallMemory, bool, false, "Use small memory mode")
100+
O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction")
100101
Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector<std::string>{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"};
101102
Configurable<std::vector<std::string>> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector<std::string>{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"};
102103
Configurable<std::vector<int>> cfgRunRemoveList{"cfgRunRemoveList", std::vector<int>{-1}, "excluded run numbers"};
@@ -147,6 +148,13 @@ struct FlowTask {
147148
ctpRateFetcher mRateFetcher;
148149
TH2* gCurrentHadronicRate;
149150

151+
// phi-EP correction
152+
std::vector<TF1*> funcEff;
153+
TH1D* hFindPtBin;
154+
TF1* funcV2;
155+
TF1* funcV3;
156+
TF1* funcV4;
157+
150158
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
151159
using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
152160

@@ -419,6 +427,24 @@ struct FlowTask {
419427
fT0AV0ASigma->SetParameters(463.4144, 6.796509e-02, -9.097136e-07, 7.971088e-12, -2.600581e-17);
420428
}
421429

430+
if (cfgTrackDensityCorrUse) {
431+
std::vector<double> pTEffBins = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0};
432+
hFindPtBin = new TH1D("hFindPtBin", "hFindPtBin", pTEffBins.size() - 1, &pTEffBins[0]);
433+
funcEff.resize(pTEffBins.size() - 1);
434+
std::vector<double> f1p0 = {0.713412, 0.73259, 0.749925, 0.760693, 0.767321, 0.772874, 0.777889, 0.782172, 0.792831, 0.808402, 0.817907, 0.82473, 0.829151};
435+
std::vector<double> f1p1 = {-2.15831e-05, -2.19538e-05, -2.2958e-05, -2.55123e-05, -2.75207e-05, -2.81486e-05, -2.839e-05, -2.83713e-05, -2.69748e-05, -2.48438e-05, -2.31138e-05, -2.20517e-05, -2.0758e-05};
436+
for (uint ifunc = 0; ifunc < pTEffBins.size() - 1; ifunc++) {
437+
funcEff[ifunc] = new TF1(Form("funcEff%i", ifunc), "[0]+[1]*x", 0, 3000);
438+
funcEff[ifunc]->SetParameters(f1p0[ifunc], f1p1[ifunc]);
439+
}
440+
funcV2 = new TF1("funcV2", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
441+
funcV2->SetParameters(0.0186111, 0.00351907, -4.38264e-05, 1.35383e-07, -3.96266e-10);
442+
funcV3 = new TF1("funcV3", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
443+
funcV3->SetParameters(0.0174056, 0.000703329, -1.45044e-05, 1.91991e-07, -1.62137e-09);
444+
funcV4 = new TF1("funcV4", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100);
445+
funcV4->SetParameters(0.008845, 0.000259668, -3.24435e-06, 4.54837e-08, -6.01825e-10);
446+
}
447+
422448
myTrackSel = getGlobalTrackSelectionRun3ITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny, TrackSelection::GlobalTrackRun3DCAxyCut::Default);
423449
myTrackSel.SetMinNClustersTPC(cfgCutTPCclu);
424450
myTrackSel.SetMinNClustersITS(cfgCutITSclu);
@@ -734,6 +760,34 @@ struct FlowTask {
734760
if (cfgUseNch)
735761
independent = static_cast<float>(tracks.size());
736762

763+
double psi2Est = 0, psi3Est = 0, psi4Est = 0;
764+
float wEPeff = 1;
765+
double v2 = 0, v3 = 0, v4 = 0;
766+
// be cautious, this only works for Pb-Pb
767+
// esimate the Event plane and vn for this event
768+
if (cfgTrackDensityCorrUse) {
769+
double q2x = 0, q2y = 0;
770+
double q3x = 0, q3y = 0;
771+
double q4x = 0, q4y = 0;
772+
for (const auto& track : tracks) {
773+
bool withinPtRef = (cfgCutPtRefMin < track.pt()) && (track.pt() < cfgCutPtRefMax); // within RF pT rang
774+
if (withinPtRef) {
775+
q2x += std::cos(2 * track.phi());
776+
q2y += std::sin(2 * track.phi());
777+
q3x += std::cos(3 * track.phi());
778+
q3y += std::sin(3 * track.phi());
779+
q4x += std::cos(4 * track.phi());
780+
q4y += std::sin(4 * track.phi());
781+
}
782+
}
783+
psi2Est = std::atan2(q2y, q2x) / 2.;
784+
psi3Est = std::atan2(q3y, q3x) / 3.;
785+
psi4Est = std::atan2(q4y, q4x) / 4.;
786+
v2 = funcV2->Eval(cent);
787+
v3 = funcV3->Eval(cent);
788+
v4 = funcV4->Eval(cent);
789+
}
790+
737791
for (const auto& track : tracks) {
738792
if (!trackSelected(track))
739793
continue;
@@ -749,6 +803,18 @@ struct FlowTask {
749803
}
750804
if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz))
751805
continue;
806+
if (cfgTrackDensityCorrUse && withinPtRef) {
807+
double fphi = v2 * std::cos(2 * (track.phi() - psi2Est)) + v3 * std::cos(3 * (track.phi() - psi3Est)) + v4 * std::cos(4 * (track.phi() - psi4Est));
808+
fphi = (1 + 2 * fphi);
809+
int pTBinForEff = hFindPtBin->FindBin(track.pt());
810+
if (pTBinForEff >= 1 && pTBinForEff <= hFindPtBin->GetNbinsX()) {
811+
wEPeff = funcEff[pTBinForEff - 1]->Eval(fphi * tracks.size());
812+
if (wEPeff > 0.) {
813+
wEPeff = 1. / wEPeff;
814+
weff *= wEPeff;
815+
}
816+
}
817+
}
752818
registry.fill(HIST("hPt"), track.pt());
753819
if (withinPtRef) {
754820
registry.fill(HIST("hPhi"), track.phi());

0 commit comments

Comments
 (0)