Commit 32195b76 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

GenericPropagation: add new line graph plotting option showing only recombined carriers

parent bee3b27b
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -83,6 +83,14 @@ GenericPropagationModule::GenericPropagationModule(Configuration& config,
    config_.setDefault<double>("output_plots_theta", 0.0f);
    config_.setDefault<double>("output_plots_phi", 0.0f);
    config_.setDefault<bool>("output_plots_lines_at_implants", false);
    config_.setDefault<bool>("output_plots_lines_recombined", false);

    if(config_.get<bool>("output_plots_lines_at_implants") && config_.get<bool>("output_plots_lines_recombined")) {
        throw InvalidCombinationError(
            config_,
            {"output_plots_lines_at_implants", "output_plots_lines_recombined"},
            "Line graphs can be created either for charge carriers reaching the implants or for those that have recombined");
    }

    // Set defaults for charge carrier propagation:
    config_.setDefault<bool>("propagate_electrons", true);
@@ -108,6 +116,7 @@ GenericPropagationModule::GenericPropagationModule(Configuration& config,
    output_animations_ = config_.get<bool>("output_animations");
    output_plots_step_ = config_.get<double>("output_plots_step");
    output_plots_lines_at_implants_ = config_.get<bool>("output_plots_lines_at_implants");
    output_plots_lines_recombined_ = config_.get<bool>("output_plots_lines_recombined");
    propagate_electrons_ = config_.get<bool>("propagate_electrons");
    propagate_holes_ = config_.get<bool>("propagate_holes");
    charge_per_step_ = config_.get<unsigned int>("charge_per_step");
@@ -855,11 +864,16 @@ GenericPropagationModule::propagate(const ROOT::Math::XYZPoint& pos,
    }

    // If requested, remove charge drift lines from plots if they did not reach the implant side within the integration time:
    if(output_linegraphs_ && output_plots_lines_at_implants_) {
        // If drift time is larger than integration time or the charge carriers have been collected at the backside, remove
    if(output_linegraphs_) {
        if(output_plots_lines_at_implants_) {
            // If drift time is larger than integration time or the charge carriers have been collected at the backside,
            // remove
            if(time >= integration_time_ || last_position.z() < -model_->getSensorSize().z() * 0.45) {
                output_plot_points.pop_back();
            }
        } else if(output_plots_lines_recombined_ && !is_alive) {
            output_plot_points.pop_back();
        }
    }

    if(state == CarrierState::RECOMBINED) {
+2 −1
Original line number Diff line number Diff line
@@ -100,7 +100,8 @@ namespace allpix {
        // Local copies of configuration parameters to avoid costly lookup:
        double temperature_{}, timestep_min_{}, timestep_max_{}, timestep_start_{}, integration_time_{},
            target_spatial_precision_{}, output_plots_step_{};
        bool output_plots_{}, output_linegraphs_{}, output_animations_{}, output_plots_lines_at_implants_{};
        bool output_plots_{}, output_linegraphs_{}, output_animations_{}, output_plots_lines_at_implants_{},
            output_plots_lines_recombined_{};
        bool propagate_electrons_{}, propagate_holes_{};
        unsigned int charge_per_step_{};

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ This module requires an installation of Eigen3.
* `output_plots_use_equal_scaling` : Determines if the plots should be produced with equal distance scales on every axis (also if this implies that some points will fall out of the graph). Defaults to true.
* `output_plots_align_pixels` : Determines if the plot should be aligned on pixels, defaults to false. If enabled the start and the end of the axis will be at the split point between pixels.
* `output_plots_lines_at_implants` : Determine whether to plot all charge carrier drift lines (`false`) or to just plot lines from charge carriers which reached the implant side within the allotted integration time (`true`). Defaults to `false`, i.e. all charge carrier drift lines are drawn.
* `output_plots_lines_recombined` : Boolean flag to select whether line graphs should be generated from all charge carrier drift lines (`false`) or only from those which have recombined with the lattice during the integration time (`true`). Defaults to `false`.
* `output_animations` : In addition to the other output plots, also write a GIF animation of the charges drifting towards the electrodes. This is very slow and writing the animation takes a considerable amount of time, therefore defaults to false. This option also requires `output_linegraphs` to be enabled.
* `output_animations_time_scaling` : Scaling for the animation used to convert the actual simulation time to the time step in the animation. Defaults to 1.0e9, meaning that every nanosecond of the simulation is equal to an animation step of a single second.
* `output_animations_marker_size` : Scaling for the markers on the animation, defaults to one. The markers are already internally scaled to the charge of their step, normalized to the maximum charge.