From 278ca28be1c907a214c96fb1f72bc782d24ce285 Mon Sep 17 00:00:00 2001 From: Finn Feindt Date: Thu, 19 May 2022 15:29:21 +0200 Subject: [PATCH 1/2] EUDAQ2: Added option to force sync by trigger ID's, even if time stamps are given. --- src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp | 4 +++- src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.h | 1 + src/modules/EventLoaderEUDAQ2/README.md | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp index 952550f5..cea48e87 100644 --- a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp +++ b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp @@ -24,6 +24,7 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration& config, std::shared_ptr("get_tag_profiles", false); config_.setDefault("ignore_bore", true); config_.setDefault("veto_triggers", false); + config_.setDefault("sync_by_trigger", false); config_.setDefault("skip_time", 0.); config_.setDefault("buffer_depth", 0); config_.setDefault("shift_triggers", 0); @@ -42,6 +43,7 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration& config, std::shared_ptr("buffer_depth"); shift_triggers_ = config_.get("shift_triggers"); inclusive_ = config_.get("inclusive"); + sync_by_trigger_ = config_.get("sync_by_trigger"); // Set EUDAQ log level to desired value: EUDAQ_LOG_LEVEL(config_.get("eudaq_loglevel")); @@ -311,7 +313,7 @@ Event::Position EventLoaderEUDAQ2::is_within_event(const std::shared_ptr(static_cast(evt->GetTriggerN()) + shift_triggers_); // Check if this event has timestamps available: - if(evt->GetTimeBegin() == 0 && evt->GetTimeEnd() == 0) { + if(evt->GetTimeBegin() == 0 && evt->GetTimeEnd() == 0 || sync_by_trigger_) { LOG(DEBUG) << evt->GetDescription() << ": Event has no timestamp, comparing trigger IDs"; // If there is no event defined yet, there is little we can do: diff --git a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.h b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.h index d98b4c37..245449a7 100644 --- a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.h +++ b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.h @@ -112,6 +112,7 @@ namespace corryvreckan { bool ignore_bore_{}; bool veto_triggers_{}; bool inclusive_{}; + bool sync_by_trigger_{}; double skip_time_{}; Matrix adjust_event_times_; int buffer_depth_; diff --git a/src/modules/EventLoaderEUDAQ2/README.md b/src/modules/EventLoaderEUDAQ2/README.md index 0755abe1..a42fcaaa 100644 --- a/src/modules/EventLoaderEUDAQ2/README.md +++ b/src/modules/EventLoaderEUDAQ2/README.md @@ -96,6 +96,7 @@ In addition, the calibration file of the detector specified in the geometry conf * `buffer_depth`: Depth of buffer in which EUDAQ2 `StandardEvents` are timesorted. This algorithm only works for `StandardEvents` with well-defined timestamps. Setting it to `0` disables timesorting. Default is `0`. * `shift_triggers`: Shift trigger ID of this device with respect to the IDs stored in the Corryrveckan Event. This allows to correct trigger ID offsets between different devices such as the TLU and MIMOSA26. Note that if using the module `EventDefinitionM26` the same value for `shift_triggers` needs to be passed in both cases. Defaults to `0`. * `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 verbosity can only be changed globally, i.e. when using multiple instances of `EventLoaderEUDAQ2`, the last occurrence will determine the (global) value of this parameter. +* `sync_by_trigger`: Forces synchronization by trigger number, even if the events come with a time frame. ### Plots produced -- GitLab From 963036177f1256abad8cc323193b0d181f808bf2 Mon Sep 17 00:00:00 2001 From: Finn Feindt Date: Thu, 19 May 2022 15:50:57 +0200 Subject: [PATCH 2/2] Fixed compiler warning. --- src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp index cea48e87..ed9b9a0d 100644 --- a/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp +++ b/src/modules/EventLoaderEUDAQ2/EventLoaderEUDAQ2.cpp @@ -313,7 +313,7 @@ Event::Position EventLoaderEUDAQ2::is_within_event(const std::shared_ptr(static_cast(evt->GetTriggerN()) + shift_triggers_); // Check if this event has timestamps available: - if(evt->GetTimeBegin() == 0 && evt->GetTimeEnd() == 0 || sync_by_trigger_) { + if((evt->GetTimeBegin() == 0 && evt->GetTimeEnd() == 0) || sync_by_trigger_) { LOG(DEBUG) << evt->GetDescription() << ": Event has no timestamp, comparing trigger IDs"; // If there is no event defined yet, there is little we can do: -- GitLab