Commit 06683da6 authored by Lennart Huth's avatar Lennart Huth
Browse files

MB must be >=0, using brackets in single line if

parent 5ad78ec0
......@@ -58,9 +58,13 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
// Size of the pixels
m_pitch = config.get<ROOT::Math::XYVector>("pixel_pitch");
// Material budget of detector, including support material
if(!config.has("material_budget"))
if(!config.has("material_budget")) {
LOG(WARNING) << "No material budget given for " << m_detectorName << ", assuming zero";
}
m_materialBudget = config.get<double>("material_budget", 0.0);
if(m_materialBudget < 0) {
throw InvalidValueError(config, "material_budget", "Material budget is negative");
}
// Intrinsic position resolution, defaults to 4um:
m_resolution = config.get<ROOT::Math::XYVector>("resolution", ROOT::Math::XYVector(0.004, 0.004));
......@@ -256,8 +260,9 @@ Configuration Detector::getConfiguration() const {
config.setMatrix("roi", m_roi);
// material budget
if(m_materialBudget > 0.0)
if(m_materialBudget > 0.0) {
config.set("material_budget", m_materialBudget);
}
return config;
}
......
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