BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
FixedBinAxis (const std::string &name, size_t nbins, double start, double end) | |
virtual | ~FixedBinAxis () |
FixedBinAxis * | clone () const |
size_t | size () const |
double | operator[] (size_t index) const |
Bin1D | getBin (size_t index) const |
double | getMin () const |
double | getMax () const |
double | getBinCenter (size_t index) const |
size_t | findClosestIndex (double value) const |
std::vector< double > | getBinCenters () const |
std::vector< double > | getBinBoundaries () const |
FixedBinAxis * | createClippedAxis (double left, double right) const |
std::string | pyString (const std::string &units, size_t) const final |
std::string | getName () const |
void | setName (std::string name) |
bool | operator== (const IAxis &right) const |
bool | operator!= (const IAxis &right) const |
virtual bool | contains (double value) const |
Protected Member Functions | |
void | print (std::ostream &ostr) const |
virtual bool | equals (const IAxis &other) const |
Private Attributes | |
size_t | m_nbins |
double | m_start |
double | m_end |
std::string | m_name |
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 22 of file FixedBinAxis.cpp.
Referenced by clone(), and createClippedAxis().
|
inlinevirtual |
Definition at line 32 of file FixedBinAxis.h.
|
virtual |
clone function
Implements IAxis.
Definition at line 27 of file FixedBinAxis.cpp.
References FixedBinAxis(), IAxis::getName(), m_end, m_nbins, and m_start.
|
inlinevirtual |
retrieve the number of bins
Implements IAxis.
Definition at line 36 of file FixedBinAxis.h.
References m_nbins.
Referenced by StandardSimulations::BasicSpecularQ(), createClippedAxis(), equals(), getBinBoundaries(), getBinCenters(), print(), pyString(), and StandardSimulations::TOFRWithPointwiseResolution().
|
virtual |
indexed accessor retrieves a sample
Implements IAxis.
Definition at line 33 of file FixedBinAxis.cpp.
|
virtual |
retrieve a 1d bin for the given index
Implements IAxis.
Definition at line 42 of file FixedBinAxis.cpp.
References m_end, m_nbins, and m_start.
Referenced by createClippedAxis(), getBinBoundaries(), and getBinCenters().
|
inlinevirtual |
Returns value of first point of axis.
Implements IAxis.
Definition at line 42 of file FixedBinAxis.h.
References m_start.
Referenced by createClippedAxis(), findClosestIndex(), print(), and pyString().
|
inlinevirtual |
Returns value of last point of axis.
Implements IAxis.
Definition at line 43 of file FixedBinAxis.h.
References m_end.
Referenced by createClippedAxis(), findClosestIndex(), print(), and pyString().
|
inlinevirtual |
|
virtual |
find bin index which is best match for given value
Implements IAxis.
Definition at line 52 of file FixedBinAxis.cpp.
References getMax(), getMin(), m_end, m_nbins, and m_start.
Referenced by createClippedAxis().
|
virtual |
Reimplemented from IAxis.
Definition at line 64 of file FixedBinAxis.cpp.
References getBin(), Bin1D::getMidPoint(), and size().
Referenced by StandardSimulations::BasicSpecularQ(), and StandardSimulations::TOFRWithPointwiseResolution().
|
virtual |
Reimplemented from IAxis.
Definition at line 74 of file FixedBinAxis.cpp.
References getBin(), Bin1D::m_lower, Bin1D::m_upper, and size().
|
virtual |
Creates a new clipped axis.
Reimplemented from IAxis.
Definition at line 85 of file FixedBinAxis.cpp.
References findClosestIndex(), FixedBinAxis(), getBin(), getMax(), Bin1D::getMidPoint(), getMin(), IAxis::getName(), and size().
|
finalvirtual |
Implements IAxis.
Definition at line 126 of file FixedBinAxis.cpp.
References getMax(), getMin(), IAxis::getName(), pyfmt::printString(), pyfmt::printValue(), and size().
|
protectedvirtual |
Implements IAxis.
Definition at line 103 of file FixedBinAxis.cpp.
References getMax(), getMin(), IAxis::getName(), and size().
|
protectedvirtual |
Reimplemented from IAxis.
Definition at line 110 of file FixedBinAxis.cpp.
References algo::almostEqual(), IAxis::equals(), m_end, m_start, and size().
|
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(), IAxis::equals(), CustomBinAxis::print(), print(), VariableBinAxis::print(), ConstKBinAxis::print(), PointwiseAxis::print(), and pyString().
|
inlineinherited |
|
inlineinherited |
test for equality
Definition at line 63 of file IAxis.h.
References IAxis::equals().
|
inlineinherited |
|
virtualinherited |
Returns true if axis contains given point.
Definition at line 40 of file IAxis.cpp.
References IAxis::getMax(), and IAxis::getMin().
Referenced by Histogram1D::crop(), Histogram2D::crop(), RectangularDetector::indexOfSpecular(), and SphericalDetector::indexOfSpecular().
|
private |
Definition at line 62 of file FixedBinAxis.h.
Referenced by clone(), findClosestIndex(), getBin(), operator[](), and size().
|
private |
Definition at line 63 of file FixedBinAxis.h.
Referenced by clone(), equals(), findClosestIndex(), getBin(), getMin(), and operator[]().
|
private |
Definition at line 64 of file FixedBinAxis.h.
Referenced by clone(), equals(), findClosestIndex(), getBin(), getMax(), and operator[]().
|
privateinherited |
axis name
Definition at line 92 of file IAxis.h.
Referenced by IAxis::getName(), and IAxis::setName().