Commit 5fcb1527 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'f-laser-groups' into 'master'

DepositionLaser: buckets of photons

See merge request allpix-squared/allpix-squared!987
parents f9d21ccb 63d10473
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -78,6 +78,15 @@ DepositionLaserModule::DepositionLaserModule(Configuration& config, Messenger* m
        throw InvalidValueError(config_, "number_of_photons", "Number of photons should be a nonzero value");
    }

    config_.setDefault<int>("group_photons", 1);
    group_photons_ = config_.get<size_t>("group_photons");
    if(group_photons_ == 0) {
        throw InvalidValueError(config_, "group_photons", "Should be a nonzero value");
    } else if(group_photons_ > 1) {
        number_of_photons_ /= group_photons_;
        LOG(DEBUG) << "Photons will be generated as " << number_of_photons_ << " groups of " << group_photons_;
    }

    config_.setDefault<double>("pulse_duration", 0.5);
    pulse_duration_ = config_.get<double>("pulse_duration");
    LOG(DEBUG) << "Pulse duration: " << Units::display(pulse_duration_, "ns");
@@ -366,7 +375,7 @@ void DepositionLaserModule::run(Event* event) {
        deposited_charges[hit.detector].emplace_back(hit_local,
                                                     hit.hit_global,
                                                     CarrierType::ELECTRON,
                                                     1, // value
                                                     group_photons_, // value
                                                     time_hit_local,
                                                     time_hit_global);

@@ -374,7 +383,7 @@ void DepositionLaserModule::run(Event* event) {
        deposited_charges[hit.detector].emplace_back(hit_local,
                                                     hit.hit_global,
                                                     CarrierType::HOLE,
                                                     1, // value
                                                     group_photons_, // value
                                                     time_hit_local,
                                                     time_hit_global);

+2 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ namespace allpix {
        double pulse_duration_;
        bool is_user_optics_{false};

        size_t group_photons_;

        // Histograms
        bool output_plots_;
        Histogram<TH2D> h_intensity_sourceplane_{};
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ and temporal distribution.

* `number_of_photons`: number of incident photons, generated in *one* event. Defaults to 10000. The total deposited charge
  will also depend on wavelength and geometry.
* `group_photons`: if specified, incident photons will be grouped in buckets of given size, decreasing amount of `DepositedCharge` instances (but keeping total amount of deposited charge the same), thus reducing load on the propagation module.
* `wavelength` of the laser. If specified, it is used to retrieve sensor optical properties from the lookup table (data is available for the range of 250 -- 1450 nm). The only supported material is silicon.
* `data_path`: Directory to read the tabulated input data for the absorption on silicon. By default, this is the standard installation path of the data files shipped with the framework.
* `absorption_length` and `refractive_index`: if both are specified, given values are used instead of the lookup table. This also allows use of sensor materials other than silicon.
+32 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2023 CERN and the Allpix Squared authors
# SPDX-License-Identifier: MIT

#DESC tests bucketing of photons

[Allpix]
detectors_file = "geometry_basic.conf"
number_of_events = 1
multithreading = false


[ElectricFieldReader]
log_level = "DEBUG"
model = "linear"
bias_voltage = 100V
depletion_voltage = 100V

[DepositionLaser]
log_level = "DEBUG"
beam_geometry = "cylindrical"
number_of_photons = 20
source_position = 0 0 0
beam_direction = 0 0 1
wavelength = 600nm
group_photons = 4

[GenericPropagation]
log_level = "DEBUG"
temperature = 300K
propagate_holes = true

#PASS Propagated total of 40 charges in 10 steps