Commit a7a4e146 authored by Lennart Huth's avatar Lennart Huth
Browse files

setting the material budget to zero if not defined

parent 9201705f
......@@ -59,6 +59,7 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
// Material budget of detector, including support material
if(!config.has("material_budget")) {
LOG(WARNING) << "No material budget given for " << m_detectorName << ", assuming zero";
m_materialBudget = 0.0;
} else if(config.get<double>("material_budget") < 0) {
throw InvalidValueError(config, "material_budget", "Material budget has to be positive");
} else {
......@@ -281,9 +282,7 @@ Configuration Detector::getConfiguration() const {
config.set("time_resolution", m_timeResolution, {"ns", "us", "ms", "s"});
// material budget
if(m_materialBudget > 0.0) {
config.set("material_budget", m_materialBudget);
}
config.set("material_budget", m_materialBudget);
// only if detector is not auxiliary:
if(!this->isAuxiliary()) {
......
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