Skip to content

Commit 346742d

Browse files
jikim1290alibuild
andauthored
[PWGCF] adding sp method (#13706)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 7daffa4 commit 346742d

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

PWGCF/JCorran/Tasks/jEPFlowAnalysis.cxx

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct jEPFlowAnalysis {
6565

6666
Configurable<bool> cfgShiftCorr{"cfgShiftCorr", false, "additional shift correction"};
6767
Configurable<std::string> cfgShiftPath{"cfgShiftPath", "Users/j/junlee/Qvector/QvecCalib/Shift", "Path for Shift"};
68-
Configurable<bool> cfgSPmethod{"cfgSPmethod", false, "flag for scalar product"};
68+
Configurable<float> cfgVertexZ{"cfgVertexZ", 10.0, "Maximum vertex Z selection"};
6969

7070
Configurable<std::string> cfgDetName{"cfgDetName", "FT0C", "The name of detector to be analyzed"};
7171
Configurable<std::string> cfgRefAName{"cfgRefAName", "TPCPos", "The name of detector for reference A"};
@@ -74,6 +74,7 @@ struct jEPFlowAnalysis {
7474
ConfigurableAxis cfgAxisCent{"cfgAxisCent", {100, 0, 100}, ""};
7575
ConfigurableAxis cfgAxisPt{"cfgAxisPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 12.0, 15.0, 30.0, 50.0, 70.0, 100.0}, ""};
7676
ConfigurableAxis cfgAxisCos{"cfgAxisCos", {102, -1.02, 1.02}, ""};
77+
ConfigurableAxis cfgAxisQvec{"cfgAxisQvec", {200, -5.0, 5.0}, ""};
7778

7879
Filter trackFilter = (aod::track::pt > cfgTrackCuts.cfgPtMin) && (nabs(aod::track::eta) < cfgTrackCuts.cfgEtaMax);
7980

@@ -123,6 +124,7 @@ struct jEPFlowAnalysis {
123124
AxisSpec axisCent{cfgAxisCent, "cent"};
124125
AxisSpec axisPt{cfgAxisPt, "pT"};
125126
AxisSpec axisCos{cfgAxisCos, "cos"};
127+
AxisSpec axisQvec{cfgAxisQvec, "Qvec"};
126128

127129
epFlowHistograms.add("EpDet", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
128130
epFlowHistograms.add("EpRefA", "", {HistType::kTH3F, {axisMod, axisCent, axisEvtPl}});
@@ -135,13 +137,25 @@ struct jEPFlowAnalysis {
135137
epFlowHistograms.add("vncos", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
136138
epFlowHistograms.add("vnsin", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisCos}});
137139

140+
epFlowHistograms.add("EpResQvecDetRefAxx", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
141+
epFlowHistograms.add("EpResQvecDetRefAxy", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
142+
epFlowHistograms.add("EpResQvecDetRefBxx", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
143+
epFlowHistograms.add("EpResQvecDetRefBxy", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
144+
epFlowHistograms.add("EpResQvecRefARefBxx", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
145+
epFlowHistograms.add("EpResQvecRefARefBxy", "", {HistType::kTH3F, {axisMod, axisCent, axisQvec}});
146+
147+
epFlowHistograms.add("SPvnxx", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisQvec}});
148+
epFlowHistograms.add("SPvnxy", "", {HistType::kTHnSparseF, {axisMod, axisCent, axisPt, axisQvec}});
149+
138150
epFlowHistograms.add("hCentrality", "", {HistType::kTH1F, {axisCent}});
139151
epFlowHistograms.add("hVertex", "", {HistType::kTH1F, {axisVertex}});
140152
}
141153

142154
void process(MyCollisions::iterator const& coll, soa::Filtered<MyTracks> const& tracks, aod::BCsWithTimestamps const&)
143155
{
144156
if (cfgAddEvtSel) {
157+
if (std::abs(coll.posZ()) > cfgVertexZ)
158+
return;
145159
switch (cfgEvtSel) {
146160
case 0: // Sel8
147161
if (!coll.sel8())
@@ -172,6 +186,8 @@ struct jEPFlowAnalysis {
172186
epFlowHistograms.fill(HIST("hCentrality"), cent);
173187
epFlowHistograms.fill(HIST("hVertex"), coll.posZ());
174188
float eps[3] = {0.};
189+
float qx_shifted[3] = {0.};
190+
float qy_shifted[3] = {0.};
175191

176192
if (cfgShiftCorr) {
177193
auto bc = coll.bc_as<aod::BCsWithTimestamps>();
@@ -222,10 +238,14 @@ struct jEPFlowAnalysis {
222238
eps[0] += deltapsiDet;
223239
eps[1] += deltapsiRefA;
224240
eps[2] += deltapsiRefB;
225-
}
226241

227-
if (cfgSPmethod)
228-
weight *= std::sqrt(std::pow(coll.qvecRe()[4 * detId + harmInd], 2) + std::pow(coll.qvecIm()[4 * detId + harmInd], 2));
242+
qx_shifted[0] = coll.qvecRe()[4 * detId + harmInd] * TMath::Cos(deltapsiDet) - coll.qvecIm()[4 * detId + harmInd] * TMath::Sin(deltapsiDet);
243+
qy_shifted[0] = coll.qvecRe()[4 * detId + harmInd] * TMath::Sin(deltapsiDet) + coll.qvecIm()[4 * detId + harmInd] * TMath::Cos(deltapsiDet);
244+
qx_shifted[1] = coll.qvecRe()[4 * refAId + harmInd] * TMath::Cos(deltapsiRefA) - coll.qvecIm()[4 * refAId + harmInd] * TMath::Sin(deltapsiRefA);
245+
qy_shifted[1] = coll.qvecRe()[4 * refAId + harmInd] * TMath::Sin(deltapsiRefA) + coll.qvecIm()[4 * refAId + harmInd] * TMath::Cos(deltapsiRefA);
246+
qx_shifted[2] = coll.qvecRe()[4 * refBId + harmInd] * TMath::Cos(deltapsiRefB) - coll.qvecIm()[4 * refBId + harmInd] * TMath::Sin(deltapsiRefB);
247+
qy_shifted[2] = coll.qvecRe()[4 * refBId + harmInd] * TMath::Sin(deltapsiRefB) + coll.qvecIm()[4 * refBId + harmInd] * TMath::Cos(deltapsiRefB);
248+
}
229249

230250
float resNumA = helperEP.GetResolution(eps[0], eps[1], i + 2);
231251
float resNumB = helperEP.GetResolution(eps[0], eps[2], i + 2);
@@ -239,14 +259,22 @@ struct jEPFlowAnalysis {
239259
epFlowHistograms.fill(HIST("EpResDetRefB"), i + 2, cent, resNumB);
240260
epFlowHistograms.fill(HIST("EpResRefARefB"), i + 2, cent, resDenom);
241261

242-
for (int j = 0; j < cfgnMode; j++) { // loop over detectors used
243-
for (const auto& track : tracks) {
244-
float vn = std::cos((i + 2) * (track.phi() - eps[j]));
245-
float vnSin = std::sin((i + 2) * (track.phi() - eps[j]));
262+
epFlowHistograms.fill(HIST("EpResQvecDetRefAxx"), i + 2, cent, qx_shifted[0] * qx_shifted[1] + qy_shifted[0] * qy_shifted[1]);
263+
epFlowHistograms.fill(HIST("EpResQvecDetRefAxy"), i + 2, cent, qx_shifted[1] * qy_shifted[0] - qx_shifted[0] * qy_shifted[1]);
264+
epFlowHistograms.fill(HIST("EpResQvecDetRefBxx"), i + 2, cent, qx_shifted[0] * qx_shifted[2] + qy_shifted[0] * qy_shifted[2]);
265+
epFlowHistograms.fill(HIST("EpResQvecDetRefBxy"), i + 2, cent, qx_shifted[2] * qy_shifted[0] - qx_shifted[0] * qy_shifted[2]);
266+
epFlowHistograms.fill(HIST("EpResQvecRefARefAxx"), i + 2, cent, qx_shifted[1] * qx_shifted[2] + qy_shifted[1] * qy_shifted[2]);
267+
epFlowHistograms.fill(HIST("EpResQvecRefARefAxy"), i + 2, cent, qx_shifted[2] * qy_shifted[1] - qx_shifted[1] * qy_shifted[2]);
246268

247-
epFlowHistograms.fill(HIST("vncos"), i + 2, cent, track.pt(), vn * weight);
248-
epFlowHistograms.fill(HIST("vnsin"), i + 2, cent, track.pt(), vnSin * weight);
249-
}
269+
for (const auto& track : tracks) {
270+
float vn = std::cos((i + 2) * (track.phi() - eps[0]));
271+
float vnSin = std::sin((i + 2) * (track.phi() - eps[0]));
272+
273+
epFlowHistograms.fill(HIST("vncos"), i + 2, cent, track.pt(), vn * weight);
274+
epFlowHistograms.fill(HIST("vnsin"), i + 2, cent, track.pt(), vnSin * weight);
275+
276+
epFlowHistograms.fill(HIST("SPvnxx"), i + 2, cent, track.pt(), (TMath::Cos(track.phi()) * qx_shifted[0] + TMath::Sin(track.phi()) * qy_shifted[0]) * weight);
277+
epFlowHistograms.fill(HIST("SPvnxy"), i + 2, cent, track.pt(), (TMath::Sin(track.phi()) * qx_shifted[0] - TMath::Cos(track.phi()) * qy_shifted[0]) * weight);
250278
}
251279
}
252280
}

0 commit comments

Comments
 (0)