Class Histogram3D
java.lang.Object
hep.aida.ref.Histogram
hep.aida.ref.AbstractHistogram3D
hep.aida.ref.Histogram3D
- All Implemented Interfaces:
IHistogram, IHistogram3D, Serializable
A reference implementation of hep.aida.IHistogram3D.
The goal is to provide a clear implementation rather than the most efficient implementation.
However, performance seems fine - filling 3 * 10^5 points/sec, both using FixedAxis or VariableAxis.
- Version:
- 1.0, 23/03/2000
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[][][]private double[][][]private double[][][]private doubleprivate doubleprivate doubleprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleFields inherited from class AbstractHistogram3D
xAxis, yAxis, zAxisFields inherited from interface IHistogram
OVERFLOW, serialVersionUID, UNDERFLOW -
Constructor Summary
ConstructorsConstructorDescriptionHistogram3D(String title, double[] xEdges, double[] yEdges, double[] zEdges) Creates a variable-width histogram.Histogram3D(String title, int xBins, double xMin, double xMax, int yBins, double yMin, double yMax, int zBins, double zMin, double zMax) Creates a fixed-width histogram.Histogram3D(String title, IAxis xAxis, IAxis yAxis, IAxis zAxis) Creates a histogram with the given axis binning. -
Method Summary
Modifier and TypeMethodDescriptionintNumber of all entries in all (both in-range and under/overflow) bins in the histogram.intbinEntries(int indexX, int indexY, int indexZ) The number of entries (ie the number of times fill was called for this bin).doublebinError(int indexX, int indexY, int indexZ) The error on this bin.doublebinHeight(int indexX, int indexY, int indexZ) Total height of the corresponding bin (ie the sum of the weights in this bin).doubleNumber of equivalent entries.voidfill(double x, double y, double z) Fill the histogram with weight 1; equivalent to fill(x,y,z,1)..voidfill(double x, double y, double z, double weight) Fill the histogram with specified weight.protected IHistogram2DinternalSliceXY(String title, int indexZ1, int indexZ2) The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.protected IHistogram2DinternalSliceXZ(String title, int indexY1, int indexY2) The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.protected IHistogram2DinternalSliceYZ(String title, int indexX1, int indexX2) The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.doublemeanX()Returns the mean of the histogram, as calculated on filling-time projected on the X axis.doublemeanY()Returns the mean of the histogram, as calculated on filling-time projected on the Y axis.doublemeanZ()Returns the mean of the histogram, as calculated on filling-time projected on the Z axis.voidreset()Reset contents; as if just constructed.doublermsX()Returns the rms of the histogram as calculated on filling-time projected on the X axis.doublermsY()Returns the rms of the histogram as calculated on filling-time projected on the Y axis.doublermsZ()Returns the rms of the histogram as calculated on filling-time projected on the Z axis.doubleSum of all (both in-range and under/overflow) bin heights in the histogram.Methods inherited from class AbstractHistogram3D
dimensions, entries, extraEntries, mapX, mapY, mapZ, minMaxBins, projectionXY, projectionXZ, projectionYZ, sliceXY, sliceXY, sliceXZ, sliceXZ, sliceYZ, sliceYZ, sumBinHeights, sumExtraBinHeights, xAxis, yAxis, zAxisMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IHistogram
dimensions, entries, extraEntries, sumBinHeights, sumExtraBinHeights, titleMethods inherited from interface IHistogram3D
minMaxBins, projectionXY, projectionXZ, projectionYZ, sliceXY, sliceXY, sliceXZ, sliceXZ, sliceYZ, sliceYZ, xAxis, yAxis, zAxis
-
Field Details
-
heights
private double[][][] heights -
errors
private double[][][] errors -
entries
private int[][][] entries -
nEntry
private int nEntry -
sumWeight
private double sumWeight -
sumWeightSquared
private double sumWeightSquared -
meanX
private double meanX -
rmsX
private double rmsX -
meanY
private double meanY -
rmsY
private double rmsY -
meanZ
private double meanZ -
rmsZ
private double rmsZ
-
-
Constructor Details
-
Histogram3D
Creates a variable-width histogram. Example: xEdges = (0.2, 1.0, 5.0, 6.0), yEdges = (-5, 0, 7), zEdges = (-5, 0, 7) yields 3*2*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.zEdges- the bin boundaries the z-axis shall have; must be sorted ascending and must not contain multiple identical elements.- Throws:
IllegalArgumentException- if xEdges.length invalid input: '<' 1 || yEdges.length invalid input: '<' 1|| zEdges.length invalid input: '<' 1.
-
Histogram3D
public Histogram3D(String title, int xBins, double xMin, double xMax, int yBins, double yMin, double yMax, int zBins, double zMin, double zMax) 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.zBins- The number of bins on the Z axis.zMin- The minimum value on the Z axis.zMax- The maximum value on the Z axis.
-
Histogram3D
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.zAxis- The z-axis description to be used for binning.
-
-
Method Details
-
allEntries
public int allEntries()Description copied from interface:IHistogramNumber of all entries in all (both in-range and under/overflow) bins in the histogram.- Specified by:
allEntriesin interfaceIHistogram- Overrides:
allEntriesin classAbstractHistogram3D
-
binEntries
public int binEntries(int indexX, int indexY, int indexZ) Description copied from interface:IHistogram3DThe number of entries (ie the number of times fill was called for this bin).- Specified by:
binEntriesin interfaceIHistogram3D- Parameters:
indexX- the x bin number (0...Nx-1) or OVERFLOW or UNDERFLOW.indexY- the y bin number (0...Ny-1) or OVERFLOW or UNDERFLOW.indexZ- the z bin number (0...Nz-1) or OVERFLOW or UNDERFLOW.
-
binError
public double binError(int indexX, int indexY, int indexZ) Description copied from interface:IHistogram3DThe error on this bin.- Specified by:
binErrorin interfaceIHistogram3D- Parameters:
indexX- the x bin number (0...Nx-1) or OVERFLOW or UNDERFLOW.indexY- the y bin number (0...Ny-1) or OVERFLOW or UNDERFLOW.indexZ- the z bin number (0...Nz-1) or OVERFLOW or UNDERFLOW.
-
binHeight
public double binHeight(int indexX, int indexY, int indexZ) Description copied from interface:IHistogram3DTotal height of the corresponding bin (ie the sum of the weights in this bin).- Specified by:
binHeightin interfaceIHistogram3D- Parameters:
indexX- the x bin number (0...Nx-1) or OVERFLOW or UNDERFLOW.indexY- the y bin number (0...Ny-1) or OVERFLOW or UNDERFLOW.indexZ- the z bin number (0...Nz-1) or OVERFLOW or UNDERFLOW.
-
equivalentBinEntries
public double equivalentBinEntries()Description copied from interface:IHistogramNumber of equivalent entries.- Specified by:
equivalentBinEntriesin interfaceIHistogram- Returns:
- SUM[ weight ] ^ 2 / SUM[ weight^2 ].
-
fill
public void fill(double x, double y, double z) Description copied from interface:IHistogram3DFill the histogram with weight 1; equivalent to fill(x,y,z,1)..- Specified by:
fillin interfaceIHistogram3D- Overrides:
fillin classAbstractHistogram3D
-
fill
public void fill(double x, double y, double z, double weight) Description copied from interface:IHistogram3DFill the histogram with specified weight.- Specified by:
fillin interfaceIHistogram3D
-
internalSliceXY
The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.Note 0indexX1 and indexX2 use our INTERNAL bin numbering scheme Note 1The slice is done between indexX1 and indexX2 INCLUSIVE Note 2indexX1 and indexX2 may include the use of under and over flow bins Note 3There is no note 3 (yet)
- Specified by:
internalSliceXYin classAbstractHistogram3D
-
internalSliceXZ
The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.Note 0indexY1 and indexY2 use our INTERNAL bin numbering scheme Note 1The slice is done between indexY1 and indexY2 INCLUSIVE Note 2indexY1 and indexY2 may include the use of under and over flow bins Note 3There is no note 3 (yet)
- Specified by:
internalSliceXZin classAbstractHistogram3D
-
internalSliceYZ
The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.Note 0indexX1 and indexX2 use our INTERNAL bin numbering scheme Note 1The slice is done between indexX1 and indexX2 INCLUSIVE Note 2indexX1 and indexX2 may include the use of under and over flow bins Note 3There is no note 3 (yet)
- Specified by:
internalSliceYZin classAbstractHistogram3D
-
meanX
public double meanX()Description copied from interface:IHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the X axis.- Specified by:
meanXin interfaceIHistogram3D
-
meanY
public double meanY()Description copied from interface:IHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the Y axis.- Specified by:
meanYin interfaceIHistogram3D
-
meanZ
public double meanZ()Description copied from interface:IHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the Z axis.- Specified by:
meanZin interfaceIHistogram3D
-
reset
public void reset()Description copied from interface:IHistogramReset contents; as if just constructed.- Specified by:
resetin interfaceIHistogram
-
rmsX
public double rmsX()Description copied from interface:IHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the X axis.- Specified by:
rmsXin interfaceIHistogram3D
-
rmsY
public double rmsY()Description copied from interface:IHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the Y axis.- Specified by:
rmsYin interfaceIHistogram3D
-
rmsZ
public double rmsZ()Description copied from interface:IHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the Z axis.- Specified by:
rmsZin interfaceIHistogram3D
-
sumAllBinHeights
public double sumAllBinHeights()Description copied from interface:IHistogramSum of all (both in-range and under/overflow) bin heights in the histogram.- Specified by:
sumAllBinHeightsin interfaceIHistogram- Overrides:
sumAllBinHeightsin classAbstractHistogram3D
-