BornAgain  1.19.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 reflection and scattering
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 
28 
30 {
31  initialize();
32 }
33 
35 
37 {
38  return new SpecularDetector1D(*this);
39 }
40 
42 {
43  return Axes::Units::RADIANS;
44 }
45 
46 std::string SpecularDetector1D::axisName(size_t index) const
47 {
48  if (index == 0) {
49  return "u";
50  } else
51  throw std::runtime_error(
52  "SpecularDetector1D::getAxisName(size_t index) -> Error! index > 0");
53 }
54 
56 {
57  setName("SpecularDetector1D");
58 }
59 
61 {
62  clear();
63  addAxis(axis);
64 }
Defines a detector for specular simulations.
Interface for one-dimensional axes.
Definition: IAxis.h:25
Abstract detector interface.
Definition: IDetector.h:36
void clear()
Definition: IDetector.cpp:51
const IAxis & axis(size_t index) const
Definition: IDetector.cpp:56
void addAxis(const IAxis &axis)
Definition: IDetector.cpp:41
void setName(const std::string &name)
1D detector for specular simulations.
void setAxis(const IAxis &axis)
virtual ~SpecularDetector1D()
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.