Improve consistency of scintillation/Cherenkov import with Geant4#2303
Open
sethrj wants to merge 34 commits intoceleritas-project:developfrom
Open
Improve consistency of scintillation/Cherenkov import with Geant4#2303sethrj wants to merge 34 commits intoceleritas-project:developfrom
sethrj wants to merge 34 commits intoceleritas-project:developfrom
Conversation
Move all scintillation data loading from GeantImporter to GeantPhysicsLoader. This removes ImportScintData and related structs from ImportOpticalMaterial, loading directly into inp::ScintillationMaterial in the physics loader. - Load scintillation properties per optical material in GeantPhysicsLoader - Support up to 3 components with Gaussian or grid-based spectra - Convert Gaussian approximations to inp::NormalDistribution - Calculate per-component yield from yield_per_energy * yield_frac - Remove all scintillation-related code from GeantImporter - Remove ImportGaussianScintComponent, ImportScintComponent, ImportMaterialScintSpectrum, and ImportScintData structs Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
…intillationProcess - Remove ScintillationParams::from_import static method - Update constructor to take optical::MaterialParams and inp::ScintillationProcess - Remove ImportScintData and related structs from ROOT dictionary - Update Problem.cc and ImportedDataTestBase to use new constructor - Rewrite Scintillation.test.cc with new inp:: types and manual optical material setup - Update GeantImporter.test.cc to check inp::ScintillationProcess instead of ImportOpticalMaterial - Fix ImportDataConverter to remove obsolete scintillation conversions - Fix GeantPhysicsLoader yield calculation: component yields are relative weights, not absolute photons/MeV The total yield is now correctly summed from individual component yields in ScintillationParams, and component yield fractions are normalized during loading in GeantPhysicsLoader. Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
Extract helper functions to anonymous namespace: - try_load_gaussian_spectrum: Load and validate mean/sigma pairs - load_scintillation_component: Load single component spectrum - normalize_component_yields: Normalize yields to material total Validates that both lambda_mean and lambda_sigma are present together for each prefix (CELER_ or deprecated unprefixed), catching configuration errors where only one parameter is specified. Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
Test summary 5 935 files 9 563 suites 8m 5s ⏱️ Results for commit 05a105f. ♻️ This comment has been updated with latest results. |
…PhysicsLoader Introduce GeantOpticalMatHelper, analogous to GeantSurfacePhysicsHelper, that bundles an OptMatId, G4Material const*, and a GeantMaterialPropertyGetter for convenient per-material property access. Extract the scintillation loading logic from GeantPhysicsLoader::scintillation into a new functor class GeantScintillationLoader, constructed with a reference to inp::ScintillationProcess. The two anonymous-namespace helpers load_scintillation_gaussian and load_scintillation_spectrum become private static methods load_gaussian and load_spectrum on the new class. GeantPhysicsLoader::scintillation is now a thin loop that builds GeantOpticalMatHelper objects and delegates to GeantScintillationLoader. Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
…Helper Define inline operator<< for both helper classes so they can be streamed directly into log messages. GeantOpticalMatHelper prints the G4Material name and optical id; GeantSurfacePhysicsHelper prints the surface name and surface id. Update the error-context log messages in GeantScintillationLoader and GeantSurfacePhysicsLoader to use the new operators, and reorganise the surface-loader message to include finish/type alongside the model name. Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
…l mat/surface helpers Add operator bool (checks non-null construction), a public property_getter() accessor returning GeantMaterialPropertyGetter const&, and CELER_ASSERT(*this) guards on member accessors, to both GeantOpticalMatHelper and GeantSurfacePhysicsHelper. Rename the get_property() accessor on GeantOpticalMatHelper to property_getter() for consistency with the surface helper. Update GeantScintillationLoader and GeantPhysicsLoader to use the renamed accessor. Update operator<< on both helpers to stream via the property getter (which already knows the material/surface name) instead of calling GetName() directly. Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
This was referenced Mar 10, 2026
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.
CHAINED on #2306
This completely refactors the scintillation import data to use
inpdata structures and to load based on the availability of the geant4 processes.Consequences:
OpticalPhysics::genprocessesEach scintillation component is now represented as a completely independent unnormalized time- and energy-dependent spectrum: it has a yield, energy distributions (independent distribution type [normal, grid] and quantity [wavelength, energy]), and time distribution.