yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
YODA::XDirectionMixin< Derived > Struct Template Reference

CRTP mixin introducing convenience aliases along X axis. More...

#include <PointUtils.h>

Public Member Functions

Point accessors
double x () const
 Get x value.
 
void setX (double x)
 Set the x value.
 
x error accessors
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.
 
Combined x value and error setters
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.
 
void scaleX (double scalex)
 Scaling of x axis.
 

Detailed Description

template<class Derived>
struct YODA::XDirectionMixin< Derived >

CRTP mixin introducing convenience aliases along X axis.

Definition at line 18 of file PointUtils.h.

Member Function Documentation

◆ scaleX()

template<class Derived >
void YODA::XDirectionMixin< Derived >::scaleX ( double  scalex)
inline

Scaling of x axis.

Definition at line 129 of file PointUtils.h.

129 {
130 setX(x()*scalex);
131 setXErrs(xErrMinus()*scalex, xErrPlus()*scalex);
132 }
double x() const
Get x value.
Definition PointUtils.h:24
void setXErrs(double ex)
Set symmetric x error (alias)
Definition PointUtils.h:75
double xErrPlus() const
Get plus x error.
Definition PointUtils.h:49
void setX(double x)
Set the x value.
Definition PointUtils.h:29
double xErrMinus() const
Get minus x error.
Definition PointUtils.h:44

References YODA::XDirectionMixin< Derived >::setX(), YODA::XDirectionMixin< Derived >::setXErrs(), YODA::XDirectionMixin< Derived >::x(), YODA::XDirectionMixin< Derived >::xErrMinus(), and YODA::XDirectionMixin< Derived >::xErrPlus().

◆ setX() [1/4]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setX ( double  x)
inline

◆ setX() [2/4]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setX ( double  x,
double  ex 
)
inline

Set x value and symmetric error.

Definition at line 106 of file PointUtils.h.

106 {
107 setX(x);
108 setXErr(ex);
109 }
void setXErr(double ex)
Set symmetric x error.
Definition PointUtils.h:69

References YODA::XDirectionMixin< Derived >::setX(), YODA::XDirectionMixin< Derived >::setXErr(), and YODA::XDirectionMixin< Derived >::x().

◆ setX() [3/4]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setX ( double  x,
double  exminus,
double  explus 
)
inline

Set x value and asymmetric error.

Definition at line 112 of file PointUtils.h.

112 {
113 setX(x);
114 setXErrs(exminus, explus);
115 }

References YODA::XDirectionMixin< Derived >::setX(), YODA::XDirectionMixin< Derived >::setXErrs(), and YODA::XDirectionMixin< Derived >::x().

◆ setX() [4/4]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setX ( double  x,
std::pair< double, double > &  ex 
)
inline

Set x value and asymmetric error.

Definition at line 118 of file PointUtils.h.

118 {
119 setX(x);
120 setXErrs(ex);
121 }

References YODA::XDirectionMixin< Derived >::setX(), YODA::XDirectionMixin< Derived >::setXErrs(), and YODA::XDirectionMixin< Derived >::x().

◆ setXErr()

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErr ( double  ex)
inline

Set symmetric x error.

Definition at line 69 of file PointUtils.h.

69 {
70 setXErrMinus(ex);
71 setXErrPlus(ex);
72 }
void setXErrMinus(double err)
Set the minus x errors.
Definition PointUtils.h:59
void setXErrPlus(double err)
Set the plus x errors.
Definition PointUtils.h:64

References YODA::XDirectionMixin< Derived >::setXErrMinus(), and YODA::XDirectionMixin< Derived >::setXErrPlus().

Referenced by YODA::XDirectionMixin< Derived >::setX(), and YODA::XDirectionMixin< Derived >::setXErrs().

◆ setXErrMinus()

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErrMinus ( double  err)
inline

Set the minus x errors.

Definition at line 59 of file PointUtils.h.

59 {
60 static_cast<Derived*>(this)->setErrMinus(0, err);
61 }

Referenced by YODA::XDirectionMixin< Derived >::setXErr().

◆ setXErrPlus()

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErrPlus ( double  err)
inline

Set the plus x errors.

Definition at line 64 of file PointUtils.h.

64 {
65 static_cast<Derived*>(this)->setErrPlus(0, err);
66 }

Referenced by YODA::XDirectionMixin< Derived >::setXErr().

◆ setXErrs() [1/3]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErrs ( double  errminus,
double  errplus 
)
inline

Set the x errors.

Definition at line 80 of file PointUtils.h.

80 {
81 static_cast<Derived*>(this)->setErrs(0, {errminus, errplus});
82 }

◆ setXErrs() [2/3]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErrs ( double  ex)
inline

◆ setXErrs() [3/3]

template<class Derived >
void YODA::XDirectionMixin< Derived >::setXErrs ( std::pair< double, double >  errs)
inline

Set the x errors.

Definition at line 85 of file PointUtils.h.

85 {
86 static_cast<Derived*>(this)->setErrs(0, errs);
87 }

◆ x()

template<class Derived >
double YODA::XDirectionMixin< Derived >::x ( ) const
inline

◆ xErrAvg()

template<class Derived >
double YODA::XDirectionMixin< Derived >::xErrAvg ( ) const
inline

Definition at line 54 of file PointUtils.h.

54 {
55 return static_cast<const Derived*>(this)->errAvg(0);
56 }

◆ xErrMinus()

template<class Derived >
double YODA::XDirectionMixin< Derived >::xErrMinus ( ) const
inline

Get minus x error.

Definition at line 44 of file PointUtils.h.

44 {
45 return static_cast<const Derived*>(this)->errMinus(0);
46 }

Referenced by YODA::XDirectionMixin< Derived >::scaleX(), and YODA::XDirectionMixin< Derived >::xMin().

◆ xErrPlus()

template<class Derived >
double YODA::XDirectionMixin< Derived >::xErrPlus ( ) const
inline

Get plus x error.

Definition at line 49 of file PointUtils.h.

49 {
50 return static_cast<const Derived*>(this)->errPlus(0);
51 }

Referenced by YODA::XDirectionMixin< Derived >::scaleX().

◆ xErrs()

template<class Derived >
std::pair< double, double > YODA::XDirectionMixin< Derived >::xErrs ( ) const
inline

Get x error pair.

Definition at line 39 of file PointUtils.h.

39 {
40 return static_cast<const Derived*>(this)->errs(0);
41 }

◆ xMax()

template<class Derived >
double YODA::XDirectionMixin< Derived >::xMax ( ) const
inline

Get value plus positive x-error.

Definition at line 96 of file PointUtils.h.

96 {
97 return static_cast<const Derived*>(this)->max(0);
98 }

◆ xMin()

template<class Derived >
double YODA::XDirectionMixin< Derived >::xMin ( ) const
inline

Get value minus negative x-error.

Definition at line 90 of file PointUtils.h.

90 {
91 return x() - xErrMinus();
92 return static_cast<const Derived*>(this)->min(0);
93 }

References YODA::XDirectionMixin< Derived >::x(), and YODA::XDirectionMixin< Derived >::xErrMinus().


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