From 917954783ebdb6e7f78e309e872a8a06ce1f58e1 Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Tue, 28 Jan 2025 22:12:44 +0100 Subject: [PATCH 1/2] [MUON] use track time in global muon matching Added option for using the track time when selecting the MFT candidates to be matched with a given MCH track. This helps to reduce the number of candidates when the MCH track is already matched with MID and therefore has a precise timing. In this case the number of MCH tracks that need to be combined with MFT tracks from two adjacent ROFs is strongly reduced. --- .../include/GlobalTracking/MatchGlobalFwd.h | 1 + .../include/GlobalTracking/MatchGlobalFwdParam.h | 1 + Detectors/GlobalTracking/src/MatchGlobalFwd.cxx | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h index c3de0cdc74ed3..3445123385cfa 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h @@ -339,6 +339,7 @@ class MatchGlobalFwd o2::itsmft::ChipMappingMFT mMFTMapping; bool mMCTruthON = false; ///< Flag availability of MC truth bool mUseMIDMCHMatch = false; ///< Flag for using MCHMID matches (TrackMCHMID) + bool mUseTrackTime = false; ///< Flag for using the MCH or MCHMID track time information to select the MFT ROF(s) int mSaveMode = 0; ///< Output mode [0 = SaveBestMatch; 1 = SaveAllMatches; 2 = SaveTrainingData; 3 = SaveNCandidates] int mNCandidates = 5; ///< Numbers of matching candidates to save in savemode=3 MatchingType mMatchingType = MATCHINGUNDEFINED; diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h index 5633decb80985..757d74ff40780 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h @@ -39,6 +39,7 @@ struct GlobalFwdMatchingParam : public o2::conf::ConfigurableParamHelper mMCHID2Work[MCHId]:" << mMCHID2Work[MCHId]; const auto& IR = MIDMatch.getIR(); int nBC = IR.differenceInBC(mStartIR); - float tMin = nBC * o2::constants::lhc::LHCBunchSpacingMUS; - float tMax = (nBC + 1) * o2::constants::lhc::LHCBunchSpacingMUS; + float tMin = (nBC - 1) * o2::constants::lhc::LHCBunchSpacingMUS; + float tMax = (nBC + 2) * o2::constants::lhc::LHCBunchSpacingMUS; thisMuonTrack.setMIDTrackID(MIDId); thisMuonTrack.setTimeMUS(MIDMatch.getTimeMUS(mStartIR).first); thisMuonTrack.tBracket.set(tMin, tMax); @@ -435,6 +438,7 @@ void MatchGlobalFwd::ROFMatch(int MFTROFId, int firstMCHROFId, int lastMCHROFId) { /// Matches MFT tracks on a given ROF with MCH tracks in a range of ROFs const auto& thisMFTROF = mMFTTrackROFRec[MFTROFId]; + const auto& thisMFTBracket = mMFTROFTimes[MFTROFId]; const auto& firstMCHROF = mMCHTrackROFRec[firstMCHROFId]; const auto& lastMCHROF = mMCHTrackROFRec[lastMCHROFId]; int nFakes = 0, nTrue = 0; @@ -464,6 +468,12 @@ void MatchGlobalFwd::ROFMatch(int MFTROFId, int firstMCHROFId, int lastMCHROFId) // loop over all MCH tracks for (auto MCHId = firstMCHTrackID; MCHId <= lastMCHTrackID; MCHId++) { auto& thisMCHTrack = mMCHWork[MCHId]; + + // If enabled, use the muon track time to check if the track is correlated with the MFT ROF + if (mUseTrackTime && (thisMFTBracket.isOutside(thisMCHTrack.tBracket))) { + continue; + } + o2::MCCompLabel matchLabel; for (auto MFTId = firstMFTTrackID; MFTId <= lastMFTTrackID; MFTId++) { auto& thisMFTTrack = mMFTWork[MFTId]; From 9da8d624ea7bbfc072c3bbbd66f0207bd410d222 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 28 Jan 2025 21:15:02 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- Detectors/GlobalTracking/src/MatchGlobalFwd.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx b/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx index a4286c75e5e29..7ed50ce7400ae 100644 --- a/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx +++ b/Detectors/GlobalTracking/src/MatchGlobalFwd.cxx @@ -471,7 +471,7 @@ void MatchGlobalFwd::ROFMatch(int MFTROFId, int firstMCHROFId, int lastMCHROFId) // If enabled, use the muon track time to check if the track is correlated with the MFT ROF if (mUseTrackTime && (thisMFTBracket.isOutside(thisMCHTrack.tBracket))) { - continue; + continue; } o2::MCCompLabel matchLabel;