1#ifndef CALIBRATE_BEAM_HPP
2#define CALIBRATE_BEAM_HPP
8#include "InitUtils.hpp"
11#include "PlottingUtils.hpp"
14#include <TDirectory.h>
19#include <TFitResult.h>
21#include <TGraphErrors.h>
46#include <toml++/toml.hpp>
142 const std::vector<ChannelCal> &chans_template);
153 const std::vector<std::vector<Float_t>> &samples,
154 const TString &plot_subdir,
const TString &file_label);
167 const std::vector<FileSpec> &specs);
174 const std::vector<FileSpec> &specs);
181 static void Run(
const TString &file_label =
"");
The dataset configuration, and how it is layered.
Per-channel beam-peak calibration, gain matching and strip alignment.
static void SaveCalibSampleOverlay(const std::vector< ChannelCal > &chans, const std::vector< std::vector< Float_t > > &samples, const TString &plot_subdir, const TString &file_label)
Save the per-channel calibration overlay figure.
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 void AggregateEresTomlForRun(Int_t run, const std::vector< FileSpec > &specs)
Aggregate the run's energy-resolution measurements into its TOML.
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 with the run-level median.
One readout channel's beam-peak calibration.
Char_t side
Readout end: 'L' or 'R'.
TString name
Channel name from the active channel map.
Double_t gain
Left/right gain-match override.
Double_t fit_adc
Fitted beam-peak centroid, in ADC.
Int_t strip
Anode strip index this channel reads.
Long64_t n_samples
Events entering the fit.
Double_t ridge_ratio
Short channels only: C_short / C_long from this subfile's own ridge fit, or 0 when the ridge was not ...
Double_t fit_sigma_adc
Fitted beam-peak width, in ADC.
One input file: a run number and the subfile suffix within it.
Output of the two post-gain calibration steps.
Double_t centroids[18]
Measured beam-peak centroid per strip, in calibrated units.
Double_t beam_e_max
Upper edge of the beam window.
Double_t factors[18]
Per-strip multiplicative alignment factors.
Double_t beam_e_min
Lower edge of the beam window, calibrated units.
Bool_t ok
Whether the steps produced usable results.