Commit b01464cf authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Added tests for new functionality in [DepositionPointCharge]

parent 9a7a1612
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,12 +149,12 @@ void DepositionPointChargeModule::initialize() {
        // Check that the scan setup is correct
        root_ = events;
        if(no_of_coordinates_ == 2) {
            // Throw if we don't have a valid combination. Need 2 valid entries; x y, x z, or y z
            root_ = static_cast<unsigned int>(std::lround(std::sqrt(events)));
            if(events != root_ * root_) {
                LOG(WARNING) << "Number of events is not a square, pixel cell volume cannot fully be covered in scan. "
                             << "Closest square is " << root_ * root_;
            }
            // Throw if we don't have a valid combination. Need 2 valid entries; x y, x z, or y z
            if(!((scan_x_ && scan_y_) || (scan_x_ && scan_z_) || (scan_y_ && scan_z_))) {
                throw InvalidValueError(config_,
                                        "scan_coordinates",
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ All charge carriers are deposited at time zero, i.e. at the beginning of the eve
* `source_type`: Modeled source type for the deposition of charge carriers. For `point`, charge carriers are deposited at the position given by the `position` parameter. For `mip`, charge carriers are deposited along a line through the full sensor thickness. Defaults to `point`.
* `position`: Position in local coordinates of the sensor, where charge carriers should be deposited. Expects three values for local-x, local-y and local-z position in the sensor volume and defaults to `0um 0um 0um`, i.e. the center of first (lower left) pixel. When using source type `mip`, providing a 2D position is sufficient since it only uses the x and y coordinates. If used in scan mode, it allows you to shift the origin of each deposited charge by adding this value. If the scan is only performed in one or two dimensions, the remaining coordinate will constantly have the value given by `position`.
* `spot_size`: Width of the Gaussian distribution used to smear the position in the `spot` model. Only one value is taken and used for all three dimensions.
* `scan_coordinates`: Coordinates to scan over, a combination of x, y, z. Defaults to `x y z`, i.e. all three spatial coordinates. The `position` parameter is used to determine the value of the coordinates that are not scanned over if a partial scan is requested, and the start offset of the scan for the other coordinates.
* `scan_coordinates`: Coordinates to scan over, a combination of x, y, z. Only used for the `scan` model. Defaults to `x y z`, i.e. all three spatial coordinates. The `position` parameter is used to determine the value of the coordinates that are not scanned over if a partial scan is requested, and the start offset of the scan for the other coordinates.
* `mip_direction`: Vector giving the direction of the line along which deposits are made when the `mip` source type is used. Defaults to `0 0 1`, i.e. along the z-axis. The `position` keyword gives a point that the line of depositions will cross through with this direction.

### Plotting parameters
+15 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2019-2024 CERN and the Allpix Squared authors
# SPDX-License-Identifier: MIT

#DESC tests the scan of a pixel volume in only the x-direcction, checks for the calculated voxel size.
[Allpix]
detectors_file = "detector.conf"
number_of_events = 8
random_seed = 0

[DepositionPointCharge]
log_level = DEBUG
model = "scan"
scan_coordinates = x

#PASS Voxel size for scan of pixel volume: (27.5um,440um,400um)
+15 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2019-2024 CERN and the Allpix Squared authors
# SPDX-License-Identifier: MIT

#DESC tests the scan of a pixel volume in the x and z-directions, checks for the calculated voxel size.
[Allpix]
detectors_file = "detector.conf"
number_of_events = 4
random_seed = 0

[DepositionPointCharge]
log_level = DEBUG
model = "scan"
scan_coordinates = x z

#PASS Voxel size for scan of pixel volume: (110um,440um,200um)
Loading