Skip to content

SSDDigitizer: reuse TF1, hoist per-hit lookups, cleanup#305

Draft
gavinsdavies wants to merge 1 commit into
mainfrom
feature/gsdavies/ssddigitizer-tf1
Draft

SSDDigitizer: reuse TF1, hoist per-hit lookups, cleanup#305
gavinsdavies wants to merge 1 commit into
mainfrom
feature/gsdavies/ssddigitizer-tf1

Conversation

@gavinsdavies

Copy link
Copy Markdown
Contributor

Part of #303.

Fixes (all in Digitization/SSDDigitizer_module.cc)

  • TF1 reuse: a TF1("func","gaus",...) was heap-allocated per hit in SimulateChargeSharing (and deleted at the end of the branch). Now created once in beginJob and reused via SetRange/SetParameters — removes per-hit allocation and gROOT name-registration churn. TF1::Integral is stateless given range+parameters, so results are identical. (Note: issue Broad-sweep code review: bugs, performance, and modernization findings (June 2026) #303 originally called this a leak; the original code did delete func — the cost was churn, not a leak.)
  • ServiceHandle hoisting: art::ServiceHandle<ChannelMapService> was constructed inside per-hit branches (twice); now fetched once at the top of the function. Redundant inner re-declarations of echan/dchan removed (their fields are fully re-set before each use).
  • adcRange(): the allowedADC table was a std::vector rebuilt on every call (per hit); now a static const std::array<float, 8>.

Cleanup (review feedback)

Removed using namespace emph; (everything lives inside namespace emph; DEFINE_ART_MODULE is fully qualified), dropped the commented-out legacy adcRange and debug std::cout blocks, and fixed tab/space indentation in the touched regions.

Verification

No numerical logic, thresholds, or outputs changed. No local build environment and no repo CI — a collaborator build before undrafting would be appreciated.

🤖 Assisted by Claude Code (claude-fable-5)

Also remove 'using namespace emph;', drop commented-out debug/legacy
blocks, and fix tab/space indentation in the touched regions
(review feedback).
@FNALbuild

Copy link
Copy Markdown
Collaborator

✔️ CI build for EMPHATIC Succeeded on slf7 for maxopt -- details available through the CI dashboard

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.

2 participants