Skip to content

Commit

Permalink
fine tuning TOF calib with FT0
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Oct 4, 2023
1 parent 72ab08f commit b7655e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1203,20 +1203,27 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI

int index = -1;
int distMax = 0;
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;

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

if (dist < 0 || dist > distThr || dist < distMax) {
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
continue;
}

bestQuality = quality;
distMax = dist;
index = i;
}
Expand Down

0 comments on commit b7655e2

Please sign in to comment.