|
epic-drich-beam-test-analysis
ePIC dRICH beam test analysis framework
|
Header-only trigger definitions, registry, and TOML-based configuration reader. More...
#include <string>#include <vector>#include <cstdint>#include <iostream>#include <toml++/toml.h>#include "TH2.h"Go to the source code of this file.
Classes | |
| struct | trigger_event |
| Per-event trigger data attached to a decoded data frame. More... | |
| struct | trigger_config |
| Static configuration for a single trigger channel, loaded from TOML. More... | |
| struct | trigger_registry |
| Runtime lookup table that maps trigger values to names and positions. More... | |
Enumerations | |
| enum | trigger_number : uint8_t { _TRIGGER_FIRST_FRAMES_ = 100 , _TRIGGER_TIMING_ = 101 , _TRIGGER_TRACKING_ = 102 , _TRIGGER_RING_FOUND_ = 103 , _TRIGGER_STREAMING_RING_FOUND_ = 104 , _TRIGGER_HOUGH_RING_FOUND_ = 105 , _TRIGGER_START_OF_SPILL_ = 200 , _TRIGGER_UNKNOWN_ = 255 } |
| Enumeration of known hardware trigger types. More... | |
Functions | |
| constexpr int | default_trigger_index (trigger_number t) |
| Returns the index of a trigger in the default table at compile time. | |
| std::vector< trigger_config > | trigger_conf_reader (const std::string &config_file="Data/triggers.toml") |
| Reads trigger configuration from a TOML file. | |
Header-only trigger definitions, registry, and TOML-based configuration reader.
Provides:
toml.hpp must be on the include path.TH2.h for histogram axis labelling in trigger_registry::label_axes. | enum trigger_number : uint8_t |
Enumeration of known hardware trigger types.
Values in the 100–199 range are physics/DAQ triggers; 200+ are spill-level signals; 255 is the catch-all unknown.
Config-defined triggers must use indices in [0, 99] — this range is intentionally left out of the enum and managed at runtime.
|
constexpr |
Returns the index of a trigger in the default table at compile time.
| t | Trigger enum value to look up. |
|
inline |
Reads trigger configuration from a TOML file.
Parses an array of [[trigger]] tables. Each table must contain:
| Key | Type | Description |
|---|---|---|
| name | string | Human-readable trigger label |
| index | integer | Trigger index in data stream |
| device | integer | Source hardware device ID |
| delay | integer | Trigger delay (DAQ units) |
Entries missing any required key are skipped with a warning. If the file cannot be opened or parsed, an empty vector is returned.
Config-defined triggers must use indices in [0, 99] — the range [100, 255] is reserved for the built-in trigger_number defaults.
| config_file | Path to the TOML configuration file. |