Skip to content

Commit 8034074

Browse files
fix linter warning
1 parent d596bf5 commit 8034074

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

Common/Core/TrackSelectorPID.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class TrackSelectorPidBase
4343
/// Default constructor
4444
TrackSelectorPidBase() = default;
4545

46-
static constexpr float kPidNsigmaMin = -999.f;
47-
static constexpr float kPidNsigmaMax = 999.f;
46+
static constexpr float NsigmaPidMin = -999.f;
47+
static constexpr float NsigmaPidMax = 999.f;
4848

4949
/// Conversion operator
5050
template <uint64_t pdgNew>
@@ -114,7 +114,7 @@ class TrackSelectorPidBase
114114
bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = -999.f)
115115
{
116116
// Accept if selection is disabled via large values.
117-
if (mNSigmaTpcMin < kPidNsigmaMin && mNSigmaTpcMax > kPidNsigmaMax) {
117+
if (mNSigmaTpcMin < NsigmaPidMin && mNSigmaTpcMax > NsigmaPidMax) {
118118
return true;
119119
}
120120

@@ -130,18 +130,18 @@ class TrackSelectorPidBase
130130
nSigma = track.tpcNSigmaKa();
131131
} else if constexpr (pdg == kProton) {
132132
nSigma = track.tpcNSigmaPr();
133-
} else if constexpr (pdg == o2::constants::physics::kDeuteron) {
133+
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
134134
nSigma = track.tpcNSigmaDe();
135135
} else {
136136
errorPdg();
137137
}
138138

139139
/// use custom TPC nσ, if a valid value is provided
140-
if (tpcNSigmaCustom > kPidNsigmaMin) {
140+
if (tpcNSigmaCustom > NsigmaPidMin) {
141141
nSigma = tpcNSigmaCustom;
142142
}
143143

144-
if (mNSigmaTpcMinCondTof < kPidNsigmaMin && mNSigmaTpcMaxCondTof > kPidNsigmaMax) {
144+
if (mNSigmaTpcMinCondTof < NsigmaPidMin && mNSigmaTpcMaxCondTof > NsigmaPidMax) {
145145
conditionalTof = true;
146146
} else {
147147
conditionalTof = mNSigmaTpcMinCondTof <= nSigma && nSigma <= mNSigmaTpcMaxCondTof;
@@ -210,7 +210,7 @@ class TrackSelectorPidBase
210210
bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = -999.f)
211211
{
212212
// Accept if selection is disabled via large values.
213-
if (mNSigmaTofMin < kPidNsigmaMin && mNSigmaTofMax > kPidNsigmaMax) {
213+
if (mNSigmaTofMin < NsigmaPidMin && mNSigmaTofMax > NsigmaPidMax) {
214214
return true;
215215
}
216216

@@ -226,18 +226,18 @@ class TrackSelectorPidBase
226226
nSigma = track.tofNSigmaKa();
227227
} else if constexpr (pdg == kProton) {
228228
nSigma = track.tofNSigmaPr();
229-
} else if constexpr (pdg == o2::constants::physics::kDeuteron) {
229+
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
230230
nSigma = track.tofNSigmaDe();
231231
} else {
232232
errorPdg();
233233
}
234234

235235
/// use custom TOF nσ, if a valid value is provided
236-
if (tofNSigmaCustom > kPidNsigmaMin) {
236+
if (tofNSigmaCustom > NsigmaPidMin) {
237237
nSigma = tofNSigmaCustom;
238238
}
239239

240-
if (mNSigmaTofMinCondTpc < kPidNsigmaMin && mNSigmaTofMaxCondTpc > kPidNsigmaMax) {
240+
if (mNSigmaTofMinCondTpc < NsigmaPidMin && mNSigmaTofMaxCondTpc > NsigmaPidMax) {
241241
conditionalTpc = true;
242242
} else {
243243
conditionalTpc = mNSigmaTofMinCondTpc <= nSigma && nSigma <= mNSigmaTofMaxCondTpc;
@@ -308,7 +308,7 @@ class TrackSelectorPidBase
308308
bool isSelectedByRich(const T& track, bool& conditionalTof)
309309
{
310310
// Accept if selection is disabled via large values.
311-
if (mNSigmaRichMin < kPidNsigmaMin && mNSigmaRichMax > kPidNsigmaMax) {
311+
if (mNSigmaRichMin < NsigmaPidMin && mNSigmaRichMax > NsigmaPidMax) {
312312
return true;
313313
}
314314

@@ -328,7 +328,7 @@ class TrackSelectorPidBase
328328
errorPdg();
329329
}
330330

331-
if (mNSigmaRichMinCondTof < kPidNsigmaMin && mNSigmaRichMaxCondTof > kPidNsigmaMax) {
331+
if (mNSigmaRichMinCondTof < NsigmaPidMin && mNSigmaRichMaxCondTof > NsigmaPidMax) {
332332
conditionalTof = true;
333333
} else {
334334
conditionalTof = mNSigmaRichMinCondTof <= nSigma && nSigma <= mNSigmaRichMaxCondTof;
@@ -471,29 +471,29 @@ class TrackSelectorPidBase
471471
template <typename T>
472472
bool isElectronAndNotPion(const T& track, bool useTof = true, bool useRich = true)
473473
{
474-
static constexpr float kPidNsigmaInvalid = -1000.f;
475-
static constexpr float kPidTofRichTransitionPMin = 0.4f;
476-
static constexpr float kPidTofRichTransitionPMax = 0.6f;
477-
static constexpr float kPidRichPionBandPMin = 1.0f;
478-
static constexpr float kPidRichPionBandPMax = 2.0f;
474+
static constexpr float PidNsigmaInvalid = -1000.f;
475+
static constexpr float PidTofRichTransitionPMin = 0.4f;
476+
static constexpr float PidTofRichTransitionPMax = 0.6f;
477+
static constexpr float PidRichPionBandPMin = 1.0f;
478+
static constexpr float PidRichPionBandPMax = 2.0f;
479479

480480
bool isSelTof = false;
481481
bool isSelRich = false;
482482
bool hasRich = track.richId() > -1;
483483
bool hasTof = isValidForTof(track);
484484
auto nSigmaTofEl = track.tofNSigmaEl();
485485
auto nSigmaTofPi = track.tofNSigmaPi();
486-
auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : kPidNsigmaInvalid;
487-
auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : kPidNsigmaInvalid;
486+
auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : PidNsigmaInvalid;
487+
auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : PidNsigmaInvalid;
488488
auto p = track.p();
489489

490490
// TOF
491-
if (useTof && hasTof && (p < kPidTofRichTransitionPMax)) {
492-
if (p > kPidTofRichTransitionPMin && hasRich) {
491+
if (useTof && hasTof && (p < PidTofRichTransitionPMax)) {
492+
if (p > PidTofRichTransitionPMin && hasRich) {
493493
if ((std::abs(nSigmaTofEl) < mNSigmaTofMax) && (std::abs(nSigmaRichEl) < mNSigmaRichMax)) {
494494
isSelTof = true; // is selected as electron by TOF and RICH
495495
}
496-
} else if (p <= kPidTofRichTransitionPMin) {
496+
} else if (p <= PidTofRichTransitionPMin) {
497497
if (std::abs(nSigmaTofEl) < mNSigmaTofMax) {
498498
isSelTof = true; // is selected as electron by TOF
499499
}
@@ -512,7 +512,7 @@ class TrackSelectorPidBase
512512
if (std::abs(nSigmaRichEl) < mNSigmaRichMax) {
513513
isSelRich = true; // is selected as electron by RICH
514514
}
515-
if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > kPidRichPionBandPMin) && (p < kPidRichPionBandPMax)) {
515+
if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > PidRichPionBandPMin) && (p < PidRichPionBandPMax)) {
516516
isSelRich = false; // is selected as pion by RICH
517517
}
518518
} else {
@@ -564,7 +564,7 @@ class TrackSelectorPidBase
564564
return track.bayesID() == o2::track::PID::Kaon;
565565
} else if constexpr (pdg == kProton) {
566566
return track.bayesID() == o2::track::PID::Proton;
567-
} else if constexpr (pdg == o2::constants::physics::kDeuteron) {
567+
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
568568
return track.bayesID() == o2::track::PID::Deuteron;
569569
} else {
570570
errorPdg();
@@ -594,7 +594,7 @@ class TrackSelectorPidBase
594594
prob = track.bayesKa();
595595
} else if constexpr (pdg == kProton) {
596596
prob = track.bayesPr();
597-
} else if constexpr (pdg == o2::constants::physics::kDeuteron) {
597+
} else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) {
598598
prob = track.bayesDe();
599599
} else {
600600
errorPdg();
@@ -673,11 +673,11 @@ class TrackSelectorPidBase
673673
};
674674

675675
// Predefined types
676-
using TrackSelectorEl = TrackSelectorPidBase<kElectron>; // El
677-
using TrackSelectorMu = TrackSelectorPidBase<kMuonMinus>; // Mu
678-
using TrackSelectorPi = TrackSelectorPidBase<kPiPlus>; // Pi
679-
using TrackSelectorKa = TrackSelectorPidBase<kKPlus>; // Ka
680-
using TrackSelectorPr = TrackSelectorPidBase<kProton>; // Pr
681-
using TrackSelectorDe = TrackSelectorPidBase<o2::constants::physics::kDeuteron>; // De
676+
using TrackSelectorEl = TrackSelectorPidBase<kElectron>; // El
677+
using TrackSelectorMu = TrackSelectorPidBase<kMuonMinus>; // Mu
678+
using TrackSelectorPi = TrackSelectorPidBase<kPiPlus>; // Pi
679+
using TrackSelectorKa = TrackSelectorPidBase<kKPlus>; // Ka
680+
using TrackSelectorPr = TrackSelectorPidBase<kProton>; // Pr
681+
using TrackSelectorDe = TrackSelectorPidBase<o2::constants::physics::Pdg::kDeuteron>; // De
682682

683683
#endif // COMMON_CORE_TRACKSELECTORPID_H_

0 commit comments

Comments
 (0)