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

A 2D data point to be contained in a Scatter2D. More...

#include <Point2D.h>

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

Public Member Functions

size_t dim ()
 Space dimension of the point. More...
 
Constructors
 Point2D ()
 
 Point2D (double x, double y, double ex=0.0, double ey=0.0, std::string source="")
 Constructor from values with optional symmetric errors. More...
 
 Point2D (double x, double y, double exminus, double explus, double eyminus, double eyplus, std::string source="")
 Constructor from values with explicit asymmetric errors. More...
 
 Point2D (double x, double y, const std::pair< double, double > &ex, const std::pair< double, double > &ey, std::string source="")
 Constructor from values with asymmetric errors on both x and y. More...
 
 Point2D (const Point2D &p)
 Copy constructor. More...
 
Point2Doperator= (const Point2D &p)
 Copy assignment. More...
 
Value 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...
 
std::pair< double, double > xy () const
 Get x,y value pair. More...
 
void setXY (double x, double y)
 Set x and y values. More...
 
void setXY (const std::pair< double, double > &xy)
 Set x and y 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
 
double xMax () const
 
y error accessors
const std::pair< double, double > & yErrs (std::string source="") const
 Get y-error values. More...
 
double yErrMinus (std::string source="") const
 Get negative y-error value. More...
 
double yErrPlus (std::string source="") const
 Get positive y-error value. More...
 
double yErrAvg (std::string source="") const
 Get average y-error value. More...
 
void setYErrMinus (double eyminus, std::string source="")
 Set negative y error. More...
 
void setYErrPlus (double eyplus, std::string source="")
 Set positive y error. More...
 
void setYErr (double ey, std::string source="")
 Set symmetric y error. More...
 
void setYErrs (double ey, std::string source="")
 Set symmetric y error (alias) More...
 
void setYErrs (double eyminus, double eyplus, std::string source="")
 Set asymmetric y error. More...
 
void setYErrs (const std::pair< double, double > &ey, std::string source="")
 Set asymmetric y error. More...
 
double yMin (std::string source="") const
 Get value minus negative y-error. More...
 
double yMax (std::string source="") const
 Get value plus positive y-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, std::string source="")
 Set y value and symmetric error. More...
 
void setY (double y, double eyminus, double eyplus, std::string source="")
 Set y value and asymmetric error. More...
 
void setY (double y, std::pair< double, double > &ey, std::string source="")
 Set y value and asymmetric error. More...
 
void scaleX (double scalex)
 Scaling of x axis. More...
 
void scaleY (double scaley)
 Scaling of y axis. More...
 
void scaleXY (double scalex, double scaley)
 Scaling of both 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 2D data point to be contained in a Scatter2D.

Definition at line 19 of file Point2D.h.

Constructor & Destructor Documentation

◆ Point2D() [1/5]

YODA::Point2D::Point2D ( )
inline

Definition at line 26 of file Point2D.h.

26 { }

◆ Point2D() [2/5]

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

Constructor from values with optional symmetric errors.

Definition at line 30 of file Point2D.h.

31  : _x(x), _y(y)
32  {
33  _ex = std::make_pair(ex, ex);
34  _ey[source] = std::make_pair(ey, ey);
35  }
double x() const
Get x value.
Definition: Point2D.h:109
double y() const
Get y value.
Definition: Point2D.h:115

◆ Point2D() [3/5]

YODA::Point2D::Point2D ( double  x,
double  y,
double  exminus,
double  explus,
double  eyminus,
double  eyplus,
std::string  source = "" 
)
inline

Constructor from values with explicit asymmetric errors.

Definition at line 39 of file Point2D.h.

44  : _x(x), _y(y)
45  {
46  _ex = std::make_pair(exminus, explus);
47  _ey[source] = std::make_pair(eyminus, eyplus);
48  }
double x() const
Get x value.
Definition: Point2D.h:109
double y() const
Get y value.
Definition: Point2D.h:115

◆ Point2D() [4/5]

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

Constructor from values with asymmetric errors on both x and y.

Definition at line 68 of file Point2D.h.

69  : _x(x), _y(y)
70  {
71  _ex = ex;
72  _ey[source] = ey;
73  }
double x() const
Get x value.
Definition: Point2D.h:109
double y() const
Get y value.
Definition: Point2D.h:115

◆ Point2D() [5/5]

YODA::Point2D::Point2D ( const Point2D p)
inline

Copy constructor.

Definition at line 77 of file Point2D.h.

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

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

Member Function Documentation

◆ dim()

size_t YODA::Point2D::dim ( )
inlinevirtual

Space dimension of the point.

Implements YODA::Point< N >.

Definition at line 102 of file Point2D.h.

102 { return 2; }

◆ errAvg()

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

Get average error value for direction i.

Implements YODA::Point< N >.

Definition at line 426 of file Point2D.h.

References xErrAvg(), and yErrAvg().

426  {
427  switch (i) {
428  case 1: return xErrAvg();
429  case 2: return yErrAvg(source);
430  default: throw RangeError("Invalid axis int, must be in range 1..dim");
431  }
432  }
double xErrAvg() const
Get average x-error value.
Definition: Point2D.h:155
double yErrAvg(std::string source="") const
Get average y-error value.
Definition: Point2D.h:235

◆ errMap()

const std::map< std::string, std::pair< double, double > > & YODA::Point2D::errMap ( ) const
virtual

Get error map for direction i.

Implements YODA::Point< N >.

Definition at line 8 of file Point2D.cc.

References getVariationsFromParent().

Referenced by YODA::Scatter2D::covarianceMatrix(), setVal(), and YODA::Scatter2D::variations().

8  {
10  return _ey;
11  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point2D.cc:14

◆ errMinus()

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

Get negative error value for direction i.

Implements YODA::Point< N >.

Definition at line 410 of file Point2D.h.

References xErrMinus(), and yErrMinus().

410  {
411  switch (i) {
412  case 1: return xErrMinus();
413  case 2: return yErrMinus(source);
414  default: throw RangeError("Invalid axis int, must be in range 1..dim");
415  }
416  }
double yErrMinus(std::string source="") const
Get negative y-error value.
Definition: Point2D.h:221
double xErrMinus() const
Get negative x-error value.
Definition: Point2D.h:144

◆ errPlus()

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

Get positive error value for direction i.

Implements YODA::Point< N >.

Definition at line 418 of file Point2D.h.

References xErrPlus(), and yErrPlus().

418  {
419  switch (i) {
420  case 1: return xErrPlus();
421  case 2: return yErrPlus(source);
422  default: throw RangeError("Invalid axis int, must be in range 1..dim");
423  }
424  }
double yErrPlus(std::string source="") const
Get positive y-error value.
Definition: Point2D.h:228
double xErrPlus() const
Get positive x-error value.
Definition: Point2D.h:149

◆ errs()

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

Get error values for direction i.

Implements YODA::Point< N >.

Definition at line 402 of file Point2D.h.

References xErrs(), and yErrs().

402  {
403  switch (i) {
404  case 1: return xErrs();
405  case 2: return yErrs(source);
406  default: throw RangeError("Invalid axis int, must be in range 1..dim");
407  }
408  }
const std::pair< double, double > & xErrs() const
Get x-error values.
Definition: Point2D.h:139
const std::pair< double, double > & yErrs(std::string source="") const
Get y-error values.
Definition: Point2D.h:214

◆ getVariationsFromParent()

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

Parse the variations annotation on the parent scatter.

Implements YODA::Point< N >.

Definition at line 14 of file Point2D.cc.

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

Referenced by errMap(), setVal(), yErrAvg(), yErrMinus(), yErrPlus(), yErrs(), yMax(), and yMin().

14  {
15  if (this->getParent()) this->getParent<Scatter2D>()->parseVariations();
16  }
T * getParent() const
Definition: Point.h:119

◆ operator=()

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

Copy assignment.

Definition at line 87 of file Point2D.h.

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

87  {
88  _x = p._x;
89  _y = p._y;
90  _ex = p._ex;
91  _ey = p._ey;
92  this->setParent( p.getParent() );
93  return *this;
94  }
void setParent(Scatter *parent)
Definition: Point.h:114

◆ scale()

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

Scaling along direction i.

Implements YODA::Point< N >.

Definition at line 364 of file Point2D.h.

References scaleX(), and scaleY().

364  {
365  switch (i) {
366  case 1: scaleX(scale); break;
367  case 2: scaleY(scale); break;
368  default: throw RangeError("Invalid axis int, must be in range 1..dim");
369  }
370  }
void scaleX(double scalex)
Scaling of x axis.
Definition: Point2D.h:344
void scaleY(double scaley)
Scaling of y axis.
Definition: Point2D.h:350
void scale(size_t i, double scale)
Scaling along direction i.
Definition: Point2D.h:364

◆ scaleX()

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

Scaling of x axis.

Definition at line 344 of file Point2D.h.

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

Referenced by scale(), and scaleXY().

344  {
345  setX(x()*scalex);
346  setXErrs(xErrMinus()*scalex, xErrPlus()*scalex);
347  }
double x() const
Get x value.
Definition: Point2D.h:109
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176
void setX(double x)
Set x value.
Definition: Point2D.h:112
double xErrMinus() const
Get negative x-error value.
Definition: Point2D.h:144
double xErrPlus() const
Get positive x-error value.
Definition: Point2D.h:149

◆ scaleXY()

void YODA::Point2D::scaleXY ( double  scalex,
double  scaley 
)
inline

Scaling of both axes.

Definition at line 358 of file Point2D.h.

References scaleX(), and scaleY().

358  {
359  scaleX(scalex);
360  scaleY(scaley);
361  }
void scaleX(double scalex)
Scaling of x axis.
Definition: Point2D.h:344
void scaleY(double scaley)
Scaling of y axis.
Definition: Point2D.h:350

◆ scaleY()

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

Scaling of y axis.

Definition at line 350 of file Point2D.h.

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

Referenced by scale(), and scaleXY().

350  {
351  setY(y()*scaley);
352  for (const auto &source : _ey){
353  setYErrs(yErrMinus()*scaley, yErrPlus()*scaley, source.first);
354  }
355  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
double y() const
Get y value.
Definition: Point2D.h:115
double yErrPlus(std::string source="") const
Get positive y-error value.
Definition: Point2D.h:228
double yErrMinus(std::string source="") const
Get negative y-error value.
Definition: Point2D.h:221

◆ set() [1/3]

void YODA::Point2D::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 477 of file Point2D.h.

References setX(), and setY().

477  {
478  switch (i) {
479  case 1: setX(val, e); break;
480  case 2: setY(val, e, source); break;
481  default: throw RangeError("Invalid axis int, must be in range 1..dim");
482  }
483  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:379
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ set() [2/3]

void YODA::Point2D::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 485 of file Point2D.h.

References setX(), and setY().

485  {
486  switch (i) {
487  case 1: setX(val, eminus, eplus); break;
488  case 2: setY(val, eminus, eplus, source); break;
489  default: throw RangeError("Invalid axis int, must be in range 1..dim");
490  }
491  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:379
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ set() [3/3]

void YODA::Point2D::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 493 of file Point2D.h.

References setX(), and setY().

493  {
494  switch (i) {
495  case 1: setX(val, e); break;
496  case 2: setY(val, e, source); break;
497  default: throw RangeError("Invalid axis int, must be in range 1..dim");
498  }
499  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:379
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setErr()

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

Set symmetric error for direction i.

Implements YODA::Point< N >.

Definition at line 452 of file Point2D.h.

References setXErrs(), and setYErrs().

452  {
453  switch (i) {
454  case 1: setXErrs(e); break;
455  case 2: setYErrs(e, source); break;
456  default: throw RangeError("Invalid axis int, must be in range 1..dim");
457  }
458  }
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176

◆ setErrMinus()

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

Set negative error for direction i.

Implements YODA::Point< N >.

Definition at line 435 of file Point2D.h.

References setXErrMinus(), and setYErrMinus().

435  {
436  switch (i) {
437  case 1: setXErrMinus(eminus); break;
438  case 2: setYErrMinus(eminus, source); break;
439  default: throw RangeError("Invalid axis int, must be in range 1..dim");
440  }
441  }
void setYErrMinus(double eyminus, std::string source="")
Set negative y error.
Definition: Point2D.h:243
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:160

◆ setErrPlus()

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

Set positive error for direction i.

Implements YODA::Point< N >.

Definition at line 443 of file Point2D.h.

References setXErrPlus(), and setYErrPlus().

443  {
444  switch (i) {
445  case 1: setXErrPlus(eplus); break;
446  case 2: setYErrPlus(eplus, source); break;
447  default: throw RangeError("Invalid axis int, must be in range 1..dim");
448  }
449  }
void setYErrPlus(double eyplus, std::string source="")
Set positive y error.
Definition: Point2D.h:251
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:165

◆ setErrs() [1/2]

void YODA::Point2D::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 460 of file Point2D.h.

References setXErrs(), and setYErrs().

460  {
461  switch (i) {
462  case 1: setXErrs(eminus, eplus); break;
463  case 2: setYErrs(eminus, eplus, source); break;
464  default: throw RangeError("Invalid axis int, must be in range 1..dim");
465  }
466  }
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176

◆ setErrs() [2/2]

void YODA::Point2D::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 468 of file Point2D.h.

References setXErrs(), and setYErrs().

468  {
469  switch (i) {
470  case 1: setXErrs(e); break;
471  case 2: setYErrs(e, source); break;
472  default: throw RangeError("Invalid axis int, must be in range 1..dim");
473  }
474  }
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176

◆ setVal()

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

Set the point value for direction i.

Implements YODA::Point< N >.

Definition at line 387 of file Point2D.h.

References errMap(), getVariationsFromParent(), setX(), and setY().

387  {
388  switch (i) {
389  case 1: setX(val); break;
390  case 2: setY(val); break;
391  default: throw RangeError("Invalid axis int, must be in range 1..dim");
392  }
393  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:379
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setX() [1/4]

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

Set x value.

Definition at line 112 of file Point2D.h.

References x().

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

112 { _x = x; }
double x() const
Get x value.
Definition: Point2D.h:109

◆ setX() [2/4]

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

Set x value and symmetric error.

Definition at line 301 of file Point2D.h.

References setX(), and setXErrs().

301  {
302  setX(x);
303  setXErrs(ex);
304  }
double x() const
Get x value.
Definition: Point2D.h:109
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setX() [3/4]

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

Set x value and asymmetric error.

Definition at line 307 of file Point2D.h.

References setX(), and setXErrs().

307  {
308  setX(x);
309  setXErrs(exminus, explus);
310  }
double x() const
Get x value.
Definition: Point2D.h:109
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setX() [4/4]

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

Set x value and asymmetric error.

Definition at line 313 of file Point2D.h.

References setX(), and setXErrs().

313  {
314  setX(x);
315  setXErrs(ex);
316  }
double x() const
Get x value.
Definition: Point2D.h:109
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:176
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setXErr()

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

Set symmetric x error.

Definition at line 170 of file Point2D.h.

References setXErrMinus(), and setXErrPlus().

Referenced by setXErrs().

170  {
171  setXErrMinus(ex);
172  setXErrPlus(ex);
173  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:165
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:160

◆ setXErrMinus()

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

Set negative x error.

Definition at line 160 of file Point2D.h.

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

160  {
161  _ex.first = exminus;
162  }

◆ setXErrPlus()

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

Set positive x error.

Definition at line 165 of file Point2D.h.

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

165  {
166  _ex.second = explus;
167  }

◆ setXErrs() [1/3]

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

Set symmetric x error (alias)

Definition at line 176 of file Point2D.h.

References setXErr().

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

176  {
177  setXErr(ex);
178  }
void setXErr(double ex)
Set symmetric x error.
Definition: Point2D.h:170

◆ setXErrs() [2/3]

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

Set asymmetric x error.

Definition at line 181 of file Point2D.h.

References setXErrMinus(), and setXErrPlus().

181  {
182  setXErrMinus(exminus);
183  setXErrPlus(explus);
184  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:165
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:160

◆ setXErrs() [3/3]

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

Set asymmetric x error.

Definition at line 187 of file Point2D.h.

187  {
188  _ex = ex;
189  }

◆ setXY() [1/2]

void YODA::Point2D::setXY ( double  x,
double  y 
)
inline

Set x and y values.

Definition at line 126 of file Point2D.h.

References setX(), and setY().

126 { setX(x); setY(y); }
void setY(double y)
Set y value.
Definition: Point2D.h:118
double x() const
Get x value.
Definition: Point2D.h:109
double y() const
Get y value.
Definition: Point2D.h:115
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setXY() [2/2]

void YODA::Point2D::setXY ( const std::pair< double, double > &  xy)
inline

Set x and y values.

Definition at line 129 of file Point2D.h.

References setX(), and setY().

129 { setX(xy.first); setY(xy.second); }
void setY(double y)
Set y value.
Definition: Point2D.h:118
std::pair< double, double > xy() const
Get x,y value pair.
Definition: Point2D.h:123
void setX(double x)
Set x value.
Definition: Point2D.h:112

◆ setY() [1/4]

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

Set y value.

Definition at line 118 of file Point2D.h.

References y().

Referenced by YODA::add(), YODA::divide(), YODA::flip(), YODA::multiply(), scaleY(), set(), setVal(), setXY(), setY(), YODA::subtract(), YODA::toIntegralHisto(), and YODA::transformY().

118 { _y = y; }
double y() const
Get y value.
Definition: Point2D.h:115

◆ setY() [2/4]

void YODA::Point2D::setY ( double  y,
double  ey,
std::string  source = "" 
)
inline

Set y value and symmetric error.

Definition at line 320 of file Point2D.h.

References setY(), and setYErrs().

320  {
321  setY(y);
322  setYErrs(ey, source);
323  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
double y() const
Get y value.
Definition: Point2D.h:115

◆ setY() [3/4]

void YODA::Point2D::setY ( double  y,
double  eyminus,
double  eyplus,
std::string  source = "" 
)
inline

Set y value and asymmetric error.

Definition at line 326 of file Point2D.h.

References setY(), and setYErrs().

326  {
327  setY(y);
328  setYErrs(eyminus, eyplus, source);
329  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
double y() const
Get y value.
Definition: Point2D.h:115

◆ setY() [4/4]

void YODA::Point2D::setY ( double  y,
std::pair< double, double > &  ey,
std::string  source = "" 
)
inline

Set y value and asymmetric error.

Definition at line 332 of file Point2D.h.

References setY(), and setYErrs().

332  {
333  setY(y);
334  setYErrs(ey, source);
335  }
void setY(double y)
Set y value.
Definition: Point2D.h:118
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:263
double y() const
Get y value.
Definition: Point2D.h:115

◆ setYErr()

void YODA::Point2D::setYErr ( double  ey,
std::string  source = "" 
)
inline

Set symmetric y error.

Definition at line 257 of file Point2D.h.

References setYErrMinus(), and setYErrPlus().

Referenced by setYErrs().

257  {
258  setYErrMinus(ey, source );
259  setYErrPlus(ey, source );
260  }
void setYErrPlus(double eyplus, std::string source="")
Set positive y error.
Definition: Point2D.h:251
void setYErrMinus(double eyminus, std::string source="")
Set negative y error.
Definition: Point2D.h:243

◆ setYErrMinus()

void YODA::Point2D::setYErrMinus ( double  eyminus,
std::string  source = "" 
)
inline

Set negative y error.

Definition at line 243 of file Point2D.h.

Referenced by YODA::add(), YODA::divide(), YODA::flip(), YODA::multiply(), setErrMinus(), setYErr(), setYErrs(), YODA::subtract(), and YODA::transformY().

243  {
244  if (!_ey.count(source)) {
245  _ey[source] = std::make_pair(0.,0.);
246  }
247  _ey.at(source).first = eyminus;
248  }

◆ setYErrPlus()

void YODA::Point2D::setYErrPlus ( double  eyplus,
std::string  source = "" 
)
inline

Set positive y error.

Definition at line 251 of file Point2D.h.

Referenced by YODA::add(), YODA::divide(), YODA::flip(), YODA::multiply(), setErrPlus(), setYErr(), setYErrs(), YODA::subtract(), and YODA::transformY().

251  {
252  if (!_ey.count(source)) _ey[source] = std::make_pair(0.,0.);
253  _ey.at(source).second = eyplus;
254  }

◆ setYErrs() [1/3]

void YODA::Point2D::setYErrs ( double  ey,
std::string  source = "" 
)
inline

Set symmetric y error (alias)

Definition at line 263 of file Point2D.h.

References setYErr().

Referenced by YODA::Scatter2D::parseVariations(), scaleY(), setErr(), setErrs(), and setY().

263  {
264  setYErr(ey, source);
265  }
void setYErr(double ey, std::string source="")
Set symmetric y error.
Definition: Point2D.h:257

◆ setYErrs() [2/3]

void YODA::Point2D::setYErrs ( double  eyminus,
double  eyplus,
std::string  source = "" 
)
inline

Set asymmetric y error.

Definition at line 268 of file Point2D.h.

References setYErrMinus(), and setYErrPlus().

268  {
269  setYErrMinus(eyminus, source);
270  setYErrPlus(eyplus, source );
271  }
void setYErrPlus(double eyplus, std::string source="")
Set positive y error.
Definition: Point2D.h:251
void setYErrMinus(double eyminus, std::string source="")
Set negative y error.
Definition: Point2D.h:243

◆ setYErrs() [3/3]

void YODA::Point2D::setYErrs ( const std::pair< double, double > &  ey,
std::string  source = "" 
)
inline

Set asymmetric y error.

Definition at line 274 of file Point2D.h.

274  {
275  _ey[source] = ey;
276  }

◆ val()

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

Get the point value for direction i.

Implements YODA::Point< N >.

Definition at line 379 of file Point2D.h.

References x(), and y().

379  {
380  switch (i) {
381  case 1: return x();
382  case 2: return y();
383  default: throw RangeError("Invalid axis int, must be in range 1..dim");
384  }
385  }
double x() const
Get x value.
Definition: Point2D.h:109
double y() const
Get y value.
Definition: Point2D.h:115

◆ x()

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

◆ xErrAvg()

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

Get average x-error value.

Definition at line 155 of file Point2D.h.

Referenced by errAvg().

155  {
156  return (_ex.first + _ex.second)/2.0;
157  }

◆ xErrMinus()

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

Get negative x-error value.

Definition at line 144 of file Point2D.h.

Referenced by YODA::add(), YODA::divide(), errMinus(), YODA::multiply(), YODA::operator<(), YODA::operator==(), scaleX(), YODA::subtract(), and YODA::toTGraph().

144  {
145  return _ex.first;
146  }

◆ xErrPlus()

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

Get positive x-error value.

Definition at line 149 of file Point2D.h.

Referenced by YODA::add(), YODA::divide(), errPlus(), YODA::multiply(), YODA::operator<(), YODA::operator==(), scaleX(), YODA::subtract(), and YODA::toTGraph().

149  {
150  return _ex.second;
151 
152  }

◆ xErrs()

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

Get x-error values.

Definition at line 139 of file Point2D.h.

Referenced by errs().

139  {
140  return _ex;
141  }

◆ xMax()

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

Get value plus positive x-error

Todo:
Remove (or extend) when multiple errors are supported No: doesn't need to change since (for now) we only store multiple errors for the highest dimentsion

Definition at line 203 of file Point2D.h.

Referenced by YODA::flip(), and YODA::transformX().

203  {
204  return _x + _ex.second;
205  }

◆ xMin()

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

Get value minus negative x-error

Todo:
Remove (or extend) when multiple errors are supported No: doesn't need to change since (for now) we only store multiple errors for the highest dimentsion

Definition at line 195 of file Point2D.h.

Referenced by YODA::flip(), and YODA::transformX().

195  {
196  return _x - _ex.first;
197  }

◆ xy()

std::pair<double,double> YODA::Point2D::xy ( ) const
inline

Get x,y value pair.

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

Definition at line 123 of file Point2D.h.

123 { return std::make_pair(_x, _y); }

◆ y()

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

Get y value.

Definition at line 115 of file Point2D.h.

Referenced by YODA::add(), YODA::divide(), YODA::flip(), YODA::multiply(), YODA::operator==(), scaleY(), setY(), YODA::subtract(), YODA::toTGraph(), YODA::transformY(), and val().

115 { return _y; }

◆ yErrAvg()

double YODA::Point2D::yErrAvg ( std::string  source = "") const
inline

Get average y-error value.

Definition at line 235 of file Point2D.h.

References getVariationsFromParent().

Referenced by YODA::divide(), and errAvg().

235  {
236  if (source!="") getVariationsFromParent();
237  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
238  double res=(fabs(_ey.at(source).first) + fabs(_ey.at(source).second))/2.;
239  return res;
240  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point2D.cc:14

◆ yErrMinus()

double YODA::Point2D::yErrMinus ( std::string  source = "") const
inline

Get negative y-error value.

Definition at line 221 of file Point2D.h.

References getVariationsFromParent().

Referenced by YODA::add(), YODA::divide(), errMinus(), YODA::multiply(), YODA::operator==(), scaleY(), YODA::subtract(), and YODA::toTGraph().

221  {
222  if (source!="") getVariationsFromParent();
223  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
224  return _ey.at(source).first;
225  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point2D.cc:14

◆ yErrPlus()

double YODA::Point2D::yErrPlus ( std::string  source = "") const
inline

Get positive y-error value.

Definition at line 228 of file Point2D.h.

References getVariationsFromParent().

Referenced by YODA::add(), YODA::divide(), errPlus(), YODA::multiply(), YODA::operator==(), scaleY(), YODA::subtract(), and YODA::toTGraph().

228  {
229  if (source!="") getVariationsFromParent();
230  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
231  return _ey.at(source).second;
232  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point2D.cc:14

◆ yErrs()

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

Get y-error values.

Definition at line 214 of file Point2D.h.

References getVariationsFromParent().

Referenced by errs().

214  {
215  if (source!="") getVariationsFromParent();
216  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
217  return _ey.at(source);
218  }
void getVariationsFromParent() const
Parse the variations annotation on the parent scatter.
Definition: Point2D.cc:14

◆ yMax()

double YODA::Point2D::yMax ( std::string  source = "") const
inline

Get value plus positive y-error.

Definition at line 286 of file Point2D.h.

References getVariationsFromParent().

Referenced by YODA::flip(), and YODA::transformY().

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

◆ yMin()

double YODA::Point2D::yMin ( std::string  source = "") const
inline

Get value minus negative y-error.

Definition at line 279 of file Point2D.h.

References getVariationsFromParent().

Referenced by YODA::flip(), and YODA::transformY().

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

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