Skip to content

Validation: fix inverted logic in IsInTMSFull (rock-muon definition) - #360

Closed
DSCorreia wants to merge 1 commit into
mainfrom
fix/validation-isintmsfull
Closed

DSCorreia wants to merge 1 commit into
mainfrom
fix/validation-isintmsfull

Conversation

@DSCorreia

Copy link
Copy Markdown
Contributor

Summary

IsInTMSFull() in scripts/Validation/Tracking_Validation.cpp had its logic inverted. It started from true and set false as soon as any one coordinate fell inside the TMS box. It therefore returned false for points inside the TMS (all three coordinates in range) and also for most points outside it (at least one coordinate in range).

Its only caller is the rock-muon definition in EventRates.cxx:

is_rock_muon = ismuon && !start_in_lar_full && !start_in_tms_full;

Because !IsInTMSFull() was true almost everywhere, the TMS veto did nothing. The event_rates/rock_muons/* plots were effectively counting every muon born outside the ND-LAr active volume, including muons born inside the TMS.

Change

IsInTMSFull() now returns true only when X, Y and Z are all inside the box. The box bounds (mm) are unchanged.

Effect

Checked on one MiniProdN5p3 sanddrift v4 file (...sanddrift.v4.0000001.TMSRECO.root, 9 spills), counting Truth_Spill muons with each definition:

Muons
All true muons 3051
Born outside LAr active 2872
Rock muons, old IsInTMSFull 2802
Rock muons, fixed IsInTMSFull 1883
Old "rock" muons born inside the TMS box 989

About a third of what the rock-muon plots were counting were muons born inside the TMS. Only the event_rates/rock_muons/* histograms change. No other code calls IsInTMSFull().

IsInTMSFull returned false as soon as any one coordinate was inside the
TMS box, so it was false both inside the TMS and for most points outside
it. Its only caller, the rock-muon definition in EventRates.cxx, therefore
never vetoed muons born in the TMS. Require all three coordinates to be
in range instead; the box bounds are unchanged.
@DSCorreia DSCorreia closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant