Commit ca4eddc4 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

DepositionGeant4: expose new variable through config interface, document it

(cherry picked from commit 0b33c20b)
parent 8e8819ea
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ DepositionGeant4Module::DepositionGeant4Module(Configuration& config, Messenger*
    config_.setDefault<double>("max_step_length", Units::get(1.0, "um"));
    // Default value chosen to ensure proper gamma generation for Cs137 decay
    config_.setDefault<double>("cutoff_time", 2.21e+11);
    // By default, only record MCTracks connected to MCParticles in the sensitive volume
    config_.setDefault<bool>("record_all_tracks", false);

    // Create user limits for maximum step length and maximum event time in the sensor
    user_limits_ =
@@ -254,7 +256,7 @@ void DepositionGeant4Module::initialize() {
    // Construct the sensitive detectors and fields.
    if(run_manager_mt == nullptr) {
        // Create the info track manager for the main thread before creating the Sensitive detectors.
        track_info_manager_ = std::make_unique<TrackInfoManager>();
        track_info_manager_ = std::make_unique<TrackInfoManager>(config_.get<bool>("record_all_tracks"));
        construct_sensitive_detectors_and_fields(fano_factor, charge_creation_energy, cutoff_time);
    } else {
        // In MT-mode we register a builder that will be called for each thread to construct the SD when needed.
@@ -284,7 +286,7 @@ void DepositionGeant4Module::initializeThread() {
        // In MT-mode the sensitive detectors will be created with the calls to BeamOn. So we construct the
        // track manager for each calling thread here.
        if(track_info_manager_ == nullptr) {
            track_info_manager_ = std::make_unique<TrackInfoManager>();
            track_info_manager_ = std::make_unique<TrackInfoManager>(config_.get<bool>("record_all_tracks"));
        }

        run_manager_mt->InitializeForThread();
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ This module requires an installation Geant4.
* `source_type` : Shape of the source: **beam** (default), **point**, **square**, **sphere**, **macro**.
* `cutoff_time` : Maximum lifetime of particles to be propagated in the simulation. This setting is passed to Geant4 as user limit and assigned to all sensitive volumes. Particles and decay products are only propagated and decayed up the this time limit and all remaining kinetic energy is deposited in the sensor it reached the time limit in. Defaults to 221s (to ensure proper gamma creation for the Cs137 decay).
Note: Neutrons have a lifetime of 882 seconds and will not be propagated in the simulation with the default `cutoff_time`.
* `record_all_tracks` : Switch to enable the recording of all Geant4 tracks in the event. By default, this parameter is set to `false` and MCTrack objects are only generated for particles interacting with sensor material, not those that never interact with any detector.
* `number_of_particles` : Number of particles to generate in a single event. Defaults to one particle.
* `output_plots` : Enables output histograms to be be generated from the data in every step (slows down simulation considerably). Disabled by default.
* `output_plots_scale` : Set the x-axis scale of the output plot, defaults to 100ke.