YODA is hosted by Hepforge, IPPP Durham

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

#include <ProfileBin1D.h>

Inheritance diagram for YODA::ProfileBin1D:
YODA::Bin1D< Dbn2D > YODA::Bin

Public Member Functions

ProfileBin1Doperator+= (const ProfileBin1D &toAdd)
 Add two bins (for use by Profile1D). More...
 
ProfileBin1Doperator-= (const ProfileBin1D &toSubtract)
 Subtract two bins. More...
 
Constructors
 ProfileBin1D (double lowedge, double highedge)
 Constructor giving bin low and high edges. More...
 
 ProfileBin1D (const std::pair< double, double > &edges)
 Constructor giving bin low and high edges as a pair. More...
 
 ProfileBin1D (std::pair< double, double > edges, const Dbn2D &dbnxy)
 Make a profile bin with all the components of a fill history. More...
 
 ProfileBin1D (const ProfileBin1D &pb)
 Copy constructor. More...
 
ProfileBin1Doperator= (const ProfileBin1D &pb)
 Copy assignment. More...
 
Modifiers
void fill (double x, double y, double weight=1.0)
 
void fillBin (double y, double weight=1.0)
 
Bin scaling (x scaling is inherited)
void scaleY (double ay)
 
void scaleXY (double ax, double ay)
 
Bin content info
double mean () const
 The mean of the y distribution. More...
 
double stdDev () const
 The std deviation of the y distribution about the mean. More...
 
double variance () const
 The variance of the y 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 y distribution. More...
 
Raw y distribution statistics
double sumWY () const
 The sum of y*weight. More...
 
double sumWY2 () const
 The sum of y^2 * weight. More...
 
- Public Member Functions inherited from YODA::Bin1D< Dbn2D >
 Bin1D (const std::pair< double, double > &edges)
 Make a new, empty bin with a pair of edges. More...
 
 Bin1D (const std::pair< double, double > &edges, const Dbn2D &dbn)
 Make a bin with all the components of a fill history. More...
 
 Bin1D (const Bin1D< Dbn2D > &b)
 Copy constructor. More...
 
Bin1Doperator= (const Bin1D< Dbn2D > &b)
 Copy assignment. More...
 
virtual void reset ()
 Reset this bin. More...
 
void scaleW (double scalefactor)
 
void scaleX (double factor)
 
std::pair< double, double > xEdges () const
 Get the {low,high} edges as an STL pair. More...
 
double xMin () const
 Lower limit of the bin (inclusive). More...
 
double xMax () const
 Upper limit of the bin (exclusive). More...
 
double xMid () const
 Geometric centre of the bin, i.e. high+low/2.0. More...
 
double midpoint () const
 
double xWidth () const
 Separation of low and high edges, i.e. high-low. More...
 
double width () const
 
double xFocus () 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 xVariance () const
 The variance of x-values in the bin. More...
 
double xStdDev () const
 The standard deviation (spread) of x-values in the bin. More...
 
double xStdErr () const
 The standard error on the bin focus. More...
 
double xRMS () const
 The x RMS in the bin. More...
 
Dbn2Ddbn ()
 Statistical distribution in this bin (non-const) More...
 
const Dbn2Ddbn () 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 sumWX2 () const
 The sum of x^2 * weight. More...
 
Bin1D< Dbn2D > & operator+= (const Bin1D< Dbn2D > &b)
 Add two bins. More...
 
Bin1D< Dbn2D > & operator-= (const Bin1D< Dbn2D > &b)
 Subtract one bin from another. More...
 
Bin1D< Dbn2D > & merge (const Bin1D< Dbn2D > &b)
 Merge two adjacent bins. More...
 
Bin1D< Dbn2D > & add (const Bin1D< Dbn2D > &b)
 
Bin1D< Dbn2D > & subtract (const Bin1D< Dbn2D > &b)
 
- Public Member Functions inherited from YODA::Bin
virtual ~Bin ()
 Virtual destructor for inheritance. More...
 

Protected Member Functions

ProfileBin1Dadd (const ProfileBin1D &pb)
 Add two bins (internal, explicitly named version) More...
 
ProfileBin1Dsubtract (const ProfileBin1D &pb)
 Subtract one bin from another (internal, explicitly named version) 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 ProfileBin1D.h.

Constructor & Destructor Documentation

YODA::ProfileBin1D::ProfileBin1D ( double  lowedge,
double  highedge 
)
inline

Constructor giving bin low and high edges.

Definition at line 30 of file ProfileBin1D.h.

31  : Bin1D<Dbn2D>(std::make_pair(lowedge, highedge))
32  { }
YODA::ProfileBin1D::ProfileBin1D ( const std::pair< double, double > &  edges)
inline

Constructor giving bin low and high edges as a pair.

Definition at line 36 of file ProfileBin1D.h.

37  : Bin1D<Dbn2D>(edges)
38  { }
YODA::ProfileBin1D::ProfileBin1D ( std::pair< double, double >  edges,
const Dbn2D dbnxy 
)
inline

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

Mainly intended for internal persistency use.

Definition at line 44 of file ProfileBin1D.h.

45  : Bin1D<Dbn2D>(edges, dbnxy)
46  { }
YODA::ProfileBin1D::ProfileBin1D ( const ProfileBin1D pb)
inline

Copy constructor.

Definition at line 50 of file ProfileBin1D.h.

51  : Bin1D<Dbn2D>(pb)
52  { }

Member Function Documentation

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

Add two bins (internal, explicitly named version)

Definition at line 175 of file ProfileBin1D.h.

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

Referenced by operator+=().

175  {
176  Bin1D<Dbn2D>::add(pb);
177  return *this;
178  }
Bin1D< DBN > & add(const Bin1D< DBN > &b)
Definition: Bin1D.h:275
void YODA::ProfileBin1D::fill ( double  x,
double  y,
double  weight = 1.0 
)
inline

Fill histo by x and y 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 70 of file ProfileBin1D.h.

Referenced by fillBin().

70  {
71  _dbn.fill(x, y, weight);
72  }
void YODA::ProfileBin1D::fillBin ( double  y,
double  weight = 1.0 
)
inline

Fill histo with weight and y-value y at x = bin midpoint.

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

Definition at line 77 of file ProfileBin1D.h.

References fill(), and YODA::Bin1D< Dbn2D >::xMid().

77  {
78  fill(xMid(), y, weight);
79  }
double xMid() const
Geometric centre of the bin, i.e. high+low/2.0.
Definition: Bin1D.h:130
void fill(double x, double y, double weight=1.0)
Definition: ProfileBin1D.h:70
double YODA::ProfileBin1D::mean ( ) const
inline

The mean of the y distribution.

Definition at line 111 of file ProfileBin1D.h.

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

111  {
112  return _dbn.yMean();
113  }
ProfileBin1D& YODA::ProfileBin1D::operator+= ( const ProfileBin1D toAdd)
inline

Add two bins (for use by Profile1D).

Definition at line 162 of file ProfileBin1D.h.

References add().

162  {
163  return add(toAdd);
164  }
ProfileBin1D & add(const ProfileBin1D &pb)
Add two bins (internal, explicitly named version)
Definition: ProfileBin1D.h:175
ProfileBin1D& YODA::ProfileBin1D::operator-= ( const ProfileBin1D toSubtract)
inline

Subtract two bins.

Definition at line 167 of file ProfileBin1D.h.

References subtract().

167  {
168  return subtract(toSubtract);
169  }
ProfileBin1D & subtract(const ProfileBin1D &pb)
Subtract one bin from another (internal, explicitly named version)
Definition: ProfileBin1D.h:181
ProfileBin1D& YODA::ProfileBin1D::operator= ( const ProfileBin1D pb)
inline

Copy assignment.

Definition at line 56 of file ProfileBin1D.h.

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

56  {
58  return *this;
59  }
Bin1D & operator=(const Bin1D< DBN > &b)
Copy assignment.
Definition: Bin1D.h:73
double YODA::ProfileBin1D::relErr ( ) const
inline

The relative size of the error on the mean.

Definition at line 131 of file ProfileBin1D.h.

References mean(), and stdErr().

131  {
132  return stdErr() != 0 ? stdErr() / mean() : 0;
133  }
double mean() const
The mean of the y distribution.
Definition: ProfileBin1D.h:111
double stdErr() const
The standard error on the mean.
Definition: ProfileBin1D.h:126
double YODA::ProfileBin1D::rms ( ) const
inline

The RMS of the y distribution.

Definition at line 136 of file ProfileBin1D.h.

136  {
137  return _dbn.yRMS();
138  }
void YODA::ProfileBin1D::scaleXY ( double  ax,
double  ay 
)
inline

Scale the x and y dimensions

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

Definition at line 97 of file ProfileBin1D.h.

References YODA::Bin1D< Dbn2D >::scaleX(), and scaleY().

97  {
98  scaleX(ax);
99  scaleY(ay);
100  }
void scaleX(double factor)
Definition: Bin1D.h:100
void scaleY(double ay)
Definition: ProfileBin1D.h:90
void YODA::ProfileBin1D::scaleY ( double  ay)
inline

Scale the y (profiled) dimension

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

Definition at line 90 of file ProfileBin1D.h.

Referenced by scaleXY(), and YODA::Profile1D::scaleY().

90  {
91  _dbn.scaleY(ay);
92  }
double YODA::ProfileBin1D::stdDev ( ) const
inline

The std deviation of the y distribution about the mean.

Definition at line 116 of file ProfileBin1D.h.

116  {
117  return _dbn.yStdDev();
118  }
double YODA::ProfileBin1D::stdErr ( ) const
inline

The standard error on the mean.

Definition at line 126 of file ProfileBin1D.h.

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

126  {
127  return _dbn.yStdErr();
128  }
ProfileBin1D& YODA::ProfileBin1D::subtract ( const ProfileBin1D pb)
inlineprotected

Subtract one bin from another (internal, explicitly named version)

Definition at line 181 of file ProfileBin1D.h.

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

Referenced by operator-=().

181  {
183  return *this;
184  }
Bin1D< DBN > & subtract(const Bin1D< DBN > &b)
Definition: Bin1D.h:289
double YODA::ProfileBin1D::sumWY ( ) const
inline

The sum of y*weight.

Definition at line 147 of file ProfileBin1D.h.

Referenced by YODA::toTProfile(), and YODA::WriterYODA::writeProfile1D().

147  {
148  return _dbn.sumWY();
149  }
double YODA::ProfileBin1D::sumWY2 ( ) const
inline

The sum of y^2 * weight.

Definition at line 152 of file ProfileBin1D.h.

Referenced by YODA::toTProfile(), and YODA::WriterYODA::writeProfile1D().

152  {
153  return _dbn.sumWY2();
154  }
double YODA::ProfileBin1D::variance ( ) const
inline

The variance of the y distribution about the mean.

Definition at line 121 of file ProfileBin1D.h.

121  {
122  return _dbn.yVariance();
123  }

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