Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ class MatchInfoTOF
hasT0_1BCbefore = 0x1 << 8,
hasT0_2BCbefore = 0x1 << 9 };

void setFT0Best(double val, float res = 200.)
{
mFT0Best = val;
mFT0BestRes = res;
}
double getFT0Best() const { return mFT0Best; }
float getFT0BestRes() const { return mFT0BestRes; }

private:
int mIdLocal; // track id in sector of the pair track-TOFcluster
float mChi2; // chi2 of the pair track-TOFcluster
Expand All @@ -106,7 +114,10 @@ class MatchInfoTOF
float mTgeant = 0.0; ///< geant time in MC
double mT0true = 0.0; ///< t0true

ClassDefNV(MatchInfoTOF, 8);
double mFT0Best = 0.0; //< best info for collision time
float mFT0BestRes = 200.0; //< resolution (in ps) of the best info for collision time

ClassDefNV(MatchInfoTOF, 9);
};
} // namespace dataformats
} // namespace o2
Expand Down
17 changes: 15 additions & 2 deletions Detectors/GlobalTracking/src/MatchTOF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1702,8 +1702,8 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
matchingPair.setT0true(TOFClusWork[matchingPair.getTOFClIndex()].getT0true());

// let's check if cluster has multiple-hits (noferini)
if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) {
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
if (tofcl.getNumOfContributingChannels() > 1) {
// has an additional hit Up or Down (Z-dir)
matchingPair.setHitPatternUpDown(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) ||
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
Expand All @@ -1719,6 +1719,19 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) ||
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight));
}

// estimate collision time using FT0 info if available
ULong64_t bclongtofCal = (matchingPair.getSignal() - 10000) * o2::tof::Geo::BC_TIME_INPS_INV;
double t0Best = bclongtofCal * o2::tof::Geo::BC_TIME_INPS; // here just BC
float t0BestRes = 200;
if (FITRecPoints.size() > 0) {
int index = findFITIndex(bclongtofCal, FITRecPoints, mFirstTForbit);
if (index > -1 && FITRecPoints[index].isValidTime(1) && FITRecPoints[index].isValidTime(2)) { // require A and C
t0Best += FITRecPoints[index].getCollisionTime(0);
t0BestRes = 15;
}
}
matchingPair.setFT0Best(t0Best, t0BestRes);
matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF

// get fit info
Expand Down
6 changes: 3 additions & 3 deletions Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
}
}

if (!writecalib) {
useFIT = false;
}
// if (!writecalib) {
// useFIT = false;
// }

LOG(debug) << "TOF MATCHER WORKFLOW configuration";
LOG(debug) << "TOF track inputs = " << configcontext.options().get<std::string>("track-sources");
Expand Down