Skip to content

Commit b49a253

Browse files
authored
Fix code check warnings in previous PR
1 parent 9fe4e71 commit b49a253

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
#include <chrono>
4949
#include <cmath>
50+
#include <cstddef>
5051
#include <cstdint>
5152
#include <memory>
5253
#include <string>
@@ -185,9 +186,9 @@ struct HadronNucleiCorrelation {
185186
// compact candidate vectors instead of re-reading the full MC particle table for every pair
186187
struct GenCandidate {
187188
float ptVal, etaVal, phiVal;
188-
float pt() const { return ptVal; }
189-
float eta() const { return etaVal; }
190-
float phi() const { return phiVal; }
189+
[[nodiscard]] float pt() const { return ptVal; }
190+
[[nodiscard]] float eta() const { return etaVal; }
191+
[[nodiscard]] float phi() const { return phiVal; }
191192
};
192193

193194
// Per-collision information needed for generated-level same- and mixed-event pairing
@@ -589,9 +590,8 @@ struct HadronNucleiCorrelation {
589590
return;
590591
}
591592

592-
float deltaEta = part0.eta() - part1.eta();
593-
float deltaPhi = part0.phi() - part1.phi();
594-
deltaPhi = RecoDecay::constrainAngle(deltaPhi, -1 * o2::constants::math::PIHalf);
593+
const float deltaEta = part0.eta() - part1.eta();
594+
const float deltaPhi = RecoDecay::constrainAngle(part0.phi() - part1.phi(), -1 * o2::constants::math::PIHalf);
595595

596596
for (int k = 0; k < nBinspT; k++) {
597597

@@ -660,9 +660,8 @@ struct HadronNucleiCorrelation {
660660
void fillHistogramsGen(T1 const& part0, T1 const& part1, const bool ME)
661661
{
662662

663-
float deltaEta = part0.eta() - part1.eta();
664-
float deltaPhi = part0.phi() - part1.phi();
665-
deltaPhi = RecoDecay::constrainAngle(deltaPhi, -1 * o2::constants::math::PIHalf);
663+
const float deltaEta = part0.eta() - part1.eta();
664+
const float deltaPhi = RecoDecay::constrainAngle(part0.phi() - part1.phi(), -1 * o2::constants::math::PIHalf);
666665

667666
for (int k = 0; k < nBinspT; k++) {
668667

0 commit comments

Comments
 (0)