37 "# enhanced accuracy",
44 "# width fluctuation correction",
47 "# pre-equilibrium off",
49 "# equidistant excitation-energy binning, enhanced segments",
239static const RunEpoch *gActiveEpoch =
nullptr;
247 for (Int_t e = 0; e < Int_t(
cfg.EPOCHS.size()); e++) {
251 for (Int_t r = 0; r < Int_t(ep.
runs.size()); r++)
252 if (ep.
runs[r] == run)
266 !
cfg.channelMap64.empty() ?
cfg.channelMap64 :
cfg.channelMap;
270 std::cerr <<
"FATAL: MakeEpoch(\"" << name
271 <<
"\") called before the channel map was set; declare epochs "
272 "at the end of InitDatasetConfig."
276 for (std::map<std::pair<Int_t, Int_t>, TString>::const_iterator it =
280 std::cerr <<
"FATAL: MakeEpoch(\"" << name <<
"\"): channel map entry ("
281 << it->first.first <<
", " << it->first.second
282 <<
") lies outside N_BOARDS x N_CHANNELS = " << ep.
n_boards
284 <<
"; set those before declaring the epoch." << std::endl;
315std::vector<Int_t>
RunRange(Int_t first, Int_t last) {
316 std::vector<Int_t> runs;
317 for (Int_t r = first; r <= last; r++)
325static const std::vector<Int_t> &EpochUnionRuns() {
326 static std::vector<Int_t> runs;
327 static Bool_t built = kFALSE;
332 for (Int_t w = 0; w < Int_t(want.size()); w++) {
333 Bool_t found = kFALSE;
334 for (Int_t e = 0; e < Int_t(
cfg.
EPOCHS.size()) && !found; e++)
337 std::cerr <<
"WARNING: CROSS_SECTION_CONFIG.EPOCHS names \"" << want[w]
338 <<
"\" but no such epoch is declared." << std::endl;
340 for (Int_t e = 0; e < Int_t(
cfg.EPOCHS.size()); e++) {
341 const RunEpoch &ep =
cfg.EPOCHS[e];
344 Bool_t wanted = want.empty();
345 for (Int_t w = 0; w < Int_t(want.size()) && !wanted; w++)
346 wanted = ep.
name == want[w];
348 runs.insert(runs.end(), ep.
runs.begin(), ep.
runs.end());
354 return gActiveEpoch ? gActiveEpoch->n_boards :
cfg.N_BOARDS;
357 return gActiveEpoch ? gActiveEpoch->n_channels :
cfg.N_CHANNELS;
360 return gActiveEpoch ? gActiveEpoch->timing_ref_board :
cfg.TIMING_REF_BOARD;
363 return gActiveEpoch ? gActiveEpoch->timing_ref_board_channels
364 :
cfg.TIMING_REF_BOARD_CHANNELS;
367 return gActiveEpoch ? gActiveEpoch->do_board_sync :
cfg.TIMING_DO_BOARD_SYNC;
370 return gActiveEpoch ? gActiveEpoch->do_sort :
cfg.TIMING_DO_SORT;
373 return gActiveEpoch ? gActiveEpoch->has_cathode :
cfg.HAS_CATHODE;
376 return gActiveEpoch ? (gActiveEpoch->source ==
kSOLARIS)
377 :
cfg.USE_SOLARIS_DATA;
380 return gActiveEpoch ? gActiveEpoch->event_time_window_us
381 :
cfg.EVENT_TIME_WINDOW_US;
384 return gActiveEpoch ? gActiveEpoch->seed_holdoff_us :
cfg.SEED_HOLDOFF_US;
387 return gActiveEpoch ? gActiveEpoch->seed_holdoff_max_ratio
388 :
cfg.SEED_HOLDOFF_MAX_RATIO;
391 return gActiveEpoch ? gActiveEpoch->reference_channel :
cfg.REFERENCE_CHANNEL;
394 return gActiveEpoch ? gActiveEpoch->reference_channel_min_adc
395 :
cfg.REFERENCE_CHANNEL_MIN_ADC;
398 return gActiveEpoch ? gActiveEpoch->reference_channel_max_adc
399 :
cfg.REFERENCE_CHANNEL_MAX_ADC;
402 return gActiveEpoch ? gActiveEpoch->dedup_strategy :
cfg.DEDUP_STRATEGY;
405 return gActiveEpoch ? gActiveEpoch->strip_e_min_adc :
cfg.STRIP_E_MIN_ADC;
408 return gActiveEpoch ? gActiveEpoch->strip_e_max_adc :
cfg.STRIP_E_MAX_ADC;
411 return gActiveEpoch ? gActiveEpoch->cathode_max_adc :
cfg.CATHODE_MAX_ADC;
414 return gActiveEpoch ? gActiveEpoch->grid_max_adc :
cfg.GRID_MAX_ADC;
417 return gActiveEpoch ? gActiveEpoch->strip0_max_adc :
cfg.STRIP0_MAX_ADC;
420 return gActiveEpoch ? gActiveEpoch->strip17_max_adc :
cfg.STRIP17_MAX_ADC;
423 return gActiveEpoch ? gActiveEpoch->left_even_max_adc :
cfg.LEFT_EVEN_MAX_ADC;
426 return gActiveEpoch ? gActiveEpoch->left_odd_max_adc :
cfg.LEFT_ODD_MAX_ADC;
429 return gActiveEpoch ? gActiveEpoch->right_even_max_adc
430 :
cfg.RIGHT_EVEN_MAX_ADC;
433 return gActiveEpoch ? gActiveEpoch->right_odd_max_adc :
cfg.RIGHT_ODD_MAX_ADC;
438 return gActiveEpoch->runs;
439 if (
cfg.RUN_NUMBERS.empty() && !
cfg.EPOCHS.empty())
440 return EpochUnionRuns();
441 return cfg.RUN_NUMBERS;
444 static const TString kNone =
"";
445 return gActiveEpoch ? gActiveEpoch->file_tag : kNone;
449 return gActiveEpoch ? gActiveEpoch->split_chunk_seconds
450 :
cfg.SOL_SPLIT_CHUNK_SECONDS;
453 return gActiveEpoch ? gActiveEpoch->pulse_history :
cfg.PULSE_HISTORY_GROUPS;
456static const RunEpoch *AnalysisEpoch() {
460 for (Int_t e = 0; e < Int_t(
cfg.
EPOCHS.size()); e++) {
462 Bool_t take = kFALSE;
466 for (Int_t w = 0; w < Int_t(want.size()) && !take; w++)
467 take = ep.
name == want[w];
473 return n == 1 ? found :
nullptr;
477 const RunEpoch *ep = AnalysisEpoch();
481 std::cout <<
"epoch " << ep->
name <<
" ("
483 << ep->
runs.size() <<
" run(s)"
490 return gActiveEpoch->ignore_short_strips;
491 if (
const RunEpoch *ep = AnalysisEpoch())
493 return cfg.IGNORE_SHORT_STRIPS;
499thread_local Bool_t t_plot_sample = kFALSE;
506std::ostream &NullStream() {
507 static thread_local std::ostream null(
nullptr);
514 return cfg.SAVE_FULL_PLOTS || k <
cfg.PLOT_SAMPLE_FILES;
519 if (gActiveEpoch && !gActiveEpoch->channel_map.empty())
520 return gActiveEpoch->channel_map;
521 if (!
cfg.channelMap64.empty())
522 return cfg.channelMap64;
523 if (!
cfg.channelMap.empty())
524 return cfg.channelMap;
525 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.
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 fit; the one above is used on stri...
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...
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.
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 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...
Int_t N_BOARDS
Hardware layout.
StripSumScatterConfig STRIP_SUM_SCATTER_CONFIG
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
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,...
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 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).
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
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
CrossSectionConfig CROSS_SECTION_CONFIG
Int_t MAX_GPU_CONCURRENT_SORTS
Bool_t IGNORE_SHORT_STRIPS
Decode the long end only, dropping every short end.
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.
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...
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.
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.
Double_t seed_holdoff_max_ratio
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.
Bool_t ignore_short_strips
Decode the long end only (L on odd strips, R on even), dropping the short end from every strip total.
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.
Double_t split_chunk_seconds
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".
Double_t seed_holdoff_us
Seed holdoff and the pre-trigger size ratio; see SEED_HOLDOFF_US.
Int_t n_boards
Boards in this era's setup.
TString reference_channel
Channel whose hits seed events, e.g. "Grid".
PulseHistoryGroups pulse_history
The pulse-history groups in force for this epoch's hits: which chains are corrected,...
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
Bool_t PLOT_ADC_TRACES
Also draw the trace overlays in raw ADC (the *_adc figures) next to the calibrated ones,...
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 ...
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_WINDOW_LAST_STRIP
Int_t POST_TRIGGER_SUM_STRIPS
Number of strips summed onto the scatter y-axis after the trigger strip: y spans reac+1 .
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...
@ TAG_RESOLVE_FIRST_STRIP
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.
PureBeamGate PURE_BEAM_GATE
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 TAIL_RERISE_NSIGMA
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
Int_t CANDIDATE_REAC_STRIP
Double_t AA_REGION_NSIGMA
Bool_t Y_RATIO_TO_UPSTREAM
Normalize the partial dE sum on y axis by the event's own mean deposit over strips 1 .
Int_t BOTH_MULT_MAX
Use the segmentation of strips to reject an event when more than MAX strips in 1.....
Double_t TAIL_RISE_NSIGMA
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 ...