cern.hep.aida.ref
Class Histogram2D
java.lang.Object
cern.hep.aida.ref.Histogram2D
- All Implemented Interfaces:
- colt.hep.aida.IHistogram, colt.hep.aida.IHistogram2D, Serializable
public class Histogram2D
- extends Object
- implements colt.hep.aida.IHistogram2D
A reference implementation of hep.aida.IHistogram2D.
The goal is to provide a clear implementation rather than the most efficient implementation.
However, performance seems fine - filling 6 * 10^5 points/sec, both using FixedAxis or VariableAxis.
- See Also:
- Serialized Form
Fields inherited from interface colt.hep.aida.IHistogram |
OVERFLOW, serialVersionUID, UNDERFLOW |
Constructor Summary |
Histogram2D(String title,
double[] xEdges,
double[] yEdges)
Creates a variable-width histogram. |
Histogram2D(String title,
colt.hep.aida.IAxis xAxis,
colt.hep.aida.IAxis yAxis)
Creates a histogram with the given axis binning. |
Histogram2D(String title,
int xBins,
double xMin,
double xMax,
int yBins,
double yMin,
double yMax)
Creates a fixed-width histogram. |
Methods inherited from interface colt.hep.aida.IHistogram2D |
binEntriesX, binEntriesY, binHeightX, binHeightY, minMaxBins, projectionX, projectionY, sliceX, sliceX, sliceY, sliceY, xAxis, yAxis |
Methods inherited from interface colt.hep.aida.IHistogram |
dimensions, entries, extraEntries, sumBinHeights, sumExtraBinHeights, title |
Histogram2D
public Histogram2D(String title,
double[] xEdges,
double[] yEdges)
- Creates a variable-width histogram.
Example: xEdges = (0.2, 1.0, 5.0, 6.0), yEdges = (-5, 0, 7) yields 3*2 in-range bins.
- Parameters:
title
- The histogram title.xEdges
- the bin boundaries the x-axis shall have;
must be sorted ascending and must not contain multiple identical elements.yEdges
- the bin boundaries the y-axis shall have;
must be sorted ascending and must not contain multiple identical elements.
- Throws:
IllegalArgumentException
- if xEdges.length < 1 || yEdges.length < 1.
Histogram2D
public Histogram2D(String title,
int xBins,
double xMin,
double xMax,
int yBins,
double yMin,
double yMax)
- Creates a fixed-width histogram.
- Parameters:
title
- The histogram title.xBins
- The number of bins on the X axis.xMin
- The minimum value on the X axis.xMax
- The maximum value on the X axis.yBins
- The number of bins on the Y axis.yMin
- The minimum value on the Y axis.yMax
- The maximum value on the Y axis.
Histogram2D
public Histogram2D(String title,
colt.hep.aida.IAxis xAxis,
colt.hep.aida.IAxis yAxis)
- Creates a histogram with the given axis binning.
- Parameters:
title
- The histogram title.xAxis
- The x-axis description to be used for binning.yAxis
- The y-axis description to be used for binning.
allEntries
public int allEntries()
- Specified by:
allEntries
in interface colt.hep.aida.IHistogram
binEntries
public int binEntries(int indexX,
int indexY)
- Specified by:
binEntries
in interface colt.hep.aida.IHistogram2D
binError
public double binError(int indexX,
int indexY)
- Specified by:
binError
in interface colt.hep.aida.IHistogram2D
binHeight
public double binHeight(int indexX,
int indexY)
- Specified by:
binHeight
in interface colt.hep.aida.IHistogram2D
equivalentBinEntries
public double equivalentBinEntries()
- Specified by:
equivalentBinEntries
in interface colt.hep.aida.IHistogram
fill
public void fill(double x,
double y)
- Specified by:
fill
in interface colt.hep.aida.IHistogram2D
fill
public void fill(double x,
double y,
double weight)
- Specified by:
fill
in interface colt.hep.aida.IHistogram2D
meanX
public double meanX()
- Specified by:
meanX
in interface colt.hep.aida.IHistogram2D
meanY
public double meanY()
- Specified by:
meanY
in interface colt.hep.aida.IHistogram2D
reset
public void reset()
- Specified by:
reset
in interface colt.hep.aida.IHistogram
rmsX
public double rmsX()
- Specified by:
rmsX
in interface colt.hep.aida.IHistogram2D
rmsY
public double rmsY()
- Specified by:
rmsY
in interface colt.hep.aida.IHistogram2D
sumAllBinHeights
public double sumAllBinHeights()
- Specified by:
sumAllBinHeights
in interface colt.hep.aida.IHistogram
binEntriesX
public int binEntriesX(int indexX)
- Specified by:
binEntriesX
in interface colt.hep.aida.IHistogram2D
binEntriesY
public int binEntriesY(int indexY)
- Specified by:
binEntriesY
in interface colt.hep.aida.IHistogram2D
binHeightX
public double binHeightX(int indexX)
- Specified by:
binHeightX
in interface colt.hep.aida.IHistogram2D
binHeightY
public double binHeightY(int indexY)
- Specified by:
binHeightY
in interface colt.hep.aida.IHistogram2D
dimensions
public int dimensions()
- Specified by:
dimensions
in interface colt.hep.aida.IHistogram
entries
public int entries()
- Specified by:
entries
in interface colt.hep.aida.IHistogram
extraEntries
public int extraEntries()
- Specified by:
extraEntries
in interface colt.hep.aida.IHistogram
minMaxBins
public int[] minMaxBins()
- Specified by:
minMaxBins
in interface colt.hep.aida.IHistogram2D
projectionX
public colt.hep.aida.IHistogram1D projectionX()
- Specified by:
projectionX
in interface colt.hep.aida.IHistogram2D
projectionY
public colt.hep.aida.IHistogram1D projectionY()
- Specified by:
projectionY
in interface colt.hep.aida.IHistogram2D
sliceX
public colt.hep.aida.IHistogram1D sliceX(int indexY)
- Specified by:
sliceX
in interface colt.hep.aida.IHistogram2D
sliceX
public colt.hep.aida.IHistogram1D sliceX(int indexY1,
int indexY2)
- Specified by:
sliceX
in interface colt.hep.aida.IHistogram2D
sliceY
public colt.hep.aida.IHistogram1D sliceY(int indexX)
- Specified by:
sliceY
in interface colt.hep.aida.IHistogram2D
sliceY
public colt.hep.aida.IHistogram1D sliceY(int indexX1,
int indexX2)
- Specified by:
sliceY
in interface colt.hep.aida.IHistogram2D
sumBinHeights
public double sumBinHeights()
- Specified by:
sumBinHeights
in interface colt.hep.aida.IHistogram
sumExtraBinHeights
public double sumExtraBinHeights()
- Specified by:
sumExtraBinHeights
in interface colt.hep.aida.IHistogram
xAxis
public colt.hep.aida.IAxis xAxis()
- Specified by:
xAxis
in interface colt.hep.aida.IHistogram2D
yAxis
public colt.hep.aida.IAxis yAxis()
- Specified by:
yAxis
in interface colt.hep.aida.IHistogram2D
title
public String title()
- Specified by:
title
in interface colt.hep.aida.IHistogram
jHepWork 3.0 ©