BornAgain  1.19.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 reflection and scattering
4 //
5 //! @file Device/Beam/IFootprintFactor.h
6 //! @brief Defines interface 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 USER_API
16 #ifndef BORNAGAIN_DEVICE_BEAM_IFOOTPRINTFACTOR_H
17 #define BORNAGAIN_DEVICE_BEAM_IFOOTPRINTFACTOR_H
18 
19 #include "Base/Types/ICloneable.h"
20 #include "Param/Node/INode.h"
21 
22 class MultiLayer;
23 class Beam;
24 
25 //! Abstract base for classes that calculate the beam footprint factor
26 //! @ingroup beam
27 
28 class IFootprintFactor : public ICloneable, public INode {
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  virtual std::string name() const = 0;
43 
44 protected:
45  const double& m_width_ratio; //! Beam to sample width ratio
46 
47 private:
48  void initialize();
49 };
50 
51 #endif // BORNAGAIN_DEVICE_BEAM_IFOOTPRINTFACTOR_H
52 #endif // USER_API
Defines and implements the standard mix-in ICloneable.
Defines interface INode.
An incident neutron or x-ray beam.
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.
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 std::string name() const =0
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:41
Metadata of one model node.
Definition: INode.h:38