Repository navigation
Store the KalSeed fit-flag bitmask in TrkInfo (trk.fitflag) - #436
Merged
Merged
Conversation
oksuzian
approved these changes
Oct 30, 2026
oksuzian
left a comment
Contributor
There was a problem hiding this comment.
PR Review Summary — #436
Reviewed at head 5f82c8c27ce9342770f66832f563c522a25f0d66. First pass.
Decision
- 🟢 Approve. One field, filled correctly, documented where
branches.mdsends readers.
Scope understood
TrkInfogainsunsigned fitflag, theKalSeed's wholeTrkFitFlagmask, parsed fromkseed.status().hex()inInfoStructHelper::fillTrkInfo. Nothing else changes.
Findings
- ⚪ [S3] The nightly validation does not look at the new field
validation/create_val_file_rooutil.Cfills one histogram pertrkfield (h_trk_goodfit,h_trk_seedalgand so on), but none forfitflag. A bit-occupancy histogram would let the nightly comparison see a change in theRangedOutorExtrapolationFailedrate once Mu2e/Offline#2084 is in.
Checked, no action needed
- 🟢 The parse is exact for every mask.
toHexusesstd::showbase, so it writes0for an empty mask and0x…otherwise, andstd::stoul(..., 16)accepts both.TrkFitFlag::mask_typeisunsigned, so nothing is lost in the cast. I ran the PR's exact expression on realTrkFitFlagobjects: an empty flag gives 0,FitOK|RangedOutgives0x20008000, andFitOK|ExtrapFailed|RangedOut|MCSeedgives0xb0008000(bit 31 included), each equal to the expected value.BitMaphas no public accessor for the raw value, so going throughhex()is the only option without changing Offline. - 🟢 It builds and fills against Mu2e/Offline#2084. EventNtuple at this head builds against Offline#2084 (muse, rc 0). An ntuple job over 2,752 events of an Offline#2084
reco_03output ran with rc 0, using the track branches only, becauseTrkQualandTrkPIDneed ArtAnalysis. Every one of the 2,736trkrows hasfitflagbit 15 (FitOK) set andstatus > 0, and no row has a zero mask. - 🟢 It works with Offline
main. The diff uses onlyhex(), which has not changed, so the field carries the existing bits on Offlinemain. - 🟢 No other copies need updating.
TrkInfois written through its dictionary (src/classes_def.xml), not a leaf list. RooUtil'sTrackholds aTrkInfo*, so there is no mirror struct to update.doc/branches.mdpoints toinc/TrkInfo.hh, where the new comment is. The PR merges cleanly with EventNtuplemain4889010.
Validation check
- Build/tests run: the muse build against Offline#2084, the ntuple job and the parse check described above.
- Not run: a build against Offline
main, and the RooUtil examples.
Residual risk
- The field comment names
ExtrapolationFailedandRangedOut, which exist only once Mu2e/Offline#2084 merges. Until then the field carries only the existing bits.
Author follow-ups
- Optional: add a
fitflaghistogram to the validation script.
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.
Motivation
TrkInforeduces the KalSeed'sTrkFitFlagto a few derived fields (status,goodfit,seedalg,fitalg), soany other flag bit is invisible in the ntuple. The KKExtrap extrapolation-sweep PR (Mu2e/Offline, companion) adds two
per-track bits that analyses need to select on:
ExtrapFailed("ExtrapolationFailed", an extrapolation directionended early on a problem with this track) and
RangedOut(the forwards extrapolation ended where the particle stopsin material). Storing the whole mask covers those and any future bit without another ntuple change.
Change
TrkInfogainsunsigned fitflag, the KalSeed'sTrkFitFlagbitmask (bit numbers inOffline/RecoDataProducts/inc/TrkFitFlag.hh), filled inInfoStructHelper::fillTrkInfo.BitMapexposes its valueonly as a hex string, so the fill parses
kseed.status().hex().(trk.fitflag >> 29) & 1forRangedOut.The field is independent of the Offline PR: with Offline main it carries the existing bits.
Validation
10,000 nightly off-spill cosmic events, CentralHelix fit, with the Offline extrapolation-sweep PR; field correction
on and off:
KKCentralHelixbit (22) settrk.statusequal to the value derived from bits 12 (kalmanConverged) and 5 (kalmanOK)BFCorrbit (14) setRangedOutbit (29) set, vs KalSeed printout (printKalSeed.fcl)ExtrapolationFailedbit (28) set🤖 Generated with Claude Code