Skip to content

Commit a00a191

Browse files
authored
Enhance particle prediction with new parameters
Updated particle selection parameters and added primary selection logic for multiplicity computation.
1 parent 79604eb commit a00a191

1 file changed

Lines changed: 84 additions & 10 deletions

File tree

PWGLF/Tasks/QC/mcParticlePrediction.cxx

Lines changed: 84 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,73 @@ using namespace o2::framework;
5555
using namespace o2::pwglf;
5656

5757
// Particles
58-
static const std::vector<std::string> parameterNames{"Enable"};
59-
static constexpr int nParameters = 1;
60-
static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
58+
static const std::vector<std::string> parameterNames{"Enable", "SelectPrimaries"};
59+
static constexpr int nParameters = 2;
60+
static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0, 1}, // Electron
61+
{0, 1}, // Muon
62+
{0, 1}, // Pion
63+
{0, 1}, // Kaon
64+
{0, 1}, // Proton
65+
{0, 1}, // Deuteron
66+
{0, 1}, // Triton
67+
{0, 1}, // Helium3
68+
{0, 1}, // Alpha
69+
{0, 1}, // PI0
70+
{0, 1}, // Photon
71+
{1, 1}, // K0
72+
{0, 1}, // Lambda
73+
{0, 1}, // HyperTriton
74+
{0, 1}, // Hyperhydrog4
75+
{0, 1}, // XiMinus
76+
{0, 1}, // OmegaMinus
77+
{0, 1}, // HyperHelium4
78+
{0, 1}, // HyperHelium5
79+
{0, 1}, // Positron
80+
{0, 1}, // MuonPlus
81+
{0, 1}, // PionMinus
82+
{0, 1}, // KaonMinus
83+
{0, 1}, // AntiProton
84+
{0, 1}, // AntiDeuteron
85+
{0, 1}, // AntiTriton
86+
{0, 1}, // AntiHelium3
87+
{0, 1}, // AntiAlpha
88+
{0, 1}, // AntiLambda
89+
{0, 1}, // AntiHyperTriton
90+
{0, 1}, // AntiHyperhydrog4
91+
{0, 1}, // XiPlus
92+
{0, 1}, // OmegaPlus
93+
{0, 1}, // AntiHyperHelium4
94+
{0, 1}, // AntiHyperHelium5
95+
{0, 1}, // Neutron
96+
{0, 1}, // AntiNeutron
97+
{0, 0}, // Phi
98+
{0, 1}, // BZero
99+
{0, 1}, // BPlus
100+
{0, 1}, // BS
101+
{0, 1}, // D0
102+
{0, 1}, // DPlus
103+
{0, 1}, // DS
104+
{0, 1}, // DStar
105+
{0, 1}, // ChiC1
106+
{0, 1}, // JPsi
107+
{0, 1}, // LambdaB0
108+
{0, 1}, // LambdaCPlus
109+
{0, 1}, // OmegaC0
110+
{0, 1}, // SigmaC0
111+
{0, 1}, // SigmaCPlusPlus
112+
{0, 1}, // X3872
113+
{0, 1}, // Xi0
114+
{0, 1}, // XiB0
115+
{0, 1}, // XiCCPlusPlus
116+
{0, 1}, // XiCPlus
117+
{0, 1}, // XiC0
118+
{0, 0}, // Kstar
119+
{0, 0}, // KstarPM
120+
{0, 1}, // Kshort
121+
{0, 0}, // Xi1530
122+
{0, 0}}; // Lambda1520
61123
bool enabledParticlesArray[PIDExtended::NIDsTot];
124+
bool selectPrimariesArray[PIDExtended::NIDsTot];
62125

63126
// Estimators
64127
struct Estimators {
@@ -196,7 +259,7 @@ struct McParticlePrediction {
196259
{defaultEstimators[0], Estimators::nEstimators, nParameters, Estimators::arrayNames(), parameterNames},
197260
"Estimators enabled"};
198261
Configurable<bool> selectInelGt0{"selectInelGt0", true, "Select only inelastic events"};
199-
Configurable<bool> selectPrimaries{"selectPrimaries", true, "Select only primary particles"};
262+
Configurable<bool> selectPrimariesForMultiplicity{"selectPrimariesForMultiplicity", true, "Select only primary particles for multiplicity computation"};
200263
Configurable<float> rapidityCut{"rapidityCut", 0.5, "Select only particles within |y| < cut for the pT and yield plots"};
201264
Configurable<float> ptCut{"ptCut", 0.01, "Select only particles within |pt| > cut for the eta and y plots"};
202265
Configurable<bool> requireCoincidenceEstimators{"requireCoincidenceEstimators", false, "Asks for a coincidence when two estimators are used"};
@@ -221,7 +284,7 @@ struct McParticlePrediction {
221284
void init(o2::framework::InitContext&)
222285
{
223286
mCounter.mPdgDatabase = pdgDB.service;
224-
mCounter.mSelectPrimaries = selectPrimaries.value;
287+
mCounter.mSelectPrimaries = selectPrimariesForMultiplicity.value;
225288
const AxisSpec axisEta{cfgBinning.binsEta, "#eta"};
226289
const AxisSpec axisRapidity{cfgBinning.binsY, "#it{y}"};
227290
const AxisSpec axisVx{cfgBinning.binsVxy, "Vx"};
@@ -315,6 +378,8 @@ struct McParticlePrediction {
315378
for (int i = 0; i < PIDExtended::NIDsTot; i++) {
316379
h->GetXaxis()->SetBinLabel(i + 1, PIDExtended::getName(i));
317380
}
381+
histos.addClone("particles/yields", "particles/idBeforePrimarySelection");
382+
histos.addClone("particles/yields", "particles/idAfterPrimarySelection");
318383

319384
for (int i = 0; i < Estimators::nEstimators; i++) {
320385
if (!enabledEstimatorsArray[i]) {
@@ -395,6 +460,7 @@ struct McParticlePrediction {
395460
enabledParticlesArray[i] = false;
396461
continue;
397462
}
463+
selectPrimariesArray[i] = (enabledSpecies->get(PIDExtended::getName(i), "SelectPrimaries") == 1);
398464
LOG(info) << "Enabling particle " << i << " " << PIDExtended::getName(i);
399465
enabledParticlesArray[i] = true;
400466
for (int j = 0; j < Estimators::nEstimators; j++) {
@@ -468,16 +534,20 @@ struct McParticlePrediction {
468534
nMult[Estimators::ZNC] = mCounter.countZNC(mcParticles);
469535
}
470536
if (enabledEstimatorsArray[Estimators::ZEM1]) {
471-
nMult[Estimators::ZEM1] = 0; // Not implemented yet
537+
LOG(warn) << "Estimator ZEM1 is not implemented yet";
538+
nMult[Estimators::ZEM1] = 0;
472539
}
473540
if (enabledEstimatorsArray[Estimators::ZEM2]) {
474-
nMult[Estimators::ZEM2] = 0; // Not implemented yet
541+
LOG(warn) << "Estimator ZEM2 is not implemented yet";
542+
nMult[Estimators::ZEM2] = 0;
475543
}
476544
if (enabledEstimatorsArray[Estimators::ZPA]) {
477-
nMult[Estimators::ZPA] = 0; // Not implemented yet
545+
LOG(warn) << "Estimator ZPA is not implemented yet";
546+
nMult[Estimators::ZPA] = 0;
478547
}
479548
if (enabledEstimatorsArray[Estimators::ZPC]) {
480-
nMult[Estimators::ZPC] = 0; // Not implemented yet
549+
LOG(warn) << "Estimator ZPC is not implemented yet";
550+
nMult[Estimators::ZPC] = 0;
481551
}
482552
if (enabledEstimatorsArray[Estimators::ITSIB] || enableVsITSHistograms) {
483553
nMult[Estimators::ITSIB] = mCounter.countITSIB(mcParticles);
@@ -553,9 +623,13 @@ struct McParticlePrediction {
553623
continue;
554624
}
555625

556-
if (!particle.isPhysicalPrimary()) {
626+
// Count ids before applying the primary selection
627+
histos.fill(HIST("particles/idBeforePrimarySelection"), id);
628+
if (selectPrimariesArray[id] && !particle.isPhysicalPrimary()) {
557629
continue;
558630
}
631+
// Count ids surviving the primary selection
632+
histos.fill(HIST("particles/idAfterPrimarySelection"), id);
559633

560634
const TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode());
561635
if (p) {

0 commit comments

Comments
 (0)