Skip to content

Conversation

@S81D
Copy link
Collaborator

@S81D S81D commented Nov 4, 2025

Describe your changes

If there are no MCHits to reconstruct a waveform, PMTWaveformSim skipped the event and told other downstream tools to do the same. It was originally implemented to be computationally efficient as to not to simulate all waveforms. It also avoided crashing the PhaseIIADCHitFinder tool; it wasn't handling blank waveform entries well since that doesn't exist in the data.

We noted that ultimately we would have to modify the waveform simulator at some point for the efficiency / cross section analyses since we need those "blank" entries.

My workaround is that if there are no MCHits in an event, rather than skipping the event all together we simulate a "minimal" waveform in one of the dead PMT channels (ID 333) so that the hit finding tool is happy and doesn't crash. The minimal waveform won't register a hit as:

  1. It will always be below baseline as I have set the noise to be very low (sigma = 0.01)
  2. Even if it does produce a pulse / dc above the pulse threshold, there is a condition in the hit finder that it won't integrate pulses in channels that are labeled "OFF".

The resulting event information is passed to other tools even though no hits have been registered (like the data) and no downstream tools are skipped.

I also removed logic from the downstream tools that checked whether they should skip the event. This was added previously purely to not crash when loading in the waveform simulated hits. It can be removed as that condition is no longer set by waveform sim.

One of the tools (EventSelector) also needs its skip logic adjusted, but I have added a commit to the outstanding PR #330 to take care of this.

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
  • [N/A] If this PR includes a new Tool, a README and minimal demonstration ToolChain is provided
  • [N/A] 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
  • [N/A] For every new usage, there is a reason the data must be on the heap
  • [N/A] 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.

S81D added 7 commits November 4, 2025 10:19
Instead, we can fill one of the dead PMTs with a "minimal" waveform to pass to the hit finding tool
forgot to set the channel ID to a dead PMT
@jminock jminock self-assigned this Nov 6, 2025
Copy link
Collaborator

@jminock jminock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround seems to work. Only caveat is if PMT ID 333 goes online again (I highly doubt this will happen). This seems like a satisfactory fix and helps reduce clutter in other Tools. Approved!

@S81D
Copy link
Collaborator Author

S81D commented Nov 6, 2025

I will make a note of it in the PMTWaveformSim README, in case anyone does PMT repairs and that tube is ever online again.

Quick disclaimer about the dummy channel
@marc1uk
Copy link
Collaborator

marc1uk commented Nov 12, 2025

Can't see any issues with this PR, thanks Steven

@marc1uk marc1uk merged commit 7dafc12 into ANNIEsoft:Application Nov 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants