diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index 2a4f0417f9cc1..91affd73221be 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -1353,7 +1353,7 @@ int MatchTOF::findFITIndex(int bc, const gsl::span& FI } int index = -1; - int distMax = 0; + int distMax = 10; bool bestQuality = false; // prioritize FT0 BC with good quality (FT0-AC + vertex) to remove umbiguity in Pb-Pb (not a strict cut because inefficient in pp) const int distThr = 8; @@ -1369,8 +1369,8 @@ int MatchTOF::findFITIndex(int bc, const gsl::span& FI int bct0 = (ir.orbit - firstOrbit) * o2::constants::lhc::LHCMaxBunches + ir.bc; int dist = bc - bct0; - bool worseDistance = dist < 0 || dist > distThr || dist < distMax; - if (worseDistance && (!quality || bestQuality)) { // discard if BC is later than the one selected, but is has a better quality + bool worseDistance = dist < 0 || dist > distThr || dist > distMax; + if (worseDistance) { // discard if BC is not in the proper range or it is worse than the one already found continue; }