BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ConstantBackground.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Background/ConstantBackground.h
6 //! @brief Defines 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 
15 #ifndef BORNAGAIN_SIM_BACKGROUND_CONSTANTBACKGROUND_H
16 #define BORNAGAIN_SIM_BACKGROUND_CONSTANTBACKGROUND_H
17 
19 
20 //! Constant background, to be added to simulated scattering.
21 //!
22 //! @ingroup background
23 
25 public:
26  ConstantBackground(std::vector<double> P);
27  ConstantBackground(double background_value);
28 
29  ConstantBackground* clone() const override;
30  std::string className() const final { return "ConstantBackground"; }
31  // const auto tooltip = "class_tooltip";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {{"BackgroundValue", "", "para_tooltip", 0, +INF, 0}};
35  }
36 
37  double backgroundValue() const { return m_background_value; }
38 
39  double addBackground(double intensity) const override;
40 
41 private:
42  const double& m_background_value;
43 };
44 
45 #endif // BORNAGAIN_SIM_BACKGROUND_CONSTANTBACKGROUND_H
Defines interface IBackground.
const double INF
Definition: INode.h:26
Constant background, to be added to simulated scattering.
double addBackground(double intensity) const override
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
const double & m_background_value
double backgroundValue() const
ConstantBackground * clone() const override
ConstantBackground(std::vector< double > P)
Abstract base class for background noise, to be added to simulated scattering.
Definition: IBackground.h:27