class Histogram2 Histogram API.
| | xbin_t Axis type; |
| | histdata_t Bin content type; |
| | stat_t Statistics type; |
| | Histogram2 () Default constructor. |
| | Histogram2 (const Histogram2& h) Copy Constructor. |
| | Histogram2 (const char* name, int nbinx, xbin_t xmin, xbin_t xmax, int nbiny, xbin_t ymin, xbin_t ymax, const char* xlabel = "", const char* ylabel = "", const char* nlabel = "") Dataless constructor. |
| | Histogram2 (const char* name, int nbinx, xbin_t* xbins, int nbiny, xbin_t* ybins, const char* xlabel = "", const char* ylabel = "", const char* nlabel = "") Dataless constructor. |
| | ~Histogram2 () Histogram2 Destructor. |
| | Clear () Clear bin contents, number of data entries and time. |
| | Fill (xbin_t x, xbin_t y, double w = 1) Increment the corresponding bin to the data by the weight. |
| | FillN (int ntimes, const xbin_t* x, const xbin_t* y) Increment corresponding bin to each data array element by given weights. |
| | FillN (int ntimes, const xbin_t* x, const xbin_t* y, const double* w) Increment corresponding bin to each data array element by given weights. |
| | GetBinContents (histdata_t* data) const Copy bin contens to a double array. |
| | GetBinContent (int xbin, int ybin) const Return bin content. |
| | GetBinLowEdges (xbin_t* bin, int axis) const Copy bin edges to a double array. |
| | GetBinLowEdge (int n, int axis) const Copy bin edges to a double array. |
| | GetBinCenter (int n, int axis) const Return the center of n-th bin content in the specified axis. |
| | GetBinErrors (stat_t* err) const Copy bin errors to a double array. |
| | GetBinError (int xbin, int ybin) const Return bin error. |
| | GetBinNumber (xbin_t val, int axis) const Return the bin number in the specified axis. |
| | GetBinSpacing (int axis) const Return bin spacing for fixed bin spacing histogram. |
| | GetNEntries (void) const Return the number of data entries. |
| | GetNBins (int axis) const Return number of bins. |
| | GetTitle (void) const Return the title of the histogram. |
| | GetXLabel (void) const Return the label of the X-axis. |
| | GetYLabel (void) const Return the label of the Y-axis. |
| | GetNLabel (void) const Return the label of the bin-count axis. |
| | GetMinContent (void) const Return the minimum of bin contents. |
| | GetMaxContent (void) const Return the maximum of bin contents. |
| | GetMinContentBin (int& xbin, int& ybin) const Return the bin number for the minimum bin content. |
| | GetMaxContentBin (int& xbin, int& ybin) const Return the bin number for the maximum bin content. |
| | GetMean (int axis) const Return mean value. |
| | GetSdev (int axis) const Return standard deviation. |
| | GetStats (stat_t *stats) const Copy statistics of the histogram to an array. |
| | PutStats (const stat_t *stats) Copy statistics of the histogram to an array. |
| | Projection (const char* title, int axis, int firstbin = 0, int lastbin = 99999) Project a 2-D histogram into a 1-D histogram. |
| | GetBinType (void) const Return the bin type. |
| | GetTime (void) const Return GPS time. |
| | IsErrorFlagON (void) const Return true, if bin errors are defined. |
| | SetTitle (const char* name) Set the histogram title. |
| | SetXLabel (const char* xlabel) Set the X-axis label. |
| | SetYLabel (const char* ylabel) Set the Y-axis label. |
| | SetNLabel (const char* nlabel) Set the bin-count axis label. |
| | SetBinLowEdges (int nbinx, xbin_t xmin, xbin_t xmax, int nbiny, xbin_t ymin, xbin_t ymax) Set the histogram bins. |
| | SetBinLowEdges (int nbinx, const xbin_t* xbins, int nbiny, const xbin_t* ybins) Set the histogram bins. |
| | SetBinContents (const histdata_t* data) Replace the contents of bins. |
| | SetBinContent (int xbin, int ybin, histdata_t content) Replace the specified bin content by the new content. |
| | SetBinErrors (const stat_t* err) Replace the error of bins. |
| | SetBinError (int x, int y, stat_t err) Replace the specified bin error by the new error. |
| | SetNEntries (int n) Replace the number of entries with new number. |
| | SetNBins (int nbin, int axis) Set number of bins. |
| | SetBinType (int type) Set the bin type. |
| | SetTime (const Time& t) Set a time stamp (GPS). |
| | Sumw2 (bool reset = true) Clear or Update errors of bins based on the current bin content. |
| | Reset (void) Clear all the histogram data. |
| | operator [] (int n) const Get the reference to the n-th bin. |
| | operator = (const Histogram2& h) Copy histogram. |
| | operator += (const Histogram2& h) Add a histogram to the current histogram. |
| | operator += (histdata_t bias) Add a bias to each bin. |
| | operator -= (const Histogram2& h) Subtract the histogram from the current histogram. |
| | operator *= (double scale) Multiply bin contents by a scalar. |
| | operator *= (const Histogram2& h) Multiply current Histogram2 by the argument histogram. |
| | operator /= (const Histogram2& h) Divide bin contents by bin contents of the argument histogram. |
| | Allocate (int nbinx = 0, int nbiny = 0) Free old memory, then allocate new memory |
The Histogram2 class holds a 2-dimensional histogram data.
typedef double histdata_t
typedef double stat_t
void Allocate(int nbinx = 0, int nbiny = 0)
Histogram2()
Histogram2(const Histogram2& h)
Histogram2(const char* name, int nbinx, xbin_t xmin, xbin_t xmax, int nbiny, xbin_t ymin, xbin_t ymax, const char* xlabel = "", const char* ylabel = "", const char* nlabel = "")
xmin - lower edge.
xmax - upper edge.
nbiny - number of bins.
ymin - lower edge.
ymax - upper edge.
xlabel - label for the X-axis.
ylabel - label for the Y-axis.
nlabel - upper for the bin content axis.
Histogram2(const char* name, int nbinx, xbin_t* xbins, int nbiny, xbin_t* ybins, const char* xlabel = "", const char* ylabel = "", const char* nlabel = "")
xbins - lower bin edges
(the last element is the upper edge).
nbiny - number of bins.
ybins - lower bin edges
(the last element is the upper edge).
xlabel - label for the X-axis.
ylabel - label for the Y-axis.
nlabel - upper for the bin content axis.
virtual ~Histogram2()
virtual void Clear()
virtual void Fill(xbin_t x, xbin_t y, double w = 1)
y - Data for Y-axis
w - Weight.
virtual void FillN(int ntimes, const xbin_t* x, const xbin_t* y)
x - Data array for X-axis.
y - Data array for Y-axis.
virtual void FillN(int ntimes, const xbin_t* x, const xbin_t* y, const double* w)
x - Data array for X-axis.
y - Data array for Y-axis.
w - Array of weights.
virtual void GetBinContents(histdata_t* data) const
virtual histdata_t GetBinContent(int xbin, int ybin) const
ybin - Bin number in Y-direction.
(0: Underflow, N+1: Overflow where N is Number of bins)
virtual void GetBinLowEdges(xbin_t* bin, int axis) const
axis - Select Axis. (0: X-axis, 1: Y-axis)
virtual xbin_t GetBinLowEdge(int n, int axis) const
virtual xbin_t GetBinCenter(int n, int axis) const
axis - Select Axis. (0: X-axis, 1: Y-axis)
virtual bool GetBinErrors(stat_t* err) const
virtual stat_t GetBinError(int xbin, int ybin) const
ybin - Bin number in Y-direction.
(0: Underflow, N+1: Overflow where N is Number of bins)
virtual int GetBinNumber(xbin_t val, int axis) const
axis - Select Axis. (0: X-axis, 1: Y-axis)
virtual xbin_t GetBinSpacing(int axis) const
virtual int GetNEntries(void) const
virtual int GetNBins(int axis) const
virtual const char* GetTitle(void) const
virtual const char* GetXLabel(void) const
virtual const char* GetYLabel(void) const
virtual const char* GetNLabel(void) const
virtual histdata_t GetMinContent(void) const
virtual histdata_t GetMaxContent(void) const
virtual histdata_t GetMinContentBin(int& xbin, int& ybin) const
virtual histdata_t GetMaxContentBin(int& xbin, int& ybin) const
virtual stat_t GetMean(int axis) const
virtual stat_t GetSdev(int axis) const
virtual void GetStats(stat_t *stats) const
stats[0] Sum of weight
stats[1] Sum of weight^2
stats[2] Sum of weight * xdata
stats[3] Sum of weight * xdata^2
stats[4] Sum of weight * ydata
stats[5] Sum of weight * ydata^2
stats[6] Sum of weight * xdata * ydata
virtual void PutStats(const stat_t *stats)
stats[0] Sum of weight
stats[1] Sum of weight^2
stats[2] Sum of weight * xdata
stats[3] Sum of weight * xdata^2
stats[4] Sum of weight * ydata
stats[5] Sum of weight * ydata^2
stats[6] Sum of weight * xdata * ydata
virtual Histogram1* Projection(const char* title, int axis, int firstbin = 0, int lastbin = 99999)
axis - Select Axis. (0: X-axis, 1: Y-axis)
firstbin - First bin to be projected.
lastbin - Last bin to be projected.
virtual int GetBinType(void) const
0 Undefined
1 Fixed Bin
2 Variable Bin
virtual Time GetTime(void) const
virtual bool IsErrorFlagON(void) const
virtual void SetTitle(const char* name)
virtual void SetXLabel(const char* xlabel)
virtual void SetYLabel(const char* ylabel)
virtual void SetNLabel(const char* nlabel)
virtual void SetBinLowEdges(int nbinx, xbin_t xmin, xbin_t xmax, int nbiny, xbin_t ymin, xbin_t ymax)
xmin - Lower edge in X-axis.
xmax - Upper edge in X-axis.
nbiny - Number of bins in Y-axis.
ymin - Lower edge in Y-axis.
ymax - Upper edge in Y-axis.
virtual void SetBinLowEdges(int nbinx, const xbin_t* xbins, int nbiny, const xbin_t* ybins)
xbins - Array of low-edges in X-axis (the last element is the upper edge).
nbiny - Number of bins in Y-axis.
ybins - Array of low-edges in Y-axis (the last element is the upper edge).
virtual void SetBinContents(const histdata_t* data)
virtual bool SetBinContent(int xbin, int ybin, histdata_t content)
ybin - Bin number in Y-Axis.
content - New content.
virtual void SetBinErrors(const stat_t* err)
virtual bool SetBinError(int x, int y, stat_t err)
ybin - Bin number in Y-Axis.
content - New error.
virtual void SetNEntries(int n)
virtual void SetNBins(int nbin, int axis)
axis - Select Axis. (0: X-axis, 1: Y-axis)
virtual void SetBinType(int type)
virtual void SetTime(const Time& t)
virtual void Sumw2(bool reset = true)
virtual void Reset(void)
virtual const histdata_t& operator [] (int n) const
Histogram2& operator = (const Histogram2& h)
Histogram2& operator += (const Histogram2& h)
Histogram2& operator += (histdata_t bias)
Histogram2& operator -= (const Histogram2& h)
Histogram2& operator *= (double scale)
Histogram2& operator *= (const Histogram2& h)
Histogram2& operator /= (const Histogram2& h)
alphabetic index hierarchy of classes
Please send questions and comments to zweizig_j@ligo.caltech.edu
generated by doc++