@@ -3424,7 +3424,7 @@ struct Photonhbt {
34243424 pcaOut = 999 .f ;
34253425 cospaOut = -1 .f ;
34263426 convROut = -1 .f ;
3427- if (std::fabs (bzkG) < 0 .1f || collisionId < 0 ) {
3427+ if (std::fabs (bzkG) < 0 .1f || collisionId < 0 ) { // o2-linter: disable=magic-number (check if number is too small)
34283428 return 999 .f ;
34293429 }
34303430 const auto posTrk = tracks.rawIteratorAt (posId);
@@ -3436,7 +3436,7 @@ struct Photonhbt {
34363436 const float dcx = h2.xC - h1.xC ;
34373437 const float dcy = h2.yC - h1.yC ;
34383438 const float d = std::hypot (dcx, dcy);
3439- if (d < 1e-3f ) {
3439+ if (d < 1e-3f ) { // o2-linter: disable=magic-number (check if number is too small)
34403440 return 999 .f ;
34413441 }
34423442 const float ux = dcx / d;
@@ -3471,7 +3471,7 @@ struct Photonhbt {
34713471 const float gx = pP[0 ] + pN[0 ], gy = pP[1 ] + pN[1 ], gz = pP[2 ] + pN[2 ];
34723472 const float fn = std::sqrt (fx * fx + fy * fy + fz * fz);
34733473 const float gn = std::sqrt (gx * gx + gy * gy + gz * gz);
3474- if (fn < 1e-3f || gn < 1e-6f ) {
3474+ if (fn < 1e-3f || gn < 1e-6f ) { // o2-linter: disable=magic-number (check if number is too small)
34753475 return 999 .f ;
34763476 }
34773477 const float cospa = std::clamp ((fx * gx + fy * gy + fz * gz) / (fn * gn), -1 .f , 1 .f );
@@ -3583,7 +3583,7 @@ struct Photonhbt {
35833583 if (itV == v0sByPosTrack.end ()) {
35843584 continue ;
35853585 }
3586- for (const int iv : itV->second ) {
3586+ for (const int & iv : itV->second ) {
35873587 const auto & v = allCands[iv];
35883588 bool negOk = false ;
35893589 for (const auto & [negGi, negCol] : itNeg->second ) {
@@ -3660,7 +3660,7 @@ struct Photonhbt {
36603660 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaScore" ), cls, std::min (allCands[i].score , 29 .9f ));
36613661 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaPCA" ), cls, std::min (allCands[i].pca , 29 .9f ));
36623662 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaCosPA" ), cls, allCands[i].cospa );
3663- if (allCands[i].convR > 35 .f ) {
3663+ if (allCands[i].convR > 35 .f ) { // o2-linter: disable=magic-number (radius)
36643664 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaScore_Rgt35" ), cls, std::min (allCands[i].score , 29 .9f ));
36653665 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaPCA_Rgt35" ), cls, std::min (allCands[i].pca , 29 .9f ));
36663666 fRegistryTruthMC .fill (HIST (" MCAOD/hAnaCosPA_Rgt35" ), cls, allCands[i].cospa );
@@ -3680,7 +3680,7 @@ struct Photonhbt {
36803680 order[i] = i;
36813681 }
36823682 std::sort (order.begin (), order.end (), [&](int a, int b) {
3683- if (ordering == 2 ) { // score-based: lower score picks first
3683+ if (ordering == 2 ) { // o2-linter: disable=magic-number (check if number is too small)
36843684 if (allCands[a].score != allCands[b].score ) {
36853685 return allCands[a].score < allCands[b].score ;
36863686 }
@@ -3695,7 +3695,7 @@ struct Photonhbt {
36953695 return allCands[a].gi < allCands[b].gi ;
36963696 });
36973697 std::set<std::pair<int , int >> usedLegs;
3698- for (const int i : order) {
3698+ for (const int & i : order) {
36993699 const int c = perCollision ? allCands[i].collisionId : -1 ;
37003700 if (usedLegs.contains ({c, allCands[i].posTrackId }) > 0 ||
37013701 usedLegs.contains ({c, allCands[i].negTrackId }) > 0 ) {
@@ -3738,11 +3738,11 @@ struct Photonhbt {
37383738 accept = false ; // shares a leg with a closer candidate
37393739 }
37403740 };
3741- for (const int j : v0sByPosTrack[allCands[i].posTrackId ]) {
3741+ for (const int & j : v0sByPosTrack[allCands[i].posTrackId ]) {
37423742 compare (j);
37433743 }
37443744 if (accept) {
3745- for (const int j : byNegTrack[allCands[i].negTrackId ]) {
3745+ for (const int & j : byNegTrack[allCands[i].negTrackId ]) {
37463746 compare (j);
37473747 }
37483748 }
@@ -3803,8 +3803,8 @@ struct Photonhbt {
38033803 if (itA != motherColls.end () && itB != motherColls.end ()) {
38043804 for (int p = 0 ; p < kNDedup ; ++p) {
38053805 bool together = false ;
3806- for (const int ca : itA->second [p]) {
3807- for (const int cb : itB->second [p]) {
3806+ for (const int & ca : itA->second [p]) {
3807+ for (const int & cb : itB->second [p]) {
38083808 if (ca == cb) {
38093809 together = true ;
38103810 }
@@ -3825,8 +3825,8 @@ struct Photonhbt {
38253825
38263826 // all 4 legs in ONE collision
38273827 bool commonTracked = false ;
3828- for (const int ca : a.trackedColls ) {
3829- for (const int cb : b.trackedColls ) {
3828+ for (const int & ca : a.trackedColls ) {
3829+ for (const int & cb : b.trackedColls ) {
38303830 if (ca == cb) {
38313831 commonTracked = true ;
38323832 }
0 commit comments