Skip to content

Commit 4a6e7bb

Browse files
Paola Vargas TorresPaola Vargas Torres
authored andcommitted
Fix PDG code used
1 parent 5ffff68 commit 4a6e7bb

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

PWGLF/Tasks/Nuspex/multiplicityPt.cxx

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,11 @@ struct MultiplicityPt {
149149
Preslice<aod::McParticles> perMCCol = aod::mcparticle::mcCollisionId;
150150

151151
enum ParticleSpecies : int {
152-
kPion = 0,
153-
kKaon = 1,
154-
kProton = 2,
155-
kNSpecies = 3
152+
PartPion = 0,
153+
PartKaon = 1,
154+
PartProton = 2,
156155
};
157156

158-
static constexpr int PDGPion = PDG_t::kPiPlus; // Changed from kPiPlus
159-
static constexpr int PDGKaon = PDG_t::kKPlus; // Changed from kKPlus
160-
static constexpr int PDGProton = PDG_t::kProton; // Changed from kProton
161-
162157
int getMagneticField(uint64_t timestamp)
163158
{
164159
static o2::parameters::GRPMagField* grpo = nullptr;
@@ -298,19 +293,19 @@ struct MultiplicityPt {
298293
bool passesPIDSelection(TrackType const& track) const
299294
{
300295
float nsigmaTPC = 0.f;
301-
if constexpr (species == kPion)
296+
if constexpr (species == PartPion)
302297
nsigmaTPC = track.tpcNSigmaPi();
303-
else if constexpr (species == kKaon)
298+
else if constexpr (species == PartKaon)
304299
nsigmaTPC = track.tpcNSigmaKa();
305-
else if constexpr (species == kProton)
300+
else if constexpr (species == PartProton)
306301
nsigmaTPC = track.tpcNSigmaPr();
307302

308303
float cutValue = cfgCutNsigma.value;
309-
if constexpr (species == kPion)
304+
if constexpr (species == PartPion)
310305
cutValue = cfgCutNsigmaPi.value;
311-
if constexpr (species == kKaon)
306+
if constexpr (species == PartKaon)
312307
cutValue = cfgCutNsigmaKa.value;
313-
if constexpr (species == kProton)
308+
if constexpr (species == PartProton)
314309
cutValue = cfgCutNsigmaPr.value;
315310

316311
return (std::abs(nsigmaTPC) < cutValue);
@@ -328,15 +323,15 @@ struct MultiplicityPt {
328323

329324
if (nsigmaPi < cfgCutNsigmaPi.value && nsigmaPi < minNSigma) {
330325
minNSigma = nsigmaPi;
331-
bestSpecies = kPion;
326+
bestSpecies = PartPion;
332327
}
333328
if (nsigmaKa < cfgCutNsigmaKa.value && nsigmaKa < minNSigma) {
334329
minNSigma = nsigmaKa;
335-
bestSpecies = kKaon;
330+
bestSpecies = PartKaon;
336331
}
337332
if (nsigmaPr < cfgCutNsigmaPr.value && nsigmaPr < minNSigma) {
338333
minNSigma = nsigmaPr;
339-
bestSpecies = kProton;
334+
bestSpecies = PartProton;
340335
}
341336
return bestSpecies;
342337
}
@@ -644,7 +639,7 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
644639
continue;
645640

646641
int pdgCode = std::abs(particle.pdgCode());
647-
if (pdgCode == PDGProton) {
642+
if (pdgCode == PDG_t::kProton) {
648643
nProtonsRaw++; // Count ALL protons regardless of status
649644

650645
if (!particle.isPhysicalPrimary())
@@ -701,25 +696,25 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
701696
// All generated (no cuts) - SIGNAL LOSS DENOMINATOR
702697
ue.fill(HIST("Inclusive/hPtPrimGenAll"), pt);
703698
ue.fill(HIST("MC/GenPtVsNch"), pt, nGenCharged);
704-
if (pdgCode == PDGPion)
699+
if (pdgCode == PDG_t::kPiPlus)
705700
ue.fill(HIST("Pion/hPtPrimGenAll"), pt);
706-
else if (pdgCode == PDGKaon)
701+
else if (pdgCode == PDG_t::kKPlus)
707702
ue.fill(HIST("Kaon/hPtPrimGenAll"), pt);
708-
else if (pdgCode == PDGProton)
703+
else if (pdgCode == PDG_t::kProton)
709704
ue.fill(HIST("Proton/hPtPrimGenAll"), pt);
710705

711706
// Physics selected - SIGNAL LOSS NUMERATOR & EFFICIENCY DENOMINATOR
712707
if (isPhysicsSelected) {
713708
ue.fill(HIST("Inclusive/hPtPrimGen"), pt);
714709
ue.fill(HIST("Inclusive/hPtDenEff"), pt);
715710
ue.fill(HIST("MC/GenPtVsNch_PhysicsSelected"), pt, nGenCharged);
716-
if (pdgCode == PDGPion) {
711+
if (pdgCode == PDG_t::kPiPlus) {
717712
ue.fill(HIST("Pion/hPtPrimGen"), pt);
718713
ue.fill(HIST("Pion/hPtDenEff"), pt);
719-
} else if (pdgCode == PDGKaon) {
714+
} else if (pdgCode == PDG_t::kKPlus) {
720715
ue.fill(HIST("Kaon/hPtPrimGen"), pt);
721716
ue.fill(HIST("Kaon/hPtDenEff"), pt);
722-
} else if (pdgCode == PDGProton) {
717+
} else if (pdgCode == PDG_t::kProton) {
723718
ue.fill(HIST("Proton/hPtPrimGen"), pt);
724719
ue.fill(HIST("Proton/hPtDenEff"), pt);
725720
}
@@ -728,11 +723,11 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
728723
// Bad vertex for signal loss study
729724
if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) {
730725
ue.fill(HIST("Inclusive/hPtPrimBadVertex"), pt);
731-
if (pdgCode == PDGPion)
726+
if (pdgCode == PDG_t::kPiPlus)
732727
ue.fill(HIST("Pion/hPtPrimBadVertex"), pt);
733-
else if (pdgCode == PDGKaon)
728+
else if (pdgCode == PDG_t::kKPlus)
734729
ue.fill(HIST("Kaon/hPtPrimBadVertex"), pt);
735-
else if (pdgCode == PDGProton)
730+
else if (pdgCode == PDG_t::kProton)
736731
ue.fill(HIST("Proton/hPtPrimBadVertex"), pt);
737732
}
738733
}
@@ -924,19 +919,19 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
924919
ue.fill(HIST("Inclusive/hPtPrimRecoEv"), particle.pt());
925920

926921
// Per-species efficiency numerator - NO PID requirement!
927-
if (pdgCode == PDGPion) {
922+
if (pdgCode == PDG_t::kPiPlus) {
928923
ue.fill(HIST("Pion/hPtNumEff"), particle.pt());
929924
ue.fill(HIST("Pion/hPtNumEffVsCent"), particle.pt(), cent);
930925
ue.fill(HIST("Pion/hPtPrimReco"), track.pt());
931926
ue.fill(HIST("Pion/hPtPrimRecoVsCent"), track.pt(), cent);
932927
ue.fill(HIST("Pion/hPtPrimRecoEv"), particle.pt());
933-
} else if (pdgCode == PDGKaon) {
928+
} else if (pdgCode == PDG_t::kKPlus) {
934929
ue.fill(HIST("Kaon/hPtNumEff"), particle.pt());
935930
ue.fill(HIST("Kaon/hPtNumEffVsCent"), particle.pt(), cent);
936931
ue.fill(HIST("Kaon/hPtPrimReco"), track.pt());
937932
ue.fill(HIST("Kaon/hPtPrimRecoVsCent"), track.pt(), cent);
938933
ue.fill(HIST("Kaon/hPtPrimRecoEv"), particle.pt());
939-
} else if (pdgCode == PDGProton) {
934+
} else if (pdgCode == PDG_t::kProton) {
940935
ue.fill(HIST("Proton/hPtNumEff"), particle.pt());
941936
ue.fill(HIST("Proton/hPtNumEffVsCent"), particle.pt(), cent);
942937
ue.fill(HIST("Proton/hPtPrimReco"), track.pt());
@@ -946,32 +941,32 @@ void MultiplicityPt::processMC(TrackTableMC const& tracks,
946941
} else {
947942
// Secondaries (non-primary particles)
948943
ue.fill(HIST("Inclusive/hPtSecReco"), track.pt());
949-
if (pdgCode == PDGPion)
944+
if (pdgCode == PDG_t::kPiPlus)
950945
ue.fill(HIST("Pion/hPtSecReco"), track.pt());
951-
else if (pdgCode == PDGKaon)
946+
else if (pdgCode == PDG_t::kKPlus)
952947
ue.fill(HIST("Kaon/hPtSecReco"), track.pt());
953-
else if (pdgCode == PDGProton)
948+
else if (pdgCode == PDG_t::kProton)
954949
ue.fill(HIST("Proton/hPtSecReco"), track.pt());
955950
}
956951
}
957952

958953
// PID selection - fill denominator for primary fraction and measured spectra
959954
int bestSpecies = getBestPIDHypothesis(track);
960-
if (bestSpecies == kPion) {
955+
if (bestSpecies == PartPion) {
961956
// Denominator for pion primary fraction: all tracks identified as pions
962957
ue.fill(HIST("Pion/hPtAllReco"), track.pt());
963958
ue.fill(HIST("Pion/hPtAllRecoVsCent"), track.pt(), cent);
964959
ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent);
965960
if (enablePIDHistograms)
966961
ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi());
967-
} else if (bestSpecies == kKaon) {
962+
} else if (bestSpecies == PartKaon) {
968963
// Denominator for kaon primary fraction: all tracks identified as kaons
969964
ue.fill(HIST("Kaon/hPtAllReco"), track.pt());
970965
ue.fill(HIST("Kaon/hPtAllRecoVsCent"), track.pt(), cent);
971966
ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent);
972967
if (enablePIDHistograms)
973968
ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa());
974-
} else if (bestSpecies == kProton) {
969+
} else if (bestSpecies == PartProton) {
975970
// Denominator for proton primary fraction: all tracks identified as protons
976971
ue.fill(HIST("Proton/hPtAllReco"), track.pt());
977972
ue.fill(HIST("Proton/hPtAllRecoVsCent"), track.pt(), cent);

0 commit comments

Comments
 (0)