BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PoissonBackground.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Background/PoissonBackground.cpp
6 //! @brief Implements class PoissonBackground.
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 #include "Base/Math/Functions.h"
17 
19  : IBackground({})
20 {
21 }
22 
24 {
25  return new PoissonBackground;
26 }
27 
28 double PoissonBackground::addBackground(double intensity) const
29 {
30  return Math::GeneratePoissonRandom(intensity);
31 }
Defines namespace Math.
Defines class PoissonBackground.
Abstract base class for background noise, to be added to simulated scattering.
Definition: IBackground.h:27
Poisson distributed noise, to be added to simulated scattering.
double addBackground(double intensity) const override
PoissonBackground * clone() const override
double GeneratePoissonRandom(double average)
Definition: Functions.cpp:124