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

DepositionCosmics: allow configuration of simulated area

parent 60958a60
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ DepositionCosmicsModule::DepositionCosmicsModule(Configuration& config, Messenge
    cry_config << " nParticlesMin " << config_.get<unsigned int>("min_particles") << " nParticlesMax "
               << config_.get<unsigned int>("max_particles");

    if(!config_.has("area")) {
        // Calculate subbox length required from the maximum coordinates of the setup:
        LOG(DEBUG) << "Calculating subbox length from setup size";
        auto min = geo_manager_->getMinimumCoordinate();
@@ -124,6 +125,14 @@ DepositionCosmicsModule::DepositionCosmicsModule(Configuration& config, Messenge
        LOG(DEBUG) << "Maximum side length (in x,y): " << Units::display(size, {"mm", "cm", "m"})
                   << ", selecting subbox of size " << size_meters << "m";
        cry_config << " subboxLength " << size_meters;
    } else {
        auto area = Units::convert(config_.get<int>("area"), "m");
        if(area > 300) {
            throw InvalidValueError(config_, "area", "only areas with side lengths of up to 300m are supported");
        }
        LOG(DEBUG) << "Configuring subbox of size " << area << "m from configuration parameter";
        cry_config << " subboxLength " << area;
    }

    auto latitude = config_.get<double>("latitude");
    if(latitude < -90 || latitude > 90) {
+3 −2
Original line number Diff line number Diff line
# DepositionCosmics
**Maintainer**: Simon Spannagel (<simon.spannagel@cern.ch>)  
**Status**: Immature  
**Status**: Functional  
**Output**: DepositedCharge, MCParticle, MCTrack  

### Description
@@ -60,6 +60,7 @@ Note: Neutrons have a lifetime of 882 seconds and will not be propagated in the
* `altitude`: Altitude for which the shower particles should be simulated. Possible values are `0m`, `2100m` and `11300m`, defaults to sea level, i.e. `0m`. It should be noted that the particle incidence plane is always located at `z = 0` independent of the simulated altitude.
* `min_particles`: Minimum number of particles required for a shower to be considered. Defaults to `1`.
* `max_particles`: Maximum number of particles in a shower before additional particles are cut off. Defaults to `100000`
* `area`: Side length of the squared area for which incident particles are simulated. This can maximally be `300m`. By default, the maximum size is automatically derived from the dimensions of the detector setup of the current simulation.

### Usage