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,
sd
must bestd::nullopt
(unset).Public Members
-
std::optional<GeantSensitiveDetector> sd
Enable Geant4 sensitive detector integration.
-
std::optional<SimpleCalo> simple_calo
Add simple on-device calorimeters integrated over events.
-
std::optional<GeantSensitiveDetector> 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 GeantSensitiveDetector
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
locate_touchable
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
track
will leaveG4Step::GetTrack
asnullptr
.Enabling
track
will set theCharge
attribute on the pre-step.Requested post-step data including
GlobalTime
,Position
,KineticEnergy
, andMomentumDirection
will be copied to theTrack
when the combination of options is enabled.Some pre-step properties (
Material
andMaterialCutsCouple
, 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
UserInformation
andAuxiliaryTrackInformation
are never set.
The
force_volumes
option 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_volumes
option allows optimized GPU-defined SDs to be used in place of a Geant4 callback. For both options, theFindVolumes
helper function can be used to determine LV pointers from the volume names.See also
celeritas::HitManager
Public Types
-
using VariantSetVolume = std::variant<std::set<Label>, std::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 locate_touchable = {true}
Set TouchableHandle for PreStepPoint.
-
bool track = {true}
Create a track with the dynamic particle type and post-step data.
-
GeantSDStepPointAttributes pre
Options for saving and converting beginning-of-step data.
-
GeantSDStepPointAttributes post
Options for saving and converting 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 global_time = {true}
Independent scoring¶
This is used to set up celeritas::SimpleCalo
.
-
struct SimpleCalo
Integrate energy deposition in each volume over all events.
See also
Public Members
-
std::vector<Label> volumes
List of geometry volumes to score.
-
std::vector<Label> volumes