Repository navigation
Conversation
CrvSiPMChargeGenerator builds the first CrvPhotons of each channel once per event instead of a linear search per channel; CaloDigiMaker collects the CaloShowerROs of each readout in one pass instead of scanning all of them per readout. Output bitwise identical; CaloDigiMaker 55 % and CrvSiPMCharges 14 % faster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
☀️ The build tests passed at a686153.
N.B. These results were obtained from a build of this Pull Request at a686153 after being merged into the base branch at 152833a. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2142
Reviewed at head a6861534dcc6d72bc4170f0c7d5ac162b9db99b6. First pass.
Decision
- 🟢 approve. Both indexes reproduce the old searches exactly, and the output is bit-identical to
mainon every sample I ran: 10,000 off-spill cosmics, 1,000 on-spill CE events, and FNALbuild'sceMixandceDigi. On CE eventsCaloDigiMakertakes about a third less time. FNALbuild build 3595 passed at this head, merged onmain152833a9. Itstriggerrow reads ":question: Return Code 1", but that comes frommain, not from this PR (see Validation check). One optional small item (finding 1).
Scope understood
CrvSiPMChargeGenerator: one pass overCrvPhotonskeeps the first collection of each channel (bar × 4 + SiPM,:200-207). The per-SiPM linear search becomes a lookup (:229-230).CaloDigiMaker: one pass collects theCaloShowerROs of each readout in collection order (:194-198), andfillROHitsloops over that list.
Findings
- ⚪ [S3] Small items, optional.
-
The new index loops drop inputs they cannot place, with no message:
- a
CrvPhotonswhose SiPM number is outside 0-3, or whose bar index is past the geometry (CrvSiPMChargeGenerator_module.cc:204,:206); - a
CaloShowerROwhoseSiPMIDis not belownWaveforms(CaloDigiMaker_module.cc:197).
That is what
maindoes too, since its searches could never match such an entry, so nothing changes. But these loops now see every input once, and a throw there would turn a corrupt input into an error rather than missing hits. - a
-
for (const auto& CaloShowerRO : CaloShowerROs)(:195) names the variable after its type, as the removed loop did.showerRO, as infillROHits, would read better.
-
Checked, no action needed
-
🟢 The index matches the old lookup.
- Duplicate entries for one channel: the old search stopped at the first match, and the index keeps the first.
- Entries the old search could never reach (SiPM outside 0-3, a bar not in the geometry) are skipped in both.
- A readout with no
CaloShowerROstill returnsisEmpty, and one with only emptyPETimelists is still non-empty. - Nothing draws random numbers, and the order inside each list is the collection order. So the random sequences and the output order are unchanged.
-
🟢 Bit-identical to
main.- Method:
mainis the CI build152833a9. The PR is this head merged on152833a9together with #2145, withbinomialArrivals: false(see my #2145 review). Each job dumped its products event by event withPrintModule, and the dumps were compared line by line. - Off-spill cosmics: Production
digitize/OffSpill.fclplus CRV reco, 10,000CosmicCRYAllMDC2025ap events.CaloDigis,CrvDigis, bothCrvDigiMCs,CrvRecoPulsesandCrvCoincidenceClustersare identical in every event: 121k CRV digis and 154k pulses. - On-spill:
digitize/OnSpill.fcl, 1,000CeMLeadingLogMDC2025ba events.CaloDigis(10,338 digis with full waveforms) andStrawDigis(29,776) are identical. - FNALbuild's
ceMix(with the muon-stop pileup) andceDigi, 53 events each: calorimeter, CRV and all seven straw-digi collections are identical.
- Method:
-
🟢 Timing.
mainand this PR ran at the same time on the same node; TimeTracker means:mainthis PR CaloDigiMaker, CE (1,000 events)0.84 ms 0.54 ms CrvSiPMCharges, cosmics (3,000)1.17 ms 1.14 ms CrvSiPMCharges, CE0.93 ms 0.90 ms full event, CE 23.6 ms 21.8 ms With few
CrvPhotonscollections per event the CRV gain is small. Your Mix1BB numbers, with heavier pileup, are larger.
Validation check
- Build/tests run: yes. A
muse buildof this head merged with #2145 on152833a9(p110) exited with status 0 and no warnings. All the jobs above exited with status 0. - FNALbuild build 3595 at this head, merged on
152833a9: every test passed excepttrigger, which reads ":question: Return Code 1". Its log shows one path off its reference:mpr_TrkDe_80m70p_D0200passes 414 events against 445. Builds 3593 (#2107) and the ones for #2141 and #2143 show the same count on the samemain. That reference has been stale sinceca7b6580, and this PR touches no trigger code. - Config contract check: pass. No fcl or parameter changes.
- Cross-repo consistency: pass. This PR merges cleanly with #2145, which also edits
CRVResponse.
Residual risk
- None found. The CRV index assumes bar indices run from 0 to the number of bars minus one, as
CosmicRayShieldbuilds them. The bit-identical cosmic run covers every bar that fired.
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2142
Reviewed at head 0a9a6084991cfdad1553d9a585e8f49b7994e824. Re-review of a686153.
Decision
- 🟡 comment now, approve when green. The new commit only renames the loop variable, as my nit suggested, and changes nothing else. FNALbuild has not built this head (no
mu2e/buildtestresult at 03:20 UTC), so I am requesting a build and will approve once it is green.
What changed since a686153
- One commit,
0a9a608"CaloDigiMaker: name the index loop variable showerRO" (CaloMC/src/CaloDigiMaker_module.cc, +3 −3). Not a rebase.
Prior findings (from my review at a6861534)
- 🟢 [was ⚪ S3, second item] The loop variable named after its type. FIXED:
for (const auto& showerRO : CaloShowerROs)(CaloDigiMaker_module.cc:195-197), the same name as infillROHits(:268). The rename covers all three uses in the loop, and the body is otherwise unchanged. - ⚪ [S3, first item, open, optional] The index loops drop inputs they cannot place, with no message, as
maindoes.
Validation check
- Build/tests run: no. The change is a rename of a loop-local variable, checked by reading the diff. My bit-identity runs at
a6861534cover the behaviour. - Config contract check: not applicable.
- Cross-repo consistency: pass.
|
@FNALbuild run build test |
2 similar comments
|
@FNALbuild run build test |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 0a9a608: build (already triggered: build) (Build queue - API unavailable) |
|
☀️ The build tests passed at 0a9a608.
N.B. These results were obtained from a build of this Pull Request at 0a9a608 after being merged into the base branch at 30088f3. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2142
Reviewed at head 0a9a6084991cfdad1553d9a585e8f49b7994e824. Follow-up to my comment review at the same head.
Decision
- 🟢 approve. FNALbuild build 3603 has now built this head, merged on
main30088f39. The prof build, all eleven validation jobs,rootOverlaps,g4surfaceCheck,check_cmakeand the whitespace check passed. triggershows "Return Code 2", but not because of this PR. Its log has exactly four messages, all from mu2e-trig-config#191's rename ofapr_protontoapr_proton_p335/p250/p150, which merged before the reference log was regenerated. No path count differs from the reference.- Both clang-tidy errors are in cetlib's
LibraryManager.h. - This is the approval my comment review promised once the build was green.
|
I'm marking this as draft so that I can remove the CRV-related parts, which may conflict with #2150 |
|
📝 The HEAD of |
Mu2e#2150 already reworked CRVResponse SiPM charge generation. Keep only the CaloDigiMaker once-per-event CaloShowerRO index from this PR.
|
@FNALbuild run build test Merged current main and dropped the CrvSiPMChargeGenerator indexing (conflicts with #2150). Only CaloDigiMaker once-per-event index remains. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2142
Reviewed at head 21f3ce348b97edd44e53b02ba215cccb780dc6d1. Re-review of 0a9a608.
Decision
- 🟡 comment now, approve when green. Thanks, Rob. Dropping the CRV half leaves exactly the calorimeter change I approved at 0a9a608, and
CrvSiPMChargeGeneratoris now the same as onmain. FNALbuild has not built this head: your 14:55 UTC request had no reply from the bot at 16:55 UTC, andjenkins/ghprbis still pending. I will approve once it is green.
What changed since 0a9a608
- One merge commit,
21f3ce3"Merge main; drop CrvSiPMChargeGenerator indexing". The PR now changes onlyCaloMC/src/CaloDigiMaker_module.cc(+12 −8), and is up to date withmain(785954ae).
The change, checked
- 🟢
CaloDigiMaker_module.ccat this head is the same file as at 0a9a608 (git blobced0708fat both heads).mainhas not changed that file since 2026-10-08, so the merge brings nothing new into it. - 🟢
CRVResponse/src/CrvSiPMChargeGenerator_module.ccat this head is the same as onmain(blobf4f33862), so nothing of the CRV half is left to conflict with #2150.
Prior findings
- ⚪ [S3, open, optional] The index loop drops readouts it cannot place with no message, as
maindoes:if (SiPMID < unsigned(nWaveforms))(CaloDigiMaker_module.cc:197). Only the calorimeter loop is left of this item.
Validation check
- Build/tests run: none. I compared the file blobs at both heads and on
main. My bit-identity runs at a686153 cover this code. - Config contract check: not applicable.
- Cross-repo consistency: pass.
Residual risk
- None beyond the build.
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 21f3ce3: build (already triggered: build) (Build queue - API unavailable) |
|
☀️ The build tests passed at 21f3ce3.
N.B. These results were obtained from a build of this Pull Request at 21f3ce3 after being merged into the base branch at 785954a. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2142
Reviewed at head 21f3ce348b97edd44e53b02ba215cccb780dc6d1. Follow-up to my comment review at the same head.
Decision
- 🟢 approve. FNALbuild build 3661 has built this head, merged on
main785954ae. The prof build, all eleven validation jobs,rootOverlaps,g4surfaceCheck,check_cmakeand the whitespace check passed. This is the approval my comment review promised once the build was green. triggershows "Return Code 2", but not because of this PR. The log reports no path whose count differs from the reference; it fails only the timing check, on the scale factor. The CI scales the new time by the average time ofLumiStreamPS, which is 8.48e-05 s in the reference log against 1.80e-05 s here, so the scale is 4.72. The reference average is set by one slow event: its maximum is 0.110 s and its median 1.32e-05 s, against a median of 1.62e-05 s here. The raw time per event is 0.0233 s against 0.0224 s. Offline#2193, #2191 and #2198 fail the same way.- clang-tidy's one error is in cetlib's
LibraryManager.h. Its 20 warnings inCaloDigiMaker_module.ccare all on lines this PR does not change.
|
@oksuzian this is ready to merge from my side: CLEAN at |
|
📝 The HEAD of |
What
CaloDigiMaker::fillROHitsscanned everyCaloShowerROfor each readout. This PR builds an index once per event: one pass collects theCaloShowerROpointers of each readout in collection order, andfillROHitstakes that list.No random numbers are drawn in the lookup, and the order of the inputs is unchanged.
File:
CaloMC/src/CaloDigiMaker_module.cc.CRV half dropped
The original PR also indexed
CrvPhotonsinCrvSiPMChargeGenerator. That change conflicted with #2150 (ehrlich-uva, merged 2026-11-17), which reworked CRVResponse SiPM charge generation. The CRV half is removed; only the Calo indexing remains. Rebased/merged onto currentmain.Validation
(From the original two-digitiser PR; Calo path unchanged by the CRV drop.)
The Calo output is bitwise identical to main. The reference was Offline main
ca7b6580(the CI build), with the same Production and mu2e-trig-config commits in both arms.CeMLeadingLog.MDC2025apevents with the four pileup streams and a fixed seed. Products dumped per event withPrintModule(including calo digis) are identical in all 2,000 events: 0.94M calo digis. TrigReport is identical.Performance
Both arms ran on the same host, Mix1BB, 1,000 events per run, in two repeats alternating base and PR. Times are art TimeTracker means.
CaloDigiMakerMain's own repeat-to-repeat spread is 0.3-0.5 %.