Commit 00d47552 authored by Jens Kroeger's avatar Jens Kroeger
Browse files

Merge branch 'eudaq_configuration' into 'master'

Allow Configuration of EUDAQ2 Converters

See merge request !118
parents 8c3e0f49 11724348
Pipeline #951471 passed with stages
in 16 minutes and 10 seconds
......@@ -18,6 +18,20 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration config, std::shared_ptr<Detec
m_filename = m_config.getPath("file_name", true);
m_skip_time = m_config.get("skip_time", 0.);
adjust_event_times = m_config.getMatrix<std::string>("adjust_event_times", {});
// Forward all settings to EUDAQ
// WARNING: the EUDAQ Configuration class is not very flexible and e.g. booleans have to be passed as 1 and 0.
eudaq::Configuration cfg;
auto configs = m_config.getAll();
for(const auto& key : configs) {
LOG(DEBUG) << "Forwarding key \"" << key.first << " = " << key.second << "\" to EUDAQ converter";
cfg.Set(key.first, key.second);
// Converting the newly built configuration to a shared pointer of a cont configuration object
// Unfortunbately EUDAQ does not provide appropriate member functions for their configuration class to avoid this dance
const eudaq::Configuration eu_cfg = cfg;
eudaq_config_ = std::make_shared<const eudaq::Configuration>(eu_cfg);
void EventLoaderEUDAQ2::initialise() {
......@@ -99,8 +113,8 @@ std::shared_ptr<eudaq::StandardEvent> EventLoaderEUDAQ2::get_next_event() {
auto event = events_.front();
decoding_failed = !eudaq::StdEventConverter::Convert(event, stdevt, nullptr);
LOG(DEBUG) << event->GetDescription() << ": Decoding " << (decoding_failed ? "failed" : "succeeded");
decoding_failed = !eudaq::StdEventConverter::Convert(event, stdevt, eudaq_config_);
LOG(DEBUG) << event->GetDescription() << ": EventConverter returned " << (decoding_failed ? "false" : "true");
} while(decoding_failed);
return stdevt;
......@@ -91,6 +91,9 @@ namespace corryvreckan {
// Currently processed decoded EUDAQ StandardEvent:
std::shared_ptr<eudaq::StandardEvent> event_;
// EUDAQ configuration to be passed to the decoder instance
eudaq::ConfigurationSPC eudaq_config_;
// 2D histograms
TH2F* hitmap;
# EventLoaderEUDAQ2
**Maintainer**: Jens Kroeger (<>), Simon Spannagel (<>)
**Module Type**: *DETECTOR*
**Maintainer**: Jens Kroeger (<>), Simon Spannagel (<>)
**Module Type**: *DETECTOR*
**Status**: under development
### Description
......@@ -42,6 +42,14 @@ The decoder promises to
* return the smallest possible granularity of data in time either as even or as sub-events within one event.
* always return valid event time stamps. If the device does not have timestamps, it should return zero for the beginning of the event and have a valid trigger number set.
### Configuring EUDAQ2 Event Converters
Some data formats depend on external configuration parameters for interpretation.
The EventLoaderEUDAQ2 takes all key-value pairs available in the configuration and forwards them to the appropriate StandardEvent converter on the EUDAQ side.
It should be kept in mind that the resulting configuration strings are parsed by EUDAQ2, not by Corryvreckan, and that therefore the functionality is reduced.
For example, it does not interpret `true` or `false` alphabetic value of a Boolean variable but will return false in both cases. Thus. `key = 0` or `key = 1` have to be used in these cases.
Also, more complex constructs such as arrays or matrices read by the Corryvreckan configuration are simply interpreted as strings.
### Parameters
* `file_name`: File name of the EUDAQ2 raw data file. This parameter is mandatory.
* `skip_time`: Time that can be skipped at the start of a run. Default is `0ms`.
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