Pandora
Pandora source code navigator
|
TwoDHistogram class. More...
#include "Histograms.h"
Public Member Functions | |
TwoDHistogram (const unsigned int nBinsX, const float xLow, const float xHigh, const unsigned int nBinsY, const float yLow, const float yHigh) | |
Constructor. | |
TwoDHistogram (const TiXmlHandle *const pXmlHandle, const std::string &xmlElementName) | |
Constructor. | |
TwoDHistogram (const TwoDHistogram &rhs) | |
Copy constructor. | |
int | GetNBinsX () const |
Get the number of x bins. | |
float | GetXLow () const |
Get the min binned x value. | |
float | GetXHigh () const |
Get the max binned x value. | |
float | GetXBinWidth () const |
Get the x bin width. | |
int | GetNBinsY () const |
Get the number of y bins. | |
float | GetYLow () const |
Get the min binned y value. | |
float | GetYHigh () const |
Get the max binned y value. | |
float | GetYBinWidth () const |
Get the y bin width. | |
float | GetBinContent (const int binX, const int binY) const |
Get the content of a specified bin. | |
int | GetBinNumberX (const float valueX) const |
Get the x bin number for a specified x value. | |
int | GetMinBinNumberX () const |
Get the min x bin number of the histogram (ignores overflow and underflow bins) | |
int | GetMaxBinNumberX () const |
Get the max x bin number of the histogram (ignores overflow and underflow bins) | |
int | GetUnderflowBinNumberX () const |
Get the underflow x bin number of the histogram. | |
int | GetOverflowBinNumberX () const |
Get the overflow x bin number of the histogram. | |
int | GetBinNumberY (const float valueY) const |
Get the y bin number for a specified value. | |
int | GetMinBinNumberY () const |
Get the min y bin number of the histogram (ignores overflow and underflow bins) | |
int | GetMaxBinNumberY () const |
Get the max y bin number of the histogram (ignores overflow and underflow bins) | |
int | GetUnderflowBinNumberY () const |
Get the underflow y bin number of the histogram. | |
int | GetOverflowBinNumberY () const |
Get the overflow y bin number of the histogram. | |
float | GetCumulativeSum () const |
Get the cumulative sum of bin entries in the histogram (ignores overflow and underflow bins) | |
float | GetCumulativeSum (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const |
Get the cumulative sum of bin entries in a specified range of the histogram (includes overflow and underflow bins if specified) | |
void | GetMaximum (float &maximumValue, int &maximumBinX, int &maximumBinY) const |
Get the maximum value in the histogram and the corresponding bin numbers (ignores overflow and underflow bins) | |
void | GetMaximum (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin, float &maximumValue, int &maximumBinX, int &maximumBinY) const |
Get the maximum value in a specified range of the histogram and the corresponding bin numbers (includes overflow and underflow bins if specified) | |
float | GetMeanX () const |
Get the mean x value of entries in the histogram (ignores overflow and underflow bins) | |
float | GetMeanX (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const |
Get the mean x value of entries in a specified range of the histogram (ignores overflow and underflow bins) | |
float | GetStandardDeviationX () const |
Get the standard deviation of x entries in the histogram (ignores overflow and underflow bins) | |
float | GetStandardDeviationX (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const |
Get the standard deviation of x entries in a specified range of the histogram (ignores overflow and underflow bins) | |
float | GetMeanY () const |
Get the mean y value of entries in the histogram (ignores overflow and underflow bins) | |
float | GetMeanY (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const |
Get the mean y value of entries in a specified range of the histogram (ignores overflow and underflow bins) | |
float | GetStandardDeviationY () const |
Get the standard deviation of y entries in the histogram (ignores overflow and underflow bins) | |
float | GetStandardDeviationY (const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const |
Get the standard deviation of y entries in a specified range of the histogram (ignores overflow and underflow bins) | |
void | SetBinContent (const int binX, const int binY, const float value) |
Set the contents of a specified bin. | |
void | Fill (const float valueX, const float valueY, const float weight=1.f) |
Add an entry to the histogram. | |
void | Scale (const float scaleFactor) |
Scale contents of all histogram bins by a specified factor. | |
void | WriteToXml (TiXmlDocument *const pTiXmlDocument, const std::string &xmlElementName) const |
Write the histogram to an xml document. | |
Private Types | |
typedef std::map< int, float > | HistogramMap |
typedef std::map< int, HistogramMap > | TwoDHistogramMap |
Private Attributes | |
TwoDHistogramMap | m_xyHistogramMap |
The x->y->value 2d histogram map. | |
TwoDHistogramMap | m_yxHistogramMap |
The y->x->value 2d histogram map. | |
int | m_nBinsX |
The number of x bins. | |
float | m_xLow |
The min binned x value. | |
float | m_xHigh |
The max binned x value. | |
float | m_xBinWidth |
The x bin width. | |
int | m_nBinsY |
The number of y bins. | |
float | m_yLow |
The min binned y value. | |
float | m_yHigh |
The max binned y value. | |
float | m_yBinWidth |
The y bin width. | |
TwoDHistogram class.
Definition at line 252 of file Histograms.h.
|
private |
Definition at line 591 of file Histograms.h.
|
private |
Definition at line 592 of file Histograms.h.
pandora::TwoDHistogram::TwoDHistogram | ( | const unsigned int | nBinsX, |
const float | xLow, | ||
const float | xHigh, | ||
const unsigned int | nBinsY, | ||
const float | yLow, | ||
const float | yHigh | ||
) |
Constructor.
nBinsX | number of x bins |
xLow | min binned x value |
xHigh | max binned x value |
nBinsY | number of y bins |
yLow | min binned y value |
yHigh | max binned y value |
Definition at line 293 of file Histograms.cc.
pandora::TwoDHistogram::TwoDHistogram | ( | const TiXmlHandle *const | pXmlHandle, |
const std::string & | xmlElementName | ||
) |
Constructor.
pXmlHandle | address of the handle for the xml element describing the histogram |
xmlElementName | the xml element name for the histogram |
Definition at line 315 of file Histograms.cc.
pandora::TwoDHistogram::TwoDHistogram | ( | const TwoDHistogram & | rhs | ) |
void pandora::TwoDHistogram::Fill | ( | const float | valueX, |
const float | valueY, | ||
const float | weight = 1.f |
||
) |
Add an entry to the histogram.
valueX | the x value for the entry |
valueY | the y value for the entry |
weight | the weight associated with this entry |
Definition at line 665 of file Histograms.cc.
float pandora::TwoDHistogram::GetBinContent | ( | const int | binX, |
const int | binY | ||
) | const |
Get the content of a specified bin.
binX | the specified x bin number |
binY | the specified y bin number |
Definition at line 394 of file Histograms.cc.
int pandora::TwoDHistogram::GetBinNumberX | ( | const float | valueX | ) | const |
Get the x bin number for a specified x value.
valueX | the specified x value |
Definition at line 410 of file Histograms.cc.
int pandora::TwoDHistogram::GetBinNumberY | ( | const float | valueY | ) | const |
Get the y bin number for a specified value.
valueY | the specified y value |
Definition at line 427 of file Histograms.cc.
|
inline |
Get the cumulative sum of bin entries in the histogram (ignores overflow and underflow bins)
Definition at line 806 of file Histograms.h.
float pandora::TwoDHistogram::GetCumulativeSum | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin | ||
) | const |
Get the cumulative sum of bin entries in a specified range of the histogram (includes overflow and underflow bins if specified)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
Definition at line 445 of file Histograms.cc.
|
inline |
Get the max x bin number of the histogram (ignores overflow and underflow bins)
Definition at line 758 of file Histograms.h.
|
inline |
Get the max y bin number of the histogram (ignores overflow and underflow bins)
Definition at line 785 of file Histograms.h.
void pandora::TwoDHistogram::GetMaximum | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin, | ||
float & | maximumValue, | ||
int & | maximumBinX, | ||
int & | maximumBinY | ||
) | const |
Get the maximum value in a specified range of the histogram and the corresponding bin numbers (includes overflow and underflow bins if specified)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
maximumValue | to receive the maximum value |
maximumBinX | to receive the x coordinate of the bin containing the maximum value |
maximumBinY | to receive the y coordinate of the bin containing the maximum value |
Definition at line 472 of file Histograms.cc.
|
inline |
Get the maximum value in the histogram and the corresponding bin numbers (ignores overflow and underflow bins)
maximumValue | to receive the maximum value |
maximumBinX | to receive the x coordinate of the bin containing the maximum value |
maximumBinY | to receive the y coordinate of the bin containing the maximum value |
Definition at line 813 of file Histograms.h.
|
inline |
Get the mean x value of entries in the histogram (ignores overflow and underflow bins)
Definition at line 820 of file Histograms.h.
float pandora::TwoDHistogram::GetMeanX | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin | ||
) | const |
Get the mean x value of entries in a specified range of the histogram (ignores overflow and underflow bins)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
Definition at line 506 of file Histograms.cc.
|
inline |
Get the mean y value of entries in the histogram (ignores overflow and underflow bins)
Definition at line 834 of file Histograms.h.
float pandora::TwoDHistogram::GetMeanY | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin | ||
) | const |
Get the mean y value of entries in a specified range of the histogram (ignores overflow and underflow bins)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
Definition at line 580 of file Histograms.cc.
|
inline |
Get the min x bin number of the histogram (ignores overflow and underflow bins)
Definition at line 751 of file Histograms.h.
|
inline |
Get the min y bin number of the histogram (ignores overflow and underflow bins)
Definition at line 778 of file Histograms.h.
|
inline |
|
inline |
|
inline |
Get the overflow x bin number of the histogram.
Definition at line 772 of file Histograms.h.
|
inline |
Get the overflow y bin number of the histogram.
Definition at line 799 of file Histograms.h.
|
inline |
Get the standard deviation of x entries in the histogram (ignores overflow and underflow bins)
Definition at line 827 of file Histograms.h.
float pandora::TwoDHistogram::GetStandardDeviationX | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin | ||
) | const |
Get the standard deviation of x entries in a specified range of the histogram (ignores overflow and underflow bins)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
Definition at line 541 of file Histograms.cc.
|
inline |
Get the standard deviation of y entries in the histogram (ignores overflow and underflow bins)
Definition at line 841 of file Histograms.h.
float pandora::TwoDHistogram::GetStandardDeviationY | ( | const int | xLowBin, |
const int | xHighBin, | ||
const int | yLowBin, | ||
const int | yHighBin | ||
) | const |
Get the standard deviation of y entries in a specified range of the histogram (ignores overflow and underflow bins)
xLowBin | bin at start of specified x range |
xHighBin | bin at end of specified x range |
yLowBin | bin at start of specified y range |
yHighBin | bin at end of specified y range |
Definition at line 615 of file Histograms.cc.
|
inline |
Get the underflow x bin number of the histogram.
Definition at line 765 of file Histograms.h.
|
inline |
Get the underflow y bin number of the histogram.
Definition at line 792 of file Histograms.h.
|
inline |
|
inline |
Get the max binned x value.
Definition at line 710 of file Histograms.h.
|
inline |
Get the min binned x value.
Definition at line 703 of file Histograms.h.
|
inline |
|
inline |
Get the max binned y value.
Definition at line 738 of file Histograms.h.
|
inline |
Get the min binned y value.
Definition at line 731 of file Histograms.h.
void pandora::TwoDHistogram::Scale | ( | const float | scaleFactor | ) |
Scale contents of all histogram bins by a specified factor.
scaleFactor | the scale factor |
Definition at line 688 of file Histograms.cc.
void pandora::TwoDHistogram::SetBinContent | ( | const int | binX, |
const int | binY, | ||
const float | value | ||
) |
Set the contents of a specified bin.
binX | the specified x bin number |
binY | the specified y bin number |
value | the new value for the specified bin |
Definition at line 654 of file Histograms.cc.
void pandora::TwoDHistogram::WriteToXml | ( | TiXmlDocument *const | pTiXmlDocument, |
const std::string & | xmlElementName | ||
) | const |
Write the histogram to an xml document.
pTiXmlDocument | address of the xml document |
xmlElementName | the xml element name for the histogram |
Definition at line 709 of file Histograms.cc.
|
private |
The number of x bins.
Definition at line 597 of file Histograms.h.
|
private |
The number of y bins.
Definition at line 602 of file Histograms.h.
|
private |
The x bin width.
Definition at line 600 of file Histograms.h.
|
private |
The max binned x value.
Definition at line 599 of file Histograms.h.
|
private |
The min binned x value.
Definition at line 598 of file Histograms.h.
|
private |
The x->y->value 2d histogram map.
Definition at line 594 of file Histograms.h.
|
private |
The y bin width.
Definition at line 605 of file Histograms.h.
|
private |
The max binned y value.
Definition at line 604 of file Histograms.h.
|
private |
The min binned y value.
Definition at line 603 of file Histograms.h.
|
private |
The y->x->value 2d histogram map.
Definition at line 595 of file Histograms.h.