1#ifndef CALIBRATE_BEAM_HPP
2#define CALIBRATE_BEAM_HPP
8#include "InitUtils.hpp"
11#include "PlottingUtils.hpp"
17#include <TGraphErrors.h>
173 const std::vector<ChannelCal> &chans_template);
188 const std::vector<FileSpec> &specs);
195 static void Run(
const TString &file_label =
"");
Per-channel beam-peak calibration, gain matching and strip alignment.
static void Run(const TString &file_label="")
Calibrate every configured subfile, then aggregate per run.
static void CalibrateBeamOneSubfile(const FileSpec &spec, const std::vector< ChannelCal > &chans_template)
Calibrate one subfile end to end.
static std::vector< ChannelCal > BuildChannels()
One ChannelCal per readout channel in the active channel map.
static void AggregateRidgeRatiosForRun(Int_t run, const std::vector< FileSpec > &specs)
Replace each subfile's ridge ratio and short-end offset with the run-level medians.
One readout channel's beam-peak calibration.
Double_t ridge_offset
Short channels only: offset_adc in units of C_long, from this subfile's own ridge fit,...
Double_t offset_adc
ADC subtracted from this channel before its gain, only when the channel fired (a reading of 0 stays 0...
Char_t side
Readout end: 'L' or 'R' for the split strips 1-16, 'S' for the unsplit end strips 0 and 17,...
TString name
Channel name from the active channel map.
Double_t gain
Left/right gain-match override.
Double_t fit_adc
Modal beam peak, in ADC: the modal bin of the channel's beam-peak histogram (100 bins over the 5th-95...
Int_t strip
Anode strip index this channel reads; -1 for the cathode.
Long64_t n_samples
Events the anchor was taken from.
Double_t ridge_ratio
Short channels only: C_short / C_long = -1 / slope from this subfile's own ridge fit,...
One input file: a run number and the subfile suffix within it.
Output of the strip centroid alignment, the post-gain calibration step.
Double_t centroids[18]
Measured beam peak per strip before alignment, in calibrated units.
Double_t pileups[18]
Measured two-particle pile-up peak per strip before alignment, in calibrated units; 0 where none was ...
Double_t factors[18]
Per-strip multiplicative alignment factors, applied to every end.
Double_t offsets[18]
Per-strip additive offsets in calibrated units, applied after the factor to the strip total; EnergyVi...
Bool_t ok
Whether the step produced usable results.