Skip to content

Commit

Permalink
adjusting TOF calib info alignment to BC
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Sep 13, 2023
1 parent 8e4388b commit 8b2a9da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
9 changes: 8 additions & 1 deletion Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,14 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
}

int mask = 0;
float deltat = o2::tof::Utils::subtractInteractionBC(TOFClusWork[matchingPair.getTOFClIndex()].getTimeRaw() - t0info - intLT.getTOF(o2::track::PID::Pion), mask, true);
float deltat;

if (t0info > 0) { // FT0 BC found
deltat = TOFClusWork[matchingPair.getTOFClIndex()].getTimeRaw() - t0info - intLT.getTOF(o2::track::PID::Pion) - o2::tof::Geo::LATENCYWINDOW_IN_BC * o2::tof::Geo::BC_TIME_INPS; // latency subtracted
mask = 1 << 8; // only FT0 BC allowed (-> BC=0 since t0info already subtracted and assumed to be aligned to the true IntBC)
} else {
deltat = o2::tof::Utils::subtractInteractionBC(TOFClusWork[matchingPair.getTOFClIndex()].getTimeRaw() - t0info - intLT.getTOF(o2::track::PID::Pion), mask, true);
}

const o2::track::TrackParCov& trc = TracksWork[trkType][itrk].first;
float pt = trc.getPt(); // from outer parameters!
Expand Down
22 changes: 18 additions & 4 deletions Detectors/TOF/base/src/Utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,28 @@ int Utils::addMaskBC(int mask, int channel)
int mask2 = (mask >> 16);
int cmask = 1;
int used = 0;
int weight = 1;
int candidates = 0;
for (int ibit = 0; ibit < 16; ibit++) { // counts candidates
if (mask & cmask) {
candidates++;
}
cmask *= 2;
}

if (candidates) {
weight = 16 / candidates;
}

cmask = 1;
for (int ibit = 0; ibit < 16; ibit++) {
if (mask & cmask) {
mMaskBCchan[channel][ibit]++;
mMaskBC[ibit]++;
mMaskBCchan[channel][ibit] += weight;
mMaskBC[ibit] += weight;
}
if (mask2 & cmask) {
mMaskBCchanUsed[channel][ibit]++;
mMaskBCUsed[ibit]++;
mMaskBCchanUsed[channel][ibit] += weight;
mMaskBCUsed[ibit] += weight;
used = ibit - 8;
}
cmask *= 2;
Expand Down

0 comments on commit 8b2a9da

Please sign in to comment.