1#ifndef WAVEFORMPROCESSOR_H
2#define WAVEFORMPROCESSOR_H
140 Double_t trigger_threshold_;
141 Int_t num_samples_baseline_;
149 Int_t adc_saturation_code_;
151 static std::mutex canvas_mutex_;
152 Int_t sample_waveforms_to_save_;
153 Int_t sample_waveforms_saved_;
154 TString current_output_name_;
158 Float_t current_baseline_rms_ = 0.0f;
159 Bool_t current_baseline_rms_valid_ = kFALSE;
164 Bool_t store_waveforms_;
165 TArrayF *save_waveform_;
166 ULong64_t current_timestamp_;
188 trigger_threshold_ = threshold;
197 num_samples_baseline_ = num_samples_baseline;
204 pre_samples_ = pre_samples;
205 post_samples_ = post_samples;
214 void SetGates(Int_t pre_gate, Int_t short_gate, Int_t long_gate) {
215 pre_gate_ = pre_gate;
216 short_gate_ = short_gate;
217 long_gate_ = long_gate;
236 sample_waveforms_to_save_ = count;
243 adc_saturation_code_ = adc_saturation_code;
309 void CropWaveform(
const TArrayF &waveform, Int_t trigger_pos);
380 Bool_t
ProcessFile(
const TString filepath,
const TString output_name);
406 const std::vector<TString> &output_names,
408 Int_t max_workers = 4);
Everything needed to configure one processing run.
Int_t max_events
Cap on waveforms to read per file; -1 means no limit.
Int_t polarity
Pulse polarity: -1 for negative-going pulses (inverted during baseline subtraction),...
Int_t sample_waveforms_to_save
How many example waveforms to write out as figures, for eyeballing.
Int_t adc_saturation_code
ADC code that means full scale.
Int_t long_gate
Width of the long integration gate.
InputFormat input_format
Input file format.
Int_t post_samples
Samples kept after the trigger when cropping.
Int_t num_samples_baseline
Leading samples averaged to estimate the baseline.
Int_t short_gate
Width of the short integration gate.
Int_t pre_gate
Samples before pre_samples at which integration starts, so integration begins at pre_samples - pre_ga...
Int_t pre_samples
Samples kept before the trigger when cropping.
Bool_t store_waveforms
Write the cropped waveform to the tree.
Float_t trigger_threshold
Trigger level as a fraction of the waveform's peak, in (0, 1].
Bool_t verbose
Print progress and per-file summaries.
Running counters and accumulators for one processing run.
Int_t rejected_no_trigger
No sample reached the trigger level.
Int_t rejected_negative_integral
Long-gate integral <= 0.
Int_t rejected_insufficient_samples
Trigger too close to either end to crop the requested window.
Int_t rejected_baseline
More than 50% negative samples.
Int_t rejected_clipped
Raw extremum hit the ADC rail.
Double_t sum_baseline_rms_accepted
Sum of baseline RMS over accepted waveforms only.
Int_t total_processed
Waveforms examined.
Double_t sum_baseline_rms
Sum of per-waveform baseline RMS.
Int_t baseline_rms_count_accepted
Accepted waveforms in that sum.
Int_t accepted
Waveforms that passed every cut.
Int_t baseline_rms_count
Waveforms contributing to that sum.