We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85a3216 commit 204f5f5Copy full SHA for 204f5f5
PWGLF/Tasks/Nuspex/identifiedraa.cxx
@@ -222,6 +222,7 @@ struct identifiedraaTask {
222
template <std::size_t i, typename T>
223
void fillHistogramsData(T const& tracks)
224
{
225
+ static_assert(i < 6, "Index i out of bounds");
226
for (auto& track : tracks) {
227
if (std::abs(track.eta()) > 0.8) {
228
continue;
@@ -235,10 +236,8 @@ struct identifiedraaTask {
235
236
237
}
238
- float mass;
239
- if constexpr ((i == 0) || (i == 1)) {
240
- mass = 0.13957; // pion mass
241
- } else if constexpr ((i == 2) || (i == 3)) {
+ float mass{0.13957};
+ if constexpr ((i == 2) || (i == 3)) {
242
mass = 0.49367; // kaon mass
243
} else if constexpr ((i == 4) || (i == 5)) {
244
mass = 0.93827; // proton mass
0 commit comments