|
LDMX Software
|
Fits a pulse shape to the ADC samples of a single silicon-strip readout channel to extract hit amplitude and time. More...
#include <StripPulseFitter.h>
Classes | |
| struct | FitResult |
Public Member Functions | |
| 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) | |
| FitResult | fit (const std::vector< short > &samples) const |
| Fit the pulse to the given ADC sample vector. | |
Private Member Functions | |
| std::pair< double, double > | evalAtT (const std::vector< short > &samples, double T) const |
| Evaluate χ²(T) and the corresponding best-fit amplitude. | |
Private Attributes | |
| const PulseShape * | shape_ |
| double | t0_offset_ns_ |
| double | sampling_interval_ns_ |
| double | pedestal_adc_ |
| double | inv_sigma2_ |
| 1/σ², pre-computed. | |
| double | t_scan_min_ns_ |
| double | t_scan_max_ns_ |
| double | t_scan_step_ns_ |
Fits a pulse shape to the ADC samples of a single silicon-strip readout channel to extract hit amplitude and time.
With N ADC samples and 2 free parameters (amplitude A and hit time T), the chi-squared is:
χ²(T) = Σ_i [(S_i − ped − A(T)·f(t_i − T)) / σ]²
where t_i = t0_offset + i·Δt are the sample times and f is the pulse shape. For each candidate T, A is solved analytically:
A(T) = Σ_i (S_i − ped)·f(t_i − T) / Σ_i f(t_i − T)²
A 1-D scan over T followed by a parabolic refinement near the minimum gives the fitted values. This is O(n_scan × N_samples) per strip and runs in < 1 µs.
The fit result t0 is defined as T − t0_offset, i.e. the hit arrival time relative to sample 0. A value of t0 = tp (peaking time) means the pulse peak coincides with sample 0.
Sample i is taken at time t_i = t0_offset_ns + i · sampling_interval_ns The pulse shape is evaluated at f(t_i − T) where T is the absolute hit arrival time in the same frame. The output t0 = T is stored directly so the caller can subtract their own reference as needed.
Definition at line 40 of file StripPulseFitter.h.
| tracking::digitization::StripPulseFitter::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 ) |
| shape | Pulse shape function (owned externally). |
| t0_offset_ns | Time of sample 0 in the hit-time frame [ns]. |
| sampling_interval_ns | Interval between samples [ns]. |
| pedestal_adc | Per-sample pedestal [ADC counts]. |
| noise_sigma_adc | Per-sample noise RMS [ADC counts], used for χ². |
| t_scan_min_ns | Lower bound of the T scan range [ns]. |
| t_scan_max_ns | Upper bound of the T scan range [ns]. |
| t_scan_step_ns | Step size of the coarse T scan [ns]. |
Definition at line 8 of file StripPulseFitter.cxx.
|
private |
Evaluate χ²(T) and the corresponding best-fit amplitude.
Definition at line 26 of file StripPulseFitter.cxx.
References tracking::digitization::PulseShape::eval(), and inv_sigma2_.
Referenced by fit().
| StripPulseFitter::FitResult tracking::digitization::StripPulseFitter::fit | ( | const std::vector< short > & | samples | ) | const |
Fit the pulse to the given ADC sample vector.
| samples | ADC values (one per sample, any integer type cast to short). |
Definition at line 67 of file StripPulseFitter.cxx.
References tracking::digitization::StripPulseFitter::FitResult::amplitude, tracking::digitization::StripPulseFitter::FitResult::chi2, tracking::digitization::StripPulseFitter::FitResult::converged, evalAtT(), tracking::digitization::StripPulseFitter::FitResult::ndf, and tracking::digitization::StripPulseFitter::FitResult::t0.
|
private |
|
private |
Definition at line 82 of file StripPulseFitter.h.
|
private |
Definition at line 81 of file StripPulseFitter.h.
|
private |
Definition at line 79 of file StripPulseFitter.h.
|
private |
Definition at line 80 of file StripPulseFitter.h.
|
private |
Definition at line 85 of file StripPulseFitter.h.
|
private |
Definition at line 84 of file StripPulseFitter.h.
|
private |
Definition at line 86 of file StripPulseFitter.h.