Commit 1d5744b7 authored by Paul Schütze's avatar Paul Schütze
Browse files

Merge branch 'fix_final_time' into 'master'

Propagation Modules: Fix LocalTime Calculation

See merge request allpix-squared/allpix-squared!801
parents 62933f7e 26e11682
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -606,8 +606,8 @@ 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, gain, state);
    // Return the final position of the propagated charge, the time it took to propagate and its final state
    return std::make_tuple(static_cast<ROOT::Math::XYZPoint>(position), time, gain, state);
}

void GenericPropagationModule::finalize() {
+3 −3
Original line number Diff line number Diff line
@@ -338,11 +338,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);
@@ -373,7 +373,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";
+2 −2
Original line number Diff line number Diff line
@@ -544,8 +544,8 @@ 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(), gain, state);
    // Return the final position of the propagated charge, the time it took to propagate and its final state
    return std::make_tuple(static_cast<ROOT::Math::XYZPoint>(position), runge_kutta.getTime(), gain, state);
}

void TransientPropagationModule::finalize() {