21#include <unordered_map>
29#include <toml++/toml.h>
36static const std::set<std::string> lightdata_core_tags = {
"timing",
"tracking",
"cherenkov"};
115 bool has_name(
const std::string &name)
const;
147 const std::map<std::string, readout_config_struct> &readout_config_utility,
161std::vector<readout_config_struct>
readout_config_reader(std::string config_file =
"conf/readout_config.toml");
260 static const std::optional<run_info_struct>
get_run_info(
const std::string &run_id);
283 static const std::optional<std::vector<std::string>>
get_run_list(
const std::string &runlist_name);
292 static std::unordered_map<std::string, run_info_struct> run_info_database;
293 static std::unordered_map<std::string, std::vector<std::string>> run_list_database;
Searchable container of readout_config_struct entries.
Definition config_reader.h:85
bool has_timing()
true if a "timing" role is present.
Definition config_reader.cxx:77
std::vector< std::string > find_by_device_and_chip(uint16_t device, uint16_t chip)
Names of all configs that contain the (device, chip) pair.
Definition config_reader.cxx:53
readout_config_struct * find_by_device(uint16_t device)
First config that contains device, or nullptr.
Definition config_reader.cxx:36
bool has_tracking()
true if a "tracking" role is present.
Definition config_reader.cxx:78
std::vector< readout_config_struct * > find_all_by_device(uint16_t device)
All configs that contain device.
Definition config_reader.cxx:44
readout_config_struct * find_by_name(const std::string &name)
First config whose name matches name, or nullptr.
Definition config_reader.cxx:28
bool has_name(const std::string &name) const
true if any config has name equal to name.
Definition config_reader.cxx:69
bool has_cherenkov()
true if a "cherenkov" role is present.
Definition config_reader.cxx:76
std::vector< readout_config_struct > configs
Ordered list of readout role assignments.
Definition config_reader.h:132
Static database of run metadata and named run lists.
Definition config_reader.h:236
static const std::optional< std::vector< std::string > > get_run_list(const std::string &runlist_name)
Retrieve the ordered run-ID list for runlist_name.
Definition config_reader.cxx:342
static void clear_database()
Clear all entries from the run-info database.
Definition config_reader.h:253
static const std::optional< run_info_struct > get_run_info(const std::string &run_id)
Retrieve the metadata record for run_id.
Definition config_reader.cxx:301
static void read_runslists(std::string runlist_file)
Parse a TOML run-list file and populate the internal list map.
Definition config_reader.cxx:307
static void read_database(std::string filename)
Parse a TOML run-database file and populate the internal map.
Definition config_reader.cxx:214
std::vector< std::string > find_by_device_and_chip(const std::map< std::string, readout_config_struct > &readout_config_utility, uint16_t device, uint16_t chip)
Names of all configs in readout_config_utility containing (device, chip).
Definition config_reader.cxx:82
std::vector< readout_config_struct > readout_config_reader(std::string config_file="conf/readout_config.toml")
Parse a TOML readout configuration file and return the role list.
Definition config_reader.cxx:102
Optical radiator properties for one radiator layer.
Definition config_reader.h:169
std::string side
Detector side ("left" / "right").
Definition config_reader.h:174
double refindex
Refractive index at the nominal beam energy.
Definition config_reader.h:172
std::string tag
Short label used in histogram naming.
Definition config_reader.h:171
double depth
Radiator depth along the beam axis [cm].
Definition config_reader.h:173
std::string type
Radiator material identifier (e.g. "aerogel").
Definition config_reader.h:170
Associates a named readout role with a set of (device, chip) pairs.
Definition config_reader.h:49
void add_device_chip(uint16_t device, uint16_t chip)
Register a single (device, chip) pair.
Definition config_reader.cxx:8
std::map< uint16_t, std::vector< uint16_t > > device_chip
Active chips per device.
Definition config_reader.h:51
std::string name
Human-readable role name (e.g. "cherenkov").
Definition config_reader.h:50
void add_device(uint16_t device)
Register all 8 chips of a device.
Definition config_reader.cxx:15
Complete per-run metadata record.
Definition config_reader.h:184
int beam_energy
Nominal beam momentum [GeV/c].
Definition config_reader.h:189
double temperature
SiPM temperature during the run [°C].
Definition config_reader.h:206
std::string rdo_firmware
RDO firmware version string.
Definition config_reader.h:195
std::string beam_polarity
Beam particle sign ("+" or "-").
Definition config_reader.h:188
bool timing_on_axis
true if the timing channel is on the beam axis.
Definition config_reader.h:198
int aerogel_mirror
Aerogel mirror configuration index.
Definition config_reader.h:213
int gas_mirror
Gas radiator mirror configuration index.
Definition config_reader.h:214
std::vector< radiator_info_struct > radiators
Ordered list of active radiator layers.
Definition config_reader.h:220
int op_mode
ALCOR operational mode index.
Definition config_reader.h:199
double v_bias
SiPM bias voltage [V].
Definition config_reader.h:207
std::string timing_firmware
Timing board firmware version string.
Definition config_reader.h:196
int delta_thr
ALCOR Δ-threshold setting [LSB].
Definition config_reader.h:200
int n_spills
Number of spills in the run.
Definition config_reader.h:197
General-purpose utilities, fitting functions, and ALCOR address decoders.