229static const RunEpoch *gActiveEpoch =
nullptr;
238 for (Int_t e = 0; e < Int_t(
cfg.EPOCHS.size()); e++) {
242 for (Int_t r = 0; r < Int_t(ep.
runs.size()); r++)
243 if (ep.
runs[r] == run)
257 !
cfg.channelMap64.empty() ?
cfg.channelMap64 :
cfg.channelMap;
281std::vector<Int_t>
RunRange(Int_t first, Int_t last) {
282 std::vector<Int_t> runs;
283 for (Int_t r = first; r <= last; r++)
291static const std::vector<Int_t> &EpochUnionRuns() {
292 static std::vector<Int_t> runs;
293 static Bool_t built = kFALSE;
298 for (Int_t w = 0; w < Int_t(want.size()); w++) {
299 Bool_t found = kFALSE;
300 for (Int_t e = 0; e < Int_t(
cfg.
EPOCHS.size()) && !found; e++)
303 std::cerr <<
"WARNING: CROSS_SECTION_CONFIG.EPOCHS names \"" << want[w]
304 <<
"\" but no such epoch is declared." << std::endl;
306 for (Int_t e = 0; e < Int_t(
cfg.EPOCHS.size()); e++) {
307 const RunEpoch &ep =
cfg.EPOCHS[e];
310 Bool_t wanted = want.empty();
311 for (Int_t w = 0; w < Int_t(want.size()) && !wanted; w++)
312 wanted = ep.
name == want[w];
314 runs.insert(runs.end(), ep.
runs.begin(), ep.
runs.end());
320 return gActiveEpoch ? gActiveEpoch->n_boards :
cfg.N_BOARDS;
323 return gActiveEpoch ? gActiveEpoch->n_channels :
cfg.N_CHANNELS;
326 return gActiveEpoch ? gActiveEpoch->timing_ref_board :
cfg.TIMING_REF_BOARD;
329 return gActiveEpoch ? gActiveEpoch->timing_ref_board_channels
330 :
cfg.TIMING_REF_BOARD_CHANNELS;
333 return gActiveEpoch ? gActiveEpoch->do_board_sync :
cfg.TIMING_DO_BOARD_SYNC;
336 return gActiveEpoch ? gActiveEpoch->do_sort :
cfg.TIMING_DO_SORT;
339 return gActiveEpoch ? gActiveEpoch->has_cathode :
cfg.HAS_CATHODE;
342 return gActiveEpoch ? (gActiveEpoch->source ==
kSolaris)
343 :
cfg.USE_SOLARIS_DATA;
346 return gActiveEpoch ? gActiveEpoch->event_time_window_us
347 :
cfg.EVENT_TIME_WINDOW_US;
350 return gActiveEpoch ? gActiveEpoch->reference_channel :
cfg.REFERENCE_CHANNEL;
353 return gActiveEpoch ? gActiveEpoch->reference_channel_min_adc
354 :
cfg.REFERENCE_CHANNEL_MIN_ADC;
357 return gActiveEpoch ? gActiveEpoch->reference_channel_max_adc
358 :
cfg.REFERENCE_CHANNEL_MAX_ADC;
361 return gActiveEpoch ? gActiveEpoch->dedup_strategy :
cfg.DEDUP_STRATEGY;
364 return gActiveEpoch ? gActiveEpoch->strip_e_min_adc :
cfg.STRIP_E_MIN_ADC;
367 return gActiveEpoch ? gActiveEpoch->strip_e_max_adc :
cfg.STRIP_E_MAX_ADC;
370 return gActiveEpoch ? gActiveEpoch->cathode_max_adc :
cfg.CATHODE_MAX_ADC;
373 return gActiveEpoch ? gActiveEpoch->grid_max_adc :
cfg.GRID_MAX_ADC;
376 return gActiveEpoch ? gActiveEpoch->strip0_max_adc :
cfg.STRIP0_MAX_ADC;
379 return gActiveEpoch ? gActiveEpoch->strip17_max_adc :
cfg.STRIP17_MAX_ADC;
382 return gActiveEpoch ? gActiveEpoch->left_even_max_adc :
cfg.LEFT_EVEN_MAX_ADC;
385 return gActiveEpoch ? gActiveEpoch->left_odd_max_adc :
cfg.LEFT_ODD_MAX_ADC;
388 return gActiveEpoch ? gActiveEpoch->right_even_max_adc
389 :
cfg.RIGHT_EVEN_MAX_ADC;
392 return gActiveEpoch ? gActiveEpoch->right_odd_max_adc :
cfg.RIGHT_ODD_MAX_ADC;
397 return gActiveEpoch->runs;
398 if (
cfg.RUN_NUMBERS.empty() && !
cfg.EPOCHS.empty())
399 return EpochUnionRuns();
400 return cfg.RUN_NUMBERS;
403 static const TString kNone =
"";
404 return gActiveEpoch ? gActiveEpoch->file_tag : kNone;
409 if (gActiveEpoch && !gActiveEpoch->channel_map.empty())
410 return gActiveEpoch->channel_map;
411 if (!
cfg.channelMap64.empty())
412 return cfg.channelMap64;
413 if (!
cfg.channelMap.empty())
414 return cfg.channelMap;
415 std::cerr <<
"FATAL: neither channelMap nor channelMap64 is configured."
Double_t TargetGasAtomsPerMolecule(TargetGas gas)
Atoms of the reacting species per molecule of fill gas.
Int_t TargetGasA(TargetGas gas)
Mass number of the target nucleus in a fill gas.
The dataset configuration, and how it is layered.
TargetGas
The fill gas the beam reacts in.
DedupStrategy
How to resolve more than one hit on the same channel within an event.
@ kLARGEST_ENERGY
Keep the highest-energy hit.
Double_t PULSE_HISTORY_OWN_LO
Looser window for the long ends of the chain whose kernel is being fitted; the tight one above applie...
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
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 TIMING_MAX_ENERGY
Double_t PULSE_HISTORY_BEAM_LO
Double_t STRIP_DE_OVERVIEW_MAX_NORMED
Double_t BEAM_GATE_NSIGMA_X
n-sigma of the per-strip beam gate in the beam calibration: strip s is gated by the ellipse on the (s...
Int_t N_BOARDS
Hardware layout.
StripSumScatterConfig STRIP_SUM_SCATTER_CONFIG
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
Double_t EVENT_TIME_WINDOW_US
Int_t SOL_N_SPLIT_WORKERS
Bool_t USE_SOLARIS_DATA
Data source.
Bool_t TIMING_DO_BOARD_SYNC
DedupStrategy DEDUP_STRATEGY
TString REFERENCE_CHANNEL
Double_t CATHODE_E_MAX_NORMED
Double_t SOL_SPLIT_CHUNK_SECONDS
Int_t TIMING_SHIFT_MIN_NPTS
Double_t TOTAL_E_MAX_NORMED
Int_t SAVE_SAMPLE_TRACES
Number of sample traces to save during event build and normed summary passes (0 = disabled).
Double_t STRIP_DE_OVERVIEW_MIN_NORMED
Double_t TIMING_OVERLAP_MARGIN_S
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
Double_t BEAM_GATE_NSIGMA_Y
Long64_t PULSE_HISTORY_MIN_EVENTS
Double_t TOTAL_E_MIN_NORMED
Int_t TIMING_SHIFT_MAX_SCAN_CANDIDATES
CrossSectionConfig CROSS_SECTION_CONFIG
Int_t MAX_GPU_CONCURRENT_SORTS
Bool_t IGNORE_SHORT_STRIPS
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....
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.
Double_t ActiveReferenceChannelMaxAdc()
Upper energy gate on the seed channel, in ADC.
Double_t ActiveStrip17MaxAdc()
Strip 17 full scale, in ADC.
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.
Bool_t ActiveDoBoardSync()
Whether to run the multi-board timing alignment.
Double_t ActiveEventTimeWindowUs()
Coincidence window for event building, in microseconds.
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.
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.
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.
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 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.
Int_t XS_STRIP_MIN
Reaction strips to report a cross section for.
std::vector< TString > EPOCHS
Epochs whose runs feed the cross-section chain (strip-sum-scatter, compute-regions,...
Double_t GAS_PRESSURE_TORR
At the pressure the gas was actually at rather than the nominal one.
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 (Szegedi et al.
std::vector< TalysModel > TALYS_MODELS
Hauser-Feshbach predictions from TALYS.
std::vector< CrossSectionChannel > CHANNELS
The reaction channels measured on this dataset.
One acquisition period of a dataset.
Double_t cathode_max_adc
Cathode full scale.
std::vector< Int_t > runs
Run numbers belonging to this epoch.
Bool_t has_cathode
Whether this era instrumented the cathode.
UShort_t timing_ref_board
Double_t right_odd_max_adc
Bool_t do_sort
Time-sort hits before event building.
Double_t left_even_max_adc
Left-side ceiling, even strips.
TString name
Epoch name, used in logs and plot paths.
Double_t right_even_max_adc
Right-side ceiling, even strips.
std::vector< UShort_t > timing_ref_board_channels
Channels on the reference board used to align the others against it.
Double_t grid_max_adc
Grid full scale.
Double_t strip0_max_adc
Strip 0 full scale.
Double_t event_time_window_us
Coincidence window, in microseconds, for grouping hits into one event.
Double_t strip_e_max_adc
Upper bound of the per-strip energy range.
TString file_tag
Prefix for this epoch's output files and plot directories.
Bool_t enabled
Whether this epoch participates in the analysis.
Double_t strip17_max_adc
Strip 17 full scale.
DedupStrategy dedup_strategy
How repeated hits on a slot resolve.
Double_t left_odd_max_adc
Left-side ceiling, odd strips.
Double_t reference_channel_min_adc
Lower energy gate on the seed channel.
Bool_t do_board_sync
Run the multi-board timing alignment.
Double_t strip_e_min_adc
Lower bound of the per-strip energy range.
std::map< std::pair< Int_t, Int_t >, TString > channel_map
Board and channel to detector-element name, e.g. "Grid", "de_l_03".
Int_t n_boards
Boards in this era's setup.
TString reference_channel
Channel whose hits seed events, e.g. "Grid".
RunSource source
Acquisition system for this era.
Double_t reference_channel_max_adc
Upper energy gate on the seed channel.
Int_t n_channels
Channels per board.
Long64_t SAMPLE_MAX_POINTS
Double_t PARITY_ASYM_MAX
Reject events whose even strips and odd strips disagree by more than this fraction,...
Double_t X_DISPLAY_MIN
Display-only windows for the strip-sum scatters (a.u.): the histograms are built over the fixed Scatt...
AnRegionMode AN_REGION_MODE
std::map< Int_t, Int_t > POST_WINDOW_STRIPS
Int_t POST_WINDOW_LAST_STRIP
Int_t POST_TRIGGER_SUM_STRIPS
Strips summed onto the scatter y-axis after the trigger strip: y spans reac+1 .
Double_t AN_RIDGE_NSIGMA_HI
Int_t CLUSTER_SMOOTH_WINDOW
Bool_t REQUIRE_STRIP_16_BELOW_BEAM
Double_t AN_RIDGE_NSIGMA_LO
Double_t REAC_JUMP_NSIGMA
Minimum jump at the reaction strip for a tag, in sigma of the measured strip-to-strip beam noise (Str...
Int_t MAX_STRIP_SUM_WORKERS
Cap on worker threads for the scatter fill.
Bool_t PLOT_PARITY_REJECTED_GRID
Diagnostic only: when set, run an extra pass over the events (gated by PARITY_ASYM_MAX > 0) that fill...
Bool_t ALT_DECODE_REGION_TRACES
Also render the selected region traces under the OTHER decode (long-side-only <-> L+R sum) from the s...
PureBeamGate PURE_BEAM_GATE
Double_t REQUIRE_SMOOTHNESS_MAX_STEP
Double_t PILEUP_THRESHOLD
Bool_t REQUIRE_BEAM_UPSTREAM_OF_REAC
Tolerance in sigma of each strip's measured beam spread (StripSumScatter::StripSigma).
Double_t AN_REGION_NSIGMA
compute-regions: the (a,n) region is the reaction component's AN_REGION_NSIGMA Mahalanobis ellipse fr...
Bool_t REQUIRE_GATE_S3_S4
Bool_t REQUIRE_GATE_S5_S6
Double_t BEAM_UPSTREAM_NSIGMA
Int_t REQUIRE_SMOOTHNESS_END_STRIP
Bool_t REQUIRE_SMOOTHNESS
Int_t CANDIDATE_REAC_STRIP
Double_t AA_REGION_NSIGMA
Double_t PILEUP_THRESH_PY
Int_t BOTH_MULT_MAX
Both-ends multiplicity cut: reject an event when more than MAX strips in 1..COUNT_TO had BOTH ends fi...
Bool_t REGION_CUT_REDRAW
Redraw the regions for this reaction strip even if saved ones exist, and overwrite only that strip's ...
Double_t TRIGGER_CFD_FRAC