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

A view over one event's energies, decoding raw ADC into calibrated units. More...

#include <Normalization.hpp>

Public Member Functions

 EnergyView ()
 Construct detached, with zeroed values and no gains loaded.
Bool_t Attach (TTree *t)
 Bind to an events tree and set up the branch addresses.
void Decode ()
 Decode the currently loaded entry into the value members.
void LoadGains ()
 Load the calibration gains for the current file.
Double_t Total (Int_t strip) const
 A strip's deposit: the sum of its ends, or the unsegmented value.
Double_t Axis (Int_t axis) const
 The value on a beam-gate axis: a strip's deposit, or the grid (GATE_AXIS_GRID) over its anchor.
void Totals (Double_t *out) const
 Every strip's deposit at once, for code that wants an array.

Public Attributes

TTree * tree_
 Events tree or chain bound by Attach(). Not owned.
Int_t loaded_tree_
 Tree number whose gains are loaded; -1 for none.
Raw ADC, straight from the events tree
UShort_t leftdE_adc [16]
 Left end of strips 1-16, index strip - 1.
UShort_t rightdE_adc [16]
 Right end of strips 1-16, index strip - 1.
UShort_t strip0_adc
 Strip 0, unsegmented.
UShort_t strip17_adc
 Strip 17, unsegmented.
UShort_t hits_adc [36]
 Raw per-slot hit ADC values.
Short_t cathode_adc
 Raw cathode ADC value.
Short_t grid_adc
 Raw Frisch grid ADC value.
Calibration, from the file's calibration tree
Float_t gain_left [16]
 Left-end gain of strips 1-16, index strip - 1.
Float_t gain_right [16]
 Right-end gain of strips 1-16.
Float_t offset_left [16]
 ADC subtracted from an end before its gain, only when that end fired: a short end's energy carries a fixed amount over the charge it collected whenever it triggers (see ChannelCal::offset_adc).
Float_t offset_right [16]
Float_t gain_strip0
 Strip 0 gain.
Float_t gain_strip17
 Strip 17 gain.
Float_t gain_cathode
 Cathode gain.
Float_t gain_grid
 Grid gain: the reciprocal of its modal beam peak, so the grid reads 1.0 for a beam event.
Float_t strip_factor [18]
 Per-strip multiplicative alignment, indexed by strip 0-17 and applied to every end of the strip after its gain.
Float_t strip_offset [18]
 Per-strip additive alignment in calibrated units, indexed by strip 0-17.
Bool_t is_normed
 Whether a calibration tree was found.
Decoded per-event values

In arbitrary units when is_normed, otherwise raw ADC.

Each end already carries its strip's alignment factor, and the long end its offset, so a strip's deposit is the plain sum of its ends, which is what Total() returns.

Double_t left [16]
 Left end of strips 1-16, index strip - 1.
Double_t right [16]
 Right end of strips 1-16, index strip - 1.
Double_t strip0
 Strip 0.
Double_t strip17
 Strip 17.
Double_t cathode
 Cathode energy.
Double_t grid
 Grid energy.

Detailed Description

A view over one event's energies, decoding raw ADC into calibrated units.

Binds to an events tree or chain, then decodes each entry: per-channel gains are applied, then per-strip alignment factors. Whether the result is in arbitrary calibrated units or still raw ADC depends on whether a calibration tree was found — see is_normed.

The layout follows the detector: strips 1-16 are segmented and read at a left and a right end, held in arrays of 16 indexed by strip - 1; strips 0 and 17 are unsegmented and each a single value. A strip's total deposit is never stored; Total() adds the two ends when asked.

Note
Holds a non-owning pointer to the tree it is attached to, which must outlive it. Gains are reloaded automatically when a TChain rolls over to a new file, tracked by loaded_tree_.

Definition at line 26 of file Normalization.hpp.

Constructor & Destructor Documentation

◆ EnergyView()

EnergyView::EnergyView ( )
inline

Construct detached, with zeroed values and no gains loaded.

Definition at line 89 of file Normalization.hpp.

Member Function Documentation

◆ Attach()

Bool_t EnergyView::Attach ( TTree * t)

Bind to an events tree and set up the branch addresses.

Parameters
tTree or chain to read. Borrowed; must outlive this view.
Returns
kTRUE if the expected branches were found.

Definition at line 6 of file Normalization.cpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms(), FindStripCentroidAlignment(), and SaveDynamicRangeOverlay().

◆ Axis()

Double_t EnergyView::Axis ( Int_t axis) const
inline

The value on a beam-gate axis: a strip's deposit, or the grid (GATE_AXIS_GRID) over its anchor.

Definition at line 146 of file Normalization.hpp.

◆ Decode()

void EnergyView::Decode ( )

Decode the currently loaded entry into the value members.

Applies the per-channel offsets (to ends that fired) and gains, drops the short end when IGNORE_SHORT_STRIPS is set, then multiplies every end by its strip's strip_factor and adds strip_offset to the long end when it fired (a reading of 0 stays 0, as for the per-channel offsets).

Note
Reads whichever entry the bound tree has loaded, so call GetEntry() first.

Definition at line 99 of file Normalization.cpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms(), FindStripCentroidAlignment(), and SaveDynamicRangeOverlay().

◆ LoadGains()

void EnergyView::LoadGains ( )

Load the calibration gains for the current file.

Note
Called automatically when a chain rolls over to a new tree; only needed directly when driving decoding by hand.

Definition at line 28 of file Normalization.cpp.

Referenced by Attach(), and Decode().

◆ Total()

Double_t EnergyView::Total ( Int_t strip) const
inline

◆ Totals()

void EnergyView::Totals ( Double_t * out) const
inline

Every strip's deposit at once, for code that wants an array.

Parameters
[out]out18 values, one per strip.

Definition at line 151 of file Normalization.hpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms().

Member Data Documentation

◆ cathode

Double_t EnergyView::cathode

Cathode energy.

Definition at line 81 of file Normalization.hpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms(), Decode(), and EnergyView().

◆ cathode_adc

Short_t EnergyView::cathode_adc

Raw cathode ADC value.

Definition at line 34 of file Normalization.hpp.

Referenced by Attach(), Decode(), and EnergyView().

◆ gain_cathode

Float_t EnergyView::gain_cathode

Cathode gain.

Definition at line 50 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ gain_grid

Float_t EnergyView::gain_grid

Grid gain: the reciprocal of its modal beam peak, so the grid reads 1.0 for a beam event.

Zero on files calibrated before it was written, where Decode() falls back to the full-scale normalisation.

Definition at line 54 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ gain_left

Float_t EnergyView::gain_left[16]

Left-end gain of strips 1-16, index strip - 1.

Definition at line 40 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ gain_right

Float_t EnergyView::gain_right[16]

Right-end gain of strips 1-16.

Definition at line 41 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ gain_strip0

Float_t EnergyView::gain_strip0

Strip 0 gain.

Definition at line 48 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ gain_strip17

Float_t EnergyView::gain_strip17

Strip 17 gain.

Definition at line 49 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ grid

Double_t EnergyView::grid

◆ grid_adc

Short_t EnergyView::grid_adc

Raw Frisch grid ADC value.

Definition at line 35 of file Normalization.hpp.

Referenced by Attach(), Decode(), and EnergyView().

◆ hits_adc

UShort_t EnergyView::hits_adc[36]

Raw per-slot hit ADC values.

Definition at line 33 of file Normalization.hpp.

Referenced by Attach(), and EventsSummary::BuildNormedSummaryHistograms().

◆ is_normed

Bool_t EnergyView::is_normed

Whether a calibration tree was found.

When true, the decoded values are in arbitrary calibrated units; when false they remain raw ADC.

Definition at line 68 of file Normalization.hpp.

Referenced by Attach(), EventsSummary::BuildNormedSummaryHistograms(), Decode(), EnergyView(), FindStripCentroidAlignment(), LoadGains(), and SaveDynamicRangeOverlay().

◆ left

Double_t EnergyView::left[16]

Left end of strips 1-16, index strip - 1.

Definition at line 77 of file Normalization.hpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms(), Decode(), EnergyView(), StripSumScatter::SimTagReport(), and Total().

◆ leftdE_adc

UShort_t EnergyView::leftdE_adc[16]

Left end of strips 1-16, index strip - 1.

Definition at line 29 of file Normalization.hpp.

Referenced by Attach(), Decode(), EnergyView(), and StripSumScatter::SimTagReport().

◆ loaded_tree_

Int_t EnergyView::loaded_tree_

Tree number whose gains are loaded; -1 for none.

Definition at line 86 of file Normalization.hpp.

Referenced by Attach(), Decode(), and EnergyView().

◆ offset_left

Float_t EnergyView::offset_left[16]

ADC subtracted from an end before its gain, only when that end fired: a short end's energy carries a fixed amount over the charge it collected whenever it triggers (see ChannelCal::offset_adc).

Zero on the long ends and when no calibration is loaded.

Definition at line 46 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ offset_right

Float_t EnergyView::offset_right[16]

Definition at line 47 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ right

Double_t EnergyView::right[16]

Right end of strips 1-16, index strip - 1.

Definition at line 78 of file Normalization.hpp.

Referenced by EventsSummary::BuildNormedSummaryHistograms(), Decode(), EnergyView(), StripSumScatter::SimTagReport(), and Total().

◆ rightdE_adc

UShort_t EnergyView::rightdE_adc[16]

Right end of strips 1-16, index strip - 1.

Definition at line 30 of file Normalization.hpp.

Referenced by Attach(), Decode(), EnergyView(), and StripSumScatter::SimTagReport().

◆ strip0

Double_t EnergyView::strip0

◆ strip0_adc

UShort_t EnergyView::strip0_adc

Strip 0, unsegmented.

Definition at line 31 of file Normalization.hpp.

Referenced by Attach(), Decode(), and EnergyView().

◆ strip17

Double_t EnergyView::strip17

◆ strip17_adc

UShort_t EnergyView::strip17_adc

Strip 17, unsegmented.

Definition at line 32 of file Normalization.hpp.

Referenced by Attach(), Decode(), and EnergyView().

◆ strip_factor

Float_t EnergyView::strip_factor[18]

Per-strip multiplicative alignment, indexed by strip 0-17 and applied to every end of the strip after its gain.

Identity (1.0) when no alignment is loaded, so an unaligned dataset decodes unchanged.

Definition at line 58 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ strip_offset

Float_t EnergyView::strip_offset[18]

Per-strip additive alignment in calibrated units, indexed by strip 0-17.

Together with strip_factor it puts the strip total on the scale with the beam at 1.0 and the two-particle pile-up at 2.0. It belongs to the strip, not an end, and is carried by the long end (L on odd strips, R on even) or the unsegmented value, so Total() stays the plain sum of the ends. Zero when no alignment is loaded.

Definition at line 65 of file Normalization.hpp.

Referenced by Decode(), EnergyView(), and LoadGains().

◆ tree_

TTree* EnergyView::tree_

Events tree or chain bound by Attach(). Not owned.

Definition at line 85 of file Normalization.hpp.

Referenced by Attach(), Decode(), EnergyView(), and LoadGains().


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