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

Merge branch 'fix_induced' into 'master'

InducedTransfer: Fix Docu, Prevent Usage with TransientPropagation

Closes #271

See merge request allpix-squared/allpix-squared!985
parents 5fcb1527 b89598f9
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -55,6 +55,12 @@ void InducedTransferModule::run(Event* event) {
    std::map<Pixel::Index, std::vector<std::pair<double, const PropagatedCharge*>>> pixel_map;
    for(const auto& propagated_charge : propagated_message->getData()) {

        // Make sure we're not double-counting by adding induced current information to an existing pulse:
        if(!propagated_charge.getPulses().empty()) {
            throw ModuleError(
                "Received pulse information - this module should not be used with transient information available");
        }

        // Make sure both electrons and holes are present in the input data
        if(propagated_charge.getType() == CarrierType::ELECTRON) {
            found_electrons = true;
@@ -95,7 +101,7 @@ void InducedTransferModule::run(Event* event) {

    // Send an error message if this even only contained one of the two carrier types
    if(!found_electrons || !found_holes) {
        LOG(ERROR) << "Did not find charge carriers of type \"" << (found_electrons ? "holes" : "electrons")
        LOG_ONCE(ERROR) << "Did not find charge carriers of type \"" << (found_electrons ? "holes" : "electrons")
                        << "\" in this event." << std::endl
                        << "This will cause wrong calculation of induced charge";
    }
+3 −3
Original line number Diff line number Diff line
@@ -20,15 +20,15 @@ The total induced charge is calculated by multiplying the potential difference w
Q_n^{ind} = \int_{t_{initial}}^{t_{final}} I_n^{ind} = q \left( \phi (x_{final}) - \phi(x_{initial}) \right)
```

The resulting induced charge is summed for all propagated charge carriers and returned as a `PixelCharge` object. The number of neighboring pixels taken into account can be configured using the `induction_matrix` parameter.
The resulting induced charge is summed for all propagated charge carriers and returned as a `PixelCharge` object. The number of neighboring pixels taken into account can be configured using the `distance` parameter.

## Parameters
* `induction_matrix`: Size of the pixel sub-matrix for which the induced charge is calculated, provided as number of pixels in x and y. The numbers have to be odd and default to `3, 3`. Usually, a 3x3 grid (9 pixels) should suffice since the weighting potential at a distance of more than one pixel pitch normally is small enough to be neglected.
* `distance`: Maximum distance of pixels to be considered for current induction, calculated from the pixel the charge carrier under investigation is below. A distance of `1` for example means that the induced current for the closest pixel plus all neighbors is calculated. It should be noted that the time required for simulating a single event depends almost linearly on the number of pixels the induced charge is calculated for. Usually, for Cartesian sensors a 3x3 grid (9 pixels, distance 1) should suffice since the weighting potential at a distance of more than one pixel pitch often is small enough to be neglected while the simulation time is almost tripled for `distance = 2` (5x5 grid, 25 pixels). To just calculate the induced current in the one pixel the charge carrier is below, `distance = 0` can be used. Defaults to `1`.

## Usage
```ini
[InducedTransfer]
induction_matrix = 3 3
distance = 1
```

[@shockley]: https://doi.org/10.1063/1.1710367