MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches
Constants.cpp
Go to the documentation of this file.
1#include "Constants.hpp"
2
3Int_t TargetGasA(TargetGas gas) {
4 switch (gas) {
5 case kHELIUM:
6 return 4;
7 }
8 return 0;
9}
10
12 switch (gas) {
13 case kHELIUM:
14 return 1.0;
15 }
16 return 0.0;
17}
18
20 // Deliberately not a working experiment: a cross-section dataset must
21 // state its gas and beam; zero pressure makes a forgotten one fail loudly.
25
26 BEAM_A = 0;
27 BEAM_Z = 0;
28 BEAM_ELEMENT = "";
29
30 TALYS_MODELS.clear();
31 // The shared TALYS settings, from the group's 14O(a,p) input; not here:
32 // the energies (per file), alphaomp (per model) and the rate options.
34 "# level density",
35 "ldmodel 1",
36 "maxlevelstar 30",
37 "# enhanced accuracy",
38 "transpower 20",
39 "ecisstep 0.02",
40 "xseps 1.e-30",
41 "transeps 1.e-30",
42 "popeps 1.e-30",
43 "elow 1.e-06",
44 "# width fluctuation correction",
45 "widthfluc 20",
46 "widthmode 1",
47 "# pre-equilibrium off",
48 "preequilibrium n",
49 "# equidistant excitation-energy binning, enhanced segments",
50 "bins 80",
51 "equidistant y",
52 "segment 4",
53 };
54
55 BEAM_SIM_FILE = "";
56
57 XS_STRIP_MIN = 3;
58 XS_STRIP_MAX = 15;
60 EFFECTIVE_ENERGY = kTRUE;
61 PRELIMINARY = kFALSE;
62 EPOCHS.clear();
63
64 CHANNELS.clear();
65}
66
70 PURE_BEAM_NSIGMA = 3.5;
71
75
78
79 SMOOTHNESS_NSIGMA = 2.5; // the 87Rb macros' 1.2/12 at that noise
81 TAIL_RISE_NSIGMA = 0.0;
88 CUT_VARIATION = kTRUE;
89 CUT_VARIATION_NSIGMA_STEP = 3.0; // the resolution, as the 87Rb paper
91 Y_RATIO_TO_UPSTREAM = kTRUE;
92
93 REAC_JUMP_NSIGMA = 1.0;
94 END_STRIP_NSIGMA = 0.0; // below the beam mean
95
96 PILEUP_NSIGMA = 8.0; // ~1.3 at the 87Rb spread, the old absolute value
98 NOISE_NSIGMA = 12.0; // ~0.5 at the 87Rb spread, the old absolute value
100
101 REGION_CUT_REDRAW = kFALSE;
102 AN_REGION_NSIGMA = 2.0;
103 AA_REGION_NSIGMA = 2.0;
107 BOTH_MULT_MAX = -1; // disabled by default
108 BOTH_MULT_COUNT_TO = 16; // whole trace unless narrowed
109
110 SEED_HALF_BINS = 40;
111
112 TRACES_PER_CLASS = 40;
113
114 X_LO = 1;
115 X_HI = 16;
116
117 GATE_STRIP = 1;
118 GATE_NSIGMA = 3.5;
119 GATE_CENTER = 0.0;
120 GATE_MIN = 0.0;
121 GATE_MAX = 3.0;
122 GATE_BINS = 240;
123
124 X_DISPLAY_MIN = 14;
125 X_DISPLAY_MAX = 26;
126 XBINS = 1500;
127 Y_DISPLAY_MIN = 0;
128 Y_DISPLAY_MAX = 20;
129 YBINS = 1500;
130
131 SAMPLE_MAX_POINTS = 2000000;
132
133 RERUN_SIM = kFALSE;
135
136 SKIP_SAVGOL_PLOTS = kFALSE;
138 PLOT_ADC_TRACES = kFALSE;
140}
141
143 // Data source
144 USE_SOLARIS_DATA = kFALSE;
147 N_CHUNKS = -1;
148
149 // Hardware layout
150 N_BOARDS = 4;
151 N_CHANNELS = 16;
153
154 // Timing
156 TIMING_MAX_ENERGY = 16384;
158 TIMING_THRESH_DT_US = 150.0;
165 TIMING_DO_BOARD_SYNC = kFALSE;
166 TIMING_DO_SORT = kFALSE;
167
168 REJECT_FLAGGED_EVENTS = kFALSE;
169
181
182 IGNORE_SHORT_STRIPS = kFALSE;
183 IGNORE_STRIP_0 = kFALSE;
184 IGNORE_STRIP_17 = kFALSE;
185 REQUIRE_STRIP_0 = kTRUE;
186
187 HAS_CATHODE = kTRUE;
188 HAS_GRID = kTRUE;
189 HAS_STRIP0 = kTRUE;
190 HAS_STRIP17 = kTRUE;
191
192 SKIP_EXISTING = kTRUE;
193 SAVE_FULL_PLOTS = kFALSE;
195
197
199
200 REFERENCE_CHANNEL = "Grid";
202 SEED_HOLDOFF_US = 0.0;
205
206 USE_GPU_ACCELERATION = kTRUE;
208
209 BEAM_GATE_NSIGMA = 3.0;
212
213 STRIP_SUM_SCATTER_CONFIG.SetDefaults();
214 CROSS_SECTION_CONFIG.SetDefaults();
215
216 STRIP_E_MIN_ADC = 0.0;
217 STRIP_E_MAX_ADC = 4096.0;
218
219 GRID_MAX_ADC = 16384.0;
220
223
224 STRIP0_MAX_ADC = 16384.0;
225 STRIP17_MAX_ADC = 16384.0;
226 CATHODE_MAX_ADC = 16384.0;
227
228 LEFT_EVEN_MAX_ADC = 16384.0;
229 LEFT_ODD_MAX_ADC = 16384.0;
230 RIGHT_EVEN_MAX_ADC = 16384.0;
231 RIGHT_ODD_MAX_ADC = 16384.0;
232}
233
234namespace Constants {
235
239static const RunEpoch *gActiveEpoch = nullptr;
240
241void SetActiveEpoch(const RunEpoch *epoch) { gActiveEpoch = epoch; }
242const RunEpoch *GetActiveEpoch() { return gActiveEpoch; }
243
244const RunEpoch *EpochForRun(Int_t run) {
245 // Only untagged epochs are addressable by run number; a tagged one's runs
246 // collide with another era's (a bare number is a coin flip), so use its tag.
247 for (Int_t e = 0; e < Int_t(cfg.EPOCHS.size()); e++) {
248 const RunEpoch &ep = cfg.EPOCHS[e];
249 if (ep.file_tag.Length() > 0)
250 continue;
251 for (Int_t r = 0; r < Int_t(ep.runs.size()); r++)
252 if (ep.runs[r] == run)
253 return &ep;
254 }
255 return nullptr;
256}
257
258RunEpoch MakeEpoch(const TString &name, const std::vector<Int_t> &runs) {
259 RunEpoch ep;
260 ep.name = name;
261 ep.runs = runs;
262 ep.source = cfg.USE_SOLARIS_DATA ? kSOLARIS : kCOMPASS;
263 ep.n_boards = cfg.N_BOARDS;
264 ep.n_channels = cfg.N_CHANNELS;
265 ep.channel_map =
266 !cfg.channelMap64.empty() ? cfg.channelMap64 : cfg.channelMap;
267 // An epoch declared before the channel map was set would carry the
268 // tooling defaults and fail far downstream, so refuse it here.
269 if (ep.channel_map.empty()) {
270 std::cerr << "FATAL: MakeEpoch(\"" << name
271 << "\") called before the channel map was set; declare epochs "
272 "at the end of InitDatasetConfig."
273 << std::endl;
274 std::abort();
275 }
276 for (std::map<std::pair<Int_t, Int_t>, TString>::const_iterator it =
277 ep.channel_map.begin();
278 it != ep.channel_map.end(); ++it)
279 if (it->first.first >= ep.n_boards || it->first.second >= ep.n_channels) {
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
283 << " x " << ep.n_channels
284 << "; set those before declaring the epoch." << std::endl;
285 std::abort();
286 }
287 ep.timing_ref_board = cfg.TIMING_REF_BOARD;
288 ep.timing_ref_board_channels = cfg.TIMING_REF_BOARD_CHANNELS;
289 ep.do_board_sync = cfg.TIMING_DO_BOARD_SYNC;
290 ep.do_sort = cfg.TIMING_DO_SORT;
291 ep.event_time_window_us = cfg.EVENT_TIME_WINDOW_US;
292 ep.seed_holdoff_us = cfg.SEED_HOLDOFF_US;
293 ep.seed_holdoff_max_ratio = cfg.SEED_HOLDOFF_MAX_RATIO;
294 ep.reference_channel = cfg.REFERENCE_CHANNEL;
295 ep.reference_channel_min_adc = cfg.REFERENCE_CHANNEL_MIN_ADC;
296 ep.reference_channel_max_adc = cfg.REFERENCE_CHANNEL_MAX_ADC;
297 ep.dedup_strategy = cfg.DEDUP_STRATEGY;
298 ep.has_cathode = cfg.HAS_CATHODE;
299 ep.split_chunk_seconds = cfg.SOL_SPLIT_CHUNK_SECONDS;
300 ep.pulse_history = cfg.PULSE_HISTORY_GROUPS;
301 ep.ignore_short_strips = cfg.IGNORE_SHORT_STRIPS;
302 ep.strip_e_min_adc = cfg.STRIP_E_MIN_ADC;
303 ep.strip_e_max_adc = cfg.STRIP_E_MAX_ADC;
304 ep.cathode_max_adc = cfg.CATHODE_MAX_ADC;
305 ep.grid_max_adc = cfg.GRID_MAX_ADC;
306 ep.strip0_max_adc = cfg.STRIP0_MAX_ADC;
307 ep.strip17_max_adc = cfg.STRIP17_MAX_ADC;
308 ep.left_even_max_adc = cfg.LEFT_EVEN_MAX_ADC;
309 ep.left_odd_max_adc = cfg.LEFT_ODD_MAX_ADC;
310 ep.right_even_max_adc = cfg.RIGHT_EVEN_MAX_ADC;
311 ep.right_odd_max_adc = cfg.RIGHT_ODD_MAX_ADC;
312 return ep;
313}
314
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++)
318 runs.push_back(r);
319 return runs;
320}
321
325static const std::vector<Int_t> &EpochUnionRuns() {
326 static std::vector<Int_t> runs;
327 static Bool_t built = kFALSE;
328 if (built)
329 return runs;
330 built = kTRUE;
331 const std::vector<TString> &want = cfg.CROSS_SECTION_CONFIG.EPOCHS;
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++)
335 found = cfg.EPOCHS[e].name == want[w];
336 if (!found)
337 std::cerr << "WARNING: CROSS_SECTION_CONFIG.EPOCHS names \"" << want[w]
338 << "\" but no such epoch is declared." << std::endl;
339 }
340 for (Int_t e = 0; e < Int_t(cfg.EPOCHS.size()); e++) {
341 const RunEpoch &ep = cfg.EPOCHS[e];
342 if (!ep.enabled)
343 continue;
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];
347 if (wanted)
348 runs.insert(runs.end(), ep.runs.begin(), ep.runs.end());
349 }
350 return runs;
351}
352
354 return gActiveEpoch ? gActiveEpoch->n_boards : cfg.N_BOARDS;
355}
357 return gActiveEpoch ? gActiveEpoch->n_channels : cfg.N_CHANNELS;
358}
360 return gActiveEpoch ? gActiveEpoch->timing_ref_board : cfg.TIMING_REF_BOARD;
361}
362const std::vector<UShort_t> &ActiveTimingRefBoardChannels() {
363 return gActiveEpoch ? gActiveEpoch->timing_ref_board_channels
364 : cfg.TIMING_REF_BOARD_CHANNELS;
365}
367 return gActiveEpoch ? gActiveEpoch->do_board_sync : cfg.TIMING_DO_BOARD_SYNC;
368}
369Bool_t ActiveDoSort() {
370 return gActiveEpoch ? gActiveEpoch->do_sort : cfg.TIMING_DO_SORT;
371}
373 return gActiveEpoch ? gActiveEpoch->has_cathode : cfg.HAS_CATHODE;
374}
376 return gActiveEpoch ? (gActiveEpoch->source == kSOLARIS)
377 : cfg.USE_SOLARIS_DATA;
378}
380 return gActiveEpoch ? gActiveEpoch->event_time_window_us
381 : cfg.EVENT_TIME_WINDOW_US;
382}
384 return gActiveEpoch ? gActiveEpoch->seed_holdoff_us : cfg.SEED_HOLDOFF_US;
385}
387 return gActiveEpoch ? gActiveEpoch->seed_holdoff_max_ratio
388 : cfg.SEED_HOLDOFF_MAX_RATIO;
389}
390const TString &ActiveReferenceChannel() {
391 return gActiveEpoch ? gActiveEpoch->reference_channel : cfg.REFERENCE_CHANNEL;
392}
394 return gActiveEpoch ? gActiveEpoch->reference_channel_min_adc
395 : cfg.REFERENCE_CHANNEL_MIN_ADC;
396}
398 return gActiveEpoch ? gActiveEpoch->reference_channel_max_adc
399 : cfg.REFERENCE_CHANNEL_MAX_ADC;
400}
402 return gActiveEpoch ? gActiveEpoch->dedup_strategy : cfg.DEDUP_STRATEGY;
403}
405 return gActiveEpoch ? gActiveEpoch->strip_e_min_adc : cfg.STRIP_E_MIN_ADC;
406}
408 return gActiveEpoch ? gActiveEpoch->strip_e_max_adc : cfg.STRIP_E_MAX_ADC;
409}
411 return gActiveEpoch ? gActiveEpoch->cathode_max_adc : cfg.CATHODE_MAX_ADC;
412}
414 return gActiveEpoch ? gActiveEpoch->grid_max_adc : cfg.GRID_MAX_ADC;
415}
417 return gActiveEpoch ? gActiveEpoch->strip0_max_adc : cfg.STRIP0_MAX_ADC;
418}
420 return gActiveEpoch ? gActiveEpoch->strip17_max_adc : cfg.STRIP17_MAX_ADC;
421}
423 return gActiveEpoch ? gActiveEpoch->left_even_max_adc : cfg.LEFT_EVEN_MAX_ADC;
424}
426 return gActiveEpoch ? gActiveEpoch->left_odd_max_adc : cfg.LEFT_ODD_MAX_ADC;
427}
429 return gActiveEpoch ? gActiveEpoch->right_even_max_adc
430 : cfg.RIGHT_EVEN_MAX_ADC;
431}
433 return gActiveEpoch ? gActiveEpoch->right_odd_max_adc : cfg.RIGHT_ODD_MAX_ADC;
434}
435
436const std::vector<Int_t> &ActiveRunNumbers() {
437 if (gActiveEpoch)
438 return gActiveEpoch->runs;
439 if (cfg.RUN_NUMBERS.empty() && !cfg.EPOCHS.empty())
440 return EpochUnionRuns();
441 return cfg.RUN_NUMBERS;
442}
443const TString &ActiveFileTag() {
444 static const TString kNone = "";
445 return gActiveEpoch ? gActiveEpoch->file_tag : kNone;
446}
447Int_t ActiveMaxFiles() { return gActiveEpoch ? gActiveEpoch->max_files : -1; }
449 return gActiveEpoch ? gActiveEpoch->split_chunk_seconds
450 : cfg.SOL_SPLIT_CHUNK_SECONDS;
451}
453 return gActiveEpoch ? gActiveEpoch->pulse_history : cfg.PULSE_HISTORY_GROUPS;
454}
455
456static const RunEpoch *AnalysisEpoch() {
457 const std::vector<TString> &want = cfg.CROSS_SECTION_CONFIG.EPOCHS;
458 const RunEpoch *found = nullptr;
459 Int_t n = 0;
460 for (Int_t e = 0; e < Int_t(cfg.EPOCHS.size()); e++) {
461 const RunEpoch &ep = cfg.EPOCHS[e];
462 Bool_t take = kFALSE;
463 if (want.empty())
464 take = ep.enabled;
465 else
466 for (Int_t w = 0; w < Int_t(want.size()) && !take; w++)
467 take = ep.name == want[w];
468 if (take) {
469 found = &ep;
470 n++;
471 }
472 }
473 return n == 1 ? found : nullptr;
474}
475
477 const RunEpoch *ep = AnalysisEpoch();
478 if (!ep)
479 return;
480 SetActiveEpoch(ep);
481 std::cout << "epoch " << ep->name << " ("
482 << (ep->source == kSOLARIS ? "SOLARIS" : "CoMPASS") << ", "
483 << ep->runs.size() << " run(s)"
484 << (ep->file_tag.Length() ? ", files tagged " + ep->file_tag : "")
485 << ")" << std::endl;
486}
487
489 if (gActiveEpoch)
490 return gActiveEpoch->ignore_short_strips;
491 if (const RunEpoch *ep = AnalysisEpoch())
492 return ep->ignore_short_strips;
493 return cfg.IGNORE_SHORT_STRIPS;
494}
495
496// The plot sample is a per-thread mark, set by every file-walking tool
497// before each file, so the stages need no plumbing to know when to draw.
498namespace {
499thread_local Bool_t t_plot_sample = kFALSE;
500}
501Bool_t FileInSample() { return cfg.SAVE_FULL_PLOTS || t_plot_sample; }
502Bool_t SavePlots() { return FileInSample(); }
503namespace {
504// A stream with no buffer discards everything written to it; one per thread
505// so the failed-write state it keeps is never shared.
506std::ostream &NullStream() {
507 static thread_local std::ostream null(nullptr);
508 return null;
509}
510} // namespace
511std::ostream &Detail() { return FileInSample() ? std::cout : NullStream(); }
512std::ostream &DetailErr() { return FileInSample() ? std::cerr : NullStream(); }
513Bool_t InPlotSample(Int_t k) {
514 return cfg.SAVE_FULL_PLOTS || k < cfg.PLOT_SAMPLE_FILES;
515}
516void SetPlotsThisFile(Bool_t on) { t_plot_sample = on; }
517
518const std::map<std::pair<Int_t, Int_t>, TString> &ActiveChannelMap() {
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."
526 << std::endl;
527 std::abort();
528}
529
530} // namespace Constants
Double_t TargetGasAtomsPerMolecule(TargetGas gas)
Atoms of the reacting species per molecule of fill gas.
Definition Constants.cpp:11
Int_t TargetGasA(TargetGas gas)
Mass number of the target nucleus in a fill gas.
Definition Constants.cpp:3
Dataset configuration.
TargetGas
The fill gas the beam reacts in.
@ kHELIUM
Helium fill.
DedupStrategy
How to resolve more than one hit on the same channel within an event.
@ kLARGEST_ENERGY
Keep the highest-energy hit.
@ kSOLARIS
SOLARIS DAQ.
Definition RunEpoch.hpp:16
@ kCOMPASS
CAEN CoMPASS.
Definition RunEpoch.hpp:15
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.
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
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
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 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
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.
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.
Definition RunEpoch.hpp:34
Double_t cathode_max_adc
Cathode full scale.
Definition RunEpoch.hpp:111
std::vector< Int_t > runs
Run numbers belonging to this epoch.
Definition RunEpoch.hpp:48
Bool_t has_cathode
Whether this era instrumented the cathode.
Definition RunEpoch.hpp:80
Double_t seed_holdoff_max_ratio
Definition RunEpoch.hpp:71
UShort_t timing_ref_board
Definition RunEpoch.hpp:62
Double_t right_odd_max_adc
Definition RunEpoch.hpp:118
Bool_t do_sort
Time-sort hits before event building.
Definition RunEpoch.hpp:66
Double_t left_even_max_adc
Left-side ceiling, even strips.
Definition RunEpoch.hpp:115
TString name
Epoch name, used in logs and plot paths.
Definition RunEpoch.hpp:35
Double_t right_even_max_adc
Right-side ceiling, even strips.
Definition RunEpoch.hpp:117
std::vector< UShort_t > timing_ref_board_channels
Channels on the reference board used to align the others against it.
Definition RunEpoch.hpp:64
Double_t grid_max_adc
Grid full scale.
Definition RunEpoch.hpp:112
Double_t strip0_max_adc
Strip 0 full scale.
Definition RunEpoch.hpp:113
Double_t event_time_window_us
Coincidence window, in microseconds, for grouping hits into one event.
Definition RunEpoch.hpp:68
Double_t strip_e_max_adc
Upper bound of the per-strip energy range.
Definition RunEpoch.hpp:110
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.
Definition RunEpoch.hpp:102
TString file_tag
Prefix for this epoch's output files and plot directories.
Definition RunEpoch.hpp:46
Bool_t enabled
Whether this epoch participates in the analysis.
Definition RunEpoch.hpp:37
Double_t strip17_max_adc
Strip 17 full scale.
Definition RunEpoch.hpp:114
Double_t split_chunk_seconds
Definition RunEpoch.hpp:91
DedupStrategy dedup_strategy
How repeated hits on a slot resolve.
Definition RunEpoch.hpp:77
Double_t left_odd_max_adc
Left-side ceiling, odd strips.
Definition RunEpoch.hpp:116
Double_t reference_channel_min_adc
Lower energy gate on the seed channel.
Definition RunEpoch.hpp:74
Bool_t do_board_sync
Run the multi-board timing alignment.
Definition RunEpoch.hpp:65
Double_t strip_e_min_adc
Lower bound of the per-strip energy range.
Definition RunEpoch.hpp:109
std::map< std::pair< Int_t, Int_t >, TString > channel_map
Board and channel to detector-element name, e.g. "Grid", "de_l_03".
Definition RunEpoch.hpp:57
Double_t seed_holdoff_us
Seed holdoff and the pre-trigger size ratio; see SEED_HOLDOFF_US.
Definition RunEpoch.hpp:70
Int_t n_boards
Boards in this era's setup.
Definition RunEpoch.hpp:54
TString reference_channel
Channel whose hits seed events, e.g. "Grid".
Definition RunEpoch.hpp:72
PulseHistoryGroups pulse_history
The pulse-history groups in force for this epoch's hits: which chains are corrected,...
Definition RunEpoch.hpp:96
RunSource source
Acquisition system for this era.
Definition RunEpoch.hpp:36
Double_t reference_channel_max_adc
Upper energy gate on the seed channel.
Definition RunEpoch.hpp:76
Int_t n_channels
Channels per board.
Definition RunEpoch.hpp:55
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 ...
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...
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
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 .
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 ...