Commit 2550e54c authored by Simon Spannagel's avatar Simon Spannagel
Browse files

PulseTransfer: check implant situation only once if pulses are empty

parent 8b3a4c17
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ void PulseTransferModule::run(Event* event) {
            auto position = propagated_charge.getLocalPosition();

            if(collect_from_implant_) {
                std::call_once(first_event_flag_, [&]() {
                    if(model->getImplants().empty()) {
                        throw InvalidValueError(
                            config_,
@@ -121,6 +122,7 @@ void PulseTransferModule::run(Event* event) {
                        throw ModuleError(
                            "Charge collection from implant region should not be used with linear electric fields.");
                    }
                });

                // Ignore if outside the implant region:
                if(!model->isWithinImplant(position)) {
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ namespace allpix {

        double max_depth_distance_{};
        bool collect_from_implant_{};
        std::once_flag first_event_flag_;

        // Output histograms
        Histogram<TH1D> h_total_induced_charge_, h_induced_pixel_charge_;