BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularDetector1D.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/Detector/SpecularDetector1D.cpp
6 //! @brief Implements a detector for specular simulations.
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 
16 
18 {
19  initialize();
20  addAxis(axis);
21 }
22 
24 {
25  initialize();
26 }
27 
29 
31 {
32  return new SpecularDetector1D(*this);
33 }
34 
36 {
37  return Axes::Units::RADIANS;
38 }
39 
40 std::string SpecularDetector1D::axisName(size_t index) const
41 {
42  if (index == 0) {
43  return "u";
44  } else
45  throw std::runtime_error(
46  "SpecularDetector1D::getAxisName(size_t index) -> Error! index > 0");
47 }
48 
50 {
51  setName("SpecularDetector1D");
52 }
Defines a detector for specular simulations.
Interface for one-dimensional axes.
Definition: IAxis.h:25
Abstract detector interface.
Definition: IDetector.h:36
void addAxis(const IAxis &axis)
Definition: IDetector.cpp:39
void setName(const std::string &name)
1D detector for specular simulations.
virtual ~SpecularDetector1D()
SpecularDetector1D(const IAxis &axis)
SpecularDetector1D * clone() const override
std::string axisName(size_t index) const override
Returns the name for the axis with given index.
Axes::Units defaultAxesUnits() const override
Return default axes units.