Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
aa55c2f0
Commit
aa55c2f0
authored
Feb 12, 2020
by
Simon Spannagel
Browse files
Merge branch 'setBudgetToZero' into 'master'
Setting the Material budget to zero if not defined See merge request
!253
parents
651f2275
bf946abc
Pipeline
#1426578
passed with stages
in 28 minutes and 14 seconds
Changes
1
Pipelines
8
Hide whitespace changes
Inline
Side-by-side
src/core/detector/Detector.cpp
View file @
aa55c2f0
...
@@ -58,7 +58,8 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
...
@@ -58,7 +58,8 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
// Material budget of detector, including support material
// 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
=
0.0
;
LOG
(
WARNING
)
<<
"No material budget given for "
<<
m_detectorName
<<
", assuming "
<<
m_materialBudget
;
}
else
if
(
config
.
get
<
double
>
(
"material_budget"
)
<
0
)
{
}
else
if
(
config
.
get
<
double
>
(
"material_budget"
)
<
0
)
{
throw
InvalidValueError
(
config
,
"material_budget"
,
"Material budget has to be positive"
);
throw
InvalidValueError
(
config
,
"material_budget"
,
"Material budget has to be positive"
);
}
else
{
}
else
{
...
@@ -281,10 +282,9 @@ Configuration Detector::getConfiguration() const {
...
@@ -281,10 +282,9 @@ Configuration Detector::getConfiguration() const {
config
.
set
(
"time_resolution"
,
m_timeResolution
,
{
"ns"
,
"us"
,
"ms"
,
"s"
});
config
.
set
(
"time_resolution"
,
m_timeResolution
,
{
"ns"
,
"us"
,
"ms"
,
"s"
});
// material budget
// material budget
if
(
m_materialBudget
>
0.0
)
{
if
(
m_materialBudget
>
std
::
numeric_limits
<
double
>::
epsilon
()
)
{
config
.
set
(
"material_budget"
,
m_materialBudget
);
config
.
set
(
"material_budget"
,
m_materialBudget
);
}
}
// only if detector is not auxiliary:
// only if detector is not auxiliary:
if
(
!
this
->
isAuxiliary
())
{
if
(
!
this
->
isAuxiliary
())
{
config
.
set
(
"number_of_pixels"
,
m_nPixels
);
config
.
set
(
"number_of_pixels"
,
m_nPixels
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment