Skip to content

Commit 9d13e6a

Browse files
committed
const-ref-in-for-loop fix
1 parent aec0fe2 commit 9d13e6a

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

PWGLF/TableProducer/Strangeness/v0qaanalysis.cxx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ struct LfV0qaanalysis {
265265
registry.fill(HIST("hCentFT0M"), collision.centFT0M());
266266
registry.fill(HIST("hCentNGlobals"), collision.centNGlobal());
267267

268-
for (auto& v0 : V0s) { // loop over V0s
268+
for (const auto& v0 : V0s) { // loop over V0s
269269

270270
if (v0.v0Type() != v0TypeSelection) {
271271
continue;
@@ -358,7 +358,7 @@ struct LfV0qaanalysis {
358358
}
359359

360360
auto v0sThisCollision = V0s.sliceBy(perCol, collision.globalIndex());
361-
for (auto& v0 : v0sThisCollision) { // loop over V0s
361+
for (const auto& v0 : v0sThisCollision) { // loop over V0s
362362

363363
if (!v0.has_mcParticle()) {
364364
continue;
@@ -406,8 +406,8 @@ struct LfV0qaanalysis {
406406
lPDG = v0mcparticle.pdgCode();
407407
isprimary = v0mcparticle.isPhysicalPrimary();
408408
}
409-
for (auto& mcparticleDaughter0 : v0mcparticle.daughters_as<aod::McParticles>()) {
410-
for (auto& mcparticleDaughter1 : v0mcparticle.daughters_as<aod::McParticles>()) {
409+
for (const auto& mcparticleDaughter0 : v0mcparticle.daughters_as<aod::McParticles>()) {
410+
for (const auto& mcparticleDaughter1 : v0mcparticle.daughters_as<aod::McParticles>()) {
411411
if (mcparticleDaughter0.pdgCode() == 211 && mcparticleDaughter1.pdgCode() == -211) {
412412
isDauK0Short = true;
413413
}
@@ -424,7 +424,7 @@ struct LfV0qaanalysis {
424424
float pdgMother = 0.;
425425

426426
if (std::abs(v0mcparticle.pdgCode()) == 3122 && v0mcparticle.has_mothers()) {
427-
for (auto& mcparticleMother0 : v0mcparticle.mothers_as<aod::McParticles>()) {
427+
for (const auto& mcparticleMother0 : v0mcparticle.mothers_as<aod::McParticles>()) {
428428
if (std::abs(mcparticleMother0.pdgCode()) == 3312 || std::abs(mcparticleMother0.pdgCode()) == 3322) {
429429
ptMotherMC = mcparticleMother0.pt();
430430
pdgMother = mcparticleMother0.pdgCode();
@@ -470,7 +470,7 @@ struct LfV0qaanalysis {
470470
// Generated particles
471471
const auto particlesInCollision = mcParticles.sliceByCached(aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache1);
472472

473-
for (auto& mcParticle : particlesInCollision) {
473+
for (const auto& mcParticle : particlesInCollision) {
474474
if (!mcParticle.isPhysicalPrimary()) {
475475
continue;
476476
}
@@ -540,7 +540,7 @@ struct LfV0qaanalysis {
540540
//===== Signal Loss Denominator =======
541541
//=====================================
542542

543-
for (auto& mcParticle : mcParticles) {
543+
for (const auto& mcParticle : mcParticles) {
544544

545545
if (!mcParticle.isPhysicalPrimary()) {
546546
continue;
@@ -571,7 +571,7 @@ struct LfV0qaanalysis {
571571

572572
int recoCollIndex_INEL = 0;
573573
int recoCollIndex_INELgt0 = 0;
574-
for (auto& collision : collisions) { // loop on reconstructed collisions
574+
for (const auto& collision : collisions) { // loop on reconstructed collisions
575575

576576
//=====================================
577577
//====== Event Split Numerator ========
@@ -598,7 +598,7 @@ struct LfV0qaanalysis {
598598
//======== Sgn Split Numerator ========
599599
//=====================================
600600

601-
for (auto& mcParticle : mcParticles) {
601+
for (const auto& mcParticle : mcParticles) {
602602

603603
if (!mcParticle.isPhysicalPrimary()) {
604604
continue;
@@ -650,7 +650,7 @@ struct LfV0qaanalysis {
650650
//===== Signal Loss Numerator =========
651651
//=====================================
652652

653-
for (auto& mcParticle : mcParticles) {
653+
for (const auto& mcParticle : mcParticles) {
654654

655655
if (!mcParticle.isPhysicalPrimary()) {
656656
continue;
@@ -727,7 +727,7 @@ struct LfMyV0s {
727727

728728
void process(aod::MyV0Candidates const& myv0s)
729729
{
730-
for (auto& candidate : myv0s) {
730+
for (const auto& candidate : myv0s) {
731731

732732
registry.fill(HIST("hMassLambda"), candidate.masslambda());
733733
registry.fill(HIST("hPt"), candidate.v0pt());

0 commit comments

Comments
 (0)