Commit 38145c61 authored by Lennart Huth's avatar Lennart Huth
Browse files

Merge branch 'fix_96' into 'master'

Read Calibration File from Geometry

Closes #96

See merge request !261
parents c393df52 a52da343
Pipeline #1498267 failed with stages
in 5 minutes and 48 seconds
......@@ -287,6 +287,7 @@ All supported rotations are extrinsic active rotations, i.e. the vector itself i
\item The intrinsic time resolution of the detector should be specified using the \parameter{time_resolution} parameter with units of time. This can be used to apply detector specific time cuts in modules. This parameter is only required when using relative time cuts in the analysis.
\item The \parameter{time_offset} can be used to shift the reference time frame of an individual detector to e.g.\ account for time of flight effects between different detector planes by adding a fixed offset.
\item The \parameter{material_budget} defines the material budget of the sensor layer in fractions of the radiation length, including support. If no value is defined a default of zero is assumed. A given value has to be larger than zero.
\item The \parameter{calibration_file} parameter can be used to supply an additional file with data relevant for the detector calibration. Since this data and its interpretation is detector-specific, the framework does not open or parse the file but simply provide its path to modules implementing calibration of this specific detector data.
\item Pixels to be masked in the offline analysis can be placed in a separate file specified by the \parameter{mask_file} parameter, which is explained in detail in Section~\ref{sec:masking}.
\item A region of interest in the given detector can be defined using the \parameter{roi} parameter. More details on this functionality can be found in Section~\ref{sec:roi}.
......@@ -113,6 +113,10 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
LOG(TRACE) << " Time resolution: " << Units::display(m_timeResolution, {"ms", "us"});
if(config.has("calibration_file")) {
m_calibrationfile = config.getPath("calibration_file");
if(!isAuxiliary()) {
if(config.has("mask_file")) {
m_maskfile_name = config.get<std::string>("mask_file");
......@@ -177,6 +177,15 @@ namespace corryvreckan {
PositionVector3D<Cartesian3D<double>> normal() const { return m_normal; };
* @brief Get path of the file with calibration information
* @return Path of the calibration file
* @note The data contained in the calibration file is detector-specific and is
* not parsed. This is left to the individual modules decoding the detector data.
std::string calibrationFile() const { return m_calibrationfile; }
* @brief Get path of the file with pixel mask information
* @return Path of the pixel mask file
......@@ -308,6 +317,9 @@ namespace corryvreckan {
PositionVector3D<Cartesian3D<double>> m_normal;
PositionVector3D<Cartesian3D<double>> m_origin;
// Path of calibration file
std::string m_calibrationfile;
// List of masked channels
std::map<int, bool> m_masked;
std::string m_maskfile;
......@@ -26,16 +26,26 @@ EventLoaderEUDAQ2::EventLoaderEUDAQ2(Configuration config, std::shared_ptr<Detec
m_shift_triggers = m_config.get<int>("shift_triggers", 0);
m_inclusive = m_config.get("inclusive", true);
// Prepare EUDAQ2 config object
eudaq::Configuration cfg;
// Provide the calibration file specified in the detector geometry:
// NOTE: This should go first to allow overwriting the calibration_file key in the module config
auto calibration_file = m_detector->calibrationFile();
if(!calibration_file.empty()) {
LOG(DEBUG) << "Forwarding detector calibration file: " << calibration_file;
cfg.Set("calibration_file", calibration_file);
// 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
// Converting the newly built configuration to a shared pointer of a const 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);
......@@ -58,6 +58,7 @@ cmake -DUSER_CARIBOU_BUILD=ON ..
### Contract between EUDAQ Decoder and EventLoader
The decoder guarantees to
* return `true` only when there is a fully decoded event available and `false` in all other cases.
* not return any event before a possible T0 signal in the data. This is a signal that indicates the clock reset at the beginning of the run. It can be a particular data word or the observation of the pixel timestamp jumping back to zero, depending on data format of each the detector.
* return the smallest possible granularity of data in time either as even or as sub-events within one event.
......@@ -72,6 +73,8 @@ It should be kept in mind that the resulting configuration strings are parsed by
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.
In addition, the calibration file of the detector specified in the geometry configuration is passed to the EUDAQ2 event decoder using the key `calibration_file` and its canonical path as value. Adding the same key to the module configuration will overwrite the file specified in the detector geometry.
### Parameters
* `file_name`: File name of the EUDAQ2 raw data file. This parameter is mandatory.
* `inclusive`: Boolean parameter to select whether new data should be compared to the existing Corryvreckan event in inclusive or exclusive mode. The inclusive interpretation will allow new data to be added to the event as soon as there is some overlap between the data time frame and the existing event, i.e. as soon as the end of the time frame is later than the event start or as soon as the time frame start is before the event end. In the exclusive mode, the frame will only be added to the existing event if its start and end are both within the defined event.
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