Skip to content

Update CALOROCDigiization.cc - #2933

Open
mhkim-anl wants to merge 1 commit into
mainfrom
2908-update-calorocdigitization-algorithm
Open

Update CALOROCDigiization.cc#2933
mhkim-anl wants to merge 1 commit into
mainfrom
2908-update-calorocdigitization-algorithm

Conversation

@mhkim-anl

@mhkim-anl mhkim-anl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.

Based on a more detailed understanding of the CALOROC measurement principle than when this algorithm was initially implemented, the following three points have been updated. Also, more explanations have been added to describe each step.

  • No measurement is performed when the pulse height stays below toa_thres.
  • The first sample of a RawCALOROCHit should come after the toa_thres up-crossing.
  • Together with the changes above, the algorithm is updated to handle each case of the pulse amplitude being above or below toa_thres and tot_thres systematically.

What is the urgency of this PR?

  • High (please describe reason below)
  • Medium
  • Low

What kind of change does this PR introduce?

Please check if any of the following apply

  • This PR requires changes to geometry (epic PR: __)
  • This PR requires changes to EDM4eic (EDM PR: __)
  • This PR introduces breaking changes. Please describe changes users need to make below.
  • This PR changes default behavior. Please describe changes below.
  • AI was used in preparing this PR. Please describe usage below.

// Start from i = 1 since amps[idx_upcross] is used to calculate the crossing time.
// Pulses that never cross toa_thres are skipped.
std::size_t idx_upcross = 0;
for (std::size_t i = 1; i < n_amps; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use find_if with lambda predicate.

@ruse-traveler ruse-traveler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix @mhkim-anl! Wouter's suggestion to use find_if is a good one, but beyond that this looks good to me!

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.

Update CALOROCDigitization algorithm

3 participants