From 08b6f3ca44a4436bcd365e07e135c678376386f8 Mon Sep 17 00:00:00 2001 From: Francesco Noferini Date: Mon, 25 Aug 2025 10:06:21 +0200 Subject: [PATCH 1/2] add best knowldge of collision time in tof matching info --- .../ReconstructionDataFormats/MatchInfoTOF.h | 9 ++++++++- Detectors/GlobalTracking/src/MatchTOF.cxx | 17 +++++++++++++++-- .../src/tof-matcher-workflow.cxx | 6 +++--- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h b/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h index 1816e8604c0be..2acbcee33df8e 100644 --- a/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h +++ b/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h @@ -86,6 +86,10 @@ 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 @@ -106,7 +110,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 diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index 89d6f8347373d..a43013d404695 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -1702,8 +1702,8 @@ void MatchTOF::BestMatches(std::vector& 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) || @@ -1719,6 +1719,19 @@ void MatchTOF::BestMatches(std::vector& 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 diff --git a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx index 8dc56794817a5..a1ee744d1f7a1 100644 --- a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx @@ -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("track-sources"); From 99c3988a6d4fef977166e05ff32a3656aed8f334 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 25 Aug 2025 13:44:13 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- .../include/ReconstructionDataFormats/MatchInfoTOF.h | 10 +++++++--- Detectors/GlobalTracking/src/MatchTOF.cxx | 2 +- .../src/tof-matcher-workflow.cxx | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h b/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h index 2acbcee33df8e..7bcfd7af0911a 100644 --- a/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h +++ b/DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h @@ -86,7 +86,11 @@ class MatchInfoTOF hasT0_1BCbefore = 0x1 << 8, hasT0_2BCbefore = 0x1 << 9 }; - void setFT0Best(double val, float res = 200.) { mFT0Best = val; mFT0BestRes = res;} + void setFT0Best(double val, float res = 200.) + { + mFT0Best = val; + mFT0BestRes = res; + } double getFT0Best() const { return mFT0Best; } float getFT0BestRes() const { return mFT0BestRes; } @@ -110,8 +114,8 @@ class MatchInfoTOF float mTgeant = 0.0; ///< geant time in MC double mT0true = 0.0; ///< t0true - double mFT0Best = 0.0; //< best info for collision time - float mFT0BestRes = 200.0; //< resolution (in ps) of the best info for collision time + 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); }; diff --git a/Detectors/GlobalTracking/src/MatchTOF.cxx b/Detectors/GlobalTracking/src/MatchTOF.cxx index a43013d404695..d5406f092ac55 100644 --- a/Detectors/GlobalTracking/src/MatchTOF.cxx +++ b/Detectors/GlobalTracking/src/MatchTOF.cxx @@ -1722,7 +1722,7 @@ void MatchTOF::BestMatches(std::vector& match // 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 + 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); diff --git a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx index a1ee744d1f7a1..9a95c83617210 100644 --- a/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx +++ b/Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx @@ -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("track-sources");