BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ConstantBackground.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/ConstantBackground.cpp
6 //! @brief Implements class ConstantBackground.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
16 
17 ConstantBackground::ConstantBackground(const std::vector<double> P)
18  : IBackground({"ConstantBackground",
19  "class_tooltip",
20  {{"BackgroundValue", "", "para_tooltip", 0, +INF, 0}}},
21  P),
22  m_background_value(m_P[0])
23 {
24 }
25 
27  : ConstantBackground(std::vector<double>{background_value})
28 {
29 }
30 
32 {
34 }
35 
36 double ConstantBackground::addBackground(double intensity) const
37 {
38  return intensity + m_background_value;
39 }
Defines class ConstantBackground.
const double INF
Definition: INode.h:24
Class representing a constant background signal.
ConstantBackground(const std::vector< double > P)
double addBackground(double intensity) const override final
const double & m_background_value
ConstantBackground * clone() const override final
Interface for a simulating the background signal.
Definition: IBackground.h:26