Skip to content

Commit fe9c954

Browse files
author
Stefanie Mrozinski
committed
fix MegaLinter
1 parent 755b80a commit fe9c954

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

PWGEM/PhotonMeson/Tasks/pairQcTask.cxx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,6 @@ struct PairQCTask {
930930
fRegistry.fill(HIST("Photon/AnalyticV0/hScore_R_Truth"), std::min(p.own.score, 29.9f), rB, truth); // o2-linter: disable=magic-number (clamp to the axis)
931931
fRegistry.fill(HIST("Photon/AnalyticV0/hPhotonLike_Truth"), isPhotonLike(p.own, mAltCuts) ? 1.f : 0.f, truth);
932932
}
933-
934933
template <bool IsMC>
935934
void runDedupQA(std::vector<PhotonCand>& cands)
936935
{
@@ -959,9 +958,12 @@ struct PairQCTask {
959958
const bool sameRecoTrack = (a.leg[static_cast<size_t>(il)].trackId == b.leg[static_cast<size_t>(il)].trackId) ||
960959
(a.leg[static_cast<size_t>(il)].trackId == b.leg[static_cast<size_t>(1 - il)].trackId);
961960
const bool sameMC = (ida == idb) || (ida == idbX);
962-
truth = (!sameRecoTrack && !sameMC) ? 0.f : (!sameRecoTrack && sameMC) ? 1.f
963-
: (sameRecoTrack && sameMC) ? 2.f
964-
: 3.f; // o2-linter: disable=magic-number (class codes, see booking)
961+
// 0 diff reco/diff MC, 1 diff reco/same MC, 2 same reco/same MC, 3 same reco/diff MC
962+
if (!sameRecoTrack) {
963+
truth = sameMC ? 1.f : 0.f;
964+
} else {
965+
truth = sameMC ? 2.f : 3.f; // o2-linter: disable=magic-number (class codes, see booking)
966+
}
965967
}
966968
const bool legFlagged = pairutil::legsIdentical(a.dedupCand, b.dedupCand, il, mDedupCfg);
967969
fRegistry.fill(HIST("Dedup/MC/hLegTrackTruthClass"), truth);
@@ -1001,9 +1003,8 @@ struct PairQCTask {
10011003
}
10021004
}
10031005
if (mcutil::classifyDupPair(a.mc, b.mc) == mcutil::DupClass::SameMcPhoton) {
1004-
const float splitType = (split[0] && split[1]) ? 3.f : split[0] ? 1.f
1005-
: split[1] ? 2.f
1006-
: 0.f; // o2-linter: disable=magic-number (split codes, see booking)
1006+
// 0 no split leg, 1 split e+, 2 split e-, 3 both
1007+
const float splitType = static_cast<float>((split[0] ? 1 : 0) + (split[1] ? 2 : 0)); // o2-linter: disable=magic-number (bit code, see booking)
10071008
fRegistry.fill(HIST("Dedup/MC/hSamePhotonDuplicateType"), splitType);
10081009
fRegistry.fill(HIST("Dedup/MC/hSamePhotonDuplicateType_vs_Flagged"), splitType, flagged ? 1.f : 0.f);
10091010
fRegistry.fill(HIST("Dedup/MC/hDupTrackClassMatrix"), static_cast<float>(a.dedupCand.nITSTPC), static_cast<float>(b.dedupCand.nITSTPC));

0 commit comments

Comments
 (0)