Commit a384643b authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Merge branch 'allow_trigger_shift' into 'master'

Allow trigger ID shift

See merge request !179
parents 7e95b788 fd6fb654
Pipeline #1123558 passed with stages
in 17 minutes and 26 seconds
......@@ -22,7 +22,7 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration config, std::shared_ptr<Detec
m_skip_time = m_config.get("skip_time", 0.);
m_adjust_event_times = m_config.getMatrix<std::string>("adjust_event_times", {});
m_buffer_depth = m_config.get<int>("buffer_depth", 0);
m_shift_triggers = m_config.get<int>("shift_triggers", 0);
m_inclusive = m_config.get("inclusive", true);
// Forward all settings to EUDAQ
......@@ -295,8 +295,10 @@ Event::Position EventLoaderEUDAQ2::is_within_event(std::shared_ptr<Clipboard> cl
} else {
// check if event has valid trigger ID (flag = 0x10):
if(evt->IsFlagTrigger()) {
// Potentially shift the trigger IDs if requested
auto trigger_id = static_cast<uint32_t>(static_cast<int>(evt->GetTriggerN()) + m_shift_triggers);
// Store potential trigger numbers, assign to center of event:
clipboard->getEvent()->addTrigger(evt->GetTriggerN(), event_timestamp);
clipboard->getEvent()->addTrigger(trigger_id, event_timestamp);
LOG(DEBUG) << "Stored trigger ID " << evt->GetTriggerN() << " at "
<< Units::display(event_timestamp, {"us", "ns"});
......@@ -110,6 +110,7 @@ namespace corryvreckan {
double m_skip_time{};
Matrix<std::string> m_adjust_event_times;
int m_buffer_depth;
int m_shift_triggers;
size_t m_hits = 0;
......@@ -76,6 +76,7 @@ Also, more complex constructs such as arrays or matrices read by the Corryvrecka
* `ignore_bore`: Boolean to completely ignore the Begin-of-Run event from EUDAQ2. Default value is `true`.
* `adjust_event_times`: Matrix that allows the user to shift the event start/end of all different types of EUDAQ events before comparison to any other Corryvreckan data. The first entry of each row specifies the data type, the second is the offset which is added to the event start and the third entry is the offset added to the event end. A usage example is shown below, double brackets are required if only one entry is provided.
* `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 the trigger ID up or down when assigning it to the Corryvreckan event. This allows to correct trigger ID offsets between different devices such as the TLU and MIMOSA26.
### Plots produced
* 2D hitmap
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