19 auto detector = config[
"detector"];
20 if (!detector)
throw std::runtime_error(
"trigger detector is not specified");
23 throw std::runtime_error(
"DigiTriggerConfig: invalid trigger detector " + detector.as<std::string>());
26 auto window = config[
"window"];
27 if (!window)
throw std::runtime_error(
"trigger window is not specified");
30 auto threshold = config[
"threshold"];
31 if (!threshold)
throw std::runtime_error(
"trigger threshold is not specified");
34 auto deadTime = config[
"deadtime"];
35 if (!deadTime)
throw std::runtime_error(
"trigger dead time is not specified");
DigiTriggerConfig(ECbmModuleId detector, double window, size_t threshold, double deadTime)
Constructor with parameters.
double fDeadTime
Minimal time between two trigger [ns].
bool fIsSet
Flag config being properly set.
YAML::Node ToYaml() const
Save to YAML.
ECbmModuleId fDetector
Trigger detector.
size_t fThreshold
Minimum number if digis in trigger window.
double fWindow
Trigger window size [ns].
std::optional< T > FromString(std::string_view str, bool caseSensitive=false)
std::string_view ToString(T t)