Skip to content

Commit 175a82d

Browse files
authored
[PWGCF] fix flowptefficiency and flowrunbyrun (AliceO2Group#9993)
1 parent 3b629e5 commit 175a82d

File tree

3 files changed

+175
-48
lines changed

3 files changed

+175
-48
lines changed

PWGCF/Flow/Tasks/flowMc.cxx

+14-11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "GFW.h"
3636
#include "GFWCumulant.h"
3737
#include "GFWWeights.h"
38+
#include <TPDGCode.h>
3839

3940
using namespace o2;
4041
using namespace o2::framework;
@@ -98,6 +99,7 @@ struct FlowMc {
9899

99100
histos.add<TH1>("hPhi", "#phi distribution", HistType::kTH1D, {axisPhi});
100101
histos.add<TH1>("hPhiWeighted", "corrected #phi distribution", HistType::kTH1D, {axisPhi});
102+
histos.add<TH2>("hEPVsPhi", "hEPVsPhi;Event Plane Angle; #varphi", HistType::kTH2D, {axisPhi, axisPhi});
101103

102104
if (cfgOutputNUAWeights) {
103105
o2::framework::AxisSpec axis = axisPt;
@@ -172,7 +174,7 @@ struct FlowMc {
172174
for (auto const& mcParticle : mcParticles) {
173175
// focus on bulk: e, mu, pi, k, p
174176
int pdgCode = std::abs(mcParticle.pdgCode());
175-
if (pdgCode != 11 && pdgCode != 13 && pdgCode != 211 && pdgCode != 321 && pdgCode != 2212)
177+
if (pdgCode != PDG_t::kElectron && pdgCode != PDG_t::kMuonMinus && pdgCode != PDG_t::kPiPlus && pdgCode != kKPlus && pdgCode != PDG_t::kProton)
176178
continue;
177179

178180
if (!mcParticle.isPhysicalPrimary())
@@ -224,6 +226,7 @@ struct FlowMc {
224226
if (withinPtRef) {
225227
histos.fill(HIST("hPhi"), mcParticle.phi());
226228
histos.fill(HIST("hPhiWeighted"), mcParticle.phi(), wacc);
229+
histos.fill(HIST("hEPVsPhi"), evPhi, mcParticle.phi());
227230
}
228231

229232
// if valid global, fill
@@ -253,7 +256,7 @@ struct FlowMc {
253256
float imp = mcCollision.impactParameter();
254257

255258
int pdgCode = std::abs(mcParticle.pdgCode());
256-
if (pdgCode != 3312 && pdgCode != 3334)
259+
if (pdgCode != PDG_t::kXiMinus && pdgCode != PDG_t::kOmegaMinus)
257260
return;
258261

259262
if (!mcParticle.isPhysicalPrimary())
@@ -266,15 +269,15 @@ struct FlowMc {
266269
deltaPhi += constants::math::TwoPI;
267270
if (deltaPhi > constants::math::TwoPI)
268271
deltaPhi -= constants::math::TwoPI;
269-
if (pdgCode == 3312)
272+
if (pdgCode == PDG_t::kXiMinus)
270273
histos.fill(HIST("hBVsPtVsPhiGeneratedXi"), imp, deltaPhi, mcParticle.pt());
271-
if (pdgCode == 3334)
274+
if (pdgCode == PDG_t::kOmegaMinus)
272275
histos.fill(HIST("hBVsPtVsPhiGeneratedOmega"), imp, deltaPhi, mcParticle.pt());
273276

274277
if (cascades.size() > 0) {
275-
if (pdgCode == 3312)
278+
if (pdgCode == PDG_t::kXiMinus)
276279
histos.fill(HIST("hBVsPtVsPhiGlobalXi"), imp, deltaPhi, mcParticle.pt());
277-
if (pdgCode == 3334)
280+
if (pdgCode == PDG_t::kOmegaMinus)
278281
histos.fill(HIST("hBVsPtVsPhiGlobalOmega"), imp, deltaPhi, mcParticle.pt());
279282
}
280283
}
@@ -288,7 +291,7 @@ struct FlowMc {
288291
float imp = mcCollision.impactParameter();
289292

290293
int pdgCode = std::abs(mcParticle.pdgCode());
291-
if (pdgCode != 310 && pdgCode != 3122)
294+
if (pdgCode != PDG_t::kK0Short && pdgCode != PDG_t::kLambda0)
292295
return;
293296

294297
if (!mcParticle.isPhysicalPrimary())
@@ -301,15 +304,15 @@ struct FlowMc {
301304
deltaPhi += constants::math::TwoPI;
302305
if (deltaPhi > constants::math::TwoPI)
303306
deltaPhi -= constants::math::TwoPI;
304-
if (pdgCode == 310)
307+
if (pdgCode == PDG_t::kK0Short)
305308
histos.fill(HIST("hBVsPtVsPhiGeneratedK0Short"), imp, deltaPhi, mcParticle.pt());
306-
if (pdgCode == 3122)
309+
if (pdgCode == PDG_t::kLambda0)
307310
histos.fill(HIST("hBVsPtVsPhiGeneratedLambda"), imp, deltaPhi, mcParticle.pt());
308311

309312
if (v0s.size() > 0) {
310-
if (pdgCode == 310)
313+
if (pdgCode == PDG_t::kK0Short)
311314
histos.fill(HIST("hBVsPtVsPhiGlobalK0Short"), imp, deltaPhi, mcParticle.pt());
312-
if (pdgCode == 3122)
315+
if (pdgCode == PDG_t::kLambda0)
313316
histos.fill(HIST("hBVsPtVsPhiGlobalLambda"), imp, deltaPhi, mcParticle.pt());
314317
}
315318
}

PWGCF/Flow/Tasks/flowPtEfficiency.cxx

+25-14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "FlowContainer.h"
3636
#include <TProfile.h>
3737
#include <TRandom3.h>
38+
#include <TPDGCode.h>
3839

3940
using namespace o2;
4041
using namespace o2::framework;
@@ -119,20 +120,21 @@ struct FlowPtEfficiency {
119120
GFW* fGFWTrue = new GFW();
120121
GFW* fGFWReco = new GFW();
121122
TAxis* fPtAxis;
122-
std::vector<GFW::CorrConfig> corrconfigs;
123+
std::vector<GFW::CorrConfig> corrconfigsTruth;
124+
std::vector<GFW::CorrConfig> corrconfigsReco;
123125
TRandom3* fRndm = new TRandom3(0);
124126

125127
bool isStable(int pdg)
126128
{
127-
if (std::abs(pdg) == 211)
129+
if (std::abs(pdg) == PDG_t::kPiPlus)
128130
return true;
129-
if (std::abs(pdg) == 321)
131+
if (std::abs(pdg) == PDG_t::kKPlus)
130132
return true;
131-
if (std::abs(pdg) == 2212)
133+
if (std::abs(pdg) == PDG_t::kProton)
132134
return true;
133-
if (std::abs(pdg) == 11)
135+
if (std::abs(pdg) == PDG_t::kElectron)
134136
return true;
135-
if (std::abs(pdg) == 13)
137+
if (std::abs(pdg) == PDG_t::kMuonMinus)
136138
return true;
137139
return false;
138140
}
@@ -143,9 +145,11 @@ struct FlowPtEfficiency {
143145
// create histograms
144146
registry.add("eventCounter", "eventCounter", kTH1F, {axisCounter});
145147
registry.add("hPtMCRec", "Monte Carlo Reco", {HistType::kTH1D, {axisPt}});
148+
registry.add("hPtCentMCRec", "Reco production; pT (GeV/c); centrality (%)", {HistType::kTH2D, {axisPt, axisCentrality}});
146149

147150
registry.add("mcEventCounter", "Monte Carlo Truth EventCounter", kTH1F, {axisCounter});
148151
registry.add("hPtMCGen", "Monte Carlo Truth", {HistType::kTH1D, {axisPt}});
152+
registry.add("hPtCentMCGen", "Truth production; pT (GeV/c); centrality (%)", {HistType::kTH2D, {axisPt, axisCentrality}});
149153

150154
if (cfgFlowEnabled) {
151155
registry.add("hImpactParameterReco", "hImpactParameterReco", {HistType::kTH1D, {axisB}});
@@ -183,10 +187,10 @@ struct FlowPtEfficiency {
183187
fGFWTrue->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2);
184188
fGFWTrue->AddRegion("olN10", -0.8, -0.5, 1, 4);
185189
fGFWTrue->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4);
186-
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
187-
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
188-
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
189-
corrconfigs.push_back(fGFWTrue->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
190+
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
191+
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
192+
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
193+
corrconfigsTruth.push_back(fGFWTrue->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
190194
fGFWTrue->CreateRegions();
191195

192196
fGFWReco->AddRegion("full", -0.8, 0.8, 1, 1);
@@ -196,6 +200,10 @@ struct FlowPtEfficiency {
196200
fGFWReco->AddRegion("poifull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 2);
197201
fGFWReco->AddRegion("olN10", -0.8, -0.5, 1, 4);
198202
fGFWReco->AddRegion("olfull", -0.8, 0.8, 1 + fPtAxis->GetNbins(), 4);
203+
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("full {2 -2}", "ChFull22", kFALSE));
204+
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("poifull full | olfull {2 -2}", "ChFull22", kTRUE));
205+
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("refN10 {2} refP10 {-2}", "Ch10Gap22", kFALSE));
206+
corrconfigsReco.push_back(fGFWReco->GetCorrelatorConfig("poiN10 refN10 | olN10 {2} refP10 {-2}", "Ch10Gap22", kTRUE));
199207
fGFWReco->CreateRegions();
200208
}
201209

@@ -385,6 +393,7 @@ struct FlowPtEfficiency {
385393
}
386394
if (isStable(mcParticle.pdgCode())) {
387395
registry.fill(HIST("hPtMCRec"), track.pt());
396+
registry.fill(HIST("hPtCentMCRec"), track.pt(), centrality);
388397

389398
if (cfgFlowEnabled) {
390399
bool withinPtPOI = (cfgFlowCutPtPOIMin < track.pt()) && (track.pt() < cfgFlowCutPtPOIMax); // within POI pT range
@@ -409,8 +418,8 @@ struct FlowPtEfficiency {
409418
}
410419
if (cfgFlowEnabled) {
411420
// Filling Flow Container
412-
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {
413-
fillFC(fGFWReco, false, corrconfigs.at(l_ind), centrality, lRandom);
421+
for (uint l_ind = 0; l_ind < corrconfigsReco.size(); l_ind++) {
422+
fillFC(fGFWReco, false, corrconfigsReco.at(l_ind), centrality, lRandom);
414423
}
415424
}
416425
}
@@ -442,6 +451,8 @@ struct FlowPtEfficiency {
442451
for (const auto& mcParticle : mcParticles) {
443452
if (mcParticle.isPhysicalPrimary() && isStable(mcParticle.pdgCode())) {
444453
registry.fill(HIST("hPtMCGen"), mcParticle.pt());
454+
registry.fill(HIST("hPtCentMCGen"), mcParticle.pt(), centrality);
455+
445456
if (cfgFlowEnabled) {
446457
bool withinPtPOI = (cfgFlowCutPtPOIMin < mcParticle.pt()) && (mcParticle.pt() < cfgFlowCutPtPOIMax); // within POI pT range
447458
bool withinPtRef = (cfgFlowCutPtRefMin < mcParticle.pt()) && (mcParticle.pt() < cfgFlowCutPtRefMax); // within RF pT range
@@ -456,8 +467,8 @@ struct FlowPtEfficiency {
456467
}
457468
if (cfgFlowEnabled) {
458469
// Filling Flow Container
459-
for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) {
460-
fillFC(fGFWTrue, true, corrconfigs.at(l_ind), centrality, lRandom);
470+
for (uint l_ind = 0; l_ind < corrconfigsTruth.size(); l_ind++) {
471+
fillFC(fGFWTrue, true, corrconfigsTruth.at(l_ind), centrality, lRandom);
461472
}
462473
}
463474
}

0 commit comments

Comments
 (0)