8#ifndef PANDORA_HISTOGRAMS_H
9#define PANDORA_HISTOGRAMS_H 1
34 Histogram(
const unsigned int nBinsX,
const float xLow,
const float xHigh);
153 void GetMaximum(
float &maximumValue,
int &maximumBinX)
const;
164 void GetMaximum(
const int xLowBin,
const int xHighBin,
float &maximumValue,
int &maximumBinX)
const;
183 float GetMeanX(
const int xLowBin,
const int xHighBin)
const;
218 void Fill(
const float valueX,
const float weight = 1.f);
225 void Scale(
const float scaleFactor);
265 TwoDHistogram(
const unsigned int nBinsX,
const float xLow,
const float xHigh,
const unsigned int nBinsY,
const float yLow,
446 float GetCumulativeSum(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin)
const;
456 void GetMaximum(
float &maximumValue,
int &maximumBinX,
int &maximumBinY)
const;
470 void GetMaximum(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin,
float &maximumValue,
int &maximumBinX,
471 int &maximumBinY)
const;
492 float GetMeanX(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin)
const;
513 float GetStandardDeviationX(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin)
const;
534 float GetMeanY(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin)
const;
555 float GetStandardDeviationY(
const int xLowBin,
const int xHighBin,
const int yLowBin,
const int yHighBin)
const;
564 void SetBinContent(
const int binX,
const int binY,
const float value);
573 void Fill(
const float valueX,
const float valueY,
const float weight = 1.f);
580 void Scale(
const float scaleFactor);
int GetNBinsX() const
Get the number of x bins.
float GetCumulativeSum() const
Get the cumulative sum of bin entries in the histogram (ignores overflow and underflow bins)
float GetMeanX() const
Get the mean x value of entries in the histogram (ignores overflow and underflow bins)
void GetMaximum(float &maximumValue, int &maximumBinX) const
Get the maximum value in the histogram and the corresponding bin number (ignores overflow and underfl...
std::map< int, float > HistogramMap
int GetBinNumber(const float valueX) const
Get the bin number for a specified value.
void Fill(const float valueX, const float weight=1.f)
Add an entry to the histogram.
float m_xBinWidth
The x bin width.
int GetOverflowBinNumber() const
Get the overflow bin number of the histogram.
int GetMinBinNumber() const
Get the min bin number of the histogram (ignores overflow and underflow bins)
void SetBinContent(const int binX, const float value)
Set the contents of a specified bin.
float m_xHigh
The max binned x value.
float GetStandardDeviationX() const
Get the standard deviation of entries in the histogram (ignores overflow and underflow bins)
int GetMaxBinNumber() const
Get the max bin number of the histogram (ignores overflow and underflow bins)
float GetXBinWidth() const
Get the x bin width.
void WriteToXml(TiXmlDocument *const pTiXmlDocument, const std::string &xmlElementName) const
Write the histogram to an xml document.
int m_nBinsX
The number of x bins.
float GetXHigh() const
Get the max binned x value.
float GetBinContent(const int binX) const
Get the content of a specified bin.
HistogramMap m_histogramMap
The histogram map.
float GetXLow() const
Get the min binned x value.
int GetUnderflowBinNumber() const
Get the underflow bin number of the histogram.
float m_xLow
The min binned x value.
void Scale(const float scaleFactor)
Scale contents of all histogram bins by a specified factor.
int GetOverflowBinNumberY() const
Get the overflow y bin number of the histogram.
TwoDHistogramMap m_yxHistogramMap
The y->x->value 2d histogram map.
float GetYLow() const
Get the min binned y value.
int GetOverflowBinNumberX() const
Get the overflow x bin number of the histogram.
int m_nBinsX
The number of x bins.
int m_nBinsY
The number of y bins.
float GetBinContent(const int binX, const int binY) const
Get the content of a specified bin.
std::map< int, float > HistogramMap
float m_xLow
The min binned x value.
int GetUnderflowBinNumberY() const
Get the underflow 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 GetMeanX() const
Get the mean x value of entries in the histogram (ignores overflow and underflow bins)
int GetBinNumberY(const float valueY) const
Get the y bin number for a specified value.
float m_yHigh
The max binned y value.
std::map< int, HistogramMap > TwoDHistogramMap
int GetNBinsX() const
Get the number of x bins.
float m_yLow
The min binned y value.
float GetYHigh() const
Get the max binned y value.
int GetNBinsY() const
Get the number of y bins.
float GetXLow() const
Get the min binned x value.
float GetStandardDeviationY() const
Get the standard deviation of y entries in the histogram (ignores overflow and underflow bins)
void GetMaximum(float &maximumValue, int &maximumBinX, int &maximumBinY) const
Get the maximum value in the histogram and the corresponding bin numbers (ignores overflow and underf...
int GetMaxBinNumberY() const
Get the max y bin number of the histogram (ignores overflow and underflow bins)
int GetBinNumberX(const float valueX) const
Get the x bin number for a specified x value.
void SetBinContent(const int binX, const int binY, const float value)
Set the contents of a specified bin.
float GetYBinWidth() const
Get the y bin width.
TwoDHistogramMap m_xyHistogramMap
The x->y->value 2d histogram map.
float GetStandardDeviationX() const
Get the standard deviation of x entries in the histogram (ignores overflow and underflow bins)
float m_xHigh
The max binned x value.
int GetUnderflowBinNumberX() const
Get the underflow x bin number of the histogram.
void WriteToXml(TiXmlDocument *const pTiXmlDocument, const std::string &xmlElementName) const
Write the histogram to an xml document.
float GetMeanY() const
Get the mean y value of entries in the histogram (ignores overflow and underflow bins)
float GetXBinWidth() const
Get the x bin width.
int GetMinBinNumberY() const
Get the min y bin number of the histogram (ignores overflow and underflow bins)
float m_yBinWidth
The y bin width.
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.
int GetMinBinNumberX() const
Get the min x bin number of the histogram (ignores overflow and underflow bins)
float m_xBinWidth
The x bin width.
int GetMaxBinNumberX() const
Get the max x bin number of the histogram (ignores overflow and underflow bins)
float GetXHigh() const
Get the max binned x value.