Commit 501c35d8 authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Merge branch 'f-pulse-times' into 'master'

PixelCharge: fix bug where times were *always* set to zero

See merge request allpix-squared/allpix-squared!1027
parents f0e5614f d246c621
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -310,7 +310,8 @@ void DefaultDigitizerModule::run(Event* event) {
        }

        auto time = time_of_arrival(pixel_charge, threshold);
        LOG(DEBUG) << "Local time of arrival: " << Units::display(time, {"ns", "ps"});
        LOG(DEBUG) << "Time of arrival: " << Units::display(time, {"ns", "ps"}) << " (local), "
                   << Units::display(pixel_charge.getGlobalTime() + time, {"ns", "ps"}) << " (global)";
        if(output_plots_) {
            h_px_toa->Fill(time);
        }
+1 −1
Original line number Diff line number Diff line
@@ -30,4 +30,4 @@ propagate_holes = true
log_level = DEBUG
threshold = 600e

#PASS [R:DefaultDigitizer:mydetector] Local time of arrival: 11.66ns
#PASS [R:DefaultDigitizer:mydetector] Time of arrival: 11.66ns (local), 11.66ns (global)
+2 −1
Original line number Diff line number Diff line
@@ -286,7 +286,8 @@ void DepositionReaderModule::run(Event* event) {

        LOG(DEBUG) << "Found deposition of " << charge << " e/h pairs inside sensor at "
                   << Units::display(local_position, {"mm", "um"}) << " in detector " << detector->getName() << ", global "
                   << Units::display(global_position, {"mm", "um"}) << ", particleID " << pdg_code;
                   << Units::display(global_position, {"mm", "um"}) << ", particleID " << pdg_code << ", time "
                   << Units::display(time, {"ns", "us"});

        // Store information about deposited charge carriers
        deposit_position[detector].push_back(global_position);
+8 −0
Original line number Diff line number Diff line
@@ -36,6 +36,14 @@ PixelCharge::PixelCharge(Pixel pixel, long charge, const std::vector<const Propa
        mc_particles_.emplace_back(mc_particle);
    }

    // If no appropriate reference time has been found, set them to zero:
    if(local_time_ > std::numeric_limits<double>::max()) {
        local_time_ = 0.;
    }
    if(global_time_ > std::numeric_limits<double>::max()) {
        global_time_ = 0.;
    }

    // No pulse provided, set full charge in first bin:
    pulse_.addCharge(static_cast<double>(charge), 0);
}
+2 −2
Original line number Diff line number Diff line
@@ -136,8 +136,8 @@ namespace allpix {
        long charge_{};
        Pulse pulse_{};

        double local_time_{};
        double global_time_{};
        double local_time_{std::numeric_limits<double>::infinity()};
        double global_time_{std::numeric_limits<double>::infinity()};

        std::vector<PointerWrapper<PropagatedCharge>> propagated_charges_;
        std::vector<PointerWrapper<MCParticle>> mc_particles_;