LDMX Software
StripPulseFitter.h
1#pragma once
2
3#include <vector>
4
5#include "Tracking/Digitization/PulseShape.h"
6
7namespace tracking::digitization {
8
41 public:
42 struct FitResult {
43 double amplitude{
44 0};
45 double t0{0};
46 double chi2{0};
47 int ndf{0};
48 bool converged{false};
49 };
50
61 StripPulseFitter(const PulseShape& shape, double t0_offset_ns,
62 double sampling_interval_ns, double pedestal_adc,
63 double noise_sigma_adc, double t_scan_min_ns = -50.0,
64 double t_scan_max_ns = 150.0, double t_scan_step_ns = 1.0);
65
72 FitResult fit(const std::vector<short>& samples) const;
73
74 private:
76 std::pair<double, double> evalAtT(const std::vector<short>& samples,
77 double T) const;
78
79 const PulseShape* shape_;
80 double t0_offset_ns_;
81 double sampling_interval_ns_;
82 double pedestal_adc_;
83 double inv_sigma2_;
84 double t_scan_min_ns_;
85 double t_scan_max_ns_;
86 double t_scan_step_ns_;
87};
88
89} // namespace tracking::digitization
Abstract base class for silicon-strip readout pulse shapes.
Definition PulseShape.h:30
Fits a pulse shape to the ADC samples of a single silicon-strip readout channel to extract hit amplit...
std::pair< double, double > evalAtT(const std::vector< short > &samples, double T) const
Evaluate χ²(T) and the corresponding best-fit amplitude.
StripPulseFitter(const PulseShape &shape, double t0_offset_ns, double sampling_interval_ns, double pedestal_adc, double noise_sigma_adc, double t_scan_min_ns=-50.0, double t_scan_max_ns=150.0, double t_scan_step_ns=1.0)
double inv_sigma2_
1/σ², pre-computed.
FitResult fit(const std::vector< short > &samples) const
Fit the pulse to the given ADC sample vector.
int ndf
Degrees of freedom = n_samples − 2.
double amplitude
Fitted peak amplitude [ADC counts], ped-subtracted.
bool converged
False if no above-pedestal samples found.
double chi2
Chi-squared value at the minimum.
double t0
Fitted hit arrival time T [ns].