Skip to content

Commit 7d78849

Browse files
committed
fixed: Use constant references for non-modified iterators in range-based for loops. [const-ref-in-for-loop]
1 parent 1e97743 commit 7d78849

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

PWGLF/Tasks/Resonances/k892hadronphotonBkg.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,13 @@ struct k892hadronphotonBkg {
698698

699699
// γ(coll1) × K0s(coll2)
700700
if (!photons1.empty() && !kshorts2.empty()) {
701-
for (const int pIdx : photons1) {
701+
for (const int& pIdx : photons1) {
702702
const auto& photon = fullV0s.rawIteratorAt(pIdx);
703703
float pP = std::hypot(photon.px(), photon.py(), photon.pz());
704704
ROOT::Math::PxPyPzEVector fourMomPhoton(
705705
photon.px(), photon.py(), photon.pz(), pP);
706706

707-
for (const int kIdx : kshorts2) {
707+
for (const int& kIdx : kshorts2) {
708708
const auto& kshort = fullV0s.rawIteratorAt(kIdx);
709709
float kP = std::hypot(kshort.px(), kshort.py(), kshort.pz());
710710
ROOT::Math::PxPyPzEVector fourMomKShort(

0 commit comments

Comments
 (0)