Skip to content

features related MCHit's immediate neutron and other particles to be stored - #392

Open
dhavvval wants to merge 7 commits into
ANNIEsoft:Applicationfrom
dhavvval:feature/NeutronAncestryPR
Open

dhavvval wants to merge 7 commits into
ANNIEsoft:Applicationfrom
dhavvval:feature/NeutronAncestryPR

Conversation

@dhavvval

@dhavvval dhavvval commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes

Checklist before submitting your PR

  • This PR implements a single change (one new/modified Tool, or a set of changes to implement one new/modified feature)
  • This PR alters the minimum number of files to affect this change
  • If this PR includes a new Tool, a README and minimal demonstration ToolChain is provided
  • If a new Tool/ToolChain requires model or configuration files, their paths are not hard-coded, and means of generating those files is described in the readme, with examples provided on /pnfs/annie/persistent
  • For every new usage, there is a reason the data must be on the heap
  • For every new there is a delete, unless I explicitly know why (e.g. ROOT or a BoostStore takes ownership)

Additional Material

Attach any validation or demonstration files here. You may also link to relavant docdb articles.
Note:- You can find a presentation describing the changes in docdb. It has minimal changes across multiple tools and details of each changes are written in corresponding commits using AI tool.

dhavvval and others added 7 commits September 17, 2026 18:57
…ing Neutron Acestor and DirectParentID related changes
LoadWCSim now records WCSimRootTrigger::GetMode() for every trigger in the
entry and publishes the result to ANNIEEvent as "WCSimInteractionModes".

BackTracker picks that vector up in LoadFromStores and, for each MC PMT hit,
maps the hit's direct parent back to its MCTriggerNum to look up the
interaction mode of the trigger that produced it.  The result is published as
"MCHitToInteractionMode" (-999 for hits taken from the pre-clock-tick path,
-9999 when the mode cannot be resolved).

ANNIEEventTreeMaker exposes this as the trueWCSimMode branch alongside the
existing DirectParent hit-level branches, so the true GENIE/WCSim interaction
channel behind every hit is available in the ntuple.
Extends BackTracker's hit-level backtracking in three ways and surfaces all of
it through ANNIEEventTreeMaker:

* Dark-noise tagging: a hit whose direct parents are all -1 was treated as
  dark noise unconditionally.  In older WCSim files (e.g. the AmBe
  wcsim_0_999 samples) -1 is a legitimate track ID, so if -1 is present in the
  track map the hit is kept as real physics instead of being discarded as
  noise.

* Immediate ancestor: for every MC PMT hit the background particle directly
  behind the detected photon is resolved and published as
  "MCHitToImmediateAncestor" / "MCHitToImmediateAncestorClass".  This is what
  is needed to separate genuine neutron-capture light from the background
  particles landing in the same time window.

* Full lineage: rather than stopping at the immediate ancestor, the parent
  links are walked all the way back, and the resulting chain is published as
  "MCHitToLineage" and "MCHitToLineageStatus", with the end of the chain in
  "MCHitToRootAncestor".  This makes it possible to attribute a tank optical
  photon to the primary interaction product it ultimately came from.

ANNIEEventTreeMaker gains the matching per-hit branches --
DirectParent_ImmediateAncestor{TrackID,PDG,Class},
DirectParent_RootAncestor{TrackID,PDG} and
DirectParent_Lineage{PDG,TrackID,Depth,Status} -- so the chain is written out
with the rest of the DirectParent hit information.
These tools printed on every event regardless of the configured verbosity,
which made long MC productions unreadable and dominated the log files.

* BackTracker: gate the FindNeutronAncestors summary print on verbosity > 1.
* LoadWCSim: drop the unconditional per-event "Event Number" print and the
  dump of every saved track ID in trackid_to_mcparticleindex.
* PMTWaveformSim: drop the unconditional "finished looping over MCHits"
  print.
* DigitBuilder: an absent MCLAPPDHits store entry is expected when running
  without LAPPD MC, so log it at v_debug rather than v_error.
* MCParticleProperties: track-length and tank entry/exit intercept warnings
  fire routinely for particles that clip the tank, so log them at v_debug
  rather than v_error.

No behaviour changes -- only logging levels and removed prints.

This branch has not been deployed

No deployments
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