Skip to content

Commit 3f97ab0

Browse files
authored
fix magic number issue
1 parent 71292db commit 3f97ab0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ enum PartTypes {
158158
kPhysPrim = BIT(22)
159159
};
160160

161+
enum TrackCharge {
162+
kAll = 0,
163+
kNegative = 1,
164+
kPositive = 2
165+
}
166+
161167
struct EbyeMaker {
162168
Produces<aod::CollEbyeTable> collisionEbyeTable;
163169
Produces<aod::MiniCollTable> miniCollTable;
@@ -571,7 +577,7 @@ struct EbyeMaker {
571577
continue;
572578
}
573579
histos.fill(HIST("QA/tpcSignal"), track.tpcInnerParam(), track.tpcSignal());
574-
if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == 1) || (track.sign() > 0 && countOnlyLSTrk == 2) || (countOnlyLSTrk == 0)))
580+
if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TrackCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TrackCharge::kPositive) || (countOnlyLSTrk == TrackCharge::kAll)))
575581
nTracksColl++;
576582

577583
for (int iP{0}; iP < kNpart; ++iP) {
@@ -856,7 +862,7 @@ struct EbyeMaker {
856862
auto genPt = std::hypot(mcPart.px(), mcPart.py());
857863
if ((std::abs(pdgCode) == PDG_t::kPiPlus || std::abs(pdgCode) == PDG_t::kElectron || std::abs(pdgCode) == PDG_t::kMuonMinus || std::abs(pdgCode) == PDG_t::kKPlus || std::abs(pdgCode) == PDG_t::kProton) && mcPart.isPhysicalPrimary() && genPt > ptMin[0] && genPt < ptMax[0]) {
858864
int ch = (pdgCode == PDG_t::kPiPlus || pdgCode == -PDG_t::kElectron || pdgCode == -PDG_t::kMuonMinus || pdgCode == PDG_t::kKPlus || pdgCode == PDG_t::kProton) ? 1 : -1;
859-
if ((ch < 0 && countOnlyLSTrk == 1) || (ch > 0 && countOnlyLSTrk == 2) || (countOnlyLSTrk == 0))
865+
if ((ch < 0 && countOnlyLSTrk == TrackCharge::kNegative) || (ch > 0 && countOnlyLSTrk == TrackCharge::kPositive) || (countOnlyLSTrk == TrackCharge::kAll))
860866
nChPartGen++;
861867
}
862868
if (std::abs(pdgCode) == PDG_t::kLambda0) {

0 commit comments

Comments
 (0)