Commit fd250716 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Fix some linting advices

parent 5f509818
Pipeline #584352 passed with stages
in 10 minutes and 48 seconds
variables:
EOS_PATH: "/eos/project/c/corryvreckan/www/"
variables:
DOCKER_FILE: etc/docker/Dockerfile
stages:
......
......@@ -32,7 +32,8 @@
using namespace corryvreckan;
// Default constructor
ModuleManager::ModuleManager(std::string config_file_name, std::vector<std::string> options) : m_terminate(false) {
ModuleManager::ModuleManager(std::string config_file_name, std::vector<std::string> options)
: m_reference(nullptr), m_terminate(false) {
LOG(TRACE) << "Loading Corryvreckan";
......@@ -109,9 +110,6 @@ void ModuleManager::load() {
void ModuleManager::load_detectors() {
// Flag for the reference detector
bool found_reference = false;
std::vector<std::string> detectors_files = global_config.getPathArray("detectors_file");
for(auto& detectors_file : detectors_files) {
......@@ -135,13 +133,12 @@ void ModuleManager::load_detectors() {
auto det_parm = std::make_shared<Detector>(detector);
// Check if we already found a reference plane:
if(found_reference && det_parm->isReference()) {
if(m_reference != nullptr && det_parm->isReference()) {
throw InvalidValueError(global_config, "detectors_file", "Found more than one reference detector");
}
// Switch flag if we found the reference plane:
if(det_parm->isReference()) {
found_reference = true;
m_reference = det_parm;
}
......@@ -151,7 +148,7 @@ void ModuleManager::load_detectors() {
}
// Check that exactly one detector is marked as reference:
if(!found_reference) {
if(m_reference == nullptr) {
throw InvalidValueError(global_config, "detectors_file", "Found no detector marked as reference");
}
......
......@@ -102,8 +102,8 @@ StatusCode TrackingSpatial::run(std::shared_ptr<Clipboard> clipboard) {
}
// If there are no detectors then stop trying to track
if(detectors.empty()) {
return StatusCode::Success;
if(detectors.empty() || referenceClusters == nullptr) {
return StatusCode::NoData;
}
// Output track container
......
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