Commit 526da4b8 authored by Paul Schütze's avatar Paul Schütze Committed by Simon Spannagel
Browse files

Trapping: Move trapping determination into if condition

(cherry picked from commit b7e9d8be)
parent d19f8817
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -850,9 +850,7 @@ GenericPropagationModule::propagate(const ROOT::Math::XYZPoint& pos,
                                   timestep);

        // Check if the charge carrier has been trapped:
        auto [trapped, traptime] =
            trapping_(type, probability_distribution(random_generator), timestep, std::sqrt(efield.Mag2()));
        if(trapped) {
        if(trapping_(type, probability_distribution(random_generator), timestep, std::sqrt(efield.Mag2()))) {
            if(output_plots_) {
                trapping_time_histo_->Fill(static_cast<double>(Units::convert(runge_kutta.getTime(), "ns")), charge);
            }
+1 −3
Original line number Diff line number Diff line
@@ -386,9 +386,7 @@ TransientPropagationModule::propagate(Event* event,
                                   timestep_);

        // Check if the charge carrier has been trapped:
        auto trapped =
            trapping_(type, probability_distribution(event->getRandomEngine()), timestep_, std::sqrt(efield.Mag2()));
        if(trapped) {
        if(trapping_(type, probability_distribution(event->getRandomEngine()), timestep_, std::sqrt(efield.Mag2()))) {
            if(output_plots_) {
                trapping_time_histo_->Fill(static_cast<double>(Units::convert(runge_kutta.getTime(), "ns")), charge);
            }