yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis  1.7.2
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 (double scalex, double scaley)
 
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 2D data point to be contained in a Scatter2D.

Definition at line 18 of file Point2D.h.

Constructor & Destructor Documentation

◆ Point2D() [1/5]

YODA::Point2D::Point2D ( )
inline

Definition at line 25 of file Point2D.h.

25 { }

◆ 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 29 of file Point2D.h.

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

◆ 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 38 of file Point2D.h.

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

◆ 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 67 of file Point2D.h.

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

◆ Point2D() [5/5]

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

Copy constructor.

Definition at line 76 of file Point2D.h.

77  : _x(p._x), _y(p._y)
78  {
79  _ex = p._ex;
80  _ey = p._ey;
81  }

Member Function Documentation

◆ dim()

size_t YODA::Point2D::dim ( )
inlinevirtual

Space dimension of the point.

Implements YODA::Point< N >.

Definition at line 99 of file Point2D.h.

99 { 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 410 of file Point2D.h.

References xErrAvg(), and yErrAvg().

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

◆ errMap()

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

Get error map for direction i.

Implements YODA::Point< N >.

Definition at line 381 of file Point2D.h.

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

381  {
382  return _ey;
383  }

◆ 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 394 of file Point2D.h.

References xErrMinus(), and yErrMinus().

394  {
395  switch (i) {
396  case 1: return xErrMinus();
397  case 2: return yErrMinus(source);
398  default: throw RangeError("Invalid axis int, must be in range 1..dim");
399  }
400  }
double yErrMinus(std::string source="") const
Get negative y-error value.
Definition: Point2D.h:217
double xErrMinus() const
Get negative x-error value.
Definition: Point2D.h:141

◆ 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 402 of file Point2D.h.

References xErrPlus(), and yErrPlus().

402  {
403  switch (i) {
404  case 1: return xErrPlus();
405  case 2: return yErrPlus(source);
406  default: throw RangeError("Invalid axis int, must be in range 1..dim");
407  }
408  }
double yErrPlus(std::string source="") const
Get positive y-error value.
Definition: Point2D.h:223
double xErrPlus() const
Get positive x-error value.
Definition: Point2D.h:146

◆ 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 386 of file Point2D.h.

References xErrs(), and yErrs().

386  {
387  switch (i) {
388  case 1: return xErrs();
389  case 2: return yErrs(source);
390  default: throw RangeError("Invalid axis int, must be in range 1..dim");
391  }
392  }
const std::pair< double, double > & xErrs() const
Get x-error values.
Definition: Point2D.h:136
const std::pair< double, double > & yErrs(std::string source="") const
Get y-error values.
Definition: Point2D.h:211

◆ operator=()

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

Copy assignment.

Definition at line 85 of file Point2D.h.

85  {
86  _x = p._x;
87  _y = p._y;
88  _ex = p._ex;
89  _ey = p._ey;
90  return *this;
91  }

◆ scale()

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

Scaling of both axes

Deprecated:
Use scaleXY

Definition at line 353 of file Point2D.h.

References scaleXY().

353  {
354  scaleXY(scalex, scaley);
355  }
void scaleXY(double scalex, double scaley)
Scaling of both axes.
Definition: Point2D.h:346

◆ scaleX()

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

Scaling of x axis.

Definition at line 332 of file Point2D.h.

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

Referenced by scaleXY().

332  {
333  setX(x()*scalex);
334  setXErrs(xErrMinus()*scalex, xErrPlus()*scalex);
335  }
double x() const
Get x value.
Definition: Point2D.h:106
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173
void setX(double x)
Set x value.
Definition: Point2D.h:109
double xErrMinus() const
Get negative x-error value.
Definition: Point2D.h:141
double xErrPlus() const
Get positive x-error value.
Definition: Point2D.h:146

◆ scaleXY()

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

Scaling of both axes.

Definition at line 346 of file Point2D.h.

References scaleX(), and scaleY().

Referenced by scale().

346  {
347  scaleX(scalex);
348  scaleY(scaley);
349  }
void scaleX(double scalex)
Scaling of x axis.
Definition: Point2D.h:332
void scaleY(double scaley)
Scaling of y axis.
Definition: Point2D.h:338

◆ scaleY()

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

Scaling of y axis.

Definition at line 338 of file Point2D.h.

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

Referenced by scaleXY().

338  {
339  setY(y()*scaley);
340  for (const auto &source : _ey){
341  setYErrs(yErrMinus()*scaley, yErrPlus()*scaley, source.first);
342  }
343  }
void setY(double y)
Set y value.
Definition: Point2D.h:115
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
double y() const
Get y value.
Definition: Point2D.h:112
double yErrPlus(std::string source="") const
Get positive y-error value.
Definition: Point2D.h:223
double yErrMinus(std::string source="") const
Get negative y-error value.
Definition: Point2D.h:217

◆ 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 461 of file Point2D.h.

References setX(), and setY().

461  {
462  switch (i) {
463  case 1: setX(val, e); break;
464  case 2: setY(val, e, source); break;
465  default: throw RangeError("Invalid axis int, must be in range 1..dim");
466  }
467  }
void setY(double y)
Set y value.
Definition: Point2D.h:115
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:364
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ 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 469 of file Point2D.h.

References setX(), and setY().

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

◆ 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 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:115
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:364
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ 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 436 of file Point2D.h.

References setXErrs(), and setYErrs().

436  {
437  switch (i) {
438  case 1: setXErrs(e); break;
439  case 2: setYErrs(e, source); break;
440  default: throw RangeError("Invalid axis int, must be in range 1..dim");
441  }
442  }
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173

◆ 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 419 of file Point2D.h.

References setXErrMinus(), and setYErrMinus().

419  {
420  switch (i) {
421  case 1: setXErrMinus(eminus); break;
422  case 2: setYErrMinus(eminus, source); break;
423  default: throw RangeError("Invalid axis int, must be in range 1..dim");
424  }
425  }
void setYErrMinus(double eyminus, std::string source="")
Set negative y error.
Definition: Point2D.h:235
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:157

◆ 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 427 of file Point2D.h.

References setXErrPlus(), and setYErrPlus().

427  {
428  switch (i) {
429  case 1: setXErrPlus(eplus); break;
430  case 2: setYErrPlus(eplus, source); break;
431  default: throw RangeError("Invalid axis int, must be in range 1..dim");
432  }
433  }
void setYErrPlus(double eyplus, std::string source="")
Set positive y error.
Definition: Point2D.h:241
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:162

◆ 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 444 of file Point2D.h.

References setXErrs(), and setYErrs().

444  {
445  switch (i) {
446  case 1: setXErrs(eminus, eplus); break;
447  case 2: setYErrs(eminus, eplus, source); break;
448  default: throw RangeError("Invalid axis int, must be in range 1..dim");
449  }
450  }
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173

◆ 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 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:253
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173

◆ 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 372 of file Point2D.h.

References setX(), and setY().

372  {
373  switch (i) {
374  case 1: setX(val); break;
375  case 2: setY(val); break;
376  default: throw RangeError("Invalid axis int, must be in range 1..dim");
377  }
378  }
void setY(double y)
Set y value.
Definition: Point2D.h:115
double val(size_t i) const
Get the point value for direction i.
Definition: Point2D.h:364
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ setX() [1/4]

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

Set x value.

Definition at line 109 of file Point2D.h.

References x().

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

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

◆ setX() [2/4]

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

Set x value and symmetric error.

Definition at line 289 of file Point2D.h.

References setX(), and setXErrs().

289  {
290  setX(x);
291  setXErrs(ex);
292  }
double x() const
Get x value.
Definition: Point2D.h:106
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ setX() [3/4]

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

Set x value and asymmetric error.

Definition at line 295 of file Point2D.h.

References setX(), and setXErrs().

295  {
296  setX(x);
297  setXErrs(exminus, explus);
298  }
double x() const
Get x value.
Definition: Point2D.h:106
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ setX() [4/4]

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

Set x value and asymmetric 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:106
void setXErrs(double ex)
Set symmetric x error (alias)
Definition: Point2D.h:173
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ setXErr()

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

Set symmetric x error.

Definition at line 167 of file Point2D.h.

References setXErrMinus(), and setXErrPlus().

Referenced by setXErrs().

167  {
168  setXErrMinus(ex);
169  setXErrPlus(ex);
170  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:162
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:157

◆ setXErrMinus()

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

Set negative x error.

Definition at line 157 of file Point2D.h.

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

157  {
158  _ex.first = exminus;
159  }

◆ setXErrPlus()

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

Set positive x error.

Definition at line 162 of file Point2D.h.

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

162  {
163  _ex.second = explus;
164  }

◆ setXErrs() [1/3]

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

Set symmetric x error (alias)

Definition at line 173 of file Point2D.h.

References setXErr().

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

173  {
174  setXErr(ex);
175  }
void setXErr(double ex)
Set symmetric x error.
Definition: Point2D.h:167

◆ setXErrs() [2/3]

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

Set asymmetric x error.

Definition at line 178 of file Point2D.h.

References setXErrMinus(), and setXErrPlus().

178  {
179  setXErrMinus(exminus);
180  setXErrPlus(explus);
181  }
void setXErrPlus(double explus)
Set positive x error.
Definition: Point2D.h:162
void setXErrMinus(double exminus)
Set negative x error.
Definition: Point2D.h:157

◆ setXErrs() [3/3]

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

Set asymmetric x error.

Definition at line 184 of file Point2D.h.

184  {
185  _ex = ex;
186  }

◆ setXY() [1/2]

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

Set x and y values.

Definition at line 123 of file Point2D.h.

References setX(), and setY().

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

◆ setXY() [2/2]

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

Set x and y values.

Definition at line 126 of file Point2D.h.

References setX(), and setY().

126 { setX(xy.first); setY(xy.second); }
void setY(double y)
Set y value.
Definition: Point2D.h:115
std::pair< double, double > xy() const
Get x,y value pair.
Definition: Point2D.h:120
void setX(double x)
Set x value.
Definition: Point2D.h:109

◆ setY() [1/4]

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

Set y value.

Definition at line 115 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().

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

◆ setY() [2/4]

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

Set y value and symmetric error.

Definition at line 308 of file Point2D.h.

References setY(), and setYErrs().

308  {
309  setY(y);
310  setYErrs(ey, source);
311  }
void setY(double y)
Set y value.
Definition: Point2D.h:115
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
double y() const
Get y value.
Definition: Point2D.h:112

◆ 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 314 of file Point2D.h.

References setY(), and setYErrs().

314  {
315  setY(y);
316  setYErrs(eyminus, eyplus, source);
317  }
void setY(double y)
Set y value.
Definition: Point2D.h:115
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
double y() const
Get y value.
Definition: Point2D.h:112

◆ 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 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:115
void setYErrs(double ey, std::string source="")
Set symmetric y error (alias)
Definition: Point2D.h:253
double y() const
Get y value.
Definition: Point2D.h:112

◆ setYErr()

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

Set symmetric y error.

Definition at line 247 of file Point2D.h.

References setYErrMinus(), and setYErrPlus().

Referenced by setYErrs().

247  {
248  setYErrMinus(ey, source );
249  setYErrPlus(ey, source );
250  }
void setYErrPlus(double eyplus, std::string source="")
Set positive y error.
Definition: Point2D.h:241
void setYErrMinus(double eyminus, std::string source="")
Set negative y error.
Definition: Point2D.h:235

◆ setYErrMinus()

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

Set negative y error.

Definition at line 235 of file Point2D.h.

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

235  {
236  if (!_ey.count(source)) _ey[source] = std::make_pair(0.,0.);
237  _ey.at(source).first = eyminus;
238  }

◆ setYErrPlus()

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

Set positive y error.

Definition at line 241 of file Point2D.h.

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

241  {
242  if (!_ey.count(source)) _ey[source] = std::make_pair(0.,0.);
243  _ey.at(source).second = eyplus;
244  }

◆ setYErrs() [1/3]

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

Set symmetric y error (alias)

Definition at line 253 of file Point2D.h.

References setYErr().

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

253  {
254  setYErr(ey, source);
255  }
void setYErr(double ey, std::string source="")
Set symmetric y error.
Definition: Point2D.h:247

◆ setYErrs() [2/3]

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

Set asymmetric y error.

Definition at line 258 of file Point2D.h.

References setYErrMinus(), and setYErrPlus().

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

◆ setYErrs() [3/3]

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

Set asymmetric y error.

Definition at line 264 of file Point2D.h.

264  {
265  _ey[source] = ey;
266  }

◆ val()

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

Get the point value for direction i.

Implements YODA::Point< N >.

Definition at line 364 of file Point2D.h.

References x(), and y().

364  {
365  switch (i) {
366  case 1: return x();
367  case 2: return y();
368  default: throw RangeError("Invalid axis int, must be in range 1..dim");
369  }
370  }
double x() const
Get x value.
Definition: Point2D.h:106
double y() const
Get y value.
Definition: Point2D.h:112

◆ x()

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

◆ xErrAvg()

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

Get average x-error value.

Definition at line 152 of file Point2D.h.

Referenced by errAvg().

152  {
153  return (_ex.first + _ex.second)/2.0;
154  }

◆ xErrMinus()

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

Get negative x-error value.

Definition at line 141 of file Point2D.h.

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

141  {
142  return _ex.first;
143  }

◆ xErrPlus()

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

Get positive x-error value.

Definition at line 146 of file Point2D.h.

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

146  {
147  return _ex.second;
148 
149  }

◆ xErrs()

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

Get x-error values.

Definition at line 136 of file Point2D.h.

Referenced by errs().

136  {
137  return _ex;
138  }

◆ 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 200 of file Point2D.h.

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

200  {
201  return _x + _ex.second;
202  }

◆ 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 192 of file Point2D.h.

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

192  {
193  return _x - _ex.first;
194  }

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

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

◆ y()

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

Get y value.

Definition at line 112 of file Point2D.h.

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

112 { return _y; }

◆ yErrAvg()

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

Get average y-error value.

Definition at line 229 of file Point2D.h.

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

229  {
230  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
231  return (_ey.at(source).first + _ey.at(source).second)/2.0;
232  }

◆ yErrMinus()

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

Get negative y-error value.

Definition at line 217 of file Point2D.h.

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

217  {
218  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
219  return _ey.at(source).first;
220  }

◆ yErrPlus()

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

Get positive y-error value.

Definition at line 223 of file Point2D.h.

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

223  {
224  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
225  return _ey.at(source).second;
226  }

◆ yErrs()

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

Get y-error values.

Definition at line 211 of file Point2D.h.

Referenced by errs().

211  {
212  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
213  return _ey.at(source);
214  }

◆ yMax()

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

Get value plus positive y-error.

Definition at line 275 of file Point2D.h.

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

275  {
276  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
277  return _y + _ey.at(source).second;
278  }

◆ yMin()

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

Get value minus negative y-error.

Definition at line 269 of file Point2D.h.

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

269  {
270  if (!_ey.count(source)) throw RangeError("yErrs has no such key: "+source);
271  return _y - _ey.at(source).first;
272  }

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