Skip to content

Commit 857c66c

Browse files
authored
Remove magic numbers to fix the O2Linter
1 parent 97a764a commit 857c66c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ struct HfTaskSingleMuonSource {
8989
double etaUp = -2.5; // up edge of eta acceptance
9090
double edgeZ = 10.0; // edge of event position Z
9191
double ptLow = 1.0; // low edge of pT for muon pairs
92-
int pdgLow = 10; // low edge of pdgCode for particle separation
93-
int pdgMid = 1000; // intermediate edge of pdgCode for particle separation
94-
int pdgHigh = 10000; // up edge of pdgCode for particle separation
9592

9693
HistogramRegistry registry{
9794
"registry",
@@ -148,6 +145,8 @@ struct HfTaskSingleMuonSource {
148145
uint8_t getMask(const McMuons::iterator& muon)
149146
{
150147
uint8_t mask(0);
148+
const int diquarkEdge = 1000;
149+
const int hadronEdge = 10000;
151150
if (muon.has_mcParticle()) {
152151
SETBIT(mask, IsIdentified);
153152
} else {
@@ -186,10 +185,10 @@ struct HfTaskSingleMuonSource {
186185
continue;
187186
} // Beam particle
188187

189-
if ((pdgRem < pdgLow) || (pdgRem >= pdgHigh)) {
188+
if ((pdgRem < kPi0) || (pdgRem >= hadronEdge)) {
190189
continue;
191190
}
192-
if ((pdgRem % 100 == kDown || pdgRem % 100 == kStrange) && pdgRem > pdgMid) { // diquarks
191+
if ((pdgRem % 100 == kDown || pdgRem % 100 == kStrange) && pdgRem > diquarkEdge) { // diquarks
193192
continue;
194193
}
195194
// compute the flavor of constituent quark
@@ -352,6 +351,7 @@ struct HfTaskSingleMuonSource {
352351
{
353352
int mcNum = 0;
354353
const int hadronStatus = 80;
354+
const int diquarkEdge = 1000;
355355
if (!muon.has_mcParticle()) {
356356
return 0;
357357
}
@@ -367,7 +367,7 @@ struct HfTaskSingleMuonSource {
367367
mcPart = mother;
368368
}
369369
int flv = mcPart.pdgCode() / std::pow(10, static_cast<int>(std::log10(std::abs(mcPart.pdgCode()))));
370-
if (std::abs(flv) == kBottom && mcPart.pdgCode() < pdgMid) {
370+
if (std::abs(flv) == kBottom && mcPart.pdgCode() < diquarkEdge) {
371371
flv = -flv;
372372
}
373373
for (int i = (mcPart.mothers_first_as<aod::McParticles>()).globalIndex(); i <= (mcPart.mothers_last_as<aod::McParticles>()).globalIndex(); i++) { // loop over the lund string

0 commit comments

Comments
 (0)