Commit 085f090d authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ELEUDAQ2: allow to skip ahead

parent 1672706e
Pipeline #824061 passed with stages
in 19 minutes and 6 seconds
......@@ -16,6 +16,7 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration config, std::shared_ptr<Detec
: Module(std::move(config), detector), m_detector(detector) {
m_filename = m_config.getPath("file_name", true);
m_skip_time = m_config.get("skip_time", 0.);
}
void EventLoaderEUDAQ2::initialise() {
......@@ -89,6 +90,13 @@ EventLoaderEUDAQ2::EventPosition EventLoaderEUDAQ2::is_within_event(std::shared_
double event_start = evt->GetTimeBegin();
double event_end = evt->GetTimeEnd();
// Skip if later start is requested:
if(event_start < m_skip_time) {
LOG(DEBUG) << "Event start before requested skip time: " << Units::display(event_start, {"us", "ns"}) << " < "
<< Units::display(m_skip_time, {"us", "ns"});
return EventPosition::BEFORE;
}
if(!clipboard->event_defined()) {
LOG(DEBUG) << "Defining Corryvreckan event: " << Units::display(event_start, {"us", "ns"}) << " - "
<< Units::display(event_end, {"us", "ns"}) << ", length "
......
......@@ -81,6 +81,7 @@ namespace corryvreckan {
std::shared_ptr<Detector> m_detector;
std::string m_filename{};
double m_skip_time{};
// EUDAQ file reader instance to retrieve data from
eudaq::FileReaderUP reader_;
......
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