yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis  1.9.0
YODA::Point3D Class Reference

A 3D data point to be contained in a Scatter3D. More...

#include <Point3D.h>

Inheritance diagram for YODA::Point3D:
YODA::Point< N >

Public Member Functions

size_t dim ()
 Space dimension of the point. More...
 
Constructors
 Point3D ()
 
 Point3D (double x, double y, double z, double ex=0.0, double ey=0.0, double ez=0.0, std::string source="")
 Constructor from values with optional symmetric errors. More...
 
 Point3D (double x, double y, double z, double exminus, double explus, double eyminus, double eyplus, double ezminus, double ezplus, std::string source="")
 Constructor from values with explicit asymmetric errors. More...
 
 Point3D (double x, double y, double z, const std::pair< double, double > &ex, const std::pair< double, double > &ey, const std::pair< double, double > &ez, std::string source="")
 Constructor from asymmetric errors given as vectors. More...
 
 Point3D (const Point3D &p)
 Copy constructor. More...
 
Point3Doperator= (const Point3D &p)
 Copy assignment. More...
 
Value and error accessors
double x () const
 Get x value. More...
 
void setX (double x)
 Set x value. More...
 
double y () const
 Get y value. More...
 
void setY (double y)
 Set y value. More...
 
double z () const
 Get z value. More...
 
void setZ (double z)
 Set z value. More...
 
void setXYZ (double x, double y, double z)
 Set x, y and z values. More...
 
x error accessors
const std::pair< double, double > & xErrs () const
 Get x-error values. More...
 
double xErrMinus () const
 Get negative x-error value. More...
 
double xErrPlus () const
 Get positive x-error value. More...
 
double xErrAvg () const
 Get average x-error value. More...
 
void setXErrMinus (double exminus)
 Set negative x error. More...
 
void setXErrPlus (double explus)
 Set positive x error. More...
 
void setXErr (double ex)
 Set symmetric x error. More...
 
void setXErrs (double ex)
 Set symmetric x error (alias) More...
 
void setXErrs (double exminus, double explus)
 Set asymmetric x error. More...
 
void setXErrs (const std::pair< double, double > &ex)
 Set asymmetric x error. More...
 
double xMin () const
 Get value minus negative x-error. More...
 
double xMax () const
 Get value plus positive x-error. More...
 
y error accessors
const std::pair< double, double > & yErrs () const
 Get y-error values. More...
 
double yErrMinus () const
 Get negative y-error value. More...
 
double yErrPlus () const
 Get positive y-error value. More...
 
double yErrAvg () const
 Get average y-error value. More...
 
void setYErrMinus (double eyminus)
 Set negative y error. More...
 
void setYErrPlus (double eyplus)
 Set positive y error. More...
 
void setYErr (double ey)
 Set symmetric y error. More...
 
void setYErrs (double ey)
 Set symmetric y error (alias) More...
 
void setYErrs (double eyminus, double eyplus)
 Set asymmetric y error. More...
 
void setYErrs (const std::pair< double, double > &ey)
 Set asymmetric y error. More...
 
double yMin () const
 Get value minus negative y-error. More...
 
double yMax () const
 Get value plus positive y-error. More...
 
z error accessors
const std::pair< double, double > & zErrs (std::string source="") const
 Get z-error values. More...
 
double zErrMinus (std::string source="") const
 Get negative z-error value. More...
 
double zErrPlus (std::string source="") const
 Get positive z-error value. More...
 
double zErrAvg (std::string source="") const
 Get average z-error value. More...
 
void setZErrMinus (double ezminus, std::string source="")
 Set negative z error. More...
 
void setZErrPlus (double ezplus, std::string source="")
 Set positive z error. More...
 
void setZErr (double ez, std::string source="")
 Set symmetric z error. More...
 
void setZErrs (double ez, std::string source="")
 Set symmetric z error (alias) More...
 
void setZErrs (double ezminus, double ezplus, std::string source="")
 Set asymmetric z error. More...
 
void setZErrs (const std::pair< double, double > &ez, std::string source="")
 Set asymmetric z error. More...
 
double zMin (std::string source="") const
 Get value minus negative z-error. More...
 
double zMax (std::string source="") const
 Get value plus positive z-error. More...
 
Combined x/y value and error setters
void setX (double x, double ex)
 Set x value and symmetric error. More...
 
void setX (double x, double exminus, double explus)
 Set x value and asymmetric error. More...
 
void setX (double x, std::pair< double, double > &ex)
 Set x value and asymmetric error. More...
 
void setY (double y, double ey)
 Set y value and symmetric error. More...
 
void setY (double y, double eyminus, double eyplus)
 Set y value and asymmetric error. More...
 
void setY (double y, std::pair< double, double > &ey)
 Set y value and asymmetric error. More...
 
void setZ (double z, double ez, std::string source="")
 Set z value and symmetric error. More...
 
void setZ (double z, double ezminus, double ezplus, std::string source="")
 Set z value and asymmetric error. More...
 
void setZ (double z, std::pair< double, double > &ez, std::string source="")
 Set z value and asymmetric error. More...
 
void scaleX (double scalex)
 Scaling of x axis. More...
 
void scaleY (double scaley)
 Scaling of y axis. More...
 
void scaleZ (double scalez)
 Scaling of z axis. More...
 
void scaleXYZ (double scalex, double scaley, double scalez)
 Scaling of all three axes. More...
 
void scale (size_t i, double scale)
 Scaling along direction i. More...
 
Integer axis accessor equivalents
double val (size_t i) const
 Get the point value for direction i. More...
 
void setVal (size_t i, double val)
 Set the point value for direction i. More...
 
const std::map< std::string, std::pair< double, double > > & errMap () const
 Get error map for direction i. More...
 
void getVariationsFromParent () const
 Parse the variations annotation on the parent scatter. More...
 
const std::pair< double, double > & errs (size_t i, std::string source="") const
 Get error values for direction i. More...
 
double errMinus (size_t i, std::string source="") const
 Get negative error value for direction i. More...
 
double errPlus (size_t i, std::string source="") const
 Get positive error value for direction i. More...
 
double errAvg (size_t i, std::string source="") const
 Get average error value for direction i. More...
 
void setErrMinus (size_t i, double eminus, std::string source="")
 Set negative error for direction i. More...
 
void setErrPlus (size_t i, double eplus, std::string source="")
 Set positive error for direction i. More...
 
void setErr (size_t i, double e, std::string source="")
 Set symmetric error for direction i. More...
 
void setErrs (size_t i, double eminus, double eplus, std::string source="")
 Set asymmetric error for direction i. More...
 
void setErrs (size_t i, std::pair< double, double > &e, std::string source="")
 Set asymmetric error for direction i. More...
 
void set (size_t i, double val, double e, std::string source="")
 Set value and symmetric error for direction i. More...
 
void set (size_t i, double val, double eminus, double eplus, std::string source="")
 Set value and asymmetric error for direction i. More...
 
void set (size_t i, double val, std::pair< double, double > &e, std::string source="")
 Set value and asymmetric error for direction i. More...
 
- Public Member Functions inherited from YODA::Point< N >
virtual ~Point ()
 Virtual destructor for inheritance. More...
 
void setParent (Scatter *parent)
 
template<typename T = Scatter>
T * getParent () const
 
virtual void setErrs (size_t i, double e, std::string source="")
 Set symmetric error for direction i (alias) More...
 
 Point ()
 
 Point (const NdVal &pos)
 Constructor from position values without errors. More...
 
 Point (const NdVal &pos, const NdValPair &errs)
 Constructor from values with a single set of asymmetric errors. More...
 
 Point (const NdVal &pos, const Error< N > &err)
 Constructor from values and a single Error object. More...
 
 Point (const std::vector< double > &pos, const std::vector< Error< N > > &errs)
 Constructor from values and a collection of Error objects. More...
 
void clear ()
 Clear the point values and errors. More...
 
NdValpos ()
 Get the coordinate vector. More...
 
const NdValpos () const
 Get the coordinate vector (const version) More...
 
void setPos (const NdVal &pos)
 Set the coordinate vector. More...
 
Errorserrs ()
 Get error values. More...
 
const Errorserrs () const
 Get error values (const version) More...
 
void setErrs (const Errors &errs)
 Set the error values. More...
 
void scale (const NdVal &scales)
 Uniform scaling. More...
 

Additional Inherited Members

- Public Types inherited from YODA::Point< N >
typedef std::pair< double, double > ValuePair
 
typedef Utils::ndarray< double, N > NdVal
 
typedef Utils::ndarray< std::pair< double, double >, N > NdValPair
 
typedef Utils::sortedvector< Error< N > > Errors
 

Detailed Description

A 3D data point to be contained in a Scatter3D.

Definition at line 18 of file Point3D.h.

Constructor & Destructor Documentation

◆ Point3D() [1/5]

YODA::Point3D::Point3D ( )
inline

Definition at line 25 of file Point3D.h.

25 { }

◆ Point3D() [2/5]

YODA::Point3D::Point3D ( double  x,
double  y,
double  z,
double  ex = 0.0,
double  ey = 0.0,
double  ez = 0.0,
std::string  source = "" 
)
inline

Constructor from values with optional symmetric errors.

Definition at line 29 of file Point3D.h.

30  : _x(x), _y(y), _z(z)
31  {
32  _ex = std::make_pair(ex, ex);
33  _ey = std::make_pair(ey, ey);
34  _ez[source] = std::make_pair(ez, ez);
35  }
double z() const
Get z value.
Definition: Point3D.h:112
double y() const
Get y value.
Definition: Point3D.h:106
double x() const
Get x value.
Definition: Point3D.h:100

◆ Point3D() [3/5]

YODA::Point3D::Point3D ( double  x,
double  y,
double  z,
double  exminus,
double  explus,
double  eyminus,
double  eyplus,
double  ezminus,
double  ezplus,
std::string  source = "" 
)
inline

Constructor from values with explicit asymmetric errors.

Definition at line 39 of file Point3D.h.

46  : _x(x), _y(y), _z(z)
47  {
48  _ex = std::make_pair(exminus, explus);
49  _ey = std::make_pair(eyminus, eyplus);
50  _ez[source] = std::make_pair(ezminus, ezplus);
51  }
double z() const
Get z value.
Definition: Point3D.h:112
double y() const
Get y value.
Definition: Point3D.h:106
double x() const
Get x value.
Definition: Point3D.h:100

◆ Point3D() [4/5]

YODA::Point3D::Point3D ( double  x,
double  y,
double  z,
const std::pair< double, double > &  ex,
const std::pair< double, double > &  ey,
const std::pair< double, double > &  ez,
std::string  source = "" 
)
inline

Constructor from asymmetric errors given as vectors.

Definition at line 54 of file Point3D.h.

58  : _x(x), _y(y), _z(z),
59  _ex(ex), _ey(ey)
60  {
61  _ez[source] = ez;
62  }
double z() const
Get z value.
Definition: Point3D.h:112
double y() const
Get y value.
Definition: Point3D.h:106
double x() const
Get x value.
Definition: Point3D.h:100

◆ Point3D() [5/5]

YODA::Point3D::Point3D ( const Point3D p)
inline

Copy constructor.

Definition at line 66 of file Point3D.h.

References YODA::Point< N >::getParent(), and YODA::Point< N >::setParent().

67  : _x(p._x), _y(p._y), _z(p._z),
68  _ex(p._ex), _ey(p._ey), _ez(p._ez)
69  {
70  this->setParent( p.getParent() );
71  }
void setParent(Scatter *parent)
Definition: Point.h:114

Member Function Documentation

◆ dim()

size_t YODA::Point3D::dim ( )
inlinevirtual

Space dimension of the point.

Implements YODA::Point< N >.

Definition at line 93 of file Point3D.h.

93 { return 3; }

◆ errAvg()

double YODA::Point3D::errAvg ( size_t  i,
std::string  source = "" 
) const
inlinevirtual

Get average error value for direction i.

Implements YODA::Point< N >.

Definition at line 514 of file Point3D.h.

References xErrAvg(), yErrAvg(), and zErrAvg().

514  {
515  switch (i) {
516  case 1: return xErrAvg();
517  case 2: return yErrAvg();
518  case 3: return zErrAvg(source);
519  default: throw RangeError("Invalid axis int, must be in range 1..dim");
520  }
521  }
double xErrAvg() const
Get average x-error value.
Definition: Point3D.h:150
double zErrAvg(std::string source="") const
Get average z-error value.
Definition: Point3D.h:293
double yErrAvg() const
Get average y-error value.
Definition: Point3D.h:218

◆ errMap()

const std::map< std::string, std::pair<double,double> >& YODA::Point3D::errMap ( ) const
inlinevirtual

Get error map for direction i.

Implements YODA::Point< N >.

Definition at line 478 of file Point3D.h.

References getVariationsFromParent().

Referenced by YODA::Scatter3D::variations().

478  {
480  return _ez;
481  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ errMinus()

double YODA::Point3D::errMinus ( size_t  i,
std::string  source = "" 
) const
inlinevirtual

Get negative error value for direction i.

Implements YODA::Point< N >.

Definition at line 496 of file Point3D.h.

References xErrMinus(), yErrMinus(), and zErrMinus().

496  {
497  switch (i) {
498  case 1: return xErrMinus();
499  case 2: return yErrMinus();
500  case 3: return zErrMinus(source);
501  default: throw RangeError("Invalid axis int, must be in range 1..dim");
502  }
503  }
double zErrMinus(std::string source="") const
Get negative z-error value.
Definition: Point3D.h:279
double yErrMinus() const
Get negative y-error value.
Definition: Point3D.h:208
double xErrMinus() const
Get negative x-error value.
Definition: Point3D.h:140

◆ errPlus()

double YODA::Point3D::errPlus ( size_t  i,
std::string  source = "" 
) const
inlinevirtual

Get positive error value for direction i.

Implements YODA::Point< N >.

Definition at line 505 of file Point3D.h.

References xErrPlus(), yErrPlus(), and zErrPlus().

505  {
506  switch (i) {
507  case 1: return xErrPlus();
508  case 2: return yErrPlus();
509  case 3: return zErrPlus(source);
510  default: throw RangeError("Invalid axis int, must be in range 1..dim");
511  }
512  }
double xErrPlus() const
Get positive x-error value.
Definition: Point3D.h:145
double yErrPlus() const
Get positive y-error value.
Definition: Point3D.h:213
double zErrPlus(std::string source="") const
Get positive z-error value.
Definition: Point3D.h:286

◆ errs()

const std::pair<double,double>& YODA::Point3D::errs ( size_t  i,
std::string  source = "" 
) const
inlinevirtual

Get error values for direction i.

Implements YODA::Point< N >.

Definition at line 487 of file Point3D.h.

References xErrs(), yErrs(), and zErrs().

487  {
488  switch (i) {
489  case 1: return xErrs();
490  case 2: return yErrs();
491  case 3: return zErrs(source);
492  default: throw RangeError("Invalid axis int, must be in range 1..dim");
493  }
494  }
const std::pair< double, double > & yErrs() const
Get y-error values.
Definition: Point3D.h:203
const std::pair< double, double > & xErrs() const
Get x-error values.
Definition: Point3D.h:135
const std::pair< double, double > & zErrs(std::string source="") const
Get z-error values.
Definition: Point3D.h:272

◆ getVariationsFromParent()

void YODA::Point3D::getVariationsFromParent ( ) const
virtual

Parse the variations annotation on the parent scatter.

Implements YODA::Point< N >.

Definition at line 7 of file Point3D.cc.

References YODA::Point< N >::getParent().

Referenced by errMap(), zErrAvg(), zErrMinus(), zErrPlus(), zErrs(), zMax(), and zMin().

7  {
8  if (this->getParent()) this->getParent<Scatter3D>()->parseVariations();
9  }
T * getParent() const
Definition: Point.h:119

◆ operator=()

Point3D& YODA::Point3D::operator= ( const Point3D p)
inline

Copy assignment.

Definition at line 75 of file Point3D.h.

References YODA::Point< N >::getParent(), and YODA::Point< N >::setParent().

75  {
76  _x = p._x;
77  _y = p._y;
78  _z = p._z;
79  _ex = p._ex;
80  _ey = p._ey;
81  _ez = p._ez;
82  this->setParent( p.getParent() );
83  return *this;
84  }
void setParent(Scatter *parent)
Definition: Point.h:114

◆ scale()

void YODA::Point3D::scale ( size_t  i,
double  scale 
)
inlinevirtual

Scaling along direction i.

Implements YODA::Point< N >.

Definition at line 443 of file Point3D.h.

References scaleX(), scaleY(), and scaleZ().

443  {
444  switch (i) {
445  case 1: scaleX(scale); break;
446  case 2: scaleY(scale); break;
447  case 3: scaleZ(scale); break;
448  default: throw RangeError("Invalid axis int, must be in range 1..dim");
449  }
450  }
void scaleY(double scaley)
Scaling of y axis.
Definition: Point3D.h:422
void scale(size_t i, double scale)
Scaling along direction i.
Definition: Point3D.h:443
void scaleZ(double scalez)
Scaling of z axis.
Definition: Point3D.h:428
void scaleX(double scalex)
Scaling of x axis.
Definition: Point3D.h:416

◆ scaleX()

void YODA::Point3D::scaleX ( double  scalex)
inline

Scaling of x axis.

Definition at line 416 of file Point3D.h.

References setX(), setXErrs(), x(), xErrMinus(), and xErrPlus().

Referenced by scale(), and scaleXYZ().

416  {
417  setX(x()*scalex);
418  setXErrs(xErrMinus()*scalex, xErrPlus()*scalex);
419  }
double xErrPlus() const
Get positive x-error value.
Definition: Point3D.h:145
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171
double xErrMinus() const
Get negative x-error value.
Definition: Point3D.h:140
void setX(double x)
Set x value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:100

◆ scaleXYZ()

void YODA::Point3D::scaleXYZ ( double  scalex,
double  scaley,
double  scalez 
)
inline

Scaling of all three axes.

Definition at line 436 of file Point3D.h.

References scaleX(), scaleY(), and scaleZ().

436  {
437  scaleX(scalex);
438  scaleY(scaley);
439  scaleZ(scalez);
440  }
void scaleY(double scaley)
Scaling of y axis.
Definition: Point3D.h:422
void scaleZ(double scalez)
Scaling of z axis.
Definition: Point3D.h:428
void scaleX(double scalex)
Scaling of x axis.
Definition: Point3D.h:416

◆ scaleY()

void YODA::Point3D::scaleY ( double  scaley)
inline

Scaling of y axis.

Definition at line 422 of file Point3D.h.

References setY(), setYErrs(), y(), yErrMinus(), and yErrPlus().

Referenced by scale(), and scaleXYZ().

422  {
423  setY(y()*scaley);
424  setYErrs(yErrMinus()*scaley, yErrPlus()*scaley);
425  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
double y() const
Get y value.
Definition: Point3D.h:106
double yErrMinus() const
Get negative y-error value.
Definition: Point3D.h:208
void setY(double y)
Set y value.
Definition: Point3D.h:109
double yErrPlus() const
Get positive y-error value.
Definition: Point3D.h:213

◆ scaleZ()

void YODA::Point3D::scaleZ ( double  scalez)
inline

Scaling of z axis.

Definition at line 428 of file Point3D.h.

References setZ(), setZErrs(), z(), zErrMinus(), and zErrPlus().

Referenced by scale(), and scaleXYZ().

428  {
429  setZ(z()*scalez);
430  for (const auto &source : _ez){
431  setZErrs(zErrMinus()*scalez, zErrPlus()*scalez, source.first);
432  }
433  }
double zErrMinus(std::string source="") const
Get negative z-error value.
Definition: Point3D.h:279
double z() const
Get z value.
Definition: Point3D.h:112
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setZ(double z)
Set z value.
Definition: Point3D.h:115
double zErrPlus(std::string source="") const
Get positive z-error value.
Definition: Point3D.h:286

◆ set() [1/3]

void YODA::Point3D::set ( size_t  i,
double  val,
double  e,
std::string  source = "" 
)
inlinevirtual

Set value and symmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 571 of file Point3D.h.

References setX(), setY(), and setZ().

571  {
572  switch (i) {
573  case 1: setX(val, e); break;
574  case 2: setY(val, e); break;
575  case 3: setZ(val, e, source); break;
576  default: throw RangeError("Invalid axis int, must be in range 1..dim");
577  }
578  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:459
void setX(double x)
Set x value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:109
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ set() [2/3]

void YODA::Point3D::set ( size_t  i,
double  val,
double  eminus,
double  eplus,
std::string  source = "" 
)
inlinevirtual

Set value and asymmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 580 of file Point3D.h.

References setX(), setY(), and setZ().

580  {
581  switch (i) {
582  case 1: setX(val, eminus, eplus); break;
583  case 2: setY(val, eminus, eplus); break;
584  case 3: setZ(val, eminus, eplus, source); break;
585  default: throw RangeError("Invalid axis int, must be in range 1..dim");
586  }
587  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:459
void setX(double x)
Set x value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:109
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ set() [3/3]

void YODA::Point3D::set ( size_t  i,
double  val,
std::pair< double, double > &  e,
std::string  source = "" 
)
inlinevirtual

Set value and asymmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 589 of file Point3D.h.

References setX(), setY(), and setZ().

589  {
590  switch (i) {
591  case 1: setX(val, e); break;
592  case 2: setY(val, e); break;
593  case 3: setZ(val, e, source); break;
594  default: throw RangeError("Invalid axis int, must be in range 1..dim");
595  }
596  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:459
void setX(double x)
Set x value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:109
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ setErr()

void YODA::Point3D::setErr ( size_t  i,
double  e,
std::string  source = "" 
)
inlinevirtual

Set symmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 543 of file Point3D.h.

References setXErrs(), setYErrs(), and setZErrs().

543  {
544  switch (i) {
545  case 1: setXErrs(e); break;
546  case 2: setYErrs(e); break;
547  case 3: setZErrs(e, source); break;
548  default: throw RangeError("Invalid axis int, must be in range 1..dim");
549  }
550  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171

◆ setErrMinus()

void YODA::Point3D::setErrMinus ( size_t  i,
double  eminus,
std::string  source = "" 
)
inlinevirtual

Set negative error for direction i.

Implements YODA::Point< N >.

Definition at line 524 of file Point3D.h.

References setXErrMinus(), setYErrMinus(), and setZErrMinus().

524  {
525  switch (i) {
526  case 1: setXErrMinus(eminus); break;
527  case 2: setYErrMinus(eminus); break;
528  case 3: setZErrMinus(eminus, source); break;
529  default: throw RangeError("Invalid axis int, must be in range 1..dim");
530  }
531  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:223
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:300
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:155

◆ setErrPlus()

void YODA::Point3D::setErrPlus ( size_t  i,
double  eplus,
std::string  source = "" 
)
inlinevirtual

Set positive error for direction i.

Implements YODA::Point< N >.

Definition at line 533 of file Point3D.h.

References setXErrPlus(), setYErrPlus(), and setZErrPlus().

533  {
534  switch (i) {
535  case 1: setXErrPlus(eplus); break;
536  case 2: setYErrPlus(eplus); break;
537  case 3: setZErrPlus(eplus, source); break;
538  default: throw RangeError("Invalid axis int, must be in range 1..dim");
539  }
540  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:160
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:228
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:306

◆ setErrs() [1/2]

void YODA::Point3D::setErrs ( size_t  i,
double  eminus,
double  eplus,
std::string  source = "" 
)
inlinevirtual

Set asymmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 552 of file Point3D.h.

References setXErrs(), setYErrs(), and setZErrs().

552  {
553  switch (i) {
554  case 1: setXErrs(eminus, eplus); break;
555  case 2: setYErrs(eminus, eplus); break;
556  case 3: setZErrs(eminus, eplus, source); break;
557  default: throw RangeError("Invalid axis int, must be in range 1..dim");
558  }
559  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171

◆ setErrs() [2/2]

void YODA::Point3D::setErrs ( size_t  i,
std::pair< double, double > &  e,
std::string  source = "" 
)
inlinevirtual

Set asymmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 561 of file Point3D.h.

References setXErrs(), setYErrs(), and setZErrs().

561  {
562  switch (i) {
563  case 1: setXErrs(e); break;
564  case 2: setYErrs(e); break;
565  case 3: setZErrs(e, source); break;
566  default: throw RangeError("Invalid axis int, must be in range 1..dim");
567  }
568  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171

◆ setVal()

void YODA::Point3D::setVal ( size_t  i,
double  val 
)
inlinevirtual

Set the point value for direction i.

Implements YODA::Point< N >.

Definition at line 468 of file Point3D.h.

References setX(), setY(), and setZ().

468  {
469  switch (i) {
470  case 1: setX(val); break;
471  case 2: setY(val); break;
472  case 3: setZ(val); break;
473  default: throw RangeError("Invalid axis int, must be in range 1..dim");
474  }
475  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:459
void setX(double x)
Set x value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:109
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ setX() [1/4]

void YODA::Point3D::setX ( double  x)
inline

Set x value.

Definition at line 103 of file Point3D.h.

References x().

Referenced by scaleX(), set(), setVal(), setX(), setXYZ(), and YODA::transformX().

103 { _x = x; }
double x() const
Get x value.
Definition: Point3D.h:100

◆ setX() [2/4]

void YODA::Point3D::setX ( double  x,
double  ex 
)
inline

Set x value and symmetric error.

Definition at line 354 of file Point3D.h.

References setX(), and setXErrs().

354  {
355  setX(x);
356  setXErrs(ex);
357  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171
void setX(double x)
Set x value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:100

◆ setX() [3/4]

void YODA::Point3D::setX ( double  x,
double  exminus,
double  explus 
)
inline

Set x value and asymmetric error.

Definition at line 360 of file Point3D.h.

References setX(), and setXErrs().

360  {
361  setX(x);
362  setXErrs(exminus, explus);
363  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171
void setX(double x)
Set x value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:100

◆ setX() [4/4]

void YODA::Point3D::setX ( double  x,
std::pair< double, double > &  ex 
)
inline

Set x value and asymmetric error.

Definition at line 366 of file Point3D.h.

References setX(), and setXErrs().

366  {
367  setX(x);
368  setXErrs(ex);
369  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:171
void setX(double x)
Set x value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:100

◆ setXErr()

void YODA::Point3D::setXErr ( double  ex)
inline

Set symmetric x error.

Definition at line 165 of file Point3D.h.

References setXErrMinus(), and setXErrPlus().

Referenced by setXErrs().

165  {
166  setXErrMinus(ex);
167  setXErrPlus(ex);
168  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:160
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:155

◆ setXErrMinus()

void YODA::Point3D::setXErrMinus ( double  exminus)
inline

Set negative x error.

Definition at line 155 of file Point3D.h.

Referenced by setErrMinus(), setXErr(), setXErrs(), and YODA::transformX().

155  {
156  _ex.first = exminus;
157  }

◆ setXErrPlus()

void YODA::Point3D::setXErrPlus ( double  explus)
inline

Set positive x error.

Definition at line 160 of file Point3D.h.

Referenced by setErrPlus(), setXErr(), setXErrs(), and YODA::transformX().

160  {
161  _ex.second = explus;
162  }

◆ setXErrs() [1/3]

void YODA::Point3D::setXErrs ( double  ex)
inline

Set symmetric x error (alias)

Definition at line 171 of file Point3D.h.

References setXErr().

Referenced by scaleX(), setErr(), setErrs(), and setX().

171  {
172  setXErr(ex);
173  }
void setXErr(double ex)
Set symmetric x error.
Definition: Point3D.h:165

◆ setXErrs() [2/3]

void YODA::Point3D::setXErrs ( double  exminus,
double  explus 
)
inline

Set asymmetric x error.

Definition at line 176 of file Point3D.h.

References setXErrMinus(), and setXErrPlus().

176  {
177  setXErrMinus(exminus);
178  setXErrPlus(explus);
179  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:160
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:155

◆ setXErrs() [3/3]

void YODA::Point3D::setXErrs ( const std::pair< double, double > &  ex)
inline

Set asymmetric x error.

Definition at line 182 of file Point3D.h.

182  {
183  _ex = ex;
184  }

◆ setXYZ()

void YODA::Point3D::setXYZ ( double  x,
double  y,
double  z 
)
inline

Set x, y and z values.

Todo:
Uniform "coords" accessor across all Scatters: returning fixed-size tuple?

Definition at line 123 of file Point3D.h.

References setX(), setY(), and setZ().

123 { setX(x); setY(y); setZ(z); }
double z() const
Get z value.
Definition: Point3D.h:112
double y() const
Get y value.
Definition: Point3D.h:106
void setX(double x)
Set x value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:109
void setZ(double z)
Set z value.
Definition: Point3D.h:115
double x() const
Get x value.
Definition: Point3D.h:100

◆ setY() [1/4]

void YODA::Point3D::setY ( double  y)
inline

Set y value.

Definition at line 109 of file Point3D.h.

References y().

Referenced by scaleY(), set(), setVal(), setXYZ(), setY(), and YODA::transformY().

109 { _y = y; }
double y() const
Get y value.
Definition: Point3D.h:106

◆ setY() [2/4]

void YODA::Point3D::setY ( double  y,
double  ey 
)
inline

Set y value and symmetric error.

Definition at line 373 of file Point3D.h.

References setY(), and setYErrs().

373  {
374  setY(y);
375  setYErrs(ey);
376  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
double y() const
Get y value.
Definition: Point3D.h:106
void setY(double y)
Set y value.
Definition: Point3D.h:109

◆ setY() [3/4]

void YODA::Point3D::setY ( double  y,
double  eyminus,
double  eyplus 
)
inline

Set y value and asymmetric error.

Definition at line 379 of file Point3D.h.

References setY(), and setYErrs().

379  {
380  setY(y);
381  setYErrs(eyminus, eyplus);
382  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
double y() const
Get y value.
Definition: Point3D.h:106
void setY(double y)
Set y value.
Definition: Point3D.h:109

◆ setY() [4/4]

void YODA::Point3D::setY ( double  y,
std::pair< double, double > &  ey 
)
inline

Set y value and asymmetric error.

Definition at line 385 of file Point3D.h.

References setY(), and setYErrs().

385  {
386  setY(y);
387  setYErrs(ey);
388  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:239
double y() const
Get y value.
Definition: Point3D.h:106
void setY(double y)
Set y value.
Definition: Point3D.h:109

◆ setYErr()

void YODA::Point3D::setYErr ( double  ey)
inline

Set symmetric y error.

Definition at line 233 of file Point3D.h.

References setYErrMinus(), and setYErrPlus().

Referenced by setYErrs().

233  {
234  setYErrMinus(ey);
235  setYErrPlus(ey);
236  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:223
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:228

◆ setYErrMinus()

void YODA::Point3D::setYErrMinus ( double  eyminus)
inline

Set negative y error.

Definition at line 223 of file Point3D.h.

Referenced by setErrMinus(), setYErr(), setYErrs(), and YODA::transformY().

223  {
224  _ey.first = eyminus;
225  }

◆ setYErrPlus()

void YODA::Point3D::setYErrPlus ( double  eyplus)
inline

Set positive y error.

Definition at line 228 of file Point3D.h.

Referenced by setErrPlus(), setYErr(), setYErrs(), and YODA::transformY().

228  {
229  _ey.second = eyplus;
230  }

◆ setYErrs() [1/3]

void YODA::Point3D::setYErrs ( double  ey)
inline

Set symmetric y error (alias)

Definition at line 239 of file Point3D.h.

References setYErr().

Referenced by scaleY(), setErr(), setErrs(), and setY().

239  {
240  setYErr(ey);
241  }
void setYErr(double ey)
Set symmetric y error.
Definition: Point3D.h:233

◆ setYErrs() [2/3]

void YODA::Point3D::setYErrs ( double  eyminus,
double  eyplus 
)
inline

Set asymmetric y error.

Definition at line 244 of file Point3D.h.

References setYErrMinus(), and setYErrPlus().

244  {
245  setYErrMinus(eyminus);
246  setYErrPlus(eyplus);
247  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:223
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:228

◆ setYErrs() [3/3]

void YODA::Point3D::setYErrs ( const std::pair< double, double > &  ey)
inline

Set asymmetric y error.

Definition at line 250 of file Point3D.h.

250  {
251  _ey = ey;
252  }

◆ setZ() [1/4]

void YODA::Point3D::setZ ( double  z)
inline

Set z value.

Definition at line 115 of file Point3D.h.

References z().

Referenced by scaleZ(), set(), setVal(), setXYZ(), setZ(), and YODA::transformZ().

115 { _z = z;}
double z() const
Get z value.
Definition: Point3D.h:112

◆ setZ() [2/4]

void YODA::Point3D::setZ ( double  z,
double  ez,
std::string  source = "" 
)
inline

Set z value and symmetric error.

Definition at line 392 of file Point3D.h.

References setZ(), and setZErrs().

392  {
393  setZ(z);
394  setZErrs(ez, source);
395  }
double z() const
Get z value.
Definition: Point3D.h:112
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ setZ() [3/4]

void YODA::Point3D::setZ ( double  z,
double  ezminus,
double  ezplus,
std::string  source = "" 
)
inline

Set z value and asymmetric error.

Definition at line 398 of file Point3D.h.

References setZ(), and setZErrs().

398  {
399  setZ(z);
400  setZErrs(ezminus, ezplus, source);
401  }
double z() const
Get z value.
Definition: Point3D.h:112
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ setZ() [4/4]

void YODA::Point3D::setZ ( double  z,
std::pair< double, double > &  ez,
std::string  source = "" 
)
inline

Set z value and asymmetric error.

Definition at line 404 of file Point3D.h.

References setZ(), and setZErrs().

404  {
405  setZ(z);
406  setZErrs(ez, source);
407  }
double z() const
Get z value.
Definition: Point3D.h:112
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:318
void setZ(double z)
Set z value.
Definition: Point3D.h:115

◆ setZErr()

void YODA::Point3D::setZErr ( double  ez,
std::string  source = "" 
)
inline

Set symmetric z error.

Definition at line 312 of file Point3D.h.

References setZErrMinus(), and setZErrPlus().

Referenced by setZErrs().

312  {
313  setZErrMinus(ez, source);
314  setZErrPlus(ez, source);
315  }
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:300
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:306

◆ setZErrMinus()

void YODA::Point3D::setZErrMinus ( double  ezminus,
std::string  source = "" 
)
inline

Set negative z error.

Definition at line 300 of file Point3D.h.

Referenced by setErrMinus(), setZErr(), setZErrs(), and YODA::transformZ().

300  {
301  if (!_ez.count(source)) _ez[source] = std::make_pair(0.,0.);
302  _ez.at(source).first = ezminus;
303  }

◆ setZErrPlus()

void YODA::Point3D::setZErrPlus ( double  ezplus,
std::string  source = "" 
)
inline

Set positive z error.

Definition at line 306 of file Point3D.h.

Referenced by setErrPlus(), setZErr(), setZErrs(), and YODA::transformZ().

306  {
307  if (!_ez.count(source)) _ez[source] = std::make_pair(0.,0.);
308  _ez.at(source).second = ezplus;
309  }

◆ setZErrs() [1/3]

void YODA::Point3D::setZErrs ( double  ez,
std::string  source = "" 
)
inline

Set symmetric z error (alias)

Definition at line 318 of file Point3D.h.

References setZErr().

Referenced by YODA::Scatter3D::parseVariations(), scaleZ(), setErr(), setErrs(), and setZ().

318  {
319  setZErr(ez, source);
320  }
void setZErr(double ez, std::string source="")
Set symmetric z error.
Definition: Point3D.h:312

◆ setZErrs() [2/3]

void YODA::Point3D::setZErrs ( double  ezminus,
double  ezplus,
std::string  source = "" 
)
inline

Set asymmetric z error.

Definition at line 323 of file Point3D.h.

References setZErrMinus(), and setZErrPlus().

323  {
324  setZErrMinus(ezminus, source);
325  setZErrPlus(ezplus, source);
326  }
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:300
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:306

◆ setZErrs() [3/3]

void YODA::Point3D::setZErrs ( const std::pair< double, double > &  ez,
std::string  source = "" 
)
inline

Set asymmetric z error.

Definition at line 329 of file Point3D.h.

329  {
330  _ez[source] = ez;
331  }

◆ val()

double YODA::Point3D::val ( size_t  i) const
inlinevirtual

Get the point value for direction i.

Implements YODA::Point< N >.

Definition at line 459 of file Point3D.h.

References x(), y(), and z().

459  {
460  switch (i) {
461  case 1: return x();
462  case 2: return y();
463  case 3: return z();
464  default: throw RangeError("Invalid axis int, must be in range 1..dim");
465  }
466  }
double z() const
Get z value.
Definition: Point3D.h:112
double y() const
Get y value.
Definition: Point3D.h:106
double x() const
Get x value.
Definition: Point3D.h:100

◆ x()

double YODA::Point3D::x ( ) const
inline

Get x value.

Definition at line 100 of file Point3D.h.

Referenced by YODA::operator<(), YODA::operator==(), scaleX(), setX(), YODA::transformX(), and val().

100 { return _x; }

◆ xErrAvg()

double YODA::Point3D::xErrAvg ( ) const
inline

Get average x-error value.

Definition at line 150 of file Point3D.h.

Referenced by errAvg().

150  {
151  return (_ex.first + _ex.second)/2.0;
152  }

◆ xErrMinus()

double YODA::Point3D::xErrMinus ( ) const
inline

Get negative x-error value.

Definition at line 140 of file Point3D.h.

Referenced by errMinus(), YODA::operator<(), YODA::operator==(), and scaleX().

140  {
141  return _ex.first;
142  }

◆ xErrPlus()

double YODA::Point3D::xErrPlus ( ) const
inline

Get positive x-error value.

Definition at line 145 of file Point3D.h.

Referenced by errPlus(), YODA::operator<(), YODA::operator==(), and scaleX().

145  {
146  return _ex.second;
147  }

◆ xErrs()

const std::pair<double,double>& YODA::Point3D::xErrs ( ) const
inline

Get x-error values.

Definition at line 135 of file Point3D.h.

Referenced by errs().

135  {
136  return _ex;
137  }

◆ xMax()

double YODA::Point3D::xMax ( ) const
inline

Get value plus positive x-error.

Definition at line 192 of file Point3D.h.

Referenced by YODA::transformX().

192  {
193  return _x + _ex.second;
194  }

◆ xMin()

double YODA::Point3D::xMin ( ) const
inline

Get value minus negative x-error.

Definition at line 187 of file Point3D.h.

Referenced by YODA::transformX().

187  {
188  return _x - _ex.first;
189  }

◆ y()

double YODA::Point3D::y ( ) const
inline

Get y value.

Definition at line 106 of file Point3D.h.

Referenced by YODA::operator<(), YODA::operator==(), scaleY(), setY(), YODA::transformY(), and val().

106 { return _y; }

◆ yErrAvg()

double YODA::Point3D::yErrAvg ( ) const
inline

Get average y-error value.

Definition at line 218 of file Point3D.h.

Referenced by errAvg().

218  {
219  return (_ey.first + _ey.second)/2.0;
220  }

◆ yErrMinus()

double YODA::Point3D::yErrMinus ( ) const
inline

Get negative y-error value.

Definition at line 208 of file Point3D.h.

Referenced by errMinus(), YODA::operator<(), YODA::operator==(), and scaleY().

208  {
209  return _ey.first;
210  }

◆ yErrPlus()

double YODA::Point3D::yErrPlus ( ) const
inline

Get positive y-error value.

Definition at line 213 of file Point3D.h.

Referenced by errPlus(), YODA::operator<(), YODA::operator==(), and scaleY().

213  {
214  return _ey.second;
215  }

◆ yErrs()

const std::pair<double,double>& YODA::Point3D::yErrs ( ) const
inline

Get y-error values.

Definition at line 203 of file Point3D.h.

Referenced by errs().

203  {
204  return _ey;
205  }

◆ yMax()

double YODA::Point3D::yMax ( ) const
inline

Get value plus positive y-error.

Definition at line 260 of file Point3D.h.

Referenced by YODA::transformY().

260  {
261  return _y + _ey.second;
262  }

◆ yMin()

double YODA::Point3D::yMin ( ) const
inline

Get value minus negative y-error.

Definition at line 255 of file Point3D.h.

Referenced by YODA::transformY().

255  {
256  return _y - _ey.first;
257  }

◆ z()

double YODA::Point3D::z ( ) const
inline

Get z value.

Definition at line 112 of file Point3D.h.

Referenced by YODA::operator==(), scaleZ(), setZ(), YODA::transformZ(), and val().

112 { return _z;}

◆ zErrAvg()

double YODA::Point3D::zErrAvg ( std::string  source = "") const
inline

Get average z-error value.

Definition at line 293 of file Point3D.h.

References getVariationsFromParent().

Referenced by errAvg().

293  {
294  if (source!="") getVariationsFromParent();
295  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
296  return (_ez.at(source).first + _ez.at(source).second)/2.0;
297  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ zErrMinus()

double YODA::Point3D::zErrMinus ( std::string  source = "") const
inline

Get negative z-error value.

Definition at line 279 of file Point3D.h.

References getVariationsFromParent().

Referenced by errMinus(), YODA::operator==(), and scaleZ().

279  {
280  if (source!="") getVariationsFromParent();
281  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
282  return _ez.at(source).first;
283  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ zErrPlus()

double YODA::Point3D::zErrPlus ( std::string  source = "") const
inline

Get positive z-error value.

Definition at line 286 of file Point3D.h.

References getVariationsFromParent().

Referenced by errPlus(), YODA::operator==(), and scaleZ().

286  {
287  if (source!="") getVariationsFromParent();
288  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
289  return _ez.at(source).second;
290  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ zErrs()

const std::pair<double,double>& YODA::Point3D::zErrs ( std::string  source = "") const
inline

Get z-error values.

Definition at line 272 of file Point3D.h.

References getVariationsFromParent().

Referenced by errs().

272  {
273  if (source!="") getVariationsFromParent();
274  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
275  return _ez.at(source);
276  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ zMax()

double YODA::Point3D::zMax ( std::string  source = "") const
inline

Get value plus positive z-error.

Definition at line 341 of file Point3D.h.

References getVariationsFromParent().

Referenced by YODA::transformZ().

341  {
342  if (source!="") getVariationsFromParent();
343  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
344  return _z + _ez.at(source).second;
345  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

◆ zMin()

double YODA::Point3D::zMin ( std::string  source = "") const
inline

Get value minus negative z-error.

Definition at line 334 of file Point3D.h.

References getVariationsFromParent().

Referenced by YODA::transformZ().

334  {
335  if (source!="") getVariationsFromParent();
336  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
337  return _z - _ez.at(source).first;
338  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point3D.cc:7

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