Skip to content

Commit cd98f9e

Browse files
authored
Making MegaLinter and O2linter happy
1 parent 9d512de commit cd98f9e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include <numeric>
5959
#include <string>
6060
#include <unordered_map>
61+
#include <utility>
6162
#include <vector>
6263

6364
using namespace o2::framework;
@@ -116,9 +117,10 @@ struct UpcCandProducerGlobalMuon {
116117
o2::vertexing::FwdDCAFitterN<2> fFwdFitter;
117118

118119
// Named constants (avoid magic numbers in expressions)
119-
static constexpr double kBcTimeRoundingOffset = 1.; // Offset used when rounding trackTime to BC units
120-
static constexpr uint16_t kMinTracksForPair = 2; // Minimum tracks required to compute a pair invariant mass
121-
static constexpr uint16_t kMinTracksForCandidate = 1; // Minimum contributors required to save a candidate
120+
static constexpr double kBcTimeRoundingOffset = 1.; // Offset used when rounding trackTime to BC units
121+
static constexpr uint16_t kMinTracksForPair = 2; // Minimum tracks required to compute a pair invariant mass
122+
static constexpr uint16_t kMinTracksForCandidate = 1; // Minimum contributors required to save a candidate
123+
static constexpr int kUpperBoundaryToTrackTypeEnum = 2; // Make sure you use MFT tracks
122124

123125
void init(InitContext&)
124126
{
@@ -514,7 +516,7 @@ struct UpcCandProducerGlobalMuon {
514516
fBestMuonMatch.clear();
515517
std::unordered_map<int, std::pair<float, int>> mCandidates;
516518
for (const auto& muon : fwdTracks) {
517-
if (static_cast<int>(muon.trackType()) < 2) {
519+
if (static_cast<int>(muon.trackType()) < kUpperBoundaryToTrackTypeEnum) {
518520
auto muonID = muon.matchMCHTrackId();
519521
auto chi2 = muon.chi2MatchMCHMFT();
520522
if (mCandidates.find(muonID) == mCandidates.end()) {
@@ -526,7 +528,7 @@ struct UpcCandProducerGlobalMuon {
526528
}
527529
}
528530
}
529-
for (auto& pairCand : mCandidates) {
531+
for (const auto& pairCand : mCandidates) {
530532
fBestMuonMatch[pairCand.second.second] = true;
531533
}
532534
}
@@ -638,7 +640,7 @@ struct UpcCandProducerGlobalMuon {
638640
continue;
639641

640642
// For global tracks, skip if not the best match for this MCH track
641-
if (fKeepBestMuonMatch && static_cast<int>(trackType) < 2) {
643+
if (fKeepBestMuonMatch && static_cast<int>(trackType) < kUpperBoundaryToTrackTypeEnum) {
642644
if (fBestMuonMatch.find(fwdTrack.globalIndex()) == fBestMuonMatch.end()) {
643645
continue;
644646
}

0 commit comments

Comments
 (0)