ant
A2 ant: class-based analysis framework
ant::AxisSettings Class Reference

#include <BinSettings.h>

+ Inheritance diagram for ant::AxisSettings:
+ Collaboration diagram for ant::AxisSettings:

Public Member Functions

 AxisSettings (const std::string &label_, const BinSettings &bin_settings)
 
const std::string & Label () const
 
std::string & Label ()
 
- Public Member Functions inherited from ant::BinSettings
 BinSettings (unsigned int number_of_bins, double minimum, double maximum)
 
 BinSettings (unsigned int number_of_bins)
 
 BinSettings (unsigned int number_of_bins, const interval< double > &i)
 
unsigned int Bins () const noexcept
 
unsigned int & Bins () noexcept
 
double BinWidth () const
 
int getBin (const double v) const noexcept
 Get the number of the bin a value would end up in. More...
 
- Public Member Functions inherited from ant::interval< double >
constexpr interval (const double &start, const double &stop) noexcept
 
constexpr const double & Start () const noexcept
 Get the lower boundary. More...
 
double & Start () noexcept
 Get the lower boundary. More...
 
constexpr const double & Stop () const noexcept
 Get the upper boundary. More...
 
double & Stop () noexcept
 Get the upper boundary. More...
 
constexpr double Length () const noexcept
 Get the length of the interval. More...
 
constexpr double Center () const noexcept
 Get the center. More...
 
interval< double > & operator+= (const double &a)
 Add a value to both boundaries. This shifts the interval to higher values. More...
 
interval< double > & operator-= (const double &a)
 Subtract a value to both boundaries. This shifts the interval to lower values. More...
 
interval< double > & operator*= (const double &f)
 Multiply both boundaries with a factor. This scales the interval (but also moves the center if center != 0) More...
 
interval< double > & operator/= (const double &f)
 Deivide both boundaries by a factor. This scales the interval (but also moves the center if center != 0) More...
 
interval< double > operator+ (const double &a) const
 Add a value to both boundaries and return the resulting interval (a new copy) The result is shifted to higher values (if a positive, of course). More...
 
interval< double > operator- (const double &a) const
 Subtract a value to both boundaries and return the resulting interval (a new copy) The result is shifted to lower values (if a positive, of course). More...
 
interval< double > operator* (const double &f) const
 Multiply both boundaries with a factor and return the resulting interval (a new copy). The result is scaled and the center is shifted if != 0. More...
 
interval< double > operator/ (const double &f) const
 Deivide both boundaries by a factor and return the resulting interval (a new copy). The result is scaled and the center is shifted if != 0. More...
 
double operator[] (const index_t n) const
 operator []: Access boundaries array-style More...
 
constexpr bool operator== (const interval< double > &rhs) const noexcept
 
constexpr bool operator!= (const interval< double > &rhs) const noexcept
 
void SetWidth (const double &width)
 
void SetCenter (const double &center)
 
constexpr bool Contains (const double &x) const noexcept
 
constexpr bool Disjoint (const ant::interval< double > &i) const noexcept
 
void Extend (const interval< double > &other)
 Extend the interval if the given covers a larger range. More...
 
void Extend (const double &other)
 Extend the interval if the given covers a larger range. More...
 
bool tryJoinWith (const ant::interval< double > &other)
 Join another interval into this one if they overlap. More...
 
void MakeSane ()
 Make sure, start < stop. More...
 
constexpr bool IsSane () const noexcept
 
constexpr double Clip (const double &x) const
 Clip x to be inside the interval. More...
 
interval< double > & Round () noexcept
 Round boundaries to integer using std::round. More...
 
std::string AsRangeString (const std::string &label="x") const noexcept
 AsRangeString makes "mathematical" string expression of interval. More...
 

Protected Attributes

std::string label
 
- Protected Attributes inherited from ant::BinSettings
unsigned int bins
 
- Protected Attributes inherited from ant::interval< double >
double _start
 
double _stop
 

Additional Inherited Members

- Static Public Member Functions inherited from ant::BinSettings
static BinSettings RoundToBinSize (const BinSettings &bins, const double binSize)
 Produces BinSettings close to the supplied one, but with a given bin size. Slightly modifies the number of bins and boundaries. Useful to to counteract binning effects if intrinsic spacing of data is known (for example ADC channel widths). More...
 
static BinSettings Make (const std::vector< double > &x_values)
 Make creates optimal BinSettings for given x_values. More...
 
- Static Public Member Functions inherited from ant::interval< double >
static constexpr interval CenterWidth (const double center, const double width) noexcept
 Factory Function: Create interval from center and width. More...
 
static constexpr interval getMaxRange () noexcept
 
static constexpr interval getMaxPositiveRange () noexcept
 
static constexpr interval getMaxNegativeRange () noexcept
 

Constructor & Destructor Documentation

◆ AxisSettings()

ant::AxisSettings::AxisSettings ( const std::string &  label_,
const BinSettings bin_settings 
)
inline

Member Function Documentation

◆ Label() [1/2]

const std::string& ant::AxisSettings::Label ( ) const
inline

◆ Label() [2/2]

std::string& ant::AxisSettings::Label ( )
inline

Member Data Documentation

◆ label

std::string ant::AxisSettings::label
protected

The documentation for this class was generated from the following file: