|
YODA - Yet more Objects for Data Analysis 2.0.2
|
Go to the documentation of this file.
6#ifndef YODA_PointUtils_h
7#define YODA_PointUtils_h
17 template < class Derived>
25 return static_cast<const Derived* >( this)->vals()[0];
30 static_cast<Derived* >( this)->setVal(0, x);
39 std::pair<double,double> xErrs() const {
40 return static_cast<const Derived* >( this)->errs(0);
45 return static_cast<const Derived* >( this)->errMinus(0);
50 return static_cast<const Derived* >( this)->errPlus(0);
55 return static_cast<const Derived* >( this)->errAvg(0);
60 static_cast<Derived* >( this)->setErrMinus(0, err);
65 static_cast<Derived* >( this)->setErrPlus(0, err);
80 void setXErrs( double errminus, double errplus) {
81 static_cast<Derived* >( this)->setErrs(0, {errminus, errplus});
86 static_cast<Derived* >( this)->setErrs(0, errs);
92 return static_cast<const Derived* >( this)->min(0);
97 return static_cast<const Derived* >( this)->max(0);
112 void setX( double x, double exminus, double explus) {
118 void setX( double x, std::pair<double,double>& ex) {
141 template < class Derived>
149 return static_cast<const Derived* >( this)->vals()[1];
154 static_cast<Derived* >( this)->setVal(1, y);
157 std::pair<double,double> xy() const {
158 const auto& vals = static_cast<const Derived* >( this)->vals();
159 return {vals[0], vals[1]};
164 static_cast<Derived* >( this)->setVal(0, x);
165 static_cast<Derived* >( this)->setVal(1, y);
169 void setXY( const std::pair<double,double>& xy) {
179 std::pair<double,double> yErrs() const {
180 return static_cast<const Derived* >( this)->errs(1);
185 return static_cast<const Derived* >( this)->errMinus(1);
190 return static_cast<const Derived* >( this)->errPlus(1);
195 return static_cast<const Derived* >( this)->errAvg(1);
200 static_cast<Derived* >( this)->setErrMinus(1, err);
205 static_cast<Derived* >( this)->setErrPlus(1, err);
221 static_cast<Derived* >( this)->setErrs(1, {errminus, errplus});
226 static_cast<Derived* >( this)->setErrs(1, errs);
231 return static_cast<const Derived* >( this)->min(1);
236 return static_cast<const Derived* >( this)->max(1);
251 void setY( double y, double eyminus, double eyplus) {
257 void setY( double y, std::pair<double,double>& ey) {
280 template < class Derived>
288 return static_cast<const Derived* >( this)->vals()[2];
293 static_cast<Derived* >( this)->setVal(2, z);
298 static_cast<Derived* >( this)->setVal(0, x);
299 static_cast<Derived* >( this)->setVal(1, y);
300 static_cast<Derived* >( this)->setVal(2, z);
309 std::pair<double,double> zErrs() const {
310 return static_cast<const Derived* >( this)->errs(2);
315 return static_cast<const Derived* >( this)->errMinus(2);
320 return static_cast<const Derived* >( this)->errPlus(2);
325 return static_cast<const Derived* >( this)->errAvg(2);
330 static_cast<Derived* >( this)->setErrMinus(2, err);
335 static_cast<Derived* >( this)->setErrPlus(2, err);
351 static_cast<Derived* >( this)->setErrs(2, {errminus, errplus});
356 static_cast<Derived* >( this)->setErrs(2, errs);
361 return static_cast<const Derived* >( this)->min(2);
366 return static_cast<const Derived* >( this)->max(2);
381 void setZ( double z, double ezminus, double ezplus) {
387 void setZ( double z, std::pair<double,double>& ez) {
Anonymous namespace to limit visibility.
CRTP mixin introducing convenience aliases along X axis.
void scaleX(double scalex) Scaling of x axis.
double x() const Get x value.
void setXErrs(double ex) Set symmetric x error (alias)
double xErrPlus() const Get plus x error.
void setXErrs(double errminus, double errplus) Set the x errors.
void setXErrs(std::pair< double, double > errs) Set the x errors.
void setXErr(double ex) Set symmetric x error.
void setX(double x, double exminus, double explus) Set x value and asymmetric error.
void setX(double x) Set the x value.
std::pair< double, double > xErrs() const Get x error pair.
void setXErrMinus(double err) Set the minus x errors.
void setXErrPlus(double err) Set the plus x errors.
void setX(double x, double ex) Set x value and symmetric error.
double xMin() const Get value minus negative x-error.
void setX(double x, std::pair< double, double > &ex) Set x value and asymmetric error.
double xMax() const Get value plus positive x-error.
double xErrMinus() const Get minus x error.
CRTP mixin introducing convenience aliases along Y axis.
void setYErrMinus(double err) Set the minus y errors.
void setXY(double x, double y) Set x and y values.
void setYErrs(double errminus, double errplus) Set the y errors.
std::pair< double, double > yErrs() const Get y error pair.
void setY(double y, double eyminus, double eyplus) Set y value and asymmetric error.
double y() const Get y value.
void setXY(const std::pair< double, double > &xy) Set x and y values.
void setY(double y, std::pair< double, double > &ey) Set y value and asymmetric error.
void setY(double y, double ey) Set y value and symmetric error.
void setYErrs(std::pair< double, double > errs) Set the y errors.
void setYErrs(double ey) Set symmetric y error (alias)
double yErrMinus() const Get minus y error.
void setYErrPlus(double err) Set the plus y errors.
std::pair< double, double > xy() const
void scaleY(double scaley) Scaling of y axis.
double yErrPlus() const Get plus y error.
void setYErr(double ey) Set symmetric y error.
double yMin() const Get value minus negative y-error.
double yMax() const Get value plus positive y-error.
void setY(double y) Set the y value.
CRTP mixin introducing convenience aliases along Z axis.
void setZErrPlus(double err) Set the plus y errors.
void setXYZ(double x, double y, double z) Set x and y values.
double zErrPlus() const Get plus z error.
double zErrMinus() const Get minus z error.
std::pair< double, double > zErrs() const Get y error pair.
void setZErrMinus(double err) Set the minus z errors.
void setZErrs(std::pair< double, double > errs) Set the z errors.
void setZ(double z, double ezminus, double ezplus) Set y value and asymmetric error.
void setZ(double z) Set the y value.
void setZErrs(double errminus, double errplus) Set the z errors.
void setZErr(double ez) Set symmetric z error.
void setZErrs(double ez) Set symmetric z error (alias)
double zMax() const Get value plus positive y-error.
void setZ(double z, std::pair< double, double > &ez) Set z value and asymmetric error.
double zMin() const Get value minus negative y-error.
void setZ(double z, double ez) Set z value and symmetric error.
void scaleZ(double scalez) Scaling of z axis.
double z() const Get z value.
|