|
47 | 47 |
|
48 | 48 | #include <chrono> |
49 | 49 | #include <cmath> |
| 50 | +#include <cstddef> |
50 | 51 | #include <cstdint> |
51 | 52 | #include <memory> |
52 | 53 | #include <string> |
@@ -185,9 +186,9 @@ struct HadronNucleiCorrelation { |
185 | 186 | // compact candidate vectors instead of re-reading the full MC particle table for every pair |
186 | 187 | struct GenCandidate { |
187 | 188 | 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; } |
191 | 192 | }; |
192 | 193 |
|
193 | 194 | // Per-collision information needed for generated-level same- and mixed-event pairing |
@@ -589,9 +590,8 @@ struct HadronNucleiCorrelation { |
589 | 590 | return; |
590 | 591 | } |
591 | 592 |
|
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); |
595 | 595 |
|
596 | 596 | for (int k = 0; k < nBinspT; k++) { |
597 | 597 |
|
@@ -660,9 +660,8 @@ struct HadronNucleiCorrelation { |
660 | 660 | void fillHistogramsGen(T1 const& part0, T1 const& part1, const bool ME) |
661 | 661 | { |
662 | 662 |
|
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); |
666 | 665 |
|
667 | 666 | for (int k = 0; k < nBinspT; k++) { |
668 | 667 |
|
|
0 commit comments