Commit 82ee547b authored by Jens Kroeger's avatar Jens Kroeger
Browse files

EventDefinitionM26: add parameter skip_time like in other EventLoaders

parent 4325a2fe
......@@ -19,6 +19,7 @@ EventDefinitionM26::EventDefinitionM26(Configuration& config, std::vector<std::s
config_.setDefault<int>("shift_triggers", 0);
config_.setDefault<std::string>("eudaq_loglevel", "ERROR");
config_.setDefault<double>("response_time_m26", Units::get<double>(0, "us"));
config_.setDefault<double>("skip_time", 0.);
detector_time_ = config_.get<std::string>("detector_event_time");
detector_duration_ = config_.get<std::string>("detector_event_duration");
......@@ -27,6 +28,8 @@ EventDefinitionM26::EventDefinitionM26(Configuration& config, std::vector<std::s
timeshift_ = config_.get<double>("time_shift");
shift_triggers_ = config_.get<int>("shift_triggers");
response_time_m26_ = config_.get<double>("response_time_m26");
skip_time_ = config_.get<double>("skip_time");
config_.setDefault<std::string>("eudaq_loglevel", "ERROR");
// Set EUDAQ log level to desired value:
......@@ -167,6 +170,13 @@ StatusCode EventDefinitionM26::run(const std::shared_ptr<Clipboard>& clipboard)
timebetweenMimosaEvents_->Fill(static_cast<double>(Units::convert(time_trig - time_prev_, "us")));
long double evtStart = time_trig - time_before_;
long double evtEnd = time_trig + time_after_;
if(evtStart < skip_time_) {
LOG(ERROR) << "Event start before requested skip time: " << Units::display(evtStart, {"us", "ns"})
<< " < " << Units::display(skip_time_, {"us", "ns"});
continue;
}
LOG(DEBUG) << "time to previous trigger = " << Units::display(time_trig - time_prev_, "us");
time_prev_ = time_trig;
LOG(DEBUG) << "before/after/duration = " << Units::display(time_before_, "us") << ", "
......
......@@ -53,6 +53,7 @@ namespace corryvreckan {
long double timeshift_{};
int shift_triggers_{};
double response_time_m26_{};
double skip_time_{};
// EUDAQ2 readers for all required files
eudaq::FileReaderUP readerTime_;
......
......@@ -27,6 +27,8 @@ end = begin + 230us
* `file_duration`: Data file containing the `detector_event_duration` data
* `time_shift`: Optional shift of the event begin/end point. Defaults to `0`
* `shift_triggers`: Shift the trigger ID of the `detector_event_time`. Defaults to `0`
* `response_time_m26`: SYSYSYDShdsjkasdkjfsadjfjdfsd;lfjklasdjf;asdjf;odjfkjn
* `skip_time`: Time that can be skipped at the start of a run. All events with earlier timestamps are discarded. Default is `0ms`.
* `eudaq_loglevel`: Verbosity level of the EUDAQ logger instance of the converter module. Possible options are, in decreasing severity, `USER`, `ERROR`, `WARN`, `INFO`, `EXTRA` and `DEBUG`. The default level is `ERROR`. Please note that the EUDAQ verbosity can only be changed globally, i.e. when using instances of `EventLoaderEUDAQ2` below this module, the last occurrence will determine the (global) value of this parameter.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment