Repository navigation
Conversation
…r-layer calibration; geometry check
jbeirer
force-pushed
the
calorimetry-evaluators
branch
from
December 5, 2026 18:43
ed9ca21 to
23413a4
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.
Stacked on #1.
Three evaluators for the first study, each stating in its docstring what it assumes of the detector.
calo.layer_energies(evaluators/calorimetry/layer_energies.py): per event, the energy in the active and in the passive material of each longitudinal layer, and the true energy and direction of the generated particle (.npzartifact). Reads the EDM4hep file with uproot; the collection, cell ID encoding, layer field and active selection are settings.Applies to layered sampling calorimeters that record their passive deposits in the same collection, identified in the cell ID (in Key4hep today: ALLEGRO's noble-liquid calorimeters with sensitive absorbers), for single-particle samples. Not to CLD's SiW ECAL, IDEA's dual-readout calorimeter or crystals as they are. An event without deposits is kept with zero energy; a missing collection, a layer out of range or an event count that does not match the stage fails.
calo.energy_resolution(evaluators/calorimetry/energy_resolution.py, withsampling_calibration.pyandresolution_fit.py), combining the energies of one particle:Reports a, c, their correlation, χ²/ndf, the mean sampling fraction, σ/E at reference energies, and the measured resolution and response at each energy; a summary JSON and a figure. A term fitted at 0 is a valid result, with its 95% upper limit. Simulation-level: no noise, no clustering, no upstream-material correction.
geometry.check(evaluators/geometry/dd4hep_check.py, withdd4hep_geometry.py): builds the candidate's geometry with DD4hep in a separate process, reports DD4hep expressions as metrics (what the values a problem writes made of it), and checks a subdetector for overlaps with TGeo (meshes and random points). Any DD4hep geometry. Overlaps make the candidate invalid; a geometry that does not build fails.Tests (
tests/unit/calorimetry): toy calorimeters with known sampling fractions and resolution: the terms are recovered; over 40 toy experiments the bootstrap uncertainties of a and c have pull widths close to 1 (slow, run nightly); the core estimator ignores tails; the failure cases. Separately checked on ALLEGRO simulations:calo.layer_energiesagrees exactly with an independent podio-based extraction of the same files, andgeometry.checkreports 1536 planes at 50.18° and 1200 at 60°, without overlaps.CI runs the tests in the Key4hep container with the pinned release.