YODA is hosted by Hepforge, IPPP Durham

A Bin1D specialised for handling profile-type information. More...

#include <ProfileBin2D.h>

Inheritance diagram for YODA::ProfileBin2D:
YODA::Bin2D< Dbn3D > YODA::Bin

Public Member Functions

ProfileBin2Doperator+= (const ProfileBin2D &toAdd)
 Add two bins (for use by Profile2D) More...
 
ProfileBin2Doperator-= (const ProfileBin2D &toSubtract)
 
Constructors
 ProfileBin2D (double xmin, double xmax, double ymin, double ymax)
 Make a new, empty bin with two pairs of edges. More...
 
 ProfileBin2D (const std::pair< double, double > &xedges, const std::pair< double, double > &yedges)
 Constructor accepting a set of all edges of a bin. More...
 
 ProfileBin2D (const std::pair< double, double > &xedges, const std::pair< double, double > &yedges, const Dbn3D &dbn)
 Make a bin with all the components of a fill history. More...
 
 ProfileBin2D (const ProfileBin2D &pb)
 Copy constructor. More...
 
ProfileBin2Doperator= (const ProfileBin2D &pb)
 Copy assignment. More...
 
Modifiers
void fill (double x, double y, double z, double weight=1.0)
 
void fill (std::pair< double, double > coords, double z, double weight=1.0)
 
void fillBin (double z, double weight=1.0)
 
void reset ()
 A reset function. More...
 
Bin scaling (x,y scaling is inherited)
void scaleZ (double az)
 
void scaleXYZ (double ax, double ay, double az)
 
Bin content info
double mean () const
 The mean of the z distribution. More...
 
double stdDev () const
 The std deviation of the z distribution about the mean. More...
 
double variance () const
 The variance of the z distribution about the mean. More...
 
double stdErr () const
 The standard error on the mean. More...
 
double relErr () const
 The relative size of the error on the mean. More...
 
double rms () const
 The RMS of the z distribution. More...
 
Raw z distribution statistics
double sumWZ () const
 The sum of z*weight. More...
 
double sumWZ2 () const
 
- Public Member Functions inherited from YODA::Bin2D< Dbn3D >
 Bin2D (const std::pair< double, double > &xedges, const std::pair< double, double > &yedges)
 Make a new, empty bin with two pairs of edges. More...
 
 Bin2D (const std::pair< double, double > &xedges, const std::pair< double, double > &yedges, const Dbn3D &dbn)
 Make a bin with all the components of a fill history. More...
 
 Bin2D (const Bin2D< Dbn3D > &b)
 Copy constructor. More...
 
Bin2D< Dbn3D > & operator= (const Bin2D< Dbn3D > &b)
 Copy assignment. More...
 
void scaleW (double scalefactor)
 
void scaleXY (double scaleX, double scaleY)
 
std::pair< double, double > xEdges () const
 Get the {low,high} edges as an STL pair. More...
 
double xMin () const
 Lower x limit of the bin (inclusive). More...
 
double xMax () const
 Upper x limit of the bin (exclusive). More...
 
std::pair< double, double > yEdges () const
 Get the {low,high} edges as an STL pair. More...
 
double yMin () const
 Lower y limit of the bin (inclusive). More...
 
double yMax () const
 Upper y limit of the bin (exclusive). More...
 
double xMid () const
 Middle of the bin in x. More...
 
double yMid () const
 Middle of the bin in y. More...
 
std::pair< double, double > xyMid () const
 The geometric centre of the bin. More...
 
double xWidth () const
 Width of the bin in x. More...
 
double yWidth () const
 Width of the bin in y. More...
 
std::pair< double, double > xyWidths () const
 Widths of the bin in x and y. More...
 
double xFocus () const
 The mean x position in the bin, or the x midpoint if that is not available. More...
 
double yFocus () const
 The mean y position in the bin, or the y midpoint if that is not available. More...
 
std::pair< double, double > xyFocus () const
 The mean position in the bin, or the midpoint if that is not available. More...
 
double xMean () const
 Mean value of x-values in the bin. More...
 
double yMean () const
 Mean value of y-values in the bin. More...
 
double xVariance () const
 The variance of x-values in the bin. More...
 
double yVariance () const
 The variance of y-values in the bin. More...
 
double xStdDev () const
 The standard deviation (spread) of x-values in the bin. More...
 
double yStdDev () const
 The standard deviation (spread) of y-values in the bin. More...
 
double xStdErr () const
 The standard error on the bin x focus. More...
 
double yStdErr () const
 The standard error on the bin y focus. More...
 
double xRMS () const
 The x RMS in the bin. More...
 
double yRMS () const
 The y RMS in the bin. More...
 
Dbn3Ddbn ()
 Statistical distribution in this bin (non-const) More...
 
const Dbn3Ddbn () const
 Statistical distribution in this bin (const) More...
 
unsigned long numEntries () const
 The number of entries. More...
 
double effNumEntries () const
 The effective number of entries. More...
 
double sumW () const
 The sum of weights. More...
 
double sumW2 () const
 The sum of weights squared. More...
 
double sumWX () const
 The sum of x*weight. More...
 
double sumWY () const
 The sum of y*weight. More...
 
double sumWXY () const
 The sum of x*y*weight. More...
 
double sumWX2 () const
 The sum of x^2 * weight. More...
 
double sumWY2 () const
 The sum of y^2 * weight. More...
 
Bin2D< Dbn3D > & operator+= (const Bin2D< Dbn3D > &b)
 Add two bins. More...
 
Bin2D< Dbn3D > & operator-= (const Bin2D< Dbn3D > &b)
 Subtract one bin from another. More...
 
Bin2D< Dbn3D > & add (const Bin2D< Dbn3D > &b)
 Merge two adjacent bins. More...
 
Bin2D< Dbn3D > & subtract (const Bin2D< Dbn3D > &b)
 
bool fitsInside (std::pair< double, double > xrange, std::pair< double, double > yrange) const
 Test whether this bin would fit inside the given area. More...
 
bool bounds (double x, double y) const
 Test whether a point lies within the current bin. More...
 
int adjacentTo (const Bin2D< Dbn3D > &b) const
 Test whether two bins are adjacent and, if so, return how as an integer. More...
 
- Public Member Functions inherited from YODA::Bin
virtual ~Bin ()
 Virtual destructor for inheritance. More...
 

Protected Member Functions

ProfileBin2Dadd (const ProfileBin2D &pb)
 Add two bins. More...
 
ProfileBin2Dsubtract (const ProfileBin2D &pb)
 Subtract one bin from another. More...
 

Detailed Description

A Bin1D specialised for handling profile-type information.

This is a 1D bin type, which supports all the operations defined for a generic Bin1D object, but also supplies the specific member functions for profile-type data, as opposed to histogram-type. This means that extra internal distribution statistics are stored for the extra "y-direction" specified in the profile fill operation.

Definition at line 23 of file ProfileBin2D.h.

Constructor & Destructor Documentation

YODA::ProfileBin2D::ProfileBin2D ( double  xmin,
double  xmax,
double  ymin,
double  ymax 
)
inline

Make a new, empty bin with two pairs of edges.

Definition at line 30 of file ProfileBin2D.h.

31  : Bin2D<Dbn3D>(std::make_pair(xmin, xmax), std::make_pair(ymin, ymax))
32  { }
YODA::ProfileBin2D::ProfileBin2D ( const std::pair< double, double > &  xedges,
const std::pair< double, double > &  yedges 
)
inline

Constructor accepting a set of all edges of a bin.

Definition at line 35 of file ProfileBin2D.h.

37  : Bin2D<Dbn3D>(xedges, yedges)
38  { }
YODA::ProfileBin2D::ProfileBin2D ( const std::pair< double, double > &  xedges,
const std::pair< double, double > &  yedges,
const Dbn3D dbn 
)
inline

Make a bin with all the components of a fill history.

Mainly intended for internal persistency use.

Definition at line 43 of file ProfileBin2D.h.

45  : Bin2D<Dbn3D>(xedges, yedges, dbn)
46  { }
Dbn3D & dbn()
Statistical distribution in this bin (non-const)
Definition: Bin2D.h:276
YODA::ProfileBin2D::ProfileBin2D ( const ProfileBin2D pb)
inline

Copy constructor.

Definition at line 49 of file ProfileBin2D.h.

50  : Bin2D<Dbn3D>(pb)
51  { }

Member Function Documentation

ProfileBin2D& YODA::ProfileBin2D::add ( const ProfileBin2D pb)
inlineprotected

Add two bins.

Definition at line 180 of file ProfileBin2D.h.

References YODA::Bin2D< DBN >::add().

Referenced by operator+=().

180  {
181  Bin2D<Dbn3D>::add(pb);
182  return *this;
183  }
Bin2D< DBN > & add(const Bin2D< DBN > &b)
Merge two adjacent bins.
Definition: Bin2D.h:377
void YODA::ProfileBin2D::fill ( double  x,
double  y,
double  z,
double  weight = 1.0 
)
inline

Fill by x, y, z values and weight

Note
This should not be used, since it breaks histogram consistency. It will be removed in a future version.

Definition at line 68 of file ProfileBin2D.h.

Referenced by fill(), and fillBin().

68  {
69  _dbn.fill(x, y, z, weight);
70  }
void YODA::ProfileBin2D::fill ( std::pair< double, double >  coords,
double  z,
double  weight = 1.0 
)
inline

A fill() function accepting the x,y coordinates as std::pair

Note
This should not be used, since it breaks histogram consistency. It will be removed in a future version.

Definition at line 75 of file ProfileBin2D.h.

References fill().

75  {
76  fill(coords.first, coords.second, z, weight);
77  }
void fill(double x, double y, double z, double weight=1.0)
Definition: ProfileBin2D.h:68
void YODA::ProfileBin2D::fillBin ( double  z,
double  weight = 1.0 
)
inline

Fill the bin at the midpoint with a given z value

Note
This should not be used, since it breaks histogram consistency. It will be removed in a future version.

Definition at line 82 of file ProfileBin2D.h.

References fill(), and YODA::Bin2D< Dbn3D >::xyMid().

82  {
83  fill(xyMid(), z, weight);
84  }
void fill(double x, double y, double z, double weight=1.0)
Definition: ProfileBin2D.h:68
std::pair< double, double > xyMid() const
The geometric centre of the bin.
Definition: Bin2D.h:173
double YODA::ProfileBin2D::mean ( ) const
inline

The mean of the z distribution.

Definition at line 119 of file ProfileBin2D.h.

Referenced by YODA::mkScatter(), and relErr().

119  {
120  return _dbn.zMean();
121  }
ProfileBin2D& YODA::ProfileBin2D::operator+= ( const ProfileBin2D toAdd)
inline

Add two bins (for use by Profile2D)

Definition at line 169 of file ProfileBin2D.h.

References add().

169  {
170  return add(toAdd);
171  }
ProfileBin2D & add(const ProfileBin2D &pb)
Add two bins.
Definition: ProfileBin2D.h:180
ProfileBin2D& YODA::ProfileBin2D::operator-= ( const ProfileBin2D toSubtract)
inline

Definition at line 173 of file ProfileBin2D.h.

References subtract().

173  {
174  return subtract(toSubtract);
175  }
ProfileBin2D & subtract(const ProfileBin2D &pb)
Subtract one bin from another.
Definition: ProfileBin2D.h:186
ProfileBin2D& YODA::ProfileBin2D::operator= ( const ProfileBin2D pb)
inline

Copy assignment.

Definition at line 54 of file ProfileBin2D.h.

References YODA::Bin2D< DBN >::operator=().

54  {
56  return *this;
57  }
Bin2D< DBN > & operator=(const Bin2D< DBN > &b)
Copy assignment.
Definition: Bin2D.h:83
double YODA::ProfileBin2D::relErr ( ) const
inline

The relative size of the error on the mean.

Definition at line 139 of file ProfileBin2D.h.

References mean(), and stdErr().

139  {
140  return stdErr() != 0 ? stdErr() / mean() : 0;
141  }
double stdErr() const
The standard error on the mean.
Definition: ProfileBin2D.h:134
double mean() const
The mean of the z distribution.
Definition: ProfileBin2D.h:119
void YODA::ProfileBin2D::reset ( )
inlinevirtual

A reset function.

Reimplemented from YODA::Bin2D< Dbn3D >.

Definition at line 87 of file ProfileBin2D.h.

References YODA::Bin2D< DBN >::reset().

87  {
89  }
virtual void reset()
Reset this bin.
Definition: Bin2D.h:97
double YODA::ProfileBin2D::rms ( ) const
inline

The RMS of the z distribution.

Definition at line 144 of file ProfileBin2D.h.

144  {
145  return _dbn.zRMS();
146  }
void YODA::ProfileBin2D::scaleXYZ ( double  ax,
double  ay,
double  az 
)
inline

Scale the x, y and z dimensions

Note
This should not be used, since it breaks histogram consistency. It will be removed in a future version.

Definition at line 107 of file ProfileBin2D.h.

References YODA::Bin2D< Dbn3D >::scaleXY(), and scaleZ().

107  {
108  scaleXY(ax, ay);
109  scaleZ(az);
110  }
void scaleXY(double scaleX, double scaleY)
Definition: Bin2D.h:111
void scaleZ(double az)
Definition: ProfileBin2D.h:100
void YODA::ProfileBin2D::scaleZ ( double  az)
inline

Scale the z (profiled) dimension

Note
This should not be used, since it breaks histogram consistency. It will be removed in a future version.

Definition at line 100 of file ProfileBin2D.h.

Referenced by scaleXYZ(), and YODA::Profile2D::scaleZ().

100  {
101  _dbn.scaleZ(az);
102  }
double YODA::ProfileBin2D::stdDev ( ) const
inline

The std deviation of the z distribution about the mean.

Definition at line 124 of file ProfileBin2D.h.

124  {
125  return _dbn.zStdDev();
126  }
double YODA::ProfileBin2D::stdErr ( ) const
inline

The standard error on the mean.

Definition at line 134 of file ProfileBin2D.h.

Referenced by YODA::mkScatter(), and relErr().

134  {
135  return _dbn.zStdErr();
136  }
ProfileBin2D& YODA::ProfileBin2D::subtract ( const ProfileBin2D pb)
inlineprotected

Subtract one bin from another.

Definition at line 186 of file ProfileBin2D.h.

References YODA::Bin2D< DBN >::subtract().

Referenced by operator-=().

186  {
188  return *this;
189  }
Bin2D< DBN > & subtract(const Bin2D< DBN > &b)
Definition: Bin2D.h:390
double YODA::ProfileBin2D::sumWZ ( ) const
inline

The sum of z*weight.

Todo:
: Check if it is correct

Definition at line 156 of file ProfileBin2D.h.

Referenced by YODA::WriterYODA::writeProfile2D().

156  {
157  return _dbn.sumWZ();
158  }
double YODA::ProfileBin2D::sumWZ2 ( ) const
inline

Definition at line 160 of file ProfileBin2D.h.

Referenced by YODA::WriterYODA::writeProfile2D().

160  {
161  return _dbn.sumWZ2();
162  }
double YODA::ProfileBin2D::variance ( ) const
inline

The variance of the z distribution about the mean.

Definition at line 129 of file ProfileBin2D.h.

129  {
130  return _dbn.zVariance();
131  }

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