Skip to content

Conversation

@S81D
Copy link
Collaborator

@S81D S81D commented Feb 25, 2025

Describe your changes

The 2023 Gains calibration employed a different integration window than what is the default for our event building / physics data. To ensure we're using the same hit finding integration window, a new option ("Fixed_2023_Gains") has been added. The key difference is:

  • Default hit finding for event building ("dynamic"):
    Pulse integration window defined by crossing and un-crossing threshold. The pulse_start is defined as 5 samples before the threshold (baseline + 7 dc) crossing point. The pulse_stop is defined when the pulse returns to the baseline + sigma crossing point.

  • Updated hit finding ("Fixed_2023_Gains"):
    Pulse integration window defined by crossing and un-crossing baseline, rather than threshold. The pulse_start is defined as 5 samples before the baseline + sigma crossing point. The pulse_stop is defined as 5 samples after the pulse returns to the baseline + sigma crossing point.

The end result is we capture slightly more charge per hit, since the integration windows are extended to the left and right by at least 5 samples. Bob recommended we should use the same integration window as the Gains calibration, as our SPE factors depend on that calibration. Looking at individual ADC traces, it also seems like we consistently grab more of the whole "pulse" (see photo attached); we capture the main peak + the reflection peaks, where as in the old hit finding we would often miss some of the reflection peaks.

Both techniques still identify the pulse in the same way: threshold crossing (baseline + 7 dc).

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

Attached photo below highlights the difference in the integration windows. The black curve is an average of 1000 SPE pulses taken from the data (Red is Andrew's new Waveform simulator, ignore for now). We can see the new pulse integration approach grabs the entirety of the pulse (including some of the reflection peaks). We should also use the same pulse integration approach in our physics data as what was used during calibration.
Averaged Data and MC Waveforms _ AmBe _ 0 to 3 pe _ TS _ 1000 pulses _ integration windows

For a thorough breakdown of the differences used in the Gains calibration vs the (old) default event building hit finding, see here and here (Gian's calibration slides).

S81D added 2 commits February 25, 2025 09:45
Added another hit finding technique that reflects the same integration window used in the 2023 Gains calibration by Gian.

if(verbosity>v_debug) {

std::cout << "Hit time [ns] " << hit_time * NS_PER_ADC_SAMPLE << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please switch to Log

Replace std::cout with Log
@S81D
Copy link
Collaborator Author

S81D commented Aug 21, 2025

Changed all instances of std::cout to Log

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.

All looks good. No major bugs or breaks and all running sums are properly initialized.

Calling log within a const method raises errors, changing back to std:out
@S81D
Copy link
Collaborator Author

S81D commented Aug 21, 2025

// ******************************************************************
// "PulseFindingApproach" default for EventBuilding
std::vector<ADCPulse> PhaseIIADCHitFinder::find_pulses_bythreshold(
  const Waveform<unsigned short>& raw_minibuffer_data,
  const CalibratedADCWaveform<double>& calibrated_minibuffer_data,
  unsigned short adc_threshold, const unsigned long& channel_key) const
{

Is what this section of the hit finding code lives in. Apparently calling Log within a const method will raise errors. I have changed back to std::cout, but made sure there are verbosity checks in place.

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.

Looks good! Waiting for compilation before switching label to "ready to merge"

@S81D S81D mentioned this pull request Aug 21, 2025
@brichards64 brichards64 merged commit 7bac65d into ANNIEsoft:Application Sep 4, 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.

4 participants