BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ISpecularScan.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sim/Scan/ISpecularScan.h
6 //! @brief Declares interface ISpecularScan.
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_SIM_SCAN_ISPECULARSCAN_H
17 #define BORNAGAIN_SIM_SCAN_ISPECULARSCAN_H
18 
19 #include "Base/Types/ICloneable.h"
20 #include <cstddef>
21 #include <heinz/Vectors3D.h>
22 #include <memory>
23 #include <vector>
24 
25 class CoordSystem1D;
26 class IAxis;
27 class IFootprintFactor;
28 class PolFilter;
29 class PolMatrices;
30 class SpecularElement;
31 
32 //! Abstract base class for all types of specular scans.
33 
34 class ISpecularScan : public ICloneable {
35 public:
36  ISpecularScan* clone() const override = 0;
37  ~ISpecularScan() override;
38 
39  //! Sets the polarization density matrix according to the given Bloch vector
40  void setPolarization(R3 bloch_vector);
41 
42  //! Sets the polarization analyzer characteristics of the detector
43  void setAnalyzer(R3 direction, double efficiency, double total_transmission);
44 
45  const PolFilter* analyzer() const { return m_polAnalyzer.get(); }
46 
47  virtual double wavelength() const = 0;
48 
49 #ifndef SWIG
50  PolMatrices polMatrices() const;
51 
52  //! Generates simulation elements for specular simulations
53  virtual std::vector<SpecularElement> generateElements() const = 0;
54 
55  //! Returns coordinate axis assigned to the data holder
56  virtual const IAxis* coordinateAxis() const = 0;
57 
58  //! Returns IFootprintFactor object pointer
59  virtual const IFootprintFactor* footprintFactor() const = 0;
60 
61  //! Returns footprint correction factor for a range of simulation elements of size _n_elements_
62  //! and starting from element with index _i_.
63  virtual std::vector<double> footprint(size_t i, size_t n_elements) const = 0;
64 
65  //! Returns the number of simulation elements
66  virtual size_t numberOfElements() const = 0;
67 
68  virtual CoordSystem1D* createCoordSystem() const = 0;
69 
70  //! Returns intensity vector corresponding to convolution of given simulation elements
71  virtual std::vector<double>
72  createIntensities(const std::vector<SpecularElement>& eles) const = 0;
73 
74  bool polarized() const;
75 
76 protected:
77  std::unique_ptr<R3> m_beamPolarization; //!< Bloch vector encoding the beam's polarization
78  std::unique_ptr<PolFilter> m_polAnalyzer;
79 
80 #endif // SWIG
81 };
82 
83 #endif // BORNAGAIN_SIM_SCAN_ISPECULARSCAN_H
84 #endif // USER_API
Defines and implements the standard mix-in ICloneable.
Abstract base class to support coordinate transforms and axis labels for 1D scans....
Definition: CoordSystem1D.h:33
Abstract base class for one-dimensional axes.
Definition: IAxis.h:27
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Definition: ICloneable.h:23
Abstract base for classes that calculate the beam footprint factor.
Abstract base class for all types of specular scans.
Definition: ISpecularScan.h:34
const PolFilter * analyzer() const
Definition: ISpecularScan.h:45
virtual std::vector< double > createIntensities(const std::vector< SpecularElement > &eles) const =0
Returns intensity vector corresponding to convolution of given simulation elements.
virtual std::vector< double > footprint(size_t i, size_t n_elements) const =0
Returns footprint correction factor for a range of simulation elements of size n_elements and startin...
std::unique_ptr< R3 > m_beamPolarization
Bloch vector encoding the beam's polarization.
Definition: ISpecularScan.h:77
virtual std::vector< SpecularElement > generateElements() const =0
Generates simulation elements for specular simulations.
void setPolarization(R3 bloch_vector)
Sets the polarization density matrix according to the given Bloch vector.
virtual const IAxis * coordinateAxis() const =0
Returns coordinate axis assigned to the data holder.
virtual double wavelength() const =0
virtual const IFootprintFactor * footprintFactor() const =0
Returns IFootprintFactor object pointer.
void setAnalyzer(R3 direction, double efficiency, double total_transmission)
Sets the polarization analyzer characteristics of the detector.
PolMatrices polMatrices() const
~ISpecularScan() override
virtual CoordSystem1D * createCoordSystem() const =0
virtual size_t numberOfElements() const =0
Returns the number of simulation elements.
std::unique_ptr< PolFilter > m_polAnalyzer
Definition: ISpecularScan.h:78
bool polarized() const
ISpecularScan * clone() const override=0
Detector properties (efficiency, transmission).
Definition: PolFilter.h:27
Convenience class for handling polarization density matrix and polarization analyzer operator.
Definition: PolMatrices.h:29
Data stucture containing both input and output of a single image pixel for specular simulation.