Skip to content

Commit 61544bd

Browse files
committed
RecoDecay: Fix compilation warnings
1 parent b422984 commit 61544bd

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Common/Core/RecoDecay.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ class RecoDecay
425425
{
426426
array<double, 3> momTotal{0., 0., 0.}; // candidate momentum vector
427427
double energyTot{0.}; // candidate energy
428-
for (auto iProng = 0; iProng < N; ++iProng) {
429-
for (auto iMom = 0; iMom < 3; ++iMom) {
428+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
429+
for (std::size_t iMom = 0; iMom < 3; ++iMom) {
430430
momTotal[iMom] += arrMom[iProng][iMom];
431431
} // loop over momentum components
432432
energyTot += E(arrMom[iProng], arrMass[iProng]);
@@ -505,7 +505,7 @@ class RecoDecay
505505
{
506506
auto decLenXY = distanceXY(posPV, posSV);
507507
double maxNormDeltaIP{0.};
508-
for (auto iProng = 0; iProng < N; ++iProng) {
508+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
509509
auto prongNormDeltaIP = normImpParMeasMinusExpProng(decLenXY, errDecLenXY, momMother, arrImpPar[iProng],
510510
arrErrImpPar[iProng], arrMom[iProng]);
511511
if (std::abs(prongNormDeltaIP) > std::abs(maxNormDeltaIP)) {
@@ -723,7 +723,7 @@ class RecoDecay
723723
*sign = sgn;
724724
}
725725
// Loop over decay candidate prongs
726-
for (auto iProng = 0; iProng < N; ++iProng) {
726+
for (std::size_t iProng = 0; iProng < N; ++iProng) {
727727
auto particleI = arrDaughters[iProng].mcParticle(); // ith daughter particle
728728
arrDaughtersIndex[iProng] = particleI.globalIndex();
729729
// Get the list of daughter indices from the mother of the first prong.
@@ -746,7 +746,7 @@ class RecoDecay
746746
return -1;
747747
}
748748
// Check that the number of direct daughters is not larger than the number of expected final daughters.
749-
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > N) {
749+
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > int(N)) {
750750
//Printf("MC Rec: Rejected: too many direct daughters: %d (expected %ld final)", indexDaughterLast - indexDaughterFirst + 1, N);
751751
return -1;
752752
}
@@ -766,7 +766,7 @@ class RecoDecay
766766
// Check that the daughter is in the list of final daughters.
767767
// (Check that the daughter is not a stepdaughter, i.e. particle pointing to the mother while not being its daughter.)
768768
bool isDaughterFound = false; // Is the index of this prong among the remaining expected indices of daughters?
769-
for (auto iD = 0; iD < arrAllDaughtersIndex.size(); ++iD) {
769+
for (std::size_t iD = 0; iD < arrAllDaughtersIndex.size(); ++iD) {
770770
if (arrDaughtersIndex[iProng] == arrAllDaughtersIndex[iD]) {
771771
arrAllDaughtersIndex[iD] = -1; // Remove this index from the array of expected daughters. (Rejects twin daughters, i.e. particle considered twice as a daughter.)
772772
isDaughterFound = true;
@@ -781,7 +781,7 @@ class RecoDecay
781781
auto PDGParticleI = particleI.pdgCode(); // PDG code of the ith daughter
782782
//Printf("MC Rec: Daughter %d PDG: %d", iProng, PDGParticleI);
783783
bool isPDGFound = false; // Is the PDG code of this daughter among the remaining expected PDG codes?
784-
for (auto iProngCp = 0; iProngCp < N; ++iProngCp) {
784+
for (std::size_t iProngCp = 0; iProngCp < N; ++iProngCp) {
785785
if (PDGParticleI == sgn * arrPDGDaughters[iProngCp]) {
786786
arrPDGDaughters[iProngCp] = 0; // Remove this PDG code from the array of expected ones.
787787
isPDGFound = true;
@@ -866,7 +866,7 @@ class RecoDecay
866866
return false;
867867
}
868868
// Check that the number of direct daughters is not larger than the number of expected final daughters.
869-
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > N) {
869+
if (indexDaughterFirst > -1 && indexDaughterLast > -1 && indexDaughterLast - indexDaughterFirst + 1 > int(N)) {
870870
//Printf("MC Gen: Rejected: too many direct daughters: %d (expected %ld final)", indexDaughterLast - indexDaughterFirst + 1, N);
871871
return false;
872872
}
@@ -888,7 +888,7 @@ class RecoDecay
888888
auto PDGCandidateDaughterI = candidateDaughterI.pdgCode(); // PDG code of the ith daughter
889889
//Printf("MC Gen: Daughter %d PDG: %d", indexDaughterI, PDGCandidateDaughterI);
890890
bool isPDGFound = false; // Is the PDG code of this daughter among the remaining expected PDG codes?
891-
for (auto iProngCp = 0; iProngCp < N; ++iProngCp) {
891+
for (std::size_t iProngCp = 0; iProngCp < N; ++iProngCp) {
892892
if (PDGCandidateDaughterI == sgn * arrPDGDaughters[iProngCp]) {
893893
arrPDGDaughters[iProngCp] = 0; // Remove this PDG code from the array of expected ones.
894894
isPDGFound = true;

0 commit comments

Comments
 (0)