BarrelHCAL: group tiles into 32 phi-sector sub-assemblies#1122
Draft
wdconinc wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR primarily optimizes detector geometry navigation by reducing large flat daughter lists through sector grouping, parameterized placements, and reusable volume templates. Its actual scope is broader than the BarrelHCAL title, also changing LFHCAL, FEMC, BIC, dRICH, and DIRC geometry/optics behavior.
Changes:
- Groups BarrelHCAL tiles/steel into 32 phi-sector assemblies and inlines tile/end-ring geometry definitions.
- Replaces repeated placements with reusable templates or
paramVolume1Din LFHCAL, forward ECAL, Barrel ScFi, and Barrel Imaging. - Adds dRICH sensorbox subvolumes and DIRC bar optical-surface handling.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/BarrelHCalCalorimeter_geo.cpp |
Builds BarrelHCAL sector sub-assemblies, procedural end rings, and XML-defined tile solids. |
compact/hcal/barrel_gdml.xml |
Replaces external end-ring/tile GDML references with inline compact XML shapes. |
src/LFHCAL_geo.cpp |
Reuses absorber/filler/scintillator templates across repeated slices. |
src/forwardEcal_geo.cpp |
Converts tower/fiber/block repeated placements to paramVolume1D. |
src/DRICH_geo.cpp |
Adds per-sector sensorbox gas subvolumes and reparents PDU assemblies. |
src/DIRC_geo.cpp |
Adds DIRC bar optical surface setup. |
compact/optical_materials.xml |
Defines the DIRC bar optical surface used by DIRC_geo.cpp. |
src/BarrelCalorimeterScFi_geo.cpp |
Groups fibers by row and places them with paramVolume1D. |
src/BarrelCalorimeterImaging_geo.cpp |
Converts 1D module placement along stave Y to parameterized placement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Replace the single flat Assembly BarrelHCAL (7,714 daughters) with 32 per-sector sub-assemblies placed directly in the envelope Polycone. The flat assembly has no bounding box, so every navigation step in the barrel must search all 7,714 children. With 32 sub-assemblies the envelope (a bounded Polycone) can voxelise their bounding boxes and skip ~31/32 of them per navigation call. Each sector sub-assembly contains ~241 daughters (1-2 steel structures + 10×12×2 tiles). Navigation cost: 119-139 µs/call → expected ~1-3 µs/call (~50× speedup). Key mapping: - phi_to_sector lambda: normalizes phi in [0,2π) → sector index [0..31] - Normal steel sectors k=0..28: phi = -k*11.25° - Chimney sectors at +11.25°, 0°, -11.25°: → sectors 1, 0, 31 - End rings placed directly in envelope (span all sectors) - 10 tiles per phi sector (i_phi wraps correctly at sector 30 boundary) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
77db324 to
9adb46a
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.
Motivation
The
BarrelHCALdetector is currently built as a single flatAssemblywith 7,714 daughters (29 normal + 3 chimney steel structures, 2 end rings, and 7,680 scintillator tiles). SinceAssemblyvolumes have no bounding box, ROOT's TGeo voxeliser must search all 7,714 children on every navigation step inside the barrel. Profiling with Perfetto traces shows this costs 119–139 µs per navigation call, roughly 100× the typical 1 µs baseline.Approach
Replaces the flat
BarrelHCALassembly with 32 phi-sector sub-assemblies placed directly in the boundedenvelopePolycone:phi_to_sectorlambda maps any phi angle (radians) to a sector index [0..31] using the 11.25°/sector geometryenvelopebypassing the sector groupingResult:
envelopehas 34 daughters (32 sectors + 2 end rings). Each sector sub-assembly has ~241 daughters (1–2 steel structures + 240 tiles). TGeo can voxelise the 32 sector bounding boxes inenvelope, skipping ~31/32 sub-assemblies per navigation step.Expected navigation speedup: 7,714 flat → ~32 (envelope) + ~241 (sector) ≈ 50× reduction in navigation search work.
Validation
-Wall -Wextra -Werror -pedantic(clang++)npsim -G -N0geometry loads without errornpsim -G -N2runs 2 events without geometry navigation errors or exceptionsenvelope → BarrelHCAL → tiletoenvelope → BarrelHCAL_sectorNN → tile; DD4hep VolumeManager walks the full chain transparentlyRelated