MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
Constants.hpp
Go to the documentation of this file.
1#ifndef CONSTANTS_HPP
2#define CONSTANTS_HPP
3
4#include "DedupStrategy.hpp"
6#include "RunEpoch.hpp"
7#include "SlotLayout.hpp"
8#include <Rtypes.h>
9#include <RtypesCore.h>
10#include <TString.h>
11#include <iostream>
12#include <map>
13#include <utility>
14#include <vector>
15
29
40#ifndef MUSIC_HOT_PATH_LOGGING
41#define MUSIC_HOT_PATH_LOGGING 0
42#endif
43
56const Int_t GATE_AXIS_GRID = -1;
57
78
84
87
90
104
110
117
124
138
148
165
170
174
182
193 Double_t NOISE_NSIGMA;
195
199
207
218
224
231
233
235
236 Int_t X_LO;
237 Int_t X_HI;
238
242 Double_t GATE_NSIGMA;
244 Double_t GATE_CENTER;
245 Double_t GATE_MIN;
246 Double_t GATE_MAX;
248
254 Int_t XBINS;
257 Int_t YBINS;
258
261 std::map<Int_t, std::pair<Double_t, Double_t>> Y_DISPLAY_RANGE;
262
264
265 Bool_t RERUN_SIM;
267
272
283
284 void SetDefaults();
285};
286
290
299 TString name;
304 TString label;
312 std::vector<TString> talys_exits;
315 std::vector<TString> subtract_exits;
321 std::vector<std::vector<Double_t>> reference_xs;
327 Int_t fit_model = -1;
328};
329
332 TString label;
333 std::vector<TString> keywords;
334};
335
344
347Int_t TargetGasA(TargetGas gas);
348
352
366
369 Int_t BEAM_A;
370 Int_t BEAM_Z;
372
385 std::vector<TalysModel> TALYS_MODELS;
394 std::vector<TString> TALYS_COMMON_KEYWORDS;
395
399
403
412
421
426
433 std::vector<TString> EPOCHS;
434
440 std::vector<CrossSectionChannel> CHANNELS;
441
442 void SetDefaults();
443};
444
446public:
460
462
467 std::vector<Int_t> RUN_NUMBERS;
468 std::vector<RunEpoch> EPOCHS;
469 Int_t N_CHUNKS;
470
472
474 Int_t N_BOARDS;
477 std::vector<UShort_t> TIMING_REF_BOARD_CHANNELS;
478
492
494
506
512
513 // How far back to check and apply a correction. The trapezoid baseline is an
514 // average over a
517
523
534
544
562
564 Bool_t HAS_GRID;
567
569
581
586
588
613
616
624
627
630
633
634 Double_t GRID_MAX_ADC;
635
638
642
647
648 std::map<std::pair<Int_t, Int_t>, TString> channelMap;
649 std::map<std::pair<Int_t, Int_t>, TString> channelMap64;
650
652};
653
654namespace Constants {
657extern const DatasetConfig &cfg;
658
668void SetActiveEpoch(const RunEpoch *epoch);
669
671const RunEpoch *GetActiveEpoch();
679const RunEpoch *EpochForRun(Int_t run);
695RunEpoch MakeEpoch(const TString &name, const std::vector<Int_t> &runs);
699std::vector<Int_t> RunRange(Int_t first, Int_t last);
703const TString &ActiveFileTag();
704
706Int_t ActiveNBoards();
708Int_t ActiveNChannels();
710UShort_t ActiveTimingRefBoard();
712const std::vector<UShort_t> &ActiveTimingRefBoardChannels();
714Bool_t ActiveDoBoardSync();
716Bool_t ActiveDoSort();
718Bool_t ActiveHasCathode();
720Bool_t ActiveUseSolarisData();
722Double_t ActiveEventTimeWindowUs();
724Double_t ActiveSeedHoldoffUs();
729const TString &ActiveReferenceChannel();
737Double_t ActiveStripEMinAdc();
739Double_t ActiveStripEMaxAdc();
741Double_t ActiveCathodeMaxAdc();
743Double_t ActiveGridMaxAdc();
745Double_t ActiveStrip0MaxAdc();
747Double_t ActiveStrip17MaxAdc();
749Double_t ActiveLeftEvenMaxAdc();
751Double_t ActiveLeftOddMaxAdc();
753Double_t ActiveRightEvenMaxAdc();
755Double_t ActiveRightOddMaxAdc();
756
758const std::vector<Int_t> &ActiveRunNumbers();
759
763Int_t ActiveMaxFiles();
764
768Double_t ActiveSplitChunkSeconds();
784
790Bool_t FileInSample();
792Bool_t SavePlots();
797std::ostream &Detail();
798std::ostream &DetailErr();
801Bool_t InPlotSample(Int_t k);
805void SetPlotsThisFile(Bool_t on);
806
815const std::map<std::pair<Int_t, Int_t>, TString> &ActiveChannelMap();
816} // namespace Constants
817
818#endif
Double_t TargetGasAtomsPerMolecule(TargetGas gas)
Atoms of the reacting species per molecule of fill gas.
Definition Constants.cpp:11
const Int_t GATE_AXIS_GRID
Options which govern the reaction search in the 2D histograms (strip-sum-scatter).
Definition Constants.hpp:56
TargetGas
The fill gas the beam reacts in.
@ kHELIUM
Helium fill.
Int_t TargetGasA(TargetGas gas)
Mass number of the target nucleus in a fill gas.
Definition Constants.cpp:3
DedupStrategy
How to resolve more than one hit on the same channel within an event.
The per-group settings of the pulse-history correction.
Fixed array indices for the per-event channel arrays.
Double_t PULSE_HISTORY_OWN_LO
Looser window for the long ends of the chain whose kernel is being fit; the one above is used on stri...
std::vector< Int_t > RUN_NUMBERS
Flat run list, used when EPOCHS is empty.
Double_t PULSE_HISTORY_TRAP_RISE_US
Trapezoid filter settings of the DPP-PHA, in microseconds, which fix the two times in the pole-zero k...
std::map< std::pair< Int_t, Int_t >, TString > channelMap
TString SOL_SPLIT_DIR
Double_t REFERENCE_CHANNEL_MIN_ADC
Double_t TIMING_MIN_ENERGY
Timing.
Double_t STRIP_DE_MIN_NORMED
Double_t PULSE_HISTORY_APPLY_MAX_US
few hundred microseconds, so pulses beyond 100 us still move it.
Bool_t HAS_STRIP0
Double_t TIMING_SHIFT_COARSE_STEP_US
Double_t LEFT_ODD_MAX_ADC
UShort_t TIMING_REF_BOARD
Double_t TIMING_THRESH_DT_US
Double_t PULSE_HISTORY_OWN_HI
Double_t STRIP17_MAX_ADC
Double_t CATHODE_MAX_ADC
Double_t PULSE_HISTORY_PEAKING_US
Double_t TIMING_MAX_ENERGY
Double_t PULSE_HISTORY_BEAM_LO
Bool_t SAVE_FULL_PLOTS
Per-subfile output: the events summaries, timing, beam calibration and pulse-history figure folders o...
Bool_t HAS_CATHODE
TString SOL_BASE_DIR
Int_t N_BOARDS
Hardware layout.
StripSumScatterConfig STRIP_SUM_SCATTER_CONFIG
Bool_t HAS_STRIP17
Double_t SEED_HOLDOFF_MAX_RATIO
Bool_t REJECT_FLAGGED_EVENTS
Double_t PULSE_HISTORY_BEAM_HI
Double_t STRIP_DE_MAX_NORMED
Double_t RIGHT_EVEN_MAX_ADC
Double_t TIMING_MAX_ABS_SHIFT_S
Int_t PLOT_SAMPLE_FILES
Bool_t TIMING_DO_SORT
PulseHistoryGroups PULSE_HISTORY_GROUPS
Which channel groups are corrected and with which kernel shape; all off by default,...
Double_t EVENT_TIME_WINDOW_US
Bool_t IGNORE_STRIP_0
Drop strip 0 / strip 17 from the analysis altogether: not required for a complete event,...
TString SIM_BEAM_FILE
Double_t SEED_HOLDOFF_US
Seed holdoff: a reference hit arriving within SEED_HOLDOFF_US after the current seed,...
Int_t SOL_N_SPLIT_WORKERS
Bool_t USE_SOLARIS_DATA
Data source.
Bool_t TIMING_DO_BOARD_SYNC
Double_t BEAM_GATE_NSIGMA
n-sigma of the per-strip beam gate in the beam calibration: strip s is gated by the ellipse on the (s...
Double_t STRIP_E_MIN_ADC
Double_t PULSE_HISTORY_TRAP_FLAT_US
DedupStrategy DEDUP_STRATEGY
TString REFERENCE_CHANNEL
Double_t SOL_SPLIT_CHUNK_SECONDS
Length of the time chunks the SOLARIS .sol files are split into by the preprocess step,...
Int_t TIMING_SHIFT_MIN_NPTS
Int_t SAVE_SAMPLE_TRACES
Number of sample traces to save during event build and normed summary passes (0 = disabled).
Int_t MAX_FUSED_WORKERS
TString COMPASS_BASE_DIR
Double_t TIMING_OVERLAP_MARGIN_S
Double_t STRIP_E_MAX_ADC
Int_t PULSE_HISTORY_AMP_BINS
Kernel bands in the previous pulse's amplitude, in units of the channel's beam peak: 1 is one kernel ...
Double_t REFERENCE_CHANNEL_MAX_ADC
Double_t RIGHT_ODD_MAX_ADC
Double_t LEFT_EVEN_MAX_ADC
Bool_t IGNORE_STRIP_17
Bool_t SKIP_EXISTING
Bool_t REQUIRE_STRIP_0
Whether a complete event must carry a strip 0 hit (EventBuilder's CheckEventComplete at build time,...
Long64_t PULSE_HISTORY_MIN_EVENTS
Int_t TIMING_SHIFT_MAX_SCAN_CANDIDATES
Double_t GRID_MAX_ADC
CrossSectionConfig CROSS_SECTION_CONFIG
Int_t MAX_GPU_CONCURRENT_SORTS
Double_t STRIP0_MAX_ADC
Bool_t IGNORE_SHORT_STRIPS
Decode the long end only, dropping every short end.
std::map< std::pair< Int_t, Int_t >, TString > channelMap64
Double_t TIMING_SHIFT_FINE_STEP_US
Double_t TIMING_SHIFT_FINE_HALF_WIDTH_US
std::vector< RunEpoch > EPOCHS
Bool_t USE_GPU_ACCELERATION
Bool_t PULSE_HISTORY_CORRECTION
Pole-zero pulse-history correction on the raw hits, before event building (see PulseHistory....
std::vector< UShort_t > TIMING_REF_BOARD_CHANNELS
DedupStrategy ActiveDedupStrategy()
How repeated hits on one slot are resolved.
const RunEpoch * GetActiveEpoch()
The currently active epoch, or null when none is set.
UShort_t ActiveTimingRefBoard()
Board the others are timing-aligned against.
RunEpoch MakeEpoch(const TString &name, const std::vector< Int_t > &runs)
Build an epoch prefilled from the flat configuration block.
Int_t ActiveMaxFiles()
Cap on subfiles processed per run for the active epoch.
Bool_t ActiveIgnoreShortStrips()
Whether the decode keeps the long end only: the active epoch's setting; with none active,...
Double_t ActiveReferenceChannelMaxAdc()
Upper energy gate on the seed channel, in ADC.
Double_t ActiveStrip17MaxAdc()
Strip 17 full scale, in ADC.
void ActivateAnalysisEpoch()
Make AnalysisEpoch() the active epoch, so a binary of the cross-section chain resolves the file tag,...
Double_t ActiveSeedHoldoffMaxRatio()
The size, as a fraction of the new hit, under which the current seed counts as a pre-trigger.
const TString & ActiveReferenceChannel()
Channel whose hits seed events.
Double_t ActiveLeftEvenMaxAdc()
Left-side ceiling for even strips, in ADC.
Double_t ActiveStripEMaxAdc()
Upper bound of the per-strip energy range, in ADC.
Double_t ActiveSplitChunkSeconds()
Chunk length the active epoch's .sol files are split into, in seconds; non-positive means whole files...
Bool_t ActiveDoBoardSync()
Whether to run the multi-board timing alignment.
Double_t ActiveEventTimeWindowUs()
Coincidence window for event building, in microseconds.
Bool_t SavePlots()
FileInSample(), by the name the plot call sites use.
Bool_t ActiveDoSort()
Whether to time-sort hits before event building.
Double_t ActiveStripEMinAdc()
Lower bound of the per-strip energy range, in ADC.
Double_t ActiveRightEvenMaxAdc()
Right-side ceiling for even strips, in ADC.
const std::vector< Int_t > & ActiveRunNumbers()
Runs of the active epoch, or the flat RUN_NUMBERS when none is set.
const std::map< std::pair< Int_t, Int_t >, TString > & ActiveChannelMap()
The channel map in force.
Double_t ActiveLeftOddMaxAdc()
Left-side ceiling for odd strips, in ADC.
Bool_t InPlotSample(Int_t k)
Whether the k-th file (0-based, in file order) of an epoch's list is in the plot sample.
Double_t ActiveStrip0MaxAdc()
Strip 0 full scale, in ADC.
Double_t ActiveRightOddMaxAdc()
Right-side ceiling for odd strips, in ADC.
Double_t ActiveCathodeMaxAdc()
Cathode full scale, in ADC.
const std::vector< UShort_t > & ActiveTimingRefBoardChannels()
Reference channel per board, for the alignment.
Double_t ActiveReferenceChannelMinAdc()
Lower energy gate on the seed channel, in ADC.
const RunEpoch * EpochForRun(Int_t run)
The epoch owning a run number.
Int_t ActiveNBoards()
Boards in the active epoch's setup.
std::ostream & Detail()
std::cout for a file in the sample, a stream that discards otherwise: the per-file detail lines (per ...
const TString & ActiveFileTag()
Output-name prefix of the active epoch.
Bool_t ActiveHasCathode()
Whether this era instrumented the cathode.
Double_t ActiveGridMaxAdc()
Grid full scale, in ADC.
Bool_t FileInSample()
Whether the file this thread is processing is in the per-file sample: every file with SAVE_FULL_PLOTS...
const DatasetConfig & cfg
The active dataset's configuration, flat block.
Int_t ActiveNChannels()
Channels per board.
std::vector< Int_t > RunRange(Int_t first, Int_t last)
Consecutive run numbers, for MakeEpoch().
void SetPlotsThisFile(Bool_t on)
Mark the file this thread is about to process as in (or out of) the plot sample.
Double_t ActiveSeedHoldoffUs()
Seed holdoff in microseconds; 0 = off. See SEED_HOLDOFF_US.
std::ostream & DetailErr()
void SetActiveEpoch(const RunEpoch *epoch)
Set the epoch the Active*() accessors read from.
Bool_t ActiveUseSolarisData()
Whether this era's data is SOLARIS rather than CoMPASS.
const PulseHistoryGroups & ActivePulseHistoryGroups()
The pulse-history groups in force: the active epoch's set, or the flat PULSE_HISTORY_GROUPS when no e...
TALYS calculation with name for plot and parameters to actually run TALYS (see CrossSectionConfig::TA...
Int_t fit_model
Index into TALYS_MODELS of the model for the second figure (cross_section_<name>_fit): that model's s...
std::vector< std::vector< Double_t > > reference_xs
Published values to compare against, if any, one row per point: the effective centre-of-mass energy [...
std::vector< TString > talys_exits
Which of the residual channels TALYS wrote make up this channel's curve, as exit channels by name: wh...
TString label
The reaction as it appears in the plot title after the dataset name, e.g.
std::vector< TString > subtract_exits
Exits that cannot be separated from this channel; their TALYS branching fraction is removed from the ...
TString name
Names the region cut (region_<name>) and the output figure.
Experimental details needed to properly calculate the cross section.
Int_t FELDMAN_COUSINS_MAX_COUNT
Statistical error on a strip's count.
Int_t XS_STRIP_MIN
Reaction strips for which to calculate a cross-section.
std::vector< TString > EPOCHS
Epochs whose runs feed the cross-section chain (strip-sum-scatter, compute-regions,...
Double_t GAS_PRESSURE_TORR_ERR
Its uncertainty [Torr]; a relative systematic on every point (the cross section scales as 1 / pressur...
Double_t GAS_PRESSURE_TORR
At the pressure the gas was actually at rather than the nominal one.
Bool_t PRELIMINARY
Stamp the cross-section figures "PRELIMINARY" (large, faint, across the plot area) so a figure that l...
TString BEAM_SIM_FILE
Simulated unreacted beam, read for the energy at each strip.
Int_t BEAM_A
Beam mass number, for the lab-to-centre-of-mass conversion; its Z and element symbol name it to a rea...
Bool_t EFFECTIVE_ENERGY
Report each strip at its effective centre-of-mass energy (the energy below which half the strip's yie...
std::vector< TalysModel > TALYS_MODELS
Hauser-Feshbach predictions from TALYS.
std::vector< CrossSectionChannel > CHANNELS
The reaction channels measured on this dataset.
std::vector< TString > TALYS_COMMON_KEYWORDS
Input lines written into every model's TALYS input, after the projectile, target and energies and bef...
Which channel groups the pulse-history correction fits and applies to, one setting per kernel group o...
One acquisition period of a dataset.
Definition RunEpoch.hpp:34
Bool_t PLOT_ADC_TRACES
Also draw the trace overlays in raw ADC (the *_adc figures) next to the calibrated ones,...
AnRegionMode
How compute-regions defines the (a,n) region.
Double_t CUT_VARIATION_CLIFF_STEP
Double_t SMOOTHNESS_NSIGMA
Event-level smoothness: every strip-to-strip step of the trace, from strips 1-2 to the last pair,...
Double_t X_DISPLAY_MIN
Display-only windows for the strip-sum scatters (a.u.): the histograms are built over the fixed Scatt...
Double_t PURE_BEAM_NSIGMA
Mahalanobis level of the pure-beam entrance and exit ellipses; separate from GATE_NSIGMA so the beam ...
Definition Constants.hpp:77
Double_t TAIL_RETURN_NSIGMA
After the post-window peak, once the trace has come back down to within TAIL_RETURN_NSIGMA x StripSig...
AnRegionMode AN_REGION_MODE
Int_t TAIL_FALL_FROM_STRIP
From TAIL_FALL_FROM_STRIP to the last strip, allow no strip-to-strip rise above TAIL_RISE_NSIGMA x St...
Int_t POST_CROSS_MIN_STRIP
The trace may not read below the beam mean before this strip: strips reac+1 .
Int_t POST_TRIGGER_SUM_STRIPS
Number of strips summed onto the scatter y-axis after the trigger strip: y spans reac+1 .
Definition Constants.hpp:82
Bool_t REQUIRE_STRIP_16_BELOW_BEAM
Bool_t SKIP_SAVGOL_PLOTS
Leave out the Savitzky-Golay-smoothed copies of the trace overlays (the _sg figures and cluster-varia...
TagResolve
One tag per event.
Definition Constants.hpp:73
Double_t REAC_JUMP_NSIGMA
Minimum jump at the reaction strip for a tag, in sigma of the measured beam spread of that strip (Str...
Int_t MAX_STRIP_SUM_WORKERS
Cap on worker threads for the scatter fill.
Definition Constants.hpp:86
PureBeamGate PURE_BEAM_GATE
Definition Constants.hpp:67
PureBeamGate
The entrance ellipse of the pure-beam sample (beam-noise reference and beam_flat reservoir): strips 0...
Definition Constants.hpp:62
Bool_t PLOT_REGION_MEAN_TRACES
Also draw the per-region mean traces with RMS bands (the region_mean_traces_* figures) next to the tr...
Bool_t REQUIRE_BEAM_UPSTREAM_OF_REAC
How close to require strips to be to beam prior to the reaction, in sigma of each strip's measured be...
Double_t TAIL_CLIFF_MAX_FRACTION
A residue stops gradually; the beam nucleus after a large-angle elastic scatter keeps its excess to t...
Double_t END_STRIP_NSIGMA
The end strip (17, or 16 with REQUIRE_STRIP_16_BELOW_BEAM or IGNORE_STRIP_17) must read below the bea...
Double_t POST_ABOVE_NSIGMA
Every strip from reac+1 to reac+ POST_ABOVE_STRIPS (capped at the last strip) must sit more than POST...
Double_t GATE_CENTER
The peak to fit, in beam units; zero lets the fit find it.
Double_t AN_REGION_NSIGMA
compute-regions: the (a,n) region is the reaction component's AN_REGION_NSIGMA Mahalanobis ellipse fr...
Int_t GATE_STRIP
The event-level beam gate: one strip, within GATE_NSIGMA of its fitted beam peak per gate group.
Bool_t CUT_VARIATION
Cut-variation systematic, after the published 87Rb analysis: every condition that selects the beam or...
Double_t BEAM_UPSTREAM_NSIGMA
Double_t CUT_VARIATION_NSIGMA_STEP
Bool_t Y_RATIO_TO_UPSTREAM
Normalize the partial dE sum on y axis by the event's own mean deposit over strips 1 .
std::map< Int_t, std::pair< Double_t, Double_t > > Y_DISPLAY_RANGE
Per-reaction-strip y-axis display windows, overriding Y_DISPLAY_MIN/MAX for individual strips (displa...
Int_t BOTH_MULT_MAX
Use the segmentation of strips to reject an event when more than MAX strips in 1.....
Double_t PILEUP_NSIGMA
Event-level cuts before any reaction is asked about, in sigma of each strip's measured beam spread (S...
Bool_t REGION_CUT_REDRAW
Redraw the regions for this reaction strip even if saved ones exist, and overwrite only that strip's ...
One TALYS model variant to compare against.
TString label
Legend label for this model's curve.
std::vector< TString > keywords
TALYS keywords selecting the variant.