BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RectangularPixel.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Detector/RectangularPixel.h
6 //! @brief Defines class RectangularPixel.
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_RECTANGULARPIXEL_H
16 #define BORNAGAIN_CORE_DETECTOR_RECTANGULARPIXEL_H
17 
18 #include "Base/Pixel/IPixel.h"
19 
20 //! A pixel in a RectangularDetector.
21 
22 class RectangularPixel : public IPixel
23 {
24 public:
26 
27  RectangularPixel* clone() const override;
28  RectangularPixel* createZeroSizePixel(double x, double y) const override;
29  kvector_t getK(double x, double y, double wavelength) const override;
30  kvector_t getPosition(double x, double y) const;
31  double getIntegrationFactor(double x, double y) const override;
32  double getSolidAngle() const override;
33 
34 private:
35  kvector_t normalizeLength(const kvector_t direction, double length) const;
36  double calculateSolidAngle() const;
40  double m_solid_angle;
42 };
43 
44 #endif // BORNAGAIN_CORE_DETECTOR_RECTANGULARPIXEL_H
Defines pure virtual interface IPixel (has no cpp file)
Interface for a function that maps [0,1]x[0,1] to the kvectors in a pixel.
Definition: IPixel.h:24
A pixel in a RectangularDetector.
kvector_t getK(double x, double y, double wavelength) const override
kvector_t getPosition(double x, double y) const
double getSolidAngle() const override
kvector_t normalizeLength(const kvector_t direction, double length) const
RectangularPixel * clone() const override
double calculateSolidAngle() const
RectangularPixel(kvector_t corner_pos, kvector_t width, kvector_t height)
double getIntegrationFactor(double x, double y) const override
kvector_t m_corner_pos
RectangularPixel * createZeroSizePixel(double x, double y) const override