Commit ec51d64d authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'fixes_depg4' into 'master'

DepositionGeant4: Minor Fixes

See merge request allpix-squared/allpix-squared!556
parents 324ca977 ed3ebd71
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -312,9 +312,9 @@ GeneratorActionInitializationMaster::GeneratorActionInitializationMaster(const C
    particle_source_->SetVerbosity(0);

    // Get source specific parameters
    auto source_type = config.get<std::string>("source_type");
    auto source_type = config.get<GeneratorActionG4::SourceType>("source_type");

    if(source_type == "macro") {
    if(source_type == GeneratorActionG4::SourceType::MACRO) {
        LOG(INFO) << "Using user macro for particle source.";

        // Get the macro file and apply its commands
+3 −1
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ This module requires an installation Geant4.
* `source_energy_spread` : Energy spread of the source.
* `source_position` : Position of the particle source in the world geometry.
* `source_type` : Shape of the source: **beam** (default), **point**, **square**, **sphere**, **macro**.
* `file_name` : Name of the macro file (if source_type=**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`.
* `number_of_particles` : Number of particles to generate in a single event. Defaults to one particle.
@@ -100,6 +99,9 @@ Note: Neutrons have a lifetime of 882 seconds and will not be propagated in the
* `sphere_radius` : Radius of the sphere source (particles start only from the surface).
* `sphere_focus_point` : Focus point of the sphere source. If not specified, the radiation field is isotropic inside the sphere.

#### Parameters for source `macro`
* `file_name` : Path to the Geant4 source macro file.

### Usage
A possible default configuration to use, simulating a beam of 120 GeV pions with a divergence in x, is the following:

+1 −2
Original line number Diff line number Diff line
@@ -96,10 +96,9 @@ namespace allpix {

        /**
         * Random number generator for e/h pair creation fluctuation
         * @note It is okay to keep a separate random number generator here because instances if this class are thread_local
         * @note It is okay to keep a separate random number generator here because instances of this class are thread_local
         * and the PRNG is re-seeded every event from the event PRNG. See \ref DepositionGeant4Module::run()
         */

        RandomNumberGenerator random_generator_;

        // Statistics of total and per-event deposited charge