Skip to content

Bug fixes in PhaseIIADCCalibrator and PhaseIIADCHitFinder - #391

Open
JohannMartyn wants to merge 5 commits into
ANNIEsoft:Applicationfrom
JohannMartyn:Application
Open

JohannMartyn wants to merge 5 commits into
ANNIEsoft:Applicationfrom
JohannMartyn:Application

Conversation

@JohannMartyn

@JohannMartyn JohannMartyn commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

PhaseIIADCCalibrator had a bug in the baseline subtraction. It compared an ADC value with an index (time sample) instead of comparing two indices.
PhaseIIADCHitFinder had a bug in the Fixed_2023_Gains pulse finding algorithm, where a pulse could be counted two times. Added a new pulse finding algorithm called "NoDoubleHits" which is a fixed version of the "Fixed_2023_Gains" method.

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). => Both bugs impact the measured hit charge and their correction decreases the mean of the measured hit charge distribution by about 7%.
  • 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

See ANNIE-doc-6987 for more details.

Previously we compared the ADC sample value with and index value. This is corrected now and we compare an index value with an index value.
Previously the adc_threshold was subtracted from the peak value. Now the baseline is subtracted.
This method works similar the the "Fixed_2023_Gains" method, but it fully avoids the incorrect double hit counting.
@S81D

S81D commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Looks good to me - one recommendation though:

Could you update the config file to reflect the new NoDoubleHits? https://github.com/ANNIEsoft/ToolAnalysis/tree/Application/UserTools/PhaseIIADCHitFinder

That way users know which option to use. We will also require an additional PR to change the configs in the EventBuilder toolchains.

@S81D S81D self-assigned this Sep 30, 2026
@JohannMartyn

Copy link
Copy Markdown
Contributor Author

I do not know exactly what you mean by "config file". So I changed the initialization of pulse_window_type = "NoDoubleHits"; and the README.md. I can also add the EventBuilder configs accordingly, in a new pull request.

@S81D

S81D commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Sorry the README is what I meant - thanks for doing this!

This is now ready to merge. Please open another PR (either you or Anuj) to update the hit finding config in the event building so it reflects this method change.

@anuj-guptta

Copy link
Copy Markdown
Contributor

Sorry the README is what I meant - thanks for doing this!

This is now ready to merge. Please open another PR (either you or Anuj) to update the hit finding config in the event building so it reflects this method change.

Hi Johann, Steven, I can open a PR correcting the hit finding config in EventBuilderV2, related toolchains and also BeamClusterAnalysis, in case people run hit finding in EventBuilding OFF mode. If that's alright with both of you ?

@JohannMartyn

Copy link
Copy Markdown
Contributor Author

Sorry the README is what I meant - thanks for doing this!
This is now ready to merge. Please open another PR (either you or Anuj) to update the hit finding config in the event building so it reflects this method change.

Hi Johann, Steven, I can open a PR correcting the hit finding config in EventBuilderV2, related toolchains and also BeamClusterAnalysis, in case people run hit finding in EventBuilding OFF mode. If that's alright with both of you ?

Sure, that is fine by me.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants