MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
CalibrateBeam Class Reference

Per-channel beam-peak calibration, gain matching and strip alignment. More...

#include <CalibrateBeam.hpp>

Static Public Member Functions

static std::vector< ChannelCalBuildChannels ()
 One ChannelCal per readout channel in the active channel map.
static void CalibrateBeamOneSubfile (const FileSpec &spec, const std::vector< ChannelCal > &chans_template)
 Calibrate one subfile end to end.
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 AggregateRidgeRatiosForRun (Int_t run, const std::vector< FileSpec > &specs)
 Replace each subfile's ridge ratio with the run-level median.
static void AggregateEresTomlForRun (Int_t run, const std::vector< FileSpec > &specs)
 Aggregate the run's energy-resolution measurements into its TOML.
static void Run (const TString &file_label="")
 Calibrate every configured subfile, then aggregate per run.

Detailed Description

Per-channel beam-peak calibration, gain matching and strip alignment.

Runs after the pipeline over its events files. For each subfile it fits every channel's beam peak, matches the left and right gains onto a common charge scale, then derives the per-strip alignment that pulls all strips onto one smooth trend.

Some results are per-channel constants rather than per-subfile measurements — the ridge ratios and the energy-resolution TOML — and those are aggregated to the run level once every subfile has been processed.

Definition at line 125 of file CalibrateBeam.hpp.

Member Function Documentation

◆ AggregateEresTomlForRun()

void CalibrateBeam::AggregateEresTomlForRun ( Int_t run,
const std::vector< FileSpec > & specs )
static

Aggregate the run's energy-resolution measurements into its TOML.

Parameters
runRun number.
specsThat run's subfiles.

Definition at line 2087 of file CalibrateBeam.cpp.

Referenced by Run().

◆ AggregateRidgeRatiosForRun()

void CalibrateBeam::AggregateRidgeRatiosForRun ( Int_t run,
const std::vector< FileSpec > & specs )
static

Replace each subfile's ridge ratio with the run-level median.

The ratio is a preamplifier gain ratio and so is fixed per channel. Taking the median across the subfiles that measured it makes the value robust for subfiles where the ridge was not measurable.

Parameters
runRun number.
specsThat run's subfiles.

Definition at line 1992 of file CalibrateBeam.cpp.

◆ BuildChannels()

std::vector< ChannelCal > CalibrateBeam::BuildChannels ( )
static

One ChannelCal per readout channel in the active channel map.

Returns
The templates, with names, sides and strips filled and the fitted quantities left at their defaults.

Definition at line 31 of file CalibrateBeam.cpp.

Referenced by AggregateEresTomlForRun(), and Run().

◆ CalibrateBeamOneSubfile()

void CalibrateBeam::CalibrateBeamOneSubfile ( const FileSpec & spec,
const std::vector< ChannelCal > & chans_template )
static

Calibrate one subfile end to end.

Parameters
specSubfile to process.
chans_templateChannel templates from BuildChannels(); copied, not modified.

Definition at line 1857 of file CalibrateBeam.cpp.

Referenced by Run(), and RunFusedPipelineForFile().

◆ Run()

void CalibrateBeam::Run ( const TString & file_label = "")
static

Calibrate every configured subfile, then aggregate per run.

Parameters
file_labelRestrict to one subfile by its FileSet::FileLabel(). Empty, the default, processes all of them.

Definition at line 2158 of file CalibrateBeam.cpp.

Referenced by main().

◆ SaveCalibSampleOverlay()

void CalibrateBeam::SaveCalibSampleOverlay ( const std::vector< ChannelCal > & chans,
const std::vector< std::vector< Float_t > > & samples,
const TString & plot_subdir,
const TString & file_label )
static

Save the per-channel calibration overlay figure.

Parameters
chansCalibrated channels.
samplesSampled spectra, one vector per channel.
plot_subdirPlot subdirectory under the plots base.
file_labelSubfile label, used in the plot name.

Definition at line 1474 of file CalibrateBeam.cpp.

Referenced by CalibrateBeamOneSubfile().


The documentation for this class was generated from the following files: