Refactoring of the caloriemter base code and bug fixes - #1908
Conversation
|
Hi @bechenard,
which require these tests: build. @Mu2e/fnalbuild-users, @Mu2e/write have access to CI actions on main. ⌛ The following tests have been triggered for 521583d: build (Build queue - API unavailable) |
|
☔ The build tests failed for 521583d.
N.B. These results were obtained from a build of this Pull Request at 521583d after being merged into the base branch at 2818851. For more information, please check the job page here. |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 3cba7b1: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 3cba7b1.
N.B. These results were obtained from a build of this Pull Request at 3cba7b1 after being merged into the base branch at 2818851. For more information, please check the job page here. |
|
Trigger test invalidated because the RNG sequence is altered by changes. The rest should be ok |
|
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 35d9c05: build (Build queue - API unavailable) |
|
📝 The HEAD of |
|
☀️ The build tests passed at 35d9c05.
N.B. These results were obtained from a build of this Pull Request at 35d9c05 after being merged into the base branch at 2818851. For more information, please check the job page here. |
giro94
left a comment
There was a problem hiding this comment.
Ok for me. This might have some consequence in EventNtuple code, e.g. https://github.com/Mu2e/EventNtuple/blob/main/src/InfoStructHelper.cc#L532C1-L532C79
Findings1. [S1] The file is loaded at runtime via configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/crystalPos.txt ${CURRENT_BINARY_DIR} data/crystalPos.txt)
has two problems:
- ${CURRENT_BINARY_DIR} is not a defined CMake variable (the standard one is CMAKE_CURRENT_BINARY_DIR); it expands to empty, which silently collapses the call to a 2-arg configure_file that copies the file into the build tree.
- Even working as intended, configure_file is a configure-time copy, not an install rule — a CMake/spack install or a Phase-2 grid tarball still ships without the file, and the first calo-geometry job dies. The scons Jenkins CI can't catch this
(it reads the source tree).
Fix (one line, matches every sibling package that ships runtime data — Mu2eG4/CMakeLists.txt:306-310, TrackerConditions, ParticleID):
install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Offline/CalorimeterGeom)
and drop the configure_file line.
2. [S3] mapPhysVol_ is now a write-only set rebuilt every subrun.
With the usePhysVol_ branch gone, CaloShowerStepMaker_module.cc still clears and repopulates mapPhysVol_ in beginSubRun (lines ~195-207), but nothing reads it anymore. Remove the member and the population loop (physVolInfoInput_/vols_ are still
genuinely needed by PhysicalVolumeMultiHelper).
3. [S3] Minor / confirm (carried over from the first pass, unchanged)
- isContainedSection → isInsideSameDisk (CaloShowerStepMaker): a genuine logic change (old = Δz-only; new = both endpoints inside the disk envelope), not a rename — this is the RNG/validation-plot change the author flagged. It conserves
per-crystal deposited energy at the production eDepThreshold: 0. A one-line comment that the criterion changed deliberately would help future archaeology.
- The shim-step loop assumes every crystal row straddles x=0 (sentinels xLowMin=1e6…); fine for the shipped crystalPos.txt (all 37 rows have both sides), fragile for future asymmetric files.
- CMake vs SConscript link-lib drift (cetlib on scons only); cosmetic. Dead Disk::radiusInCrystal_ member. DiskCal00_module.cc dropped an Origin: debug print rather than porting it. SquareShiftMapper::colFromIndex changed the negative-column
convention (now self-consistent, internally unused — confirm no external caller relied on the old numbering). |
Calorimeter::geomUtil()/CaloGeomUtil were removed in #1908, but the calo-cluster matching added to LineFinder in 0d17255 (2026-07-20, after that PR branched) still called them, breaking main for every PR buildtest. Migrate the one surviving call site to the hoisted transforms, matching how #1908 migrated the identical pattern in CalPatRec (CalTimePeakFinder, CalLineTimePeakFinder). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix LineFinder build: migrate to calo transform API from #1908
Major (and hopefully final) refactoring of the calorimeter code, including a few bug fixes, to facilitate condition integration and improve readability
o Changed interface to navigation classes. There is still a method to call mu2e<->tracker frame transformations (a big wart) that needs to be moved to the tracker and removed
o The SimParticle selection for the CaloShowerStep reconstruction was slightly tightened -> doesn't change the physics, but it changes the RNG sequence and the validation plots
o Kept the calorimeter interface to avoid exposing some of the DiskCalorimeter methods -> fixed some call sites
Will fix the CMakeList files when the tests complain...