Skip to content

Commit 1628f77

Browse files
committed
fix MegaLinter errors
1 parent a150df9 commit 1628f77

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

‎PWGJE/Tasks/emcTmMonitor.cxx‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ struct EmcTmMonitor {
422422
int supermoduleID = -1;
423423
try {
424424
supermoduleID = mGeometry->SuperModuleNumberFromEtaPhi(cluster.eta(), cluster.phi());
425-
} catch (o2::emcal::InvalidPositionException& e) {
425+
} catch (o2::emcal::InvalidPositionException const& e) {
426426
// Imprecision of the position at the sector boundaries, mostly due to
427427
// vertex imprecision. Skip these clusters for the now.
428428
continue;
@@ -657,25 +657,17 @@ struct EmcTmMonitor {
657657
for (const auto& cluster : clusters) {
658658
try {
659659
mGeometry->SuperModuleNumberFromEtaPhi(cluster.eta(), cluster.phi());
660-
} catch (o2::emcal::InvalidPositionException& e) {
660+
} catch (o2::emcal::InvalidPositionException const& e) {
661661
continue; // same as in processCollisions
662662
}
663663
const float clusterPt = cluster.energy() / std::cosh(cluster.eta());
664664
if (m02highPt > 0. && cluster.m02() >= maxM02HighPt && clusterPt >= m02highPt) {
665665
continue;
666666
}
667667

668-
// leading contributor: largest energy fraction
668+
// leading contributor: the labels are ordered by energy fraction (ClusterLabel::orderLabels in the ClusterFactory)
669669
const auto mcIds = cluster.mcParticleIds();
670-
const auto fractions = cluster.amplitudeA();
671-
int64_t leadId = -1;
672-
float maxFraction = -1.f;
673-
for (std::size_t i = 0; i < mcIds.size() && i < fractions.size(); ++i) {
674-
if (mcIds[i] >= 0 && fractions[i] > maxFraction) {
675-
maxFraction = fractions[i];
676-
leadId = mcIds[i];
677-
}
678-
}
670+
const int64_t leadId = mcIds.empty() ? -1 : mcIds[0];
679671
TmTruthClass truthClass = TmTruthClass::kOther;
680672
float mcPt = 0.f;
681673
float convRadius = -1.f;
@@ -820,7 +812,7 @@ struct EmcTmMonitor {
820812
result.emplace_back(50. + 2.0 * (i - 190));
821813
} else if (i < 235) { // o2-linter: disable=magic-number (just numbers for binning)
822814
result.emplace_back(100. + 5.0 * (i - 215));
823-
} else if (i < 245) { // o2-linter: disable=magic-number (just numbers for binning)
815+
} else {
824816
result.emplace_back(200. + 10.0 * (i - 235));
825817
}
826818
}

0 commit comments

Comments
 (0)