BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IFootprintFactor.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Beam/IFootprintFactor.cpp
6 //! @brief Implements class IFootprintFactor.
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 <stdexcept>
17 
18 IFootprintFactor::IFootprintFactor(const NodeMeta& meta, const std::vector<double>& PValues)
20  {{"BeamToSampleWidthRatio", "", "ratio of beam width to sample width", 0, INF, 1.}},
21  meta),
22  PValues),
23  m_width_ratio(m_P[0])
24 {
25  if (m_P[0] < 0.0)
26  throw std::runtime_error(
27  "Error in IFootprintFactor::setWidthRatio: width ratio is negative");
28 }
29 
31 
32 void IFootprintFactor::setWidthRatio(double width_ratio)
33 {
34  if (width_ratio < 0.0)
35  throw std::runtime_error(
36  "Error in IFootprintFactor::setWidthRatio: width ratio is negative");
37  m_P[0] = width_ratio;
38 }
Defines class IFootprintFactor.
NodeMeta nodeMetaUnion(const std::vector< ParaMeta > &base, const NodeMeta &other)
Definition: INode.cpp:24
const double INF
Definition: INode.h:24
void setWidthRatio(double width_ratio)
IFootprintFactor()=delete
virtual ~IFootprintFactor()
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:49
std::vector< double > m_P
Definition: INode.h:87
Metadata of one model node.
Definition: INode.h:37