BornAgain  1.18.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 scattering at grazing incidence
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_CORE_AXIS_CUSTOMBINAXIS_H
16 #define BORNAGAIN_CORE_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 {
26 public:
27  //! CustomBinAxis constructor.
28  //! @param name Axis name
29  //! @param nbins number of bins
30  //! @param start center of first bin (IsGisaxs convention)
31  //! @param end center of last bin (IsGisaxs convention)
32  CustomBinAxis(const std::string& name, size_t nbins, double start, double end);
33  virtual ~CustomBinAxis() {}
34 
35  CustomBinAxis* clone() const;
36 
37  Bin1D getBin(size_t index) const;
38 
39  std::vector<double> getBinCenters() const;
40 
41  CustomBinAxis* createClippedAxis(double left, double right) const;
42 
43 protected:
44  void print(std::ostream& ostr) const;
45  bool equals(const IAxis& other) const;
46 
47  double m_start;
48  double m_end;
49  std::vector<double> m_bin_centers;
50 };
51 
52 #endif // BORNAGAIN_CORE_AXIS_CUSTOMBINAXIS_H
Defines class VariableBinAxis.
Axis with fixed bin size in sin(angle) space used for numerical comparison with IsGisaxs.
Definition: CustomBinAxis.h:25
CustomBinAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
void print(std::ostream &ostr) const
std::vector< double > getBinCenters() const
virtual ~CustomBinAxis()
Definition: CustomBinAxis.h:33
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:49
Bin1D getBin(size_t index) const
retrieve a 1d bin for the given index
Interface for one-dimensional axes.
Definition: IAxis.h:25
Axis with variable bin size.
Definition: Bin.h:20