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

A 2D data point to be contained in a Scatter2D. More...

#include <Point.h>

Inheritance diagram for YODA::PointND< 2 >:
YODA::PointBase< 2 > YODA::XDirectionMixin< PointND< 2 > > YODA::YDirectionMixin< PointND< 2 > > YODA::Point

Public Types

using BaseT = PointBase< 2 >
 
- Public Types inherited from YODA::PointBase< 2 >
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 y, double ex=0.0, double ey=0.0)
 Constructor from values with optional symmetric errors.
 
 PointND (double x, double y, double exminus, double explus, double eyminus, double eyplus)
 Constructor from values with explicit asymmetric errors.
 
 PointND (double x, double y, const std::pair< double, double > &ex, const std::pair< double, double > &ey)
 Constructor from values with asymmetric errors on both x and y.
 
 PointND (const BaseT &other)
 Copy constructor.
 
 PointND (BaseT &&other)
 Move constructor.
 
void scaleXY (double scalex, double scaley)
 Scaling of both axes.
 
- Public Member Functions inherited from YODA::PointBase< 2 >
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)
 
double val (size_t i) const
 Get the value along direction i.
 
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< 2 > >
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.
 
- Public Member Functions inherited from YODA::YDirectionMixin< PointND< 2 > >
double y () const
 Get y value.
 
void setY (double y)
 Set the y value.
 
std::pair< double, double > xy () const
 
void setXY (double x, double y)
 Set x and y values.
 
void setXY (const std::pair< double, double > &xy)
 Set x and y values.
 
void setY (double y, double ey)
 Set y value and symmetric error.
 
void setY (double y, double eyminus, double eyplus)
 Set y value and asymmetric error.
 
void setY (double y, std::pair< double, double > &ey)
 Set y value and asymmetric error.
 
std::pair< double, double > yErrs () const
 Get y error pair.
 
double yErrMinus () const
 Get minus y error.
 
double yErrPlus () const
 Get plus y error.
 
double yErrAvg () const
 
void setYErrMinus (double err)
 Set the minus y errors.
 
void setYErrPlus (double err)
 Set the plus y errors.
 
void setYErr (double ey)
 Set symmetric y error.
 
void setYErrs (double ey)
 Set symmetric y error (alias)
 
void setYErrs (double errminus, double errplus)
 Set the y errors.
 
void setYErrs (std::pair< double, double > errs)
 Set the y errors.
 
double yMin () const
 Get value minus negative y-error.
 
double yMax () const
 Get value plus positive y-error.
 
void scaleY (double scaley)
 Scaling of y axis.
 

Additional Inherited Members

- Protected Types inherited from YODA::PointBase< 2 >
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 2D data point to be contained in a Scatter2D.

Definition at line 605 of file Point.h.

Member Typedef Documentation

◆ BaseT

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

Definition at line 610 of file Point.h.

Constructor & Destructor Documentation

◆ PointND() [1/5]

YODA::PointND< 2 >::PointND ( double  x,
double  y,
double  ex = 0.0,
double  ey = 0.0 
)
inline

Constructor from values with optional symmetric errors.

Definition at line 617 of file Point.h.

618 : BaseT( {x,y}, {{ex,ex}, {ey,ey}}) { }
PointBase< 2 > BaseT
Definition Point.h:610
double x() const
Get x value.
Definition PointUtils.h:24
double y() const
Get y value.
Definition PointUtils.h:148

◆ PointND() [2/5]

YODA::PointND< 2 >::PointND ( double  x,
double  y,
double  exminus,
double  explus,
double  eyminus,
double  eyplus 
)
inline

Constructor from values with explicit asymmetric errors.

Definition at line 622 of file Point.h.

625 : BaseT({x,y}, {{exminus,explus}, {eyminus,eyplus}}) { }

◆ PointND() [3/5]

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

Constructor from values with asymmetric errors on both x and y.

Definition at line 629 of file Point.h.

630 : BaseT({x,y}, {ex, ey}) { }

◆ PointND() [4/5]

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

Copy constructor.

Definition at line 634 of file Point.h.

634: BaseT(other) { }

◆ PointND() [5/5]

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

Move constructor.

Definition at line 637 of file Point.h.

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

Member Function Documentation

◆ scaleXY()

void YODA::PointND< 2 >::scaleXY ( double  scalex,
double  scaley 
)
inline

Scaling of both axes.

Definition at line 646 of file Point.h.

646 {
647 scaleX(scalex);
648 scaleY(scaley);
649 }
void scaleX(double scalex)
Scaling of x axis.
Definition PointUtils.h:129
void scaleY(double scaley)
Scaling of y axis.
Definition PointUtils.h:268

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