yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis  1.7.2
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 (double scalex, double scaley, double scalez)
 
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...
 
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...
 
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:109
double y() const
Get y value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:97

◆ 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:109
double y() const
Get y value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:97

◆ 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:109
double y() const
Get y value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:97

◆ Point3D() [5/5]

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

Copy constructor.

Definition at line 66 of file Point3D.h.

67  : _x(p._x), _y(p._y), _z(p._z),
68  _ex(p._ex), _ey(p._ey), _ez(p._ez)
69  { }

Member Function Documentation

◆ dim()

size_t YODA::Point3D::dim ( )
inlinevirtual

Space dimension of the point.

Implements YODA::Point< N >.

Definition at line 90 of file Point3D.h.

90 { 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 497 of file Point3D.h.

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

497  {
498  switch (i) {
499  case 1: return xErrAvg();
500  case 2: return yErrAvg();
501  case 3: return zErrAvg(source);
502  default: throw RangeError("Invalid axis int, must be in range 1..dim");
503  }
504  }
double xErrAvg() const
Get average x-error value.
Definition: Point3D.h:147
double zErrAvg(std::string source="") const
Get average z-error value.
Definition: Point3D.h:287
double yErrAvg() const
Get average y-error value.
Definition: Point3D.h:215

◆ 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 465 of file Point3D.h.

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

465  {
466  return _ez;
467  }

◆ 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 479 of file Point3D.h.

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

479  {
480  switch (i) {
481  case 1: return xErrMinus();
482  case 2: return yErrMinus();
483  case 3: return zErrMinus(source);
484  default: throw RangeError("Invalid axis int, must be in range 1..dim");
485  }
486  }
double zErrMinus(std::string source="") const
Get negative z-error value.
Definition: Point3D.h:275
double yErrMinus() const
Get negative y-error value.
Definition: Point3D.h:205
double xErrMinus() const
Get negative x-error value.
Definition: Point3D.h:137

◆ 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 488 of file Point3D.h.

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

488  {
489  switch (i) {
490  case 1: return xErrPlus();
491  case 2: return yErrPlus();
492  case 3: return zErrPlus(source);
493  default: throw RangeError("Invalid axis int, must be in range 1..dim");
494  }
495  }
double xErrPlus() const
Get positive x-error value.
Definition: Point3D.h:142
double yErrPlus() const
Get positive y-error value.
Definition: Point3D.h:210
double zErrPlus(std::string source="") const
Get positive z-error value.
Definition: Point3D.h:281

◆ 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 470 of file Point3D.h.

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

470  {
471  switch (i) {
472  case 1: return xErrs();
473  case 2: return yErrs();
474  case 3: return zErrs(source);
475  default: throw RangeError("Invalid axis int, must be in range 1..dim");
476  }
477  }
const std::pair< double, double > & yErrs() const
Get y-error values.
Definition: Point3D.h:200
const std::pair< double, double > & xErrs() const
Get x-error values.
Definition: Point3D.h:132
const std::pair< double, double > & zErrs(std::string source="") const
Get z-error values.
Definition: Point3D.h:269

◆ operator=()

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

Copy assignment.

Definition at line 73 of file Point3D.h.

73  {
74  _x = p._x;
75  _y = p._y;
76  _z = p._z;
77  _ex = p._ex;
78  _ey = p._ey;
79  _ez = p._ez;
80  return *this;
81  }

◆ scale()

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

Scaling of both axes

Deprecated:
Use scaleXYZ

Definition at line 435 of file Point3D.h.

References scaleXYZ().

435  {
436  scaleXYZ(scalex, scaley, scalez);
437  }
void scaleXYZ(double scalex, double scaley, double scalez)
Scaling of all three axes.
Definition: Point3D.h:427

◆ scaleX()

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

Scaling of x axis.

Definition at line 407 of file Point3D.h.

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

Referenced by scaleXYZ().

407  {
408  setX(x()*scalex);
409  setXErrs(xErrMinus()*scalex, xErrPlus()*scalex);
410  }
double xErrPlus() const
Get positive x-error value.
Definition: Point3D.h:142
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168
double xErrMinus() const
Get negative x-error value.
Definition: Point3D.h:137
void setX(double x)
Set x value.
Definition: Point3D.h:100
double x() const
Get x value.
Definition: Point3D.h:97

◆ scaleXYZ()

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

Scaling of all three axes.

Definition at line 427 of file Point3D.h.

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

Referenced by scale().

427  {
428  scaleX(scalex);
429  scaleY(scaley);
430  scaleZ(scalez);
431  }
void scaleY(double scaley)
Scaling of y axis.
Definition: Point3D.h:413
void scaleZ(double scalez)
Scaling of z axis.
Definition: Point3D.h:419
void scaleX(double scalex)
Scaling of x axis.
Definition: Point3D.h:407

◆ scaleY()

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

Scaling of y axis.

Definition at line 413 of file Point3D.h.

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

Referenced by scaleXYZ().

413  {
414  setY(y()*scaley);
415  setYErrs(yErrMinus()*scaley, yErrPlus()*scaley);
416  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
double y() const
Get y value.
Definition: Point3D.h:103
double yErrMinus() const
Get negative y-error value.
Definition: Point3D.h:205
void setY(double y)
Set y value.
Definition: Point3D.h:106
double yErrPlus() const
Get positive y-error value.
Definition: Point3D.h:210

◆ scaleZ()

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

Scaling of z axis.

Definition at line 419 of file Point3D.h.

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

Referenced by scaleXYZ().

419  {
420  setZ(z()*scalez);
421  for (const auto &source : _ez){
422  setZErrs(zErrMinus()*scalez, zErrPlus()*scalez, source.first);
423  }
424  }
double zErrMinus(std::string source="") const
Get negative z-error value.
Definition: Point3D.h:275
double z() const
Get z value.
Definition: Point3D.h:109
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setZ(double z)
Set z value.
Definition: Point3D.h:112
double zErrPlus(std::string source="") const
Get positive z-error value.
Definition: Point3D.h:281

◆ 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 554 of file Point3D.h.

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

554  {
555  switch (i) {
556  case 1: setX(val, e); break;
557  case 2: setY(val, e); break;
558  case 3: setZ(val, e, source); break;
559  default: throw RangeError("Invalid axis int, must be in range 1..dim");
560  }
561  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:446
void setX(double x)
Set x value.
Definition: Point3D.h:100
void setY(double y)
Set y value.
Definition: Point3D.h:106
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ 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 563 of file Point3D.h.

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

563  {
564  switch (i) {
565  case 1: setX(val, eminus, eplus); break;
566  case 2: setY(val, eminus, eplus); break;
567  case 3: setZ(val, eminus, eplus, source); break;
568  default: throw RangeError("Invalid axis int, must be in range 1..dim");
569  }
570  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:446
void setX(double x)
Set x value.
Definition: Point3D.h:100
void setY(double y)
Set y value.
Definition: Point3D.h:106
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ 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 572 of file Point3D.h.

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

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

◆ 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 526 of file Point3D.h.

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

526  {
527  switch (i) {
528  case 1: setXErrs(e); break;
529  case 2: setYErrs(e); break;
530  case 3: setZErrs(e, source); break;
531  default: throw RangeError("Invalid axis int, must be in range 1..dim");
532  }
533  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168

◆ 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 507 of file Point3D.h.

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

507  {
508  switch (i) {
509  case 1: setXErrMinus(eminus); break;
510  case 2: setYErrMinus(eminus); break;
511  case 3: setZErrMinus(eminus, source); break;
512  default: throw RangeError("Invalid axis int, must be in range 1..dim");
513  }
514  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:220
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:293
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:152

◆ 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 516 of file Point3D.h.

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

516  {
517  switch (i) {
518  case 1: setXErrPlus(eplus); break;
519  case 2: setYErrPlus(eplus); break;
520  case 3: setZErrPlus(eplus, source); break;
521  default: throw RangeError("Invalid axis int, must be in range 1..dim");
522  }
523  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:157
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:225
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:299

◆ 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 535 of file Point3D.h.

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

535  {
536  switch (i) {
537  case 1: setXErrs(eminus, eplus); break;
538  case 2: setYErrs(eminus, eplus); break;
539  case 3: setZErrs(eminus, eplus, source); break;
540  default: throw RangeError("Invalid axis int, must be in range 1..dim");
541  }
542  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168

◆ 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 544 of file Point3D.h.

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

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

◆ 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 455 of file Point3D.h.

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

455  {
456  switch (i) {
457  case 1: setX(val); break;
458  case 2: setY(val); break;
459  case 3: setZ(val); break;
460  default: throw RangeError("Invalid axis int, must be in range 1..dim");
461  }
462  }
double val(size_t i) const
Get the point value for direction i.
Definition: Point3D.h:446
void setX(double x)
Set x value.
Definition: Point3D.h:100
void setY(double y)
Set y value.
Definition: Point3D.h:106
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ setX() [1/4]

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

Set x value.

Definition at line 100 of file Point3D.h.

References x().

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

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

◆ setX() [2/4]

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

Set x value and symmetric error.

Definition at line 345 of file Point3D.h.

References setX(), and setXErrs().

345  {
346  setX(x);
347  setXErrs(ex);
348  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168
void setX(double x)
Set x value.
Definition: Point3D.h:100
double x() const
Get x value.
Definition: Point3D.h:97

◆ setX() [3/4]

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

Set x value and asymmetric error.

Definition at line 351 of file Point3D.h.

References setX(), and setXErrs().

351  {
352  setX(x);
353  setXErrs(exminus, explus);
354  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168
void setX(double x)
Set x value.
Definition: Point3D.h:100
double x() const
Get x value.
Definition: Point3D.h:97

◆ setX() [4/4]

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

Set x value and asymmetric error.

Definition at line 357 of file Point3D.h.

References setX(), and setXErrs().

357  {
358  setX(x);
359  setXErrs(ex);
360  }
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point3D.h:168
void setX(double x)
Set x value.
Definition: Point3D.h:100
double x() const
Get x value.
Definition: Point3D.h:97

◆ setXErr()

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

Set symmetric x error.

Definition at line 162 of file Point3D.h.

References setXErrMinus(), and setXErrPlus().

Referenced by setXErrs().

162  {
163  setXErrMinus(ex);
164  setXErrPlus(ex);
165  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:157
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:152

◆ setXErrMinus()

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

Set negative x error.

Definition at line 152 of file Point3D.h.

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

152  {
153  _ex.first = exminus;
154  }

◆ setXErrPlus()

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

Set positive x error.

Definition at line 157 of file Point3D.h.

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

157  {
158  _ex.second = explus;
159  }

◆ setXErrs() [1/3]

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

Set symmetric x error (alias)

Definition at line 168 of file Point3D.h.

References setXErr().

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

168  {
169  setXErr(ex);
170  }
void setXErr(double ex)
Set symmetric x error.
Definition: Point3D.h:162

◆ setXErrs() [2/3]

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

Set asymmetric x error.

Definition at line 173 of file Point3D.h.

References setXErrMinus(), and setXErrPlus().

173  {
174  setXErrMinus(exminus);
175  setXErrPlus(explus);
176  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point3D.h:157
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point3D.h:152

◆ setXErrs() [3/3]

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

Set asymmetric x error.

Definition at line 179 of file Point3D.h.

179  {
180  _ex = ex;
181  }

◆ 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 120 of file Point3D.h.

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

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

◆ setY() [1/4]

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

Set y value.

Definition at line 106 of file Point3D.h.

References y().

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

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

◆ setY() [2/4]

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

Set y value and symmetric error.

Definition at line 364 of file Point3D.h.

References setY(), and setYErrs().

364  {
365  setY(y);
366  setYErrs(ey);
367  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
double y() const
Get y value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:106

◆ setY() [3/4]

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

Set y value and asymmetric error.

Definition at line 370 of file Point3D.h.

References setY(), and setYErrs().

370  {
371  setY(y);
372  setYErrs(eyminus, eyplus);
373  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
double y() const
Get y value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:106

◆ setY() [4/4]

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

Set y value and asymmetric error.

Definition at line 376 of file Point3D.h.

References setY(), and setYErrs().

376  {
377  setY(y);
378  setYErrs(ey);
379  }
void setYErrs(double ey)
Set symmetric y error (alias)
Definition: Point3D.h:236
double y() const
Get y value.
Definition: Point3D.h:103
void setY(double y)
Set y value.
Definition: Point3D.h:106

◆ setYErr()

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

Set symmetric y error.

Definition at line 230 of file Point3D.h.

References setYErrMinus(), and setYErrPlus().

Referenced by setYErrs().

230  {
231  setYErrMinus(ey);
232  setYErrPlus(ey);
233  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:220
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:225

◆ setYErrMinus()

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

Set negative y error.

Definition at line 220 of file Point3D.h.

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

220  {
221  _ey.first = eyminus;
222  }

◆ setYErrPlus()

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

Set positive y error.

Definition at line 225 of file Point3D.h.

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

225  {
226  _ey.second = eyplus;
227  }

◆ setYErrs() [1/3]

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

Set symmetric y error (alias)

Definition at line 236 of file Point3D.h.

References setYErr().

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

236  {
237  setYErr(ey);
238  }
void setYErr(double ey)
Set symmetric y error.
Definition: Point3D.h:230

◆ setYErrs() [2/3]

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

Set asymmetric y error.

Definition at line 241 of file Point3D.h.

References setYErrMinus(), and setYErrPlus().

241  {
242  setYErrMinus(eyminus);
243  setYErrPlus(eyplus);
244  }
void setYErrMinus(double eyminus)
Set negative y error.
Definition: Point3D.h:220
void setYErrPlus(double eyplus)
Set positive y error.
Definition: Point3D.h:225

◆ setYErrs() [3/3]

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

Set asymmetric y error.

Definition at line 247 of file Point3D.h.

247  {
248  _ey = ey;
249  }

◆ setZ() [1/4]

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

Set z value.

Definition at line 112 of file Point3D.h.

References z().

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

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

◆ setZ() [2/4]

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

Set z value and symmetric error.

Definition at line 383 of file Point3D.h.

References setZ(), and setZErrs().

383  {
384  setZ(z);
385  setZErrs(ez, source);
386  }
double z() const
Get z value.
Definition: Point3D.h:109
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ 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 389 of file Point3D.h.

References setZ(), and setZErrs().

389  {
390  setZ(z);
391  setZErrs(ezminus, ezplus, source);
392  }
double z() const
Get z value.
Definition: Point3D.h:109
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ 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 395 of file Point3D.h.

References setZ(), and setZErrs().

395  {
396  setZ(z);
397  setZErrs(ez, source);
398  }
double z() const
Get z value.
Definition: Point3D.h:109
void setZErrs(double ez, std::string source="")
Set symmetric z error (alias)
Definition: Point3D.h:311
void setZ(double z)
Set z value.
Definition: Point3D.h:112

◆ setZErr()

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

Set symmetric z error.

Definition at line 305 of file Point3D.h.

References setZErrMinus(), and setZErrPlus().

Referenced by setZErrs().

305  {
306  setZErrMinus(ez, source);
307  setZErrPlus(ez, source);
308  }
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:293
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:299

◆ setZErrMinus()

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

Set negative z error.

Definition at line 293 of file Point3D.h.

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

293  {
294  if (!_ez.count(source)) _ez[source] = std::make_pair(0.,0.);
295  _ez.at(source).first = ezminus;
296  }

◆ setZErrPlus()

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

Set positive z error.

Definition at line 299 of file Point3D.h.

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

299  {
300  if (!_ez.count(source)) _ez[source] = std::make_pair(0.,0.);
301  _ez.at(source).second = ezplus;
302  }

◆ setZErrs() [1/3]

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

Set symmetric z error (alias)

Definition at line 311 of file Point3D.h.

References setZErr().

Referenced by scaleZ(), setErr(), setErrs(), and setZ().

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

◆ setZErrs() [2/3]

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

Set asymmetric z error.

Definition at line 316 of file Point3D.h.

References setZErrMinus(), and setZErrPlus().

316  {
317  setZErrMinus(ezminus, source);
318  setZErrPlus(ezplus, source);
319  }
void setZErrMinus(double ezminus, std::string source="")
Set negative z error.
Definition: Point3D.h:293
void setZErrPlus(double ezplus, std::string source="")
Set positive z error.
Definition: Point3D.h:299

◆ setZErrs() [3/3]

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

Set asymmetric z error.

Definition at line 322 of file Point3D.h.

322  {
323  _ez[source] = ez;
324  }

◆ val()

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

Get the point value for direction i.

Implements YODA::Point< N >.

Definition at line 446 of file Point3D.h.

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

446  {
447  switch (i) {
448  case 1: return x();
449  case 2: return y();
450  case 3: return z();
451  default: throw RangeError("Invalid axis int, must be in range 1..dim");
452  }
453  }
double z() const
Get z value.
Definition: Point3D.h:109
double y() const
Get y value.
Definition: Point3D.h:103
double x() const
Get x value.
Definition: Point3D.h:97

◆ x()

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

Get x value.

Definition at line 97 of file Point3D.h.

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

97 { return _x; }

◆ xErrAvg()

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

Get average x-error value.

Definition at line 147 of file Point3D.h.

Referenced by errAvg().

147  {
148  return (_ex.first + _ex.second)/2.0;
149  }

◆ xErrMinus()

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

Get negative x-error value.

Definition at line 137 of file Point3D.h.

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

137  {
138  return _ex.first;
139  }

◆ xErrPlus()

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

Get positive x-error value.

Definition at line 142 of file Point3D.h.

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

142  {
143  return _ex.second;
144  }

◆ xErrs()

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

Get x-error values.

Definition at line 132 of file Point3D.h.

Referenced by errs().

132  {
133  return _ex;
134  }

◆ xMax()

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

Get value plus positive x-error.

Definition at line 189 of file Point3D.h.

Referenced by YODA::transformX().

189  {
190  return _x + _ex.second;
191  }

◆ xMin()

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

Get value minus negative x-error.

Definition at line 184 of file Point3D.h.

Referenced by YODA::transformX().

184  {
185  return _x - _ex.first;
186  }

◆ y()

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

Get y value.

Definition at line 103 of file Point3D.h.

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

103 { return _y; }

◆ yErrAvg()

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

Get average y-error value.

Definition at line 215 of file Point3D.h.

Referenced by errAvg().

215  {
216  return (_ey.first + _ey.second)/2.0;
217  }

◆ yErrMinus()

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

Get negative y-error value.

Definition at line 205 of file Point3D.h.

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

205  {
206  return _ey.first;
207  }

◆ yErrPlus()

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

Get positive y-error value.

Definition at line 210 of file Point3D.h.

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

210  {
211  return _ey.second;
212  }

◆ yErrs()

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

Get y-error values.

Definition at line 200 of file Point3D.h.

Referenced by errs().

200  {
201  return _ey;
202  }

◆ yMax()

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

Get value plus positive y-error.

Definition at line 257 of file Point3D.h.

Referenced by YODA::transformY().

257  {
258  return _y + _ey.second;
259  }

◆ yMin()

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

Get value minus negative y-error.

Definition at line 252 of file Point3D.h.

Referenced by YODA::transformY().

252  {
253  return _y - _ey.first;
254  }

◆ z()

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

Get z value.

Definition at line 109 of file Point3D.h.

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

109 { return _z;}

◆ zErrAvg()

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

Get average z-error value.

Definition at line 287 of file Point3D.h.

Referenced by errAvg().

287  {
288  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
289  return (_ez.at(source).first + _ez.at(source).second)/2.0;
290  }

◆ zErrMinus()

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

Get negative z-error value.

Definition at line 275 of file Point3D.h.

Referenced by errMinus(), and scaleZ().

275  {
276  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
277  return _ez.at(source).first;
278  }

◆ zErrPlus()

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

Get positive z-error value.

Definition at line 281 of file Point3D.h.

Referenced by errPlus(), and scaleZ().

281  {
282  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
283  return _ez.at(source).second;
284  }

◆ zErrs()

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

Get z-error values.

Definition at line 269 of file Point3D.h.

Referenced by errs().

269  {
270  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
271  return _ez.at(source);
272  }

◆ zMax()

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

Get value plus positive z-error.

Definition at line 333 of file Point3D.h.

Referenced by YODA::transformZ().

333  {
334  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
335  return _z + _ez.at(source).second;
336  }

◆ zMin()

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

Get value minus negative z-error.

Definition at line 327 of file Point3D.h.

Referenced by YODA::transformZ().

327  {
328  if (!_ez.count(source)) throw RangeError("zErrs has no such key: "+source);
329  return _z - _ez.at(source).first;
330  }

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