Skip to content

Commit

Permalink
check fill scheme to clean FT0 BC in TOF calibs
Browse files Browse the repository at this point in the history
  • Loading branch information
noferini committed Oct 3, 2023
1 parent e1813f5 commit 72ab08f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ class MatchTOF

void updateTimeDependentParams();

static bool mHasFillScheme;
static bool mFillScheme[o2::constants::lhc::LHCMaxBunches];

//================================================================

// Data members
Expand Down
18 changes: 16 additions & 2 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ using Cluster = o2::tof::Cluster;
using GTrackID = o2::dataformats::GlobalTrackID;
using timeEst = o2::dataformats::TimeStampWithError<float, float>;

bool MatchTOF::mHasFillScheme = false;
bool MatchTOF::mFillScheme[o2::constants::lhc::LHCMaxBunches] = {0};

ClassImp(MatchTOF);

//______________________________________________
Expand Down Expand Up @@ -1187,19 +1190,30 @@ void MatchTOF::doMatchingForTPC(int sec)
//______________________________________________
int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit)
{
if ((!mHasFillScheme) && o2::tof::Utils::hasFillScheme()) {
mHasFillScheme = true;
for (int ibc = 0; ibc < o2::tof::Utils::getNinteractionBC(); ibc++) {
mFillScheme[o2::tof::Utils::getInteractionBC(ibc)] = true;
}
}

if (FITRecPoints.size() == 0) {
return -1;
}

int index = -1;
int distMax = 7; // require bc distance below 5
int distMax = 0;
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;
}
int bct0 = (ir.orbit - firstOrbit) * o2::constants::lhc::LHCMaxBunches + ir.bc;
int dist = bc - bct0;

if (dist < 0 || dist > distMax) {
if (dist < 0 || dist > distThr || dist < distMax) {
continue;
}

Expand Down

0 comments on commit 72ab08f

Please sign in to comment.