MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
Normalization.hpp
Go to the documentation of this file.
1#ifndef NORMALIZATION_HPP
2#define NORMALIZATION_HPP
3
4#include "Constants.hpp"
5#include <Rtypes.h>
6#include <TTree.h>
7
26struct EnergyView {
29 UShort_t leftdE_adc[16];
30 UShort_t rightdE_adc[16];
31 UShort_t strip0_adc;
32 UShort_t strip17_adc;
33 UShort_t hits_adc[36];
34 Short_t cathode_adc;
35 Short_t grid_adc;
37
40 Float_t gain_left[16];
41 Float_t gain_right[16];
46 Float_t offset_left[16];
47 Float_t offset_right[16];
48 Float_t gain_strip0;
49 Float_t gain_strip17;
50 Float_t gain_cathode;
54 Float_t gain_grid;
58 Float_t strip_factor[18];
65 Float_t strip_offset[18];
68 Bool_t is_normed;
70
77 Double_t left[16];
78 Double_t right[16];
79 Double_t strip0;
80 Double_t strip17;
81 Double_t cathode;
82 Double_t grid;
84
85 TTree *tree_;
87
91 gain_strip0(0.0f), gain_strip17(0.0f), gain_cathode(0.0f),
92 gain_grid(0.0f), is_normed(kFALSE), strip0(0.0), strip17(0.0),
93 cathode(0.0), grid(0.0), tree_(nullptr), loaded_tree_(-1) {
94 for (Int_t k = 0; k < 16; k++) {
95 leftdE_adc[k] = 0;
96 rightdE_adc[k] = 0;
97 gain_left[k] = 0.0f;
98 gain_right[k] = 0.0f;
99 offset_left[k] = 0.0f;
100 offset_right[k] = 0.0f;
101 left[k] = 0.0;
102 right[k] = 0.0;
103 }
104 for (Int_t s = 0; s < 18; s++) {
105 strip_factor[s] = 1.0f;
106 strip_offset[s] = 0.0f;
107 }
108 }
109
115 Bool_t Attach(TTree *t);
116
128 void Decode();
129
133 void LoadGains();
134
137 Double_t Total(Int_t strip) const {
138 if (strip <= 0)
139 return strip0;
140 if (strip >= 17)
141 return strip17;
142 return left[strip - 1] + right[strip - 1];
143 }
144
146 Double_t Axis(Int_t axis) const {
147 return axis == GATE_AXIS_GRID ? grid : Total(axis);
148 }
149
151 void Totals(Double_t *out) const {
152 for (Int_t s = 0; s < 18; s++)
153 out[s] = Total(s);
154 }
155};
156
157#endif
Dataset configuration.
const Int_t GATE_AXIS_GRID
Options which govern the reaction search in the 2D histograms (strip-sum-scatter).
Definition Constants.hpp:56
Float_t gain_strip0
Strip 0 gain.
UShort_t rightdE_adc[16]
Right end of strips 1-16, index strip - 1.
TTree * tree_
Events tree or chain bound by Attach(). Not owned.
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 ...
Float_t offset_right[16]
Double_t strip17
Strip 17.
void Decode()
Decode the currently loaded entry into the value members.
Float_t gain_grid
Grid gain: the reciprocal of its modal beam peak, so the grid reads 1.0 for a beam event.
Short_t cathode_adc
Raw cathode ADC value.
void LoadGains()
Load the calibration gains for the current file.
Float_t strip_offset[18]
Per-strip additive alignment in calibrated units, indexed by strip 0-17.
Int_t loaded_tree_
Tree number whose gains are loaded; -1 for none.
Bool_t Attach(TTree *t)
Bind to an events tree and set up the branch addresses.
Double_t Total(Int_t strip) const
A strip's deposit: the sum of its ends, or the unsegmented value.
Double_t left[16]
Left end of strips 1-16, index strip - 1.
Float_t strip_factor[18]
Per-strip multiplicative alignment, indexed by strip 0-17 and applied to every end of the strip after...
Bool_t is_normed
Whether a calibration tree was found.
Float_t gain_right[16]
Right-end gain of strips 1-16.
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.
UShort_t leftdE_adc[16]
Left end of strips 1-16, index strip - 1.
UShort_t strip17_adc
Strip 17, unsegmented.
Float_t gain_left[16]
Left-end gain of strips 1-16, index strip - 1.
EnergyView()
Construct detached, with zeroed values and no gains loaded.
Double_t strip0
Strip 0.
UShort_t strip0_adc
Strip 0, unsegmented.
Double_t right[16]
Right end of strips 1-16, index strip - 1.
Short_t grid_adc
Raw Frisch grid ADC value.
Float_t gain_cathode
Cathode gain.
UShort_t hits_adc[36]
Raw per-slot hit ADC values.
Float_t gain_strip17
Strip 17 gain.
Double_t grid
Grid energy.
Double_t cathode
Cathode energy.