Skip to content

Commit 1a6b150

Browse files
noferinishahor02
authored andcommitted
fine tuning TOF calib with FT0
1 parent cd34d34 commit 1a6b150

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,20 +1203,27 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI
12031203

12041204
int index = -1;
12051205
int distMax = 0;
1206+
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)
12061207
const int distThr = 8;
12071208

12081209
for (unsigned int i = 0; i < FITRecPoints.size(); i++) {
12091210
const o2::InteractionRecord ir = FITRecPoints[i].getInteractionRecord();
12101211
if (mHasFillScheme && !mFillScheme[ir.bc]) {
12111212
continue;
12121213
}
1214+
bool quality = (fabs(FITRecPoints[i].getCollisionTime(0)) < 1000 && fabs(FITRecPoints[i].getVertex()) < 1000);
1215+
if (bestQuality && !quality) { // if current has no good quality and the one previoulsy selected has -> discard the current one
1216+
continue;
1217+
}
12131218
int bct0 = (ir.orbit - firstOrbit) * o2::constants::lhc::LHCMaxBunches + ir.bc;
12141219
int dist = bc - bct0;
12151220

1216-
if (dist < 0 || dist > distThr || dist < distMax) {
1221+
bool worseDistance = dist < 0 || dist > distThr || dist < distMax;
1222+
if (worseDistance && (!quality || bestQuality)) { // discard if BC is later than the one selected, but is has a better quality
12171223
continue;
12181224
}
12191225

1226+
bestQuality = quality;
12201227
distMax = dist;
12211228
index = i;
12221229
}

0 commit comments

Comments
 (0)