yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
YODA::PointND< 1 > Class Reference

A 1D data point to be contained in a Scatter1D. More...

#include <Point.h>

Inheritance diagram for YODA::PointND< 1 >:
YODA::PointBase< 1 > YODA::XDirectionMixin< PointND< 1 > > YODA::Point

Public Types

using BaseT = PointBase< 1 >
 
- Public Types inherited from YODA::PointBase< 1 >
using NdVal = typename Utils::ndarray< double, N >
 
using NdValPair = typename Utils::ndarray< std::pair< double, double >, N >
 
using DataSize = std::integral_constant< size_t, 3 *N >
 
- Public Types inherited from YODA::Point
using ValuePair = std::pair< double, double >
 

Public Member Functions

Constructors
 PointND (double x, double ex=0.0)
 Constructor from values with optional symmetric errors.
 
 PointND (double x, double exminus, double explus)
 Constructor from values with explicit asymmetric errors.
 
 PointND (double x, const std::pair< double, double > &ex)
 Constructor from values with asymmetric errors.
 
 PointND (const BaseT &other)
 Copy constructor.
 
 PointND (BaseT &&other)
 Move constructor.
 
Coordinate accessors
double val (size_t i=0) const
 Get the value along direction i.
 
- Public Member Functions inherited from YODA::PointBase< 1 >
size_t dim () const
 Space dimension of the point.
 
 PointBase ()
 
 PointBase (ValRange &&val)
 Constructor from position values without errors.
 
 PointBase (ValRange &&val, PairRange &&errs)
 Constructor from values and a set of asymmetric errors.
 
 PointBase (ValRange &&val, ValRange &&errs)
 Constructor from values and a set of symmetric errors.
 
 PointBase (ValRange &&val, ValRange &&errsdn, ValRange &&errsup)
 Constructor from values and a set of asymmetric errors.
 
 PointBase (const PointBase &p)
 
 PointBase (PointBase &&p)
 
void clear ()
 Clear the point values and errors.
 
PointBaseoperator= (const PointBase &p)
 Assignment operator.
 
PointBaseoperator= (PointBase &&p)
 Assignment operator.
 
NdValvals ()
 Get the coordinate vector.
 
const NdValvals () const
 Get the coordinate vector (const version)
 
void setVal (const NdVal &val)
 Set the coordinate vector.
 
void setVal (const size_t i, const double val)
 Set a specific coordinate.
 
NdValPairerrs ()
 Get error values.
 
const NdValPairerrs () const
 Get error values (const version)
 
Pair errs (const size_t i) const
 Get error values along axis i.
 
double errMinus (const size_t i) const
 Get the minus error along axis i.
 
double errPlus (const size_t i) const
 Get the plus error along axis i.
 
double errAvg (const size_t i) const
 
double min (const size_t i) const
 Get value minus negative error along axis i.
 
double max (const size_t i) const
 Get value plus positive error along axis i.
 
void setErr (const size_t i, const double e)
 Set a symmetric error pair along axis i.
 
void setErrs (const size_t i, const double eminus, const double eplus)
 Set an asymmetric error pair along axis i.
 
void setErrs (const size_t i, const std::pair< double, double > &e)
 Set a specific error pair along axis i.
 
void setErrMinus (const size_t i, const double eminus)
 Set a specific minus error along axis i.
 
void setErrPlus (const size_t i, const double eplus)
 Set a specific plus error along axis i.
 
void set (const size_t i, const double val, const double e)
 Set value and symmetric error for direction i.
 
void set (const size_t i, const double val, const double eminus, const double eplus)
 Set value and asymmetric error for direction i.
 
void set (const size_t i, const double val, const std::pair< double, double > &e)
 Set value and asymmetric error for direction i.
 
void scaleVal (const size_t i, const double scale)
 Scaling value along direction i.
 
void scaleErr (const size_t i, const double scale)
 Scaling error along direction i.
 
void scale (const size_t i, const double scale)
 Scaling along direction i.
 
void scale (const NdVal &scales)
 Uniform scaling.
 
void scale (const Trf< N > &trf)
 Generalised transformations with functors.
 
void scale (const size_t i, const Trf< N > &trf)
 
void transform (const size_t i, const Trf< N > &trf)
 
- Public Member Functions inherited from YODA::Point
virtual ~Point ()
 Virtual destructor for inheritance.
 
- Public Member Functions inherited from YODA::XDirectionMixin< PointND< 1 > >
double x () const
 Get x value.
 
void setX (double x)
 Set the x value.
 
void setX (double x, double ex)
 Set x value and symmetric error.
 
void setX (double x, double exminus, double explus)
 Set x value and asymmetric error.
 
void setX (double x, std::pair< double, double > &ex)
 Set x value and asymmetric error.
 
std::pair< double, double > xErrs () const
 Get x error pair.
 
double xErrMinus () const
 Get minus x error.
 
double xErrPlus () const
 Get plus x error.
 
double xErrAvg () const
 
void setXErrMinus (double err)
 Set the minus x errors.
 
void setXErrPlus (double err)
 Set the plus x errors.
 
void setXErr (double ex)
 Set symmetric x error.
 
void setXErrs (double ex)
 Set symmetric x error (alias)
 
void setXErrs (double errminus, double errplus)
 Set the x errors.
 
void setXErrs (std::pair< double, double > errs)
 Set the x errors.
 
double xMin () const
 Get value minus negative x-error.
 
double xMax () const
 Get value plus positive x-error.
 
void scaleX (double scalex)
 Scaling of x axis.
 

Additional Inherited Members

- Protected Types inherited from YODA::PointBase< 1 >
using Pair = std::pair< double, double >
 
using ValList = std::initializer_list< double >
 
using PairList = std::initializer_list< Pair >
 
using containedType = std::decay_t< decltype(*std::declval< Arr >().begin())>
 
using containsPair = typename std::is_same< containedType< Arr >, Pair >
 
using isIterable = std::enable_if_t< Iterable< T >::value >
 
using isIterableWithPair = std::enable_if_t<(Iterable< T >::value &&Iterable< U >::value &&containsPair< U >::value)>
 

Detailed Description

A 1D data point to be contained in a Scatter1D.

Definition at line 554 of file Point.h.

Member Typedef Documentation

◆ BaseT

using YODA::PointND< 1 >::BaseT = PointBase<1>

Definition at line 558 of file Point.h.

Constructor & Destructor Documentation

◆ PointND() [1/5]

YODA::PointND< 1 >::PointND ( double  x,
double  ex = 0.0 
)
inline

Constructor from values with optional symmetric errors.

Definition at line 565 of file Point.h.

566 : BaseT({x}, {{ex, ex}}) { }
PointBase< 1 > BaseT
Definition Point.h:558
double x() const
Get x value.
Definition PointUtils.h:24

◆ PointND() [2/5]

YODA::PointND< 1 >::PointND ( double  x,
double  exminus,
double  explus 
)
inline

Constructor from values with explicit asymmetric errors.

Definition at line 570 of file Point.h.

571 : BaseT({x}, {{exminus, explus}}) { }

◆ PointND() [3/5]

YODA::PointND< 1 >::PointND ( double  x,
const std::pair< double, double > &  ex 
)
inline

Constructor from values with asymmetric errors.

Definition at line 575 of file Point.h.

576 : BaseT( {x}, {ex}) { }

◆ PointND() [4/5]

YODA::PointND< 1 >::PointND ( const BaseT other)
inline

Copy constructor.

Definition at line 580 of file Point.h.

580: BaseT(other) {}

◆ PointND() [5/5]

YODA::PointND< 1 >::PointND ( BaseT &&  other)
inline

Move constructor.

Definition at line 583 of file Point.h.

583: BaseT(std::move(other)) {}

Member Function Documentation

◆ val()

double YODA::PointND< 1 >::val ( size_t  i = 0) const
inlinevirtual

Get the value along direction i.

Reimplemented from YODA::PointBase< 1 >.

Definition at line 592 of file Point.h.

592 {
593 if (i >= 1) throw RangeError("Invalid axis int, must be in range 0..dim-1");
594 return _val[i];
595 }

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