Commit 7887851a authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'backport_time_fix' into 'v2.3-stable'

[v2.3-stable]  Propagation Modules: Fix LocalTime Calculation

See merge request allpix-squared/allpix-squared!802
parents 2ba5f82c 430ffc08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -913,7 +913,7 @@ GenericPropagationModule::propagate(const ROOT::Math::XYZPoint& pos,
                   << Units::display(static_cast<ROOT::Math::XYZPoint>(position), {"um", "mm"});
    }
    // Return the final position of the propagated charge
    return std::make_tuple(static_cast<ROOT::Math::XYZPoint>(position), initial_time + time, is_alive, is_trapped);
    return std::make_tuple(static_cast<ROOT::Math::XYZPoint>(position), time, is_alive, is_trapped);
}

void GenericPropagationModule::finalize() {
+3 −3
Original line number Diff line number Diff line
@@ -284,11 +284,11 @@ void ProjectionPropagationModule::run(Event* event) {
                boltzmann_kT_ * ((*mobility_)(type, efield_mag, doping) + (*mobility_)(type, efield_mag_top, doping)) / 2.;

            double drift_time = calc_drift_time();
            double propagation_time = deposit.getLocalTime() + drift_time + diffusion_time;
            double propagation_time = drift_time + diffusion_time;
            LOG(TRACE) << "Drift time is " << Units::display(drift_time, "ns");

            if(output_plots_) {
                propagation_time_histo_->Fill(propagation_time, charge_per_step);
                propagation_time_histo_->Fill(deposit.getLocalTime() + propagation_time, charge_per_step);
                drift_time_histo_->Fill(drift_time, charge_per_step);
                if(diffuse_deposit_) {
                    diffusion_time_histo_->Fill(diffusion_time, charge_per_step);
@@ -319,7 +319,7 @@ void ProjectionPropagationModule::run(Event* event) {
            auto local_time = deposit.getLocalTime() + propagation_time;

            // Only add if within requested integration time:
            if(propagation_time > integration_time_) {
            if(local_time > integration_time_) {
                LOG(DEBUG) << "Charge carriers propagation time not within integration time: "
                           << Units::display(global_time, "ns") << " global / " << Units::display(local_time, {"ns", "ps"})
                           << " local";
+1 −2
Original line number Diff line number Diff line
@@ -471,8 +471,7 @@ TransientPropagationModule::propagate(Event* event,
    }

    // Return the final position of the propagated charge
    return std::make_tuple(
        static_cast<ROOT::Math::XYZPoint>(position), initial_time + runge_kutta.getTime(), is_alive, is_trapped);
    return std::make_tuple(static_cast<ROOT::Math::XYZPoint>(position), runge_kutta.getTime(), is_alive, is_trapped);
}

void TransientPropagationModule::finalize() {