Skip to content

Commit e72fde8

Browse files
authored
Update PDG check to avoid zero comparison
1 parent d1ad791 commit e72fde8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ALICE3/Tasks/alice3-qa-singleparticle.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ struct Alice3SingleParticle {
249249
} else {
250250
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
251251
}
252-
if (mcParticle.pdgCode() != PDG) {
252+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
253253
continue;
254254
}
255255
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -417,7 +417,7 @@ struct Alice3SingleParticle {
417417
LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode();
418418
}
419419
} else {
420-
if (mcParticle.pdgCode() != PDG) {
420+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
421421
continue;
422422
}
423423
histos.fill(HIST("track/Pt"), track.pt() * charge);
@@ -469,7 +469,7 @@ struct Alice3SingleParticle {
469469
} else {
470470
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
471471
}
472-
if (mcParticle.pdgCode() != PDG) {
472+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
473473
continue;
474474
}
475475
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -609,7 +609,7 @@ struct Alice3SingleParticle {
609609
} else {
610610
histos.get<TH2>(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f);
611611
}
612-
if (mcParticle.pdgCode() != PDG) {
612+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
613613
continue;
614614
}
615615
if (mcParticle.y() < yMin || mcParticle.y() > yMax) {
@@ -734,7 +734,7 @@ struct Alice3SingleParticle {
734734
LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode();
735735
}
736736
} else {
737-
if (mcParticle.pdgCode() != PDG) {
737+
if (PDG != 0 && mcParticle.pdgCode() != PDG) {
738738
continue;
739739
}
740740
histos.fill(HIST("track/Pt"), track.pt() * charge);

0 commit comments

Comments
 (0)