Phase 2: split TMS_Event's detector-sim pipeline into TMS_DetectorSimulation and TMS_SignalProcessing - #300
Open
SFBayLaser wants to merge 2 commits into
Open
Phase 2: split TMS_Event's detector-sim pipeline into TMS_DetectorSimulation and TMS_SignalProcessing#300SFBayLaser wants to merge 2 commits into
SFBayLaser wants to merge 2 commits into
Conversation
SFBayLaser
force-pushed
the
phase2-detsim-fixes
branch
from
August 12, 2026 18:52
443fb27 to
9339aa4
Compare
SFBayLaser
force-pushed
the
phase2-detsim-class-split
branch
from
August 12, 2026 18:52
50b2542 to
0a262ce
Compare
SFBayLaser
force-pushed
the
phase2-detsim-fixes
branch
from
August 12, 2026 19:40
9339aa4 to
94bd90d
Compare
SFBayLaser
force-pushed
the
phase2-detsim-class-split
branch
from
August 12, 2026 19:40
0a262ce to
99234fe
Compare
SFBayLaser
force-pushed
the
phase2-detsim-fixes
branch
from
August 13, 2026 18:28
94bd90d to
96fcd21
Compare
SFBayLaser
force-pushed
the
phase2-detsim-class-split
branch
from
August 13, 2026 18:28
99234fe to
9dc3827
Compare
…nd TMS_SignalProcessing Phase 2 class split from the real-data restructuring proposal, now that the double-merge workaround is gone and ApplyReconstructionEffects() is a single linear call chain. Moves the 7 private Simulate*()/MergeCoincidentHits() methods out of TMS_Event into two new singleton classes, matching the existing TMS_TrackFinder/TMS_ReadoutTreeWriter/TMS_Readout_Manager Meyers- singleton convention (private ctor, deleted copy/assign, GetInstance()): - TMS_DetectorSimulation: SimulateOpticalModel, SimulateDarkCount, SimulateTimingModel, SimulateDeadtime, SimulateReadoutNoise -- sim-only steps that only make sense when simulating a response from truth. - TMS_SignalProcessing: MergeCoincidentHits, SimulatePedestalSubtraction -- real-or-simulated steps a real DAQ readout would also need. This is the seam a future real-data entry point can join at, by calling only these two methods on digitized hits and skipping TMS_DetectorSimulation. Pure mechanical move: every method body, call order, and RNG draw sequence is unchanged. TMS_Event::ApplyReconstructionEffects() now just orchestrates calls into both singletons in the exact same order as before -- kept as individual calls rather than one Run() per class, because SimulateReadoutNoise() must run after MergeCoincidentHits() (noise is drawn once per final merged channel-readout, not per raw sub-hit), so the two classes' methods are necessarily interleaved rather than each being one contiguous block. TMS_Event gained two small public members to support the move without a bigger encapsulation break: GetHitsRawRef() (a reference-returning sibling of the existing by-value GetHitsRaw()/SetHitsRaw(), avoiding a full hit- vector copy on every relocated method call) and AddDeadtimeChannelRecord() (SimulateDeadtime() used to push directly into three private TMS_Event member vectors; now it calls this new appender instead). generator stays private, passed by reference into the two methods that need RNG draws. GetUniqIDForDeadtime()'s one-line body is inlined into the relocated SimulateDeadtime() rather than kept as a shared helper, since nothing else used it. No behavior change intended -- output should be bit-identical to before this commit, unlike the earlier merge-collapse work which had an accepted RNG-stream side effect. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…file build Same gap as TMS_Geom.o: this class split added two new .cpp files that the hand-maintained TMS_OBJ list doesn't know about, so GitHub CI's plain `make` path would fail to link them in.
SFBayLaser
force-pushed
the
phase2-detsim-fixes
branch
from
August 13, 2026 18:47
96fcd21 to
dc8e09d
Compare
SFBayLaser
force-pushed
the
phase2-detsim-class-split
branch
from
August 13, 2026 18:47
9dc3827 to
f0b5a58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third step of the real-data restructuring proposal (see #298 for Phase 1, #299 for the Phase 2 prep fixes this builds on; also discussed in #nd_muon_spectrometer_code). This is the actual class split Phase 2 aims for. Heads-up issue: #293.
Change: moved
TMS_Event's 7 private detector-response methods into two new classes --TMS_DetectorSimulation(sim-only: optical model, dark count, timing, deadtime, readout noise) andTMS_SignalProcessing(real-or-simulated: hit merging, pedestal subtraction).TMS_Event::ApplyReconstructionEffects()is now pure orchestration, calling into both classes in the same order as before -- this is the seam a future real-data entry point can join at, by calling onlyTMS_SignalProcessingon digitized hits.Pure mechanical move, no algorithm changes.
Verification: build clean, zero new warnings. Full-spill run compared field-for-field against the pre-split baseline: log output,
nSlices/totHits/nTracksper spill, andRecoHitBar/TrueHitBardistributions are all bit-identical (only non-deterministic wall-clock timing and raw heap pointer addresses in the log differ).Closes #293.