Scoring¶
Scoring setup is for measuring and recording physical simulation results.
-
struct Scoring
Enable scoring of hits or other quantities.
If the problem to be executed has no sensitive detectors,
sdmust bestd::nullopt(unset).Public Members
-
std::optional<GeantSd> sd
Enable Geant4 sensitive detector integration.
-
std::optional<SimpleCalo> simple_calo
Add simple on-device calorimeters integrated over events.
-
std::optional<GeantSd> sd
Geant4 sensitive detectors¶
These options are used to integrate Celeritas with Geant4 sensitive detectors by reconstructing Geant4 hits and calling back to user code.
-
struct GeantSd
Control options for Geant4 sensitive detector integration.
By default, Celeritas connects to Geant4 sensitive detectors so that it reconstructs full-fidelity hits with all available step information.
By default, steps that do not deposit energy do not generate any hits.
To improve performance and memory usage, determine what quantities (time, position, direction, touchable, …) are required by your setup’s sensitive detectors and set all other attributes to
false.Reconstructing the full geometry status using
touchablestep option is the most expensive detector option. Disable it unless your SDs require (e.g.) the volume’s copy number to locate a detector submodule.Some reconstructed track attributes (such as post-step material) are currently never set because they are rarely used in practice. Contact the Celeritas team or submit a pull request to add this functionality.
Various attributes on the step, track, and pre/post step points may be available depending on the selected options.
Disabling
trackwill leaveG4Step::GetTrackasnullptr.Enabling
trackwill set theChargeattribute on the pre-step.Requested post-step data including
GlobalTime,Position,KineticEnergy, andMomentumDirectionwill be copied to theTrackwhen the combination of options is enabled.Some pre-step properties (
MaterialandMaterialCutsCouple, and sensitive detector) are always updated. Post-step values for those are not set.Track and Parent IDs will never be a valid value since Celeritas track counters are independent from Geant4 track counters. Similarly, special Geant4 user-defined
UserInformationandAuxiliaryTrackInformationare never set.
The
force_volumesoption can be used for unusual cases (i.e., when using a custom run manager) that do not define SDs on the “master” thread. Similarly, theskip_volumesoption allows optimized GPU-defined SDs to be used in place of a Geant4 callback. For both options, theFindVolumeshelper function can be used to determine LV pointers from the volume names.- Todo:
For improved granularity in models with duplicate names, we could add a vector of
LabeltoVariantSetVolume.change from
unordered_settosetfor better reproducibility in serialized output
The pre- and post-step attributes can be set with:
sd.points[StepPoint::pre].global_time = true; sd.points[StepPoint::post].touchable = false;
See also
celeritas::GeantSd
Public Types
-
using SetVolume = std::unordered_set<G4LogicalVolume const*>
Provide either a set of labels or a set of pointers to Geant4 objects.
Public Members
-
bool ignore_zero_deposition = {true}
Skip steps that do not deposit energy locally.
-
bool energy_deposition = {true}
Save energy deposition.
-
bool step_length = {true}
Save physical step length.
-
bool track = {true}
Create a track with the dynamic particle type and post-step data.
-
PointAttrs points
Options for saving and converting beginning- and end-of-step data.
-
VariantSetVolume force_volumes
Manually list LVs that don’t have an SD on the master thread.
-
VariantSetVolume skip_volumes
List LVs that should not have automatic hit mapping.
-
struct GeantSdStepPointAttributes
Options for saving attributes at each step point.
Public Members
-
bool global_time = {true}
Store the time since the start of the event.
-
bool position = {true}
Store the step point position.
-
bool direction = {true}
Store the step point direction (AKA momentum direction)
-
bool kinetic_energy = {true}
Store the step point energy.
-
bool touchable = {true}
Reconstruct the complete volume hierarchy.
-
bool global_time = {true}
Independent scoring¶
This is used to set up celeritas::SimpleCalo.
-
struct SimpleCalo
Integrate energy deposition in each volume over all events.
- Todo:
Delete this; detectors can be set up through standalone, or we want to integrate directly with G4 detectors.
See also
Public Members
-
std::vector<Label> volumes
List of geometry volumes to score.