BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IsGISAXSDetector.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Detector/IsGISAXSDetector.cpp
6 //! @brief Implements class IsGISAXSDetector.
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 
17 
19 {
20  setName("IsGISAXSDetector");
21 }
22 
23 IsGISAXSDetector::IsGISAXSDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha,
24  double alpha_min, double alpha_max)
25 {
26  setName("IsGISAXSDetector");
27  setDetectorParameters(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max);
28 }
29 
31 {
32  setName("IsGISAXSDetector");
33 }
34 
36 {
37  return new IsGISAXSDetector(*this);
38 }
39 
40 std::unique_ptr<IAxis> IsGISAXSDetector::createAxis(size_t index, size_t n_bins, double min,
41  double max) const
42 {
43  if (max <= min) {
45  "IsGISAXSDetector::createAxis() -> Error! max <= min");
46  }
47  if (n_bins == 0) {
49  "IsGISAXSDetector::createAxis() -> Error! Number n_bins can't be zero.");
50  }
51  return std::make_unique<CustomBinAxis>(axisName(index), n_bins, min, max);
52 }
53 
54 size_t IsGISAXSDetector::indexOfSpecular(const Beam& /*beam*/) const
55 {
56  return totalSize();
57 }
Defines class CustomBinAxis.
Defines class IsGISAXSDetector.
Beam defined by wavelength, direction and intensity.
Definition: Beam.h:27
void setDetectorParameters(size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max)
Sets detector parameters using angle ranges.
Definition: IDetector2D.cpp:35
size_t totalSize() const
Returns total number of pixels.
Definition: IDetector.cpp:87
void setName(const std::string &name)
A spherical detector used for validation with IsGISAXS results.
std::unique_ptr< IAxis > createAxis(size_t index, size_t n_bins, double min, double max) const override
Generates an axis with correct name and default binning for given index.
IsGISAXSDetector * clone() const override
size_t indexOfSpecular(const Beam &beam) const override
Returns index of pixel that contains the specular wavevector.
A spherical detector with axes and resolution function.
std::string axisName(size_t index) const override
Returns the name for the axis with given index.