BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SphericalDetector.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Detector/SphericalDetector.h
6 //! @brief Defines class SphericalDetector.
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_DETECTOR_SPHERICALDETECTOR_H
16 #define BORNAGAIN_CORE_DETECTOR_SPHERICALDETECTOR_H
17 
19 
20 class IPixel;
21 class SphericalPixel;
22 
23 //! A spherical detector with axes and resolution function.
24 //! @ingroup detector
25 
27 {
28 public:
30 
31  //! Spherical detector constructor using angle ranges
32  //! @param n_phi number of phi-axis bins
33  //! @param phi_min low edge of first phi-bin
34  //! @param phi_max upper edge of last phi-bin
35  //! @param n_alpha number of alpha-axis bins
36  //! @param alpha_min low edge of first alpha-bin
37  //! @param alpha_max upper edge of last alpha-bin
38  SphericalDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha,
39  double alpha_min, double alpha_max);
40 
42 
43  SphericalDetector* clone() const override;
44 
45  void accept(INodeVisitor* visitor) const override { visitor->visit(this); }
46 
47  ~SphericalDetector() override {}
48 
49  //! return default axes units
50  Axes::Units defaultAxesUnits() const override;
51 
52 protected:
53  //! Creates an IPixel for the given OutputData object and index
54  IPixel* createPixel(size_t index) const override;
55 
56  //! Returns the name for the axis with given index
57  std::string axisName(size_t index) const override;
58 
59  //! Returns index of pixel that contains the specular wavevector.
60  //! If no pixel contains this specular wavevector, the number of pixels is
61  //! returned. This corresponds to an overflow index.
62  size_t indexOfSpecular(const Beam& beam) const override;
63 };
64 
65 #endif // BORNAGAIN_CORE_DETECTOR_SPHERICALDETECTOR_H
Defines interface IDetector2D.
Beam defined by wavelength, direction and intensity.
Definition: Beam.h:27
Abstract 2D detector interface.
Definition: IDetector2D.h:31
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
virtual void visit(const BasicLattice *)
Definition: INodeVisitor.h:154
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel.
Definition: IPixel.h:24
A spherical detector with axes and resolution function.
void accept(INodeVisitor *visitor) const override
Calls the INodeVisitor's visit method.
std::string axisName(size_t index) const override
Returns the name for the axis with given index.
size_t indexOfSpecular(const Beam &beam) const override
Returns index of pixel that contains the specular wavevector.
~SphericalDetector() override
IPixel * createPixel(size_t index) const override
Creates an IPixel for the given OutputData object and index.
Axes::Units defaultAxesUnits() const override
return default axes units
SphericalDetector * clone() const override
A pixel in a SphericalDetector.