BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IFootprintFactor.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Beam/IFootprintFactor.h
6 //! @brief Defines 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 
15 #ifndef BORNAGAIN_CORE_BEAM_IFOOTPRINTFACTOR_H
16 #define BORNAGAIN_CORE_BEAM_IFOOTPRINTFACTOR_H
17 
18 #include "Base/Types/ICloneable.h"
19 #include "Param/Node/INode.h"
20 
21 class MultiLayer;
22 class Beam;
23 
24 //! Abstract base for classes that calculate the beam footprint factor
25 //! @ingroup beam
26 
27 class IFootprintFactor : public ICloneable, public INode
28 {
29 public:
30  IFootprintFactor(const NodeMeta& meta, const std::vector<double>& PValues);
31  IFootprintFactor() = delete;
32  virtual ~IFootprintFactor();
33 
34  virtual IFootprintFactor* clone() const = 0;
35 
36  void setWidthRatio(double width_ratio);
37  double widthRatio() const { return m_width_ratio; }
38 
39  //! Calculate footprint correction coefficient from the beam incident angle _alpha_.
40  virtual double calculate(double alpha) const = 0;
41 
42  //! Print python-formatted footprint definition
43  virtual std::string print() const = 0;
44 
45 protected:
46  const double& m_width_ratio; //! Beam to sample width ratio
47 
48 private:
49  void initialize();
50 };
51 
52 inline std::ostream& operator<<(std::ostream& os, const IFootprintFactor& f_factor)
53 {
54  return os << f_factor.print();
55 }
56 
57 #endif // BORNAGAIN_CORE_BEAM_IFOOTPRINTFACTOR_H
Defines and implements the standard mix-in ICloneable.
Defines class INode.
std::ostream & operator<<(std::ostream &os, const BasicVector3D< T > &a)
Output to stream.
Beam defined by wavelength, direction and intensity.
Definition: Beam.h:27
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:25
Abstract base for classes that calculate the beam footprint factor.
virtual std::string print() const =0
Print python-formatted footprint definition.
double widthRatio() const
void initialize()
Beam to sample width ratio.
void setWidthRatio(double width_ratio)
virtual IFootprintFactor * clone() const =0
IFootprintFactor()=delete
const double & m_width_ratio
virtual ~IFootprintFactor()
virtual double calculate(double alpha) const =0
Calculate footprint correction coefficient from the beam incident angle alpha.
Base class for tree-like structures containing parameterized objects.
Definition: INode.h:49
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
Metadata of one model node.
Definition: INode.h:37