BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Axis with fixed bin size. More...
Public Member Functions | |
FixedBinAxis (const std::string &name, size_t nbins, double start, double end) | |
FixedBinAxis constructor. More... | |
virtual | ~FixedBinAxis () |
Bin1D | bin (size_t index) const |
retrieve a 1d bin for the given index More... | |
std::vector< double > | binBoundaries () const |
double | binCenter (size_t index) const |
std::vector< double > | binCenters () const |
double | center () const |
Returns midpoint of axis. More... | |
FixedBinAxis * | clone () const |
clone function More... | |
virtual bool | contains (double value) const |
Returns true if axis contains given point. More... | |
FixedBinAxis * | createClippedAxis (double left, double right) const |
Creates a new clipped axis. More... | |
size_t | findClosestIndex (double value) const |
find bin index which is best match for given value More... | |
std::string | getName () const |
retrieve the label of the axis More... | |
double | lowerBound () const |
Returns value of first point of axis. More... | |
bool | operator!= (const IAxis &right) const |
bool | operator== (const IAxis &right) const |
test for equality More... | |
double | operator[] (size_t index) const |
indexed accessor retrieves a sample More... | |
void | setName (std::string name) |
Sets the axis label. More... | |
size_t | size () const |
retrieve the number of bins More... | |
double | span () const |
Returns distance from first to last point. More... | |
double | upperBound () const |
Returns value of last point of axis. More... | |
Protected Member Functions | |
virtual bool | equals (const IAxis &other) const |
void | print (std::ostream &ostr) const |
Private Attributes | |
double | m_end |
std::string | m_name |
axis name More... | |
size_t | m_nbins |
double | m_start |
Axis with fixed bin size.
Definition at line 23 of file FixedBinAxis.h.
FixedBinAxis::FixedBinAxis | ( | const std::string & | name, |
size_t | nbins, | ||
double | start, | ||
double | end | ||
) |
FixedBinAxis constructor.
name | Axis name |
nbins | number of bins |
start | low edge of first bin |
end | upper edge of last bin |
Definition at line 20 of file FixedBinAxis.cpp.
Referenced by clone(), and createClippedAxis().
|
inlinevirtual |
Definition at line 31 of file FixedBinAxis.h.
|
virtual |
retrieve a 1d bin for the given index
Implements IAxis.
Definition at line 40 of file FixedBinAxis.cpp.
References m_end, m_nbins, and m_start.
Referenced by binBoundaries(), binCenters(), and createClippedAxis().
|
virtual |
Reimplemented from IAxis.
Definition at line 72 of file FixedBinAxis.cpp.
References bin(), Bin1D::m_lower, Bin1D::m_upper, and size().
|
inlinevirtual |
|
virtual |
Reimplemented from IAxis.
Definition at line 62 of file FixedBinAxis.cpp.
References bin(), Bin1D::center(), and size().
Referenced by StandardSimulations::BasicSpecularQ(), and StandardSimulations::TOFRWithPointwiseResolution().
|
inherited |
Returns midpoint of axis.
Definition at line 47 of file IAxis.cpp.
References IAxis::lowerBound(), and IAxis::upperBound().
|
virtual |
clone function
Implements IAxis.
Definition at line 25 of file FixedBinAxis.cpp.
References FixedBinAxis(), IAxis::getName(), m_end, m_nbins, and m_start.
|
virtualinherited |
Returns true if axis contains given point.
Definition at line 37 of file IAxis.cpp.
References IAxis::lowerBound(), and IAxis::upperBound().
Referenced by Histogram1D::crop(), Histogram2D::crop(), Histogram1D::fill(), RectangularDetector::indexOfSpecular(), and SphericalDetector::indexOfSpecular().
|
virtual |
Creates a new clipped axis.
Reimplemented from IAxis.
Definition at line 83 of file FixedBinAxis.cpp.
References FixedBinAxis(), bin(), Bin1D::center(), findClosestIndex(), IAxis::getName(), lowerBound(), size(), and upperBound().
|
protectedvirtual |
Reimplemented from IAxis.
Definition at line 107 of file FixedBinAxis.cpp.
References algo::almostEqual(), IAxis::equals(), m_end, m_start, and size().
|
virtual |
find bin index which is best match for given value
Implements IAxis.
Definition at line 50 of file FixedBinAxis.cpp.
References lowerBound(), m_end, m_nbins, m_start, and upperBound().
Referenced by createClippedAxis().
|
inlineinherited |
retrieve the label of the axis
Definition at line 40 of file IAxis.h.
References IAxis::m_name.
Referenced by OutputData< T >::addAxis(), RegionOfInterest::clipAxisToRoi(), CustomBinAxis::clone(), clone(), VariableBinAxis::clone(), ConstKBinAxis::clone(), PointwiseAxis::clone(), createClippedAxis(), VariableBinAxis::createClippedAxis(), ConstKBinAxis::createClippedAxis(), PointwiseAxis::createClippedAxis(), ImportDataUtils::CreateSimplifiedOutputData(), IAxis::equals(), CustomBinAxis::print(), print(), VariableBinAxis::print(), ConstKBinAxis::print(), PointwiseAxis::print(), and TransformFromDomain::setAxisItem().
|
inlinevirtual |
Returns value of first point of axis.
Implements IAxis.
Definition at line 41 of file FixedBinAxis.h.
References m_start.
Referenced by createClippedAxis(), findClosestIndex(), and print().
|
inlineinherited |
|
inlineinherited |
test for equality
Definition at line 69 of file IAxis.h.
References IAxis::equals().
|
virtual |
indexed accessor retrieves a sample
Implements IAxis.
Definition at line 31 of file FixedBinAxis.cpp.
|
protectedvirtual |
Implements IAxis.
Definition at line 100 of file FixedBinAxis.cpp.
References IAxis::getName(), lowerBound(), size(), and upperBound().
|
inlineinherited |
Sets the axis label.
Definition at line 43 of file IAxis.h.
References IAxis::m_name, and RealSpace::Particles::name().
|
inlinevirtual |
retrieve the number of bins
Implements IAxis.
Definition at line 35 of file FixedBinAxis.h.
References m_nbins.
Referenced by StandardSimulations::BasicSpecularQ(), binBoundaries(), binCenters(), createClippedAxis(), equals(), print(), and StandardSimulations::TOFRWithPointwiseResolution().
|
inherited |
Returns distance from first to last point.
Definition at line 42 of file IAxis.cpp.
References IAxis::lowerBound(), and IAxis::upperBound().
Referenced by RectangularDetector::getHeight(), RectangularDetector::getWidth(), and DetectorUtils::isQuadratic().
|
inlinevirtual |
Returns value of last point of axis.
Implements IAxis.
Definition at line 42 of file FixedBinAxis.h.
References m_end.
Referenced by createClippedAxis(), findClosestIndex(), and print().
|
private |
Definition at line 61 of file FixedBinAxis.h.
Referenced by bin(), clone(), equals(), findClosestIndex(), operator[](), and upperBound().
|
privateinherited |
axis name
Definition at line 96 of file IAxis.h.
Referenced by IAxis::getName(), and IAxis::setName().
|
private |
Definition at line 59 of file FixedBinAxis.h.
Referenced by bin(), clone(), findClosestIndex(), operator[](), and size().
|
private |
Definition at line 60 of file FixedBinAxis.h.
Referenced by bin(), clone(), equals(), findClosestIndex(), lowerBound(), and operator[]().