Commit 6fca8f21 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Module: allow retrieval of reference detector

parent 0c414e8f
......@@ -34,6 +34,12 @@ Detector* Module::get_detector(std::string name) {
return (*it);
}
Detector* Module::get_reference() {
auto it = find_if(
m_detectors.begin(), m_detectors.end(), [](Detector* obj) { return obj->role() == DetectorRole::REFERENCE; });
return (*it);
}
bool Module::has_detector(std::string name) {
auto it = find_if(m_detectors.begin(), m_detectors.end(), [&name](Detector* obj) { return obj->name() == name; });
if(it == m_detectors.end()) {
......
......@@ -134,6 +134,12 @@ namespace corryvreckan {
*/
Detector* get_detector(std::string name);
/**
* @brief Get the reference detector for this setup
* @return Pointer to the reference detector
*/
Detector* get_reference();
/**
* @brief Check if this module should act on a given detector
* @param name Name of the detector to check
......
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