Skip to content

Commit 4db50c1

Browse files
committed
Fix cpplinter warning in identified RAA task
1 parent f2fb3b5 commit 4db50c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

PWGLF/Tasks/Nuspex/identifiedraa.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ struct identifiedraaTask {
222222
template <std::size_t i, typename T>
223223
void fillHistogramsData(T const& tracks)
224224
{
225+
static_assert(i < 6, "Index i out of bounds");
225226
for (auto& track : tracks) {
226227
if (std::abs(track.eta()) > 0.8) {
227228
continue;
@@ -235,10 +236,8 @@ struct identifiedraaTask {
235236
continue;
236237
}
237238
}
238-
float mass;
239-
if constexpr ((i == 0) || (i == 1)) {
240-
mass = 0.13957; // pion mass
241-
} else if constexpr ((i == 2) || (i == 3)) {
239+
float mass{0.13957};
240+
if constexpr ((i == 2) || (i == 3)) {
242241
mass = 0.49367; // kaon mass
243242
} else if constexpr ((i == 4) || (i == 5)) {
244243
mass = 0.93827; // proton mass

0 commit comments

Comments
 (0)