Skip to content

Commit 12fe962

Browse files
author
Stefanie Mrozinski
committed
fix o2-linter
1 parent 234bb82 commit 12fe962

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

PWGEM/PhotonMeson/Tasks/photonhbt.cxx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,38 @@ struct LegHelix {
163163
[[nodiscard]] inline float selfTestLegHelix()
164164
{
165165
float worst = 0.f;
166-
const float eps = 1.e-5f; // m, "at the origin"
167-
for (const float bz : {0.5f, -0.5f}) {
168-
for (const int q : {+1, -1}) {
169-
for (const float pt : {0.1f, 0.2f, 0.5f}) {
170-
for (const float r : {0.85f, 1.45f, 2.45f}) {
171-
for (const float phi : {0.f, 1.f, -2.f}) {
166+
constexpr float eps = 1.e-5f;
167+
168+
for (const auto& bz : {0.5f, -0.5f}) {
169+
for (const auto& q : {+1, -1}) {
170+
for (const auto& pt : {0.1f, 0.2f, 0.5f}) {
171+
for (const auto& r : {0.85f, 1.45f, 2.45f}) {
172+
for (const auto& phi : {0.f, 1.f, -2.f}) {
172173
const auto h = legHelixAt(eps * std::cos(phi), eps * std::sin(phi), phi, pt, q, bz, r);
174+
173175
if (h.status != 0) {
174176
continue;
175177
}
176-
const float arg = -0.3f * bz * static_cast<float>(q) * r / (2.f * pt);
178+
const float arg =
179+
-0.3f * bz * static_cast<float>(q) * r / (2.f * pt);
180+
177181
if (std::fabs(arg) >= 1.f) {
178182
continue;
179183
}
180-
const float ref = RecoDecay::constrainAngle(phi + std::asin(arg), 0.f);
181-
worst = std::max(worst, std::fabs(RecoDecay::constrainAngle(h.phiStar - ref, -o2::constants::math::PI)));
184+
const float referencePhi =
185+
RecoDecay::constrainAngle(phi + std::asin(arg), 0.f);
186+
187+
worst = std::max(
188+
worst,
189+
std::fabs(RecoDecay::constrainAngle(
190+
h.phiStar - referencePhi,
191+
-o2::constants::math::PI)));
182192
}
183193
}
184194
}
185195
}
186196
}
197+
187198
return worst;
188199
}
189200

@@ -1839,7 +1850,7 @@ struct Photonhbt {
18391850
for (int k = 0; k < s.nPoints[ic]; ++k) {
18401851
fRegistryCF.fill(HIST(dir) + HIST("hSparse_DzSignedLocal_dVtxZ_R"),
18411852
s.ptDZSgnLocal[ic][k], s.dVtxZ, s.ptR[ic][k]);
1842-
if (s.ptSameSide[ic][k] < 0.5f) {
1853+
if (s.ptSameSide[ic][k] < 0.5f) { // o2-linter: disable=magic-number
18431854
fRegistryCF.fill(HIST(dir) + HIST("hSparse_Calib_OppositeSide"), s.ptDRPhi[ic][k], s.ptDZ[ic][k]);
18441855
continue; // cannot merge: different endcap
18451856
}

0 commit comments

Comments
 (0)