Commit c0d25a6e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'p-select-carrier' into 'master'

PulseTransfer: add possibility to create pulses just from one carrier type

See merge request allpix-squared/allpix-squared!1168
parents a8bcae12 5453dfb5
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@ PulseTransferModule::PulseTransferModule(Configuration& config, Messenger* messe
    max_depth_distance_ = config_.get<double>("max_depth_distance");
    collect_from_implant_ = config_.get<bool>("collect_from_implant");

    if(config.has("skip_charge_carriers")) {
        skip_charge_carriers_ = true;
        skip_carrier_ = config.get<CarrierType>("skip_charge_carriers");
    }

    // Enable multithreading of this module if multithreading is enabled and no per-event output plots are requested:
    // FIXME: Review if this is really the case or we can still use multithreading
    if(!output_pulsegraphs_) {
@@ -100,6 +105,13 @@ void PulseTransferModule::run(Event* event) {

    LOG(DEBUG) << "Received " << propagated_message->getData().size() << " propagated charge objects.";
    for(const auto& propagated_charge : propagated_message->getData()) {

        // Skip charge carriers requested from configuration:
        if(skip_charge_carriers_ && propagated_charge.getType() == skip_carrier_) {
            LOG(TRACE) << "Skipping charge carrier of type " << propagated_charge.getType();
            continue;
        }

        auto pulses = propagated_charge.getPulses();

        if(pulses.empty()) {
+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ namespace allpix {
        bool collect_from_implant_{};
        std::once_flag first_event_flag_;

        bool skip_charge_carriers_{};
        CarrierType skip_carrier_;

        // Output histograms
        Histogram<TH1D> h_total_induced_charge_, h_induced_pixel_charge_;
        Histogram<TH2D> h_induced_pulses_, h_integrated_pulses_;
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ It should be noted that generating per-pixel pulses will generate several pulse
* `timestep`: Time step for the pulse to be generated from charge carrier arrival times. Only used if no pulse information is available for the propagated charge object. Default value is 0.01ns.
* `max_depth_distance` : Maximum distance in depth, i.e. normal to the sensor surface at the implant side, for a propagated charge to be taken into account in case the detector has no implants defined. Only used if no pulse information is available for the propagated charge object. Defaults to `5um`.
* `collect_from_implant`: Only consider charge carriers within the implant region of the respective detector instead of the full surface of the sensor. Only used if no pulse information is available for the propagated charge object. Should only be used with non-linear electric fields and defaults to `false`.
* `skip_charge_carriers` : Possibility to exclude a charge carrier type from the resulting pulses. This can be helpful to get an impression of the relative contributions of electrons or holes to the final current pulse. Set to either `ELECTRON` or `HOLE`. By default, no carrier is skipped.

## Usage