tcnt/ntrk: a counter for distinct tracks#325
Draft
Conversation
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.
tnct.ntrk: a counter for distinct tracksThe event-level
tcntbranch is "MARKED FOR REMOVAL", but a counter for the number of distinct tracks (not hypotheses) would be very useful for signal-like event selection.Example: An event containing a reflected track produced by a cosmic muon
Subrun 27992 event 280437 in the pure CRY MDC202aw dataset. This event has two distinct track "legs": an upstream muon fit and a downstream electron fit. The types of events are distinct from those which have multiple fit hypotheses to the same physical track.
Signal-like events do not look like this, they have a single track, so we need a way to filter these types of events.
This event has track PDGs
[11, -11, 13, 13], which has a duplicate fit hypothesis.Strategy: count unique PDGs
Each track gets four fit hypotheses: [e-, e+, mu-, mu+]:
trk.pdg: [-11, 11, -13, 13]Each hypothesis is stored in EventNtuple if the fit converges, so if the mu+ fit fails:
trk.pdg: [-11, 11, -13]If there are multiple distinct tracks per event:
trk.pdg: [-11, 11, 11, -11, -13, 13, 13, -13]We can simply count the maximum number of instances of a unique track PDG.
Demo
1 track
2 tracks
3 tracks
4 tracks
5 tracks
Edge case
You could get unlucky and have unique PDGs by accident, although I have never seen this happen. I'm also not sure if there is a way around this.