YODA is hosted by Hepforge, IPPP Durham
YODA::Point< N > Class Template Reference

An N-dimensional data point to be contained in a Scatter<N> More...

#include <PointND.h>

Public Types

typedef Utils::ndarray< double, N > NdVal
 
typedef Utils::ndarray
< std::pair< double, double >
, N > 
NdValPair
 
typedef Utils::sortedvector
< Error< N > > 
Errors
 

Public Member Functions

Constructors
 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...
 
Modifiers
void clear ()
 Clear the point values and errors. More...
 
Coordinate accessors
Todo:
addError, addErrors, setErrors
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...
 
Error accessors
Errorserrs ()
 Get error values. More...
 
const Errorserrs () const
 Get error values (const version) More...
 
void setErrs (const Errors &errs)
 Set the error values. More...
 
Scaling and transformations
void scale (const NdVal &scales)
 Uniform scaling. More...
 

Detailed Description

template<int N>
class YODA::Point< N >

An N-dimensional data point to be contained in a Scatter<N>

Definition at line 22 of file PointND.h.

Member Typedef Documentation

template<int N>
typedef Utils::sortedvector< Error<N> > YODA::Point< N >::Errors

Definition at line 28 of file PointND.h.

template<int N>
typedef Utils::ndarray<double, N> YODA::Point< N >::NdVal

Definition at line 26 of file PointND.h.

template<int N>
typedef Utils::ndarray<std::pair<double,double>, N> YODA::Point< N >::NdValPair

Definition at line 27 of file PointND.h.

Constructor & Destructor Documentation

template<int N>
YODA::Point< N >::Point ( )
inline

Definition at line 35 of file PointND.h.

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

35  {
36  clear();
37  }
void clear()
Clear the point values and errors.
Definition: PointND.h:83
template<int N>
YODA::Point< N >::Point ( const NdVal pos)
inline

Constructor from position values without errors.

Definition at line 41 of file PointND.h.

42  : _pos(pos)
43  { }
NdVal & pos()
Get the coordinate vector.
Definition: PointND.h:99
template<int N>
YODA::Point< N >::Point ( const NdVal pos,
const NdValPair errs 
)
inline

Constructor from values with a single set of asymmetric errors.

Definition at line 56 of file PointND.h.

57  : _pos(pos)
58  {
59  _errs.insert(Error<N>(errs));
60  }
Errors & errs()
Get error values.
Definition: PointND.h:116
NdVal & pos()
Get the coordinate vector.
Definition: PointND.h:99
template<int N>
YODA::Point< N >::Point ( const NdVal pos,
const Error< N > &  err 
)
inline

Constructor from values and a single Error object.

Definition at line 64 of file PointND.h.

65  : _pos(pos)
66  {
67  _errs.insert(err);
68  }
NdVal & pos()
Get the coordinate vector.
Definition: PointND.h:99
template<int N>
YODA::Point< N >::Point ( const std::vector< double > &  pos,
const std::vector< Error< N > > &  errs 
)
inline

Constructor from values and a collection of Error objects.

Definition at line 72 of file PointND.h.

73  : _pos(pos), _errs(errs)
74  { }

Member Function Documentation

template<int N>
void YODA::Point< N >::clear ( )
inline

Clear the point values and errors.

Definition at line 83 of file PointND.h.

Referenced by YODA::Point< N >::Point().

83  {
84  for (size_t i = 0; i < N; ++i) _pos[i] = 0;
85  _errs.clear();
86  }
template<int N>
Errors& YODA::Point< N >::errs ( )
inline

Get error values.

Definition at line 116 of file PointND.h.

Referenced by YODA::operator==(), YODA::Point< N >::scale(), and YODA::Point< N >::setErrs().

116  {
117  return _errs;
118  }
template<int N>
const Errors& YODA::Point< N >::errs ( ) const
inline

Get error values (const version)

Definition at line 121 of file PointND.h.

121  {
122  return _errs;
123  }
template<int N>
NdVal& YODA::Point< N >::pos ( )
inline

Get the coordinate vector.

Definition at line 99 of file PointND.h.

Referenced by YODA::operator==(), and YODA::Point< N >::setPos().

99 { return _pos; }
template<int N>
const NdVal& YODA::Point< N >::pos ( ) const
inline

Get the coordinate vector (const version)

Definition at line 102 of file PointND.h.

102 { return _pos; }
template<int N>
void YODA::Point< N >::scale ( const NdVal scales)
inline

Uniform scaling.

Definition at line 137 of file PointND.h.

References YODA::Point< N >::errs(), and YODA::Error< N >::scale().

Referenced by YODA::Scatter< N >::scale().

137  {
138  for (size_t i = 0; i < N; ++i) {
139  _pos[i] *= scales[i];
140  }
141  BOOST_FOREACH (Error<N>& e, errs()) {
142  e.scale(scales);
143  }
144  }
Errors & errs()
Get error values.
Definition: PointND.h:116
template<int N>
void YODA::Point< N >::setErrs ( const Errors errs)
inline

Set the error values.

Definition at line 126 of file PointND.h.

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

126  {
127  _errs = errs;
128  }
Errors & errs()
Get error values.
Definition: PointND.h:116
template<int N>
void YODA::Point< N >::setPos ( const NdVal pos)
inline

Set the coordinate vector.

Definition at line 105 of file PointND.h.

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

105  {
106  _pos = pos;
107  }
NdVal & pos()
Get the coordinate vector.
Definition: PointND.h:99

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