Skip to content

Commit e6a0bf3

Browse files
committed
Fix bugs found by cppcheck
- `Invalid abs() argument nr 1. A non-boolean value is required. [invalidFunctionArgBool]` - `Shifting 32-bit value by 63 bits is undefined behaviour [shiftTooManyBits]`
1 parent d8b84ce commit e6a0bf3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

PWGJE/Core/JetTaggingUtilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ int jetOrigin(T const& jet, U const& particles, float dRMax = 0.25)
350350
typename U::iterator parton1;
351351
typename U::iterator parton2;
352352
for (auto const& particle : particles) {
353-
if (std::abs(particle.getGenStatusCode() == 23)) {
353+
if (std::abs(particle.getGenStatusCode()) == 23) {
354354
if (!firstPartonFound) {
355355
parton1 = particle;
356356
firstPartonFound = true;

PWGJE/Tasks/trackJetQA.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ struct TrackJetQa {
272272
histos.fill(HIST("TrackPar/signed1Pt"), track.pt(), track.sigma1Pt() * track.pt(), track.signed1Pt(), collision.centFT0A(), collision.centFT0C());
273273
histos.fill(HIST("TrackPar/snp"), track.pt(), track.sigma1Pt() * track.pt(), track.snp(), collision.centFT0A(), collision.centFT0C());
274274
histos.fill(HIST("TrackPar/tgl"), track.pt(), track.sigma1Pt() * track.pt(), track.tgl(), collision.centFT0A(), collision.centFT0C());
275-
for (unsigned int i = 0; i < 64; i++) {
275+
for (unsigned int i = 0; i < 32; i++) {
276276
if (track.flags() & (1 << i)) {
277277
histos.fill(HIST("TrackPar/flags"), track.pt(), track.sigma1Pt() * track.pt(), i);
278278
}

0 commit comments

Comments
 (0)