hep.aida.tdouble.ref
Class DoubleHistogram3D
- java.lang.Object
-
- hep.aida.tdouble.ref.DoubleHistogram3D
-
- All Implemented Interfaces:
- DoubleIHistogram, DoubleIHistogram3D, java.io.Serializable
public class DoubleHistogram3D extends java.lang.Object implements DoubleIHistogram3D
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.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface hep.aida.tdouble.DoubleIHistogram
OVERFLOW, UNDERFLOW
-
-
Constructor Summary
Constructors Constructor and Description DoubleHistogram3D(java.lang.String title, double[] xEdges, double[] yEdges, double[] zEdges)Creates a variable-width histogram.DoubleHistogram3D(java.lang.String title, DoubleIAxis xAxis, DoubleIAxis yAxis, DoubleIAxis zAxis)Creates a histogram with the given axis binning.DoubleHistogram3D(java.lang.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intallEntries()Number 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).intdimensions()Returns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.intentries()Number of in-range entries in the histogram.doubleequivalentBinEntries()Number of equivalent entries.intextraEntries()Number of under and overflow entries in the histogram.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.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.int[]minMaxBins()Indexes of the in-range bins containing the smallest and largest binHeight(), respectively.DoubleIHistogram2DprojectionXY()Create a projection parallel to the XY plane.DoubleIHistogram2DprojectionXZ()Create a projection parallel to the XZ plane.DoubleIHistogram2DprojectionYZ()Create a projection parallel to the YZ plane.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.DoubleIHistogram2DsliceXY(int indexZ)Create a slice parallel to the XY plane at bin indexZ and one bin wide.DoubleIHistogram2DsliceXY(int indexZ1, int indexZ2)Create a slice parallel to the XY plane, between "indexZ1" and "indexZ2" (inclusive).DoubleIHistogram2DsliceXZ(int indexY)Create a slice parallel to the XZ plane at bin indexY and one bin wide.DoubleIHistogram2DsliceXZ(int indexY1, int indexY2)Create a slice parallel to the XZ plane, between "indexY1" and "indexY2" (inclusive).DoubleIHistogram2DsliceYZ(int indexX)Create a slice parallel to the YZ plane at bin indexX and one bin wide.DoubleIHistogram2DsliceYZ(int indexX1, int indexX2)Create a slice parallel to the YZ plane, between "indexX1" and "indexX2" (inclusive).doublesumAllBinHeights()Sum of all (both in-range and under/overflow) bin heights in the histogram.doublesumBinHeights()Sum of in-range bin heights in the histogram.doublesumExtraBinHeights()Sum of under/overflow bin heights in the histogram.java.lang.Stringtitle()Title of the histogram (will be set only in the constructor).DoubleIAxisxAxis()Return the X axis.DoubleIAxisyAxis()Return the Y axis.DoubleIAxiszAxis()Return the Z axis.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hep.aida.tdouble.DoubleIHistogram3D
minMaxBins, projectionXY, projectionXZ, projectionYZ, sliceXY, sliceXY, sliceXZ, sliceXZ, sliceYZ, sliceYZ, xAxis, yAxis, zAxis
-
Methods inherited from interface hep.aida.tdouble.DoubleIHistogram
dimensions, entries, extraEntries, sumBinHeights, sumExtraBinHeights, title
-
-
-
-
Constructor Detail
-
DoubleHistogram3D
public DoubleHistogram3D(java.lang.String title, double[] xEdges, double[] yEdges, double[] zEdges)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:
java.lang.IllegalArgumentException- if xEdges.length < 1 || yEdges.length < 1|| zEdges.length < 1 .
-
DoubleHistogram3D
public DoubleHistogram3D(java.lang.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.
-
DoubleHistogram3D
public DoubleHistogram3D(java.lang.String title, DoubleIAxis xAxis, DoubleIAxis yAxis, DoubleIAxis zAxis)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 Detail
-
allEntries
public int allEntries()
Description copied from interface:DoubleIHistogramNumber of all entries in all (both in-range and under/overflow) bins in the histogram.- Specified by:
allEntriesin interfaceDoubleIHistogram
-
binEntries
public int binEntries(int indexX, int indexY, int indexZ)Description copied from interface:DoubleIHistogram3DThe number of entries (ie the number of times fill was called for this bin).- Specified by:
binEntriesin interfaceDoubleIHistogram3D- 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:DoubleIHistogram3DThe error on this bin.- Specified by:
binErrorin interfaceDoubleIHistogram3D- 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:DoubleIHistogram3DTotal height of the corresponding bin (ie the sum of the weights in this bin).- Specified by:
binHeightin interfaceDoubleIHistogram3D- 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:DoubleIHistogramNumber of equivalent entries.- Specified by:
equivalentBinEntriesin interfaceDoubleIHistogram- Returns:
- SUM[ weight ] ^ 2 / SUM[ weight^2 ].
-
fill
public void fill(double x, double y, double z)Description copied from interface:DoubleIHistogram3DFill the histogram with weight 1; equivalent to fill(x,y,z,1)..- Specified by:
fillin interfaceDoubleIHistogram3D
-
fill
public void fill(double x, double y, double z, double weight)Description copied from interface:DoubleIHistogram3DFill the histogram with specified weight.- Specified by:
fillin interfaceDoubleIHistogram3D
-
meanX
public double meanX()
Description copied from interface:DoubleIHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the X axis.- Specified by:
meanXin interfaceDoubleIHistogram3D
-
meanY
public double meanY()
Description copied from interface:DoubleIHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the Y axis.- Specified by:
meanYin interfaceDoubleIHistogram3D
-
meanZ
public double meanZ()
Description copied from interface:DoubleIHistogram3DReturns the mean of the histogram, as calculated on filling-time projected on the Z axis.- Specified by:
meanZin interfaceDoubleIHistogram3D
-
reset
public void reset()
Description copied from interface:DoubleIHistogramReset contents; as if just constructed.- Specified by:
resetin interfaceDoubleIHistogram
-
rmsX
public double rmsX()
Description copied from interface:DoubleIHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the X axis.- Specified by:
rmsXin interfaceDoubleIHistogram3D
-
rmsY
public double rmsY()
Description copied from interface:DoubleIHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the Y axis.- Specified by:
rmsYin interfaceDoubleIHistogram3D
-
rmsZ
public double rmsZ()
Description copied from interface:DoubleIHistogram3DReturns the rms of the histogram as calculated on filling-time projected on the Z axis.- Specified by:
rmsZin interfaceDoubleIHistogram3D
-
sumAllBinHeights
public double sumAllBinHeights()
Description copied from interface:DoubleIHistogramSum of all (both in-range and under/overflow) bin heights in the histogram.- Specified by:
sumAllBinHeightsin interfaceDoubleIHistogram
-
dimensions
public int dimensions()
Description copied from interface:DoubleIHistogramReturns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.- Specified by:
dimensionsin interfaceDoubleIHistogram
-
entries
public int entries()
Description copied from interface:DoubleIHistogramNumber of in-range entries in the histogram.- Specified by:
entriesin interfaceDoubleIHistogram
-
extraEntries
public int extraEntries()
Description copied from interface:DoubleIHistogramNumber of under and overflow entries in the histogram.- Specified by:
extraEntriesin interfaceDoubleIHistogram
-
minMaxBins
public int[] minMaxBins()
Description copied from interface:DoubleIHistogram3DIndexes of the in-range bins containing the smallest and largest binHeight(), respectively.- Specified by:
minMaxBinsin interfaceDoubleIHistogram3D- Returns:
- {minBinX,minBinY,minBinZ, maxBinX,maxBinY,maxBinZ}.
-
projectionXY
public DoubleIHistogram2D projectionXY()
Description copied from interface:DoubleIHistogram3DCreate a projection parallel to the XY plane. Equivalent to sliceXY(UNDERFLOW,OVERFLOW).- Specified by:
projectionXYin interfaceDoubleIHistogram3D
-
projectionXZ
public DoubleIHistogram2D projectionXZ()
Description copied from interface:DoubleIHistogram3DCreate a projection parallel to the XZ plane. Equivalent to sliceXZ(UNDERFLOW,OVERFLOW).- Specified by:
projectionXZin interfaceDoubleIHistogram3D
-
projectionYZ
public DoubleIHistogram2D projectionYZ()
Description copied from interface:DoubleIHistogram3DCreate a projection parallel to the YZ plane. Equivalent to sliceYZ(UNDERFLOW,OVERFLOW).- Specified by:
projectionYZin interfaceDoubleIHistogram3D
-
sliceXY
public DoubleIHistogram2D sliceXY(int indexZ)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the XY plane at bin indexZ and one bin wide. Equivalent to sliceXY(indexZ,indexZ).- Specified by:
sliceXYin interfaceDoubleIHistogram3D
-
sliceXY
public DoubleIHistogram2D sliceXY(int indexZ1, int indexZ2)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the XY plane, between "indexZ1" and "indexZ2" (inclusive). The returned IHistogram2D represents an instantaneous snapshot of the histogram at the time the slice was created.- Specified by:
sliceXYin interfaceDoubleIHistogram3D
-
sliceXZ
public DoubleIHistogram2D sliceXZ(int indexY)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the XZ plane at bin indexY and one bin wide. Equivalent to sliceXZ(indexY,indexY).- Specified by:
sliceXZin interfaceDoubleIHistogram3D
-
sliceXZ
public DoubleIHistogram2D sliceXZ(int indexY1, int indexY2)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the XZ plane, between "indexY1" and "indexY2" (inclusive). The returned IHistogram2D represents an instantaneous snapshot of the histogram at the time the slice was created.- Specified by:
sliceXZin interfaceDoubleIHistogram3D
-
sliceYZ
public DoubleIHistogram2D sliceYZ(int indexX)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the YZ plane at bin indexX and one bin wide. Equivalent to sliceYZ(indexX,indexX).- Specified by:
sliceYZin interfaceDoubleIHistogram3D
-
sliceYZ
public DoubleIHistogram2D sliceYZ(int indexX1, int indexX2)
Description copied from interface:DoubleIHistogram3DCreate a slice parallel to the YZ plane, between "indexX1" and "indexX2" (inclusive). The returned IHistogram2D represents an instantaneous snapshot of the histogram at the time the slice was created.- Specified by:
sliceYZin interfaceDoubleIHistogram3D
-
sumBinHeights
public double sumBinHeights()
Description copied from interface:DoubleIHistogramSum of in-range bin heights in the histogram.- Specified by:
sumBinHeightsin interfaceDoubleIHistogram
-
sumExtraBinHeights
public double sumExtraBinHeights()
Description copied from interface:DoubleIHistogramSum of under/overflow bin heights in the histogram.- Specified by:
sumExtraBinHeightsin interfaceDoubleIHistogram
-
xAxis
public DoubleIAxis xAxis()
Description copied from interface:DoubleIHistogram3DReturn the X axis.- Specified by:
xAxisin interfaceDoubleIHistogram3D
-
yAxis
public DoubleIAxis yAxis()
Description copied from interface:DoubleIHistogram3DReturn the Y axis.- Specified by:
yAxisin interfaceDoubleIHistogram3D
-
zAxis
public DoubleIAxis zAxis()
Description copied from interface:DoubleIHistogram3DReturn the Z axis.- Specified by:
zAxisin interfaceDoubleIHistogram3D
-
title
public java.lang.String title()
Description copied from interface:DoubleIHistogramTitle of the histogram (will be set only in the constructor).- Specified by:
titlein interfaceDoubleIHistogram
-
-
DMelt 3.0 © DataMelt by jWork.ORG