Skip to content

Commit cfa791d

Browse files
authored
add best knowldge of collision time in tof matching info (#14615)
1 parent 3673ef7 commit cfa791d

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ class MatchInfoTOF
8686
hasT0_1BCbefore = 0x1 << 8,
8787
hasT0_2BCbefore = 0x1 << 9 };
8888

89+
void setFT0Best(double val, float res = 200.)
90+
{
91+
mFT0Best = val;
92+
mFT0BestRes = res;
93+
}
94+
double getFT0Best() const { return mFT0Best; }
95+
float getFT0BestRes() const { return mFT0BestRes; }
96+
8997
private:
9098
int mIdLocal; // track id in sector of the pair track-TOFcluster
9199
float mChi2; // chi2 of the pair track-TOFcluster
@@ -106,7 +114,10 @@ class MatchInfoTOF
106114
float mTgeant = 0.0; ///< geant time in MC
107115
double mT0true = 0.0; ///< t0true
108116

109-
ClassDefNV(MatchInfoTOF, 8);
117+
double mFT0Best = 0.0; //< best info for collision time
118+
float mFT0BestRes = 200.0; //< resolution (in ps) of the best info for collision time
119+
120+
ClassDefNV(MatchInfoTOF, 9);
110121
};
111122
} // namespace dataformats
112123
} // namespace o2

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,8 @@ void MatchTOF::doMatchingForTPC(int sec)
15811581
//______________________________________________
15821582
int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, unsigned long firstOrbit)
15831583
{
1584+
const auto& FT0Params = o2::ft0::InteractionTag::Instance();
1585+
15841586
if ((!mHasFillScheme) && o2::tof::Utils::hasFillScheme()) {
15851587
mHasFillScheme = true;
15861588
for (int ibc = 0; ibc < o2::tof::Utils::getNinteractionBC(); ibc++) {
@@ -1598,6 +1600,10 @@ int MatchTOF::findFITIndex(int bc, const gsl::span<const o2::ft0::RecPoints>& FI
15981600
const int distThr = 8;
15991601

16001602
for (unsigned int i = 0; i < FITRecPoints.size(); i++) {
1603+
const auto& ft = FITRecPoints[i];
1604+
if (!FT0Params.isSelected(ft)) {
1605+
continue;
1606+
}
16011607
const o2::InteractionRecord ir = FITRecPoints[i].getInteractionRecord();
16021608
if (mHasFillScheme && !mFillScheme[ir.bc]) {
16031609
continue;
@@ -1702,8 +1708,8 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17021708
matchingPair.setT0true(TOFClusWork[matchingPair.getTOFClIndex()].getT0true());
17031709

17041710
// let's check if cluster has multiple-hits (noferini)
1705-
if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) {
1706-
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1711+
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1712+
if (tofcl.getNumOfContributingChannels() > 1) {
17071713
// has an additional hit Up or Down (Z-dir)
17081714
matchingPair.setHitPatternUpDown(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) ||
17091715
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
@@ -1719,6 +1725,19 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
17191725
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) ||
17201726
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight));
17211727
}
1728+
1729+
// estimate collision time using FT0 info if available
1730+
ULong64_t bclongtofCal = (matchingPair.getSignal() - 10000) * o2::tof::Geo::BC_TIME_INPS_INV;
1731+
double t0Best = bclongtofCal * o2::tof::Geo::BC_TIME_INPS; // here just BC
1732+
float t0BestRes = 200;
1733+
if (FITRecPoints.size() > 0) {
1734+
int index = findFITIndex(bclongtofCal, FITRecPoints, mFirstTForbit);
1735+
if (index > -1 && FITRecPoints[index].isValidTime(1) && FITRecPoints[index].isValidTime(2)) { // require A and C
1736+
t0Best += FITRecPoints[index].getCollisionTime(0);
1737+
t0BestRes = 15;
1738+
}
1739+
}
1740+
matchingPair.setFT0Best(t0Best, t0BestRes);
17221741
matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF
17231742

17241743
// get fit info

Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
114114
}
115115
}
116116

117-
if (!writecalib) {
118-
useFIT = false;
119-
}
117+
// if (!writecalib) {
118+
// useFIT = false;
119+
// }
120120

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

0 commit comments

Comments
 (0)