22 m_data.addAxis(
FixedBinAxis(
"x-axis", nbinsx, xlow, xup));
48 m_data[index].add(weight);
67 #ifdef BORNAGAIN_PYTHON
69 PyObject* Histogram1D::getBinCentersNumpy()
const
74 PyObject* Histogram1D::getBinValuesNumpy()
const
79 PyObject* Histogram1D::getBinErrorsNumpy()
const
88 const std::unique_ptr<IAxis> xaxis(
getXaxis().createClippedAxis(xmin, xmax));
92 while (it_origin != m_data.
end()) {
95 *it_result = *it_origin;
Defines various functions to interact from numpy on Python side.
Defines class Histogram1D.
Defines class VariableBinAxis.
Axis with fixed bin size.
One dimensional histogram.
std::vector< double > getBinCenters() const
returns vector of histogram bin centers
int fill(double x, double weight=1.0)
Increment bin with abscissa x with a weight.
std::vector< double > getBinErrors() const
returns vector of bin errors
Histogram1D * crop(double xmin, double xmax)
Creates new histogram by applying crop on axis.
std::vector< double > getBinValues() const
returns vector of bin content (the value accumulated by bins)
Histogram1D(int nbinsx, double xlow, double xup)
Constructor for fix bin size histograms.
Histogram1D * clone() const
Returns clone of other histogram.
Interface for one-dimensional axes.
virtual bool contains(double value) const
Returns true if axis contains given point.
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual double getMin() const =0
Returns value of first point of axis.
virtual double getMax() const =0
Returns value of last point of axis.
Base class for 1D and 2D histograms holding values of double type.
std::vector< double > getDataVector(DataType dataType) const
returns vector of values of requested DataType
const IAxis & getXaxis() const
returns x-axis
iterator end()
Returns read/write iterator that points to the one past last element.
iterator begin()
Returns read/write iterator that points to the first element.
double getAxisValue(size_t global_index, size_t i_selected_axis) const
Returns the value of selected axis for given global_index.
Axis with variable bin size.