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

Trapping: Move trapping determination into if condition

parent d66df3fe
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -537,8 +537,7 @@ GenericPropagationModule::propagate(const ROOT::Math::XYZPoint& pos,
        }

        // Check if the charge carrier has been trapped:
        auto trapped = 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
@@ -468,9 +468,7 @@ TransientPropagationModule::propagate(Event* event,
        }

        // 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);
            }