Commit 897f3377 authored by Håkan Wennlöf's avatar Håkan Wennlöf Committed by Simon Spannagel
Browse files

Updated so that if the nubmer is uneven, there is one deposit point with fewer...

Updated so that if the nubmer is uneven, there is one deposit point with fewer events rather than one with more.

Also calrified a point in the README
parent 3db13ef3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ void DepositionPointChargeModule::initialize() {
            LOG(WARNING) << "Number of events cannot be divided into cells evenly";
        }

        root_ = events / events_per_cell_;
        root_ = static_cast<unsigned int>(std::ceil(events / static_cast<double>(events_per_cell_)));
        if(no_of_coordinates_ == 2) {
            root_ = static_cast<unsigned int>(std::lround(std::sqrt(events / events_per_cell_)));
            if(events != root_ * root_ * events_per_cell_) {
@@ -223,7 +223,8 @@ void DepositionPointChargeModule::run(Event* event) {
        // Fixed position as read from the configuration:
        position = position_;
    } else if(model_ == DepositionModel::SCAN) {
        // Voxel iterator depends in number of events per cell:
        // Voxel iterator depends on number of events per cell:
        // Note: this implicitly throws away the fractional part of the number, which is desirable in this case
        const auto voxel_it = (event->number - 1) / events_per_cell_;

        // Center the volume to be scanned in the center of the sensor,
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ Two different source types are available:
This module supports three different deposition models:

* In the `fixed` model, charge carriers are always deposited at exactly the same position, specified via the `position` parameter, in every event of the simulation. This model is mostly interesting for development of new charge transport algorithms, where the initial position of charge carriers should be known exactly.
* In the `scan` model, the position where charge carriers are deposited changes with every event. The scanning positions are distributed such, that the volume of one pixel cell is homogeneously scanned. The total number of positions is taken from the total number of events configured for the simulation. If this number doesn't allow for a full illumination, a warning is printed, suggesting a different number of events. The pixel volume to be scanned is always placed at the center of the active sensor area. The scan model can be used to generate sensor response templates for fast simulations by generating a lookup table from the final simulation results.
* In the `scan` model, the position where charge carriers are deposited changes with every event. The scanning positions are distributed such that the volume of one pixel cell is homogeneously scanned. The total number of positions is taken from the total number of events configured for the simulation. If this number doesn't allow for a full illumination, a warning is printed, suggesting a different number of events. The pixel volume to be scanned always has its bottom left corner placed at the center of the active sensor area. The `scan` model can be used to generate sensor response templates for fast simulations by generating a lookup table from the final simulation results.
* In the `spot` model, charge carriers are deposited in a Gaussian spot around the configured position. The sigma of the Gaussian distribution in all coordinates can be configured via the `spot_size` parameter. Charge carriers are only deposited inside the active sensor volume.

Monte Carlo particles are generated at the respective positions, bearing a particle ID of -1.