Repository navigation
KKExtrap: clamp the calo search time into the trajectory range - #2076
Merged
Merged
Conversation
toCaloDisk searched for calorimeter intersections in TimeRange(begin, tref) or TimeRange(tref, end), where tref is ftraj.t0() taken before any extrapolation. PiecewiseTrajectory::t0() is the helix time at z=0 and need not lie inside the trajectory. When it does not, the range is reversed and its constructor throws "Invalid Time Range". This stopped the nightly reco_03 job in LoopHelixFit/KKUe on run 1430, subrun 1652, event 852 (tref 466.92 ns, trajectory 480.92-587.87 ns). Clamp tref with forceRange, as toTrackerPerimeter already does. When tref was inside the range nothing changes; otherwise the search range is empty and the track, which never reaches the calorimeter, gets no calorimeter intersections. The toCaloDisk debug printout now also shows tref and the trajectory range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RobMina
approved these changes
Oct 28, 2026
RobMina
left a comment
Contributor
There was a problem hiding this comment.
I will follow up with another PR later to make the extrapolation more robust. For the time being this looks like the right fix.
Collaborator
|
☀️ The build tests passed at 68b28d6.
N.B. These results were obtained from a build of this Pull Request at 68b28d6 after being merged into the base branch at 77c4233. For more information, please check the job page here. |
This was referenced Oct 29, 2026
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the nightly
reco_03crash:LoopHelixFit/KKUethrowsInvalid Time Rangeon run 1430, subrun 1652, event 852 ofdig.mu2e.CeMLeadingLogMix1BB.MDC2025au_best_v1_3.001430_00001612.art.KKExtrap::toCaloDisk(added in #2059) searches for calorimeter intersections betweentrefand the end of the trajectory in the direction of the calorimeter.trefisftraj.t0(), captured before any extrapolation.PiecewiseTrajectory::t0()is the helix time at z=0. It is not guaranteed to lie inside the trajectory's time range, for example for a track whose hits are all in one half of the tracker. When it lies outside,TimeRange(ftraj.range().begin(), tref)is reversed and its constructor throws.On event 852, the second
KKUetrack hastref= 466.92 ns and a trajectory range of 480.92 to 587.87 ns.ExtrapolateToZdoes not extend it towards the calorimeter, because the track's start is heading away from the calorimeter, so the range never reaches back totref.The fix clamps
trefinto the trajectory range withTimeRange::forceRange, astoTrackerPerimeteralready does for its own reference time (c4673ba). In every case wheretrefwas already inside the range, it is unchanged, so the output is unchanged. In the case that used to throw, the search range is empty and the track gets no calorimeter intersections, which is correct because the track never reaches the calorimeter. The existingtoCaloDiskdebug printout now also printstrefand the trajectory range.Testing
Offline
main77c4233dwith this change, built with Production4479f3faand mu2e-trig-configa664b74b(the same three commits as the nightly buildmuseCIBuild/main/77c4233d_4479f3fa_a664b74b), envset p109. The build had no warnings.Invalid Time Range, as in the nightly. With this change it exits 0. WithToCaloD0/ToCaloD1off forKKUeonly, the nightly build also exits 0, which shows the calorimeter step is the cause.reco_03input, all 16508 events of the two files, in six chunks. EveryKalSeedcollection was printed per event withPrintModuleat verbose 2, which includes the fit summary and every intersection:services.scheduler.SkipEvent : [ "StdException" ], fails only event 852.KKDe,KKUe,KKDmuandKKUmu(the trigger-level collections in the input are identical too), about 1.28 million intersections in all.🤖 Generated with Claude Code