Skip to content

Commit a5a28d6

Browse files
authored
Refactor negative particle momentum handling
1 parent 9d6e00d commit a5a28d6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

PWGJE/TableProducer/diffWakeTreeProducer.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,27 +232,30 @@ struct DiffWakeTreeProducer {
232232

233233
int64_t particlePx = (track.px() * 6000);
234234
if (particlePx < 0)
235+
{
235236
substituteP |= static_cast<uint64_t>(1) << uppermostBit;
236-
if (particlePx < 0)
237237
particlePx = (-1) * particlePx;
238+
}
238239
substituteP |= (particlePx & bitmask20Bits) << lowermostBit;
239240

240241
uppermostBit = 41;
241242
lowermostBit = 21;
242243
int64_t particlePy = (track.py() * 6000);
243244
if (particlePy < 0)
245+
{
244246
substituteP |= static_cast<uint64_t>(1) << uppermostBit;
245-
if (particlePy < 0)
246247
particlePy = (-1) * particlePy;
248+
}
247249
substituteP |= (particlePy & bitmask20Bits) << lowermostBit;
248250

249251
uppermostBit = 62;
250252
lowermostBit = 42;
251253
int64_t particlePz = (track.pz() * 6000);
252254
if (particlePz < 0)
255+
{
253256
substituteP |= static_cast<uint64_t>(1) << uppermostBit;
254-
if (particlePz < 0)
255257
particlePz = (-1) * particlePz;
258+
}
256259
substituteP |= (particlePz & bitmask20Bits) << lowermostBit;
257260

258261
// dEdx

0 commit comments

Comments
 (0)