BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
CustomBinAxis.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Axis/CustomBinAxis.h
6 //! @brief Defines class CustomBinAxis.
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_BASE_AXIS_CUSTOMBINAXIS_H
16 #define BORNAGAIN_BASE_AXIS_CUSTOMBINAXIS_H
17 
19 
20 //! Axis with fixed bin size in sin(angle) space used for numerical comparison with IsGisaxs.
21 //! The main feature of the axis is that it produces zero bin sizes.
22 //! @ingroup tools
23 
25 public:
26  //! CustomBinAxis constructor.
27  //! @param name Axis name
28  //! @param nbins number of bins
29  //! @param start center of first bin (IsGisaxs convention)
30  //! @param end center of last bin (IsGisaxs convention)
31  CustomBinAxis(const std::string& name, size_t nbins, double start, double end);
32  virtual ~CustomBinAxis() {}
33 
34  CustomBinAxis* clone() const;
35 
36  Bin1D bin(size_t index) const;
37 
38  std::vector<double> binCenters() const;
39 
40  CustomBinAxis* createClippedAxis(double left, double right) const;
41 
42 protected:
43  void print(std::ostream& ostr) const;
44  bool equals(const IAxis& other) const;
45 
46  double m_start;
47  double m_end;
48  std::vector<double> m_bin_centers;
49 };
50 
51 #endif // BORNAGAIN_BASE_AXIS_CUSTOMBINAXIS_H
Defines class VariableBinAxis.
Axis with fixed bin size in sin(angle) space used for numerical comparison with IsGisaxs.
Definition: CustomBinAxis.h:24
Bin1D bin(size_t index) const
retrieve a 1d bin for the given index
CustomBinAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
void print(std::ostream &ostr) const
virtual ~CustomBinAxis()
Definition: CustomBinAxis.h:32
CustomBinAxis * clone() const
clone function
bool equals(const IAxis &other) const
CustomBinAxis(const std::string &name, size_t nbins, double start, double end)
CustomBinAxis constructor.
std::vector< double > m_bin_centers
Definition: CustomBinAxis.h:48
std::vector< double > binCenters() const
Interface for one-dimensional axes.
Definition: IAxis.h:25
Axis with variable bin size.
QString const & name(EShape k)
Definition: particles.cpp:21
Definition: Bin.h:20