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

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

#include <PointUtils.h>

Public Member Functions

Point accessors
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.
 
x error accessors
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.
 
Combined y value and error setters
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.
 
void scaleY (double scaley)
 Scaling of y axis.
 

Detailed Description

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

CRTP mixin introducing convenience aliases along Y axis.

Definition at line 142 of file PointUtils.h.

Member Function Documentation

◆ scaleY()

template<class Derived >
void YODA::YDirectionMixin< Derived >::scaleY ( double  scaley)
inline

Scaling of y axis.

Definition at line 268 of file PointUtils.h.

268 {
269 setY(y()*scaley);
270 setYErrs(yErrMinus()*scaley, yErrPlus()*scaley);
271 }
double y() const
Get y value.
Definition PointUtils.h:148
void setYErrs(double ey)
Set symmetric y error (alias)
Definition PointUtils.h:215
double yErrMinus() const
Get minus y error.
Definition PointUtils.h:184
double yErrPlus() const
Get plus y error.
Definition PointUtils.h:189
void setY(double y)
Set the y value.
Definition PointUtils.h:153

References YODA::YDirectionMixin< Derived >::setY(), YODA::YDirectionMixin< Derived >::setYErrs(), YODA::YDirectionMixin< Derived >::y(), YODA::YDirectionMixin< Derived >::yErrMinus(), and YODA::YDirectionMixin< Derived >::yErrPlus().

◆ setXY() [1/2]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setXY ( const std::pair< double, double > &  xy)
inline

Set x and y values.

Definition at line 169 of file PointUtils.h.

169 {
170 setXY(xy.first, xy.second);
171 }
void setXY(double x, double y)
Set x and y values.
Definition PointUtils.h:163
std::pair< double, double > xy() const
Definition PointUtils.h:157

References YODA::YDirectionMixin< Derived >::setXY(), and YODA::YDirectionMixin< Derived >::xy().

◆ setXY() [2/2]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setXY ( double  x,
double  y 
)
inline

Set x and y values.

Definition at line 163 of file PointUtils.h.

163 {
164 static_cast<Derived*>(this)->setVal(0, x);
165 static_cast<Derived*>(this)->setVal(1, y);
166 }

References YODA::YDirectionMixin< Derived >::y().

Referenced by YODA::YDirectionMixin< Derived >::setXY().

◆ setY() [1/4]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setY ( double  y)
inline

Set the y value.

Definition at line 153 of file PointUtils.h.

153 {
154 static_cast<Derived*>(this)->setVal(1, y);
155 }

References YODA::YDirectionMixin< Derived >::y().

Referenced by YODA::YDirectionMixin< Derived >::scaleY(), YODA::YDirectionMixin< Derived >::setY(), YODA::YDirectionMixin< Derived >::setY(), and YODA::YDirectionMixin< Derived >::setY().

◆ setY() [2/4]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setY ( double  y,
double  ey 
)
inline

Set y value and symmetric error.

Definition at line 245 of file PointUtils.h.

245 {
246 setY(y);
247 setYErr(ey);
248 }
void setYErr(double ey)
Set symmetric y error.
Definition PointUtils.h:209

References YODA::YDirectionMixin< Derived >::setY(), YODA::YDirectionMixin< Derived >::setYErr(), and YODA::YDirectionMixin< Derived >::y().

◆ setY() [3/4]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setY ( double  y,
double  eyminus,
double  eyplus 
)
inline

Set y value and asymmetric error.

Definition at line 251 of file PointUtils.h.

251 {
252 setY(y);
253 setYErrs(eyminus, eyplus);
254 }

References YODA::YDirectionMixin< Derived >::setY(), YODA::YDirectionMixin< Derived >::setYErrs(), and YODA::YDirectionMixin< Derived >::y().

◆ setY() [4/4]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setY ( double  y,
std::pair< double, double > &  ey 
)
inline

Set y value and asymmetric error.

Definition at line 257 of file PointUtils.h.

257 {
258 setY(y);
259 setYErrs(ey);
260 }

References YODA::YDirectionMixin< Derived >::setY(), YODA::YDirectionMixin< Derived >::setYErrs(), and YODA::YDirectionMixin< Derived >::y().

◆ setYErr()

template<class Derived >
void YODA::YDirectionMixin< Derived >::setYErr ( double  ey)
inline

Set symmetric y error.

Definition at line 209 of file PointUtils.h.

209 {
210 setYErrMinus(ey);
211 setYErrPlus(ey);
212 }
void setYErrMinus(double err)
Set the minus y errors.
Definition PointUtils.h:199
void setYErrPlus(double err)
Set the plus y errors.
Definition PointUtils.h:204

References YODA::YDirectionMixin< Derived >::setYErrMinus(), and YODA::YDirectionMixin< Derived >::setYErrPlus().

Referenced by YODA::YDirectionMixin< Derived >::setY(), and YODA::YDirectionMixin< Derived >::setYErrs().

◆ setYErrMinus()

template<class Derived >
void YODA::YDirectionMixin< Derived >::setYErrMinus ( double  err)
inline

Set the minus y errors.

Definition at line 199 of file PointUtils.h.

199 {
200 static_cast<Derived*>(this)->setErrMinus(1, err);
201 }

Referenced by YODA::YDirectionMixin< Derived >::setYErr().

◆ setYErrPlus()

template<class Derived >
void YODA::YDirectionMixin< Derived >::setYErrPlus ( double  err)
inline

Set the plus y errors.

Definition at line 204 of file PointUtils.h.

204 {
205 static_cast<Derived*>(this)->setErrPlus(1, err);
206 }

Referenced by YODA::YDirectionMixin< Derived >::setYErr().

◆ setYErrs() [1/3]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setYErrs ( double  errminus,
double  errplus 
)
inline

Set the y errors.

Definition at line 220 of file PointUtils.h.

220 {
221 static_cast<Derived*>(this)->setErrs(1, {errminus, errplus});
222 }

◆ setYErrs() [2/3]

template<class Derived >
void YODA::YDirectionMixin< Derived >::setYErrs ( double  ey)
inline

◆ setYErrs() [3/3]

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

Set the y errors.

Definition at line 225 of file PointUtils.h.

225 {
226 static_cast<Derived*>(this)->setErrs(1, errs);
227 }

◆ xy()

template<class Derived >
std::pair< double, double > YODA::YDirectionMixin< Derived >::xy ( ) const
inline

Definition at line 157 of file PointUtils.h.

157 {
158 const auto& vals = static_cast<const Derived*>(this)->vals();
159 return {vals[0], vals[1]};
160 }

Referenced by YODA::YDirectionMixin< Derived >::setXY().

◆ y()

template<class Derived >
double YODA::YDirectionMixin< Derived >::y ( ) const
inline

◆ yErrAvg()

template<class Derived >
double YODA::YDirectionMixin< Derived >::yErrAvg ( ) const
inline

Definition at line 194 of file PointUtils.h.

194 {
195 return static_cast<const Derived*>(this)->errAvg(1);
196 }

◆ yErrMinus()

template<class Derived >
double YODA::YDirectionMixin< Derived >::yErrMinus ( ) const
inline

Get minus y error.

Definition at line 184 of file PointUtils.h.

184 {
185 return static_cast<const Derived*>(this)->errMinus(1);
186 }

Referenced by YODA::YDirectionMixin< Derived >::scaleY().

◆ yErrPlus()

template<class Derived >
double YODA::YDirectionMixin< Derived >::yErrPlus ( ) const
inline

Get plus y error.

Definition at line 189 of file PointUtils.h.

189 {
190 return static_cast<const Derived*>(this)->errPlus(1);
191 }

Referenced by YODA::YDirectionMixin< Derived >::scaleY().

◆ yErrs()

template<class Derived >
std::pair< double, double > YODA::YDirectionMixin< Derived >::yErrs ( ) const
inline

Get y error pair.

Definition at line 179 of file PointUtils.h.

179 {
180 return static_cast<const Derived*>(this)->errs(1);
181 }

◆ yMax()

template<class Derived >
double YODA::YDirectionMixin< Derived >::yMax ( ) const
inline

Get value plus positive y-error.

Definition at line 235 of file PointUtils.h.

235 {
236 return static_cast<const Derived*>(this)->max(1);
237 }

◆ yMin()

template<class Derived >
double YODA::YDirectionMixin< Derived >::yMin ( ) const
inline

Get value minus negative y-error.

Definition at line 230 of file PointUtils.h.

230 {
231 return static_cast<const Derived*>(this)->min(1);
232 }

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