Parallel Colt 0.7.2

hep.aida.tfloat.ref
Class FloatHistogram3D

java.lang.Object
  extended by hep.aida.tfloat.ref.FloatHistogram3D
All Implemented Interfaces:
FloatIHistogram, FloatIHistogram3D, Serializable

public class FloatHistogram3D
extends Object
implements FloatIHistogram3D

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
Author:
Wolfgang Hoschek, Tony Johnson, and others.
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface hep.aida.tfloat.FloatIHistogram
OVERFLOW, serialVersionUID, UNDERFLOW
 
Constructor Summary
FloatHistogram3D(String title, float[] xEdges, float[] yEdges, float[] zEdges)
          Creates a variable-width histogram.
FloatHistogram3D(String title, FloatIAxis xAxis, FloatIAxis yAxis, FloatIAxis zAxis)
          Creates a histogram with the given axis binning.
FloatHistogram3D(String title, int xBins, float xMin, float xMax, int yBins, float yMin, float yMax, int zBins, float zMin, float zMax)
          Creates a fixed-width histogram.
 
Method Summary
 int allEntries()
          Number of all entries in all (both in-range and under/overflow) bins in the histogram.
 int binEntries(int indexX, int indexY, int indexZ)
          The number of entries (ie the number of times fill was called for this bin).
 float binError(int indexX, int indexY, int indexZ)
          The error on this bin.
 float binHeight(int indexX, int indexY, int indexZ)
          Total height of the corresponding bin (ie the sum of the weights in this bin).
 int dimensions()
          Returns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.
 int entries()
          Number of in-range entries in the histogram.
 float equivalentBinEntries()
          Number of equivalent entries.
 int extraEntries()
          Number of under and overflow entries in the histogram.
 void fill(float x, float y, float z)
          Fill the histogram with weight 1; equivalent to fill(x,y,z,1)..
 void fill(float x, float y, float z, float weight)
          Fill the histogram with specified weight.
 float meanX()
          Returns the mean of the histogram, as calculated on filling-time projected on the X axis.
 float meanY()
          Returns the mean of the histogram, as calculated on filling-time projected on the Y axis.
 float meanZ()
          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.
 FloatIHistogram2D projectionXY()
          Create a projection parallel to the XY plane.
 FloatIHistogram2D projectionXZ()
          Create a projection parallel to the XZ plane.
 FloatIHistogram2D projectionYZ()
          Create a projection parallel to the YZ plane.
 void reset()
          Reset contents; as if just constructed.
 float rmsX()
          Returns the rms of the histogram as calculated on filling-time projected on the X axis.
 float rmsY()
          Returns the rms of the histogram as calculated on filling-time projected on the Y axis.
 float rmsZ()
          Returns the rms of the histogram as calculated on filling-time projected on the Z axis.
 FloatIHistogram2D sliceXY(int indexZ)
          Create a slice parallel to the XY plane at bin indexZ and one bin wide.
 FloatIHistogram2D sliceXY(int indexZ1, int indexZ2)
          Create a slice parallel to the XY plane, between "indexZ1" and "indexZ2" (inclusive).
 FloatIHistogram2D sliceXZ(int indexY)
          Create a slice parallel to the XZ plane at bin indexY and one bin wide.
 FloatIHistogram2D sliceXZ(int indexY1, int indexY2)
          Create a slice parallel to the XZ plane, between "indexY1" and "indexY2" (inclusive).
 FloatIHistogram2D sliceYZ(int indexX)
          Create a slice parallel to the YZ plane at bin indexX and one bin wide.
 FloatIHistogram2D sliceYZ(int indexX1, int indexX2)
          Create a slice parallel to the YZ plane, between "indexX1" and "indexX2" (inclusive).
 float sumAllBinHeights()
          Sum of all (both in-range and under/overflow) bin heights in the histogram.
 float sumBinHeights()
          Sum of in-range bin heights in the histogram.
 float sumExtraBinHeights()
          Sum of under/overflow bin heights in the histogram.
 String title()
          Title of the histogram (will be set only in the constructor).
 FloatIAxis xAxis()
          Return the X axis.
 FloatIAxis yAxis()
          Return the Y axis.
 FloatIAxis zAxis()
          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.tfloat.FloatIHistogram3D
minMaxBins, projectionXY, projectionXZ, projectionYZ, sliceXY, sliceXY, sliceXZ, sliceXZ, sliceYZ, sliceYZ, xAxis, yAxis, zAxis
 
Methods inherited from interface hep.aida.tfloat.FloatIHistogram
dimensions, entries, extraEntries, sumBinHeights, sumExtraBinHeights, title
 

Constructor Detail

FloatHistogram3D

public FloatHistogram3D(String title,
                        float[] xEdges,
                        float[] yEdges,
                        float[] 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:
IllegalArgumentException - if xEdges.length < 1 || yEdges.length < 1|| zEdges.length < 1 .

FloatHistogram3D

public FloatHistogram3D(String title,
                        int xBins,
                        float xMin,
                        float xMax,
                        int yBins,
                        float yMin,
                        float yMax,
                        int zBins,
                        float zMin,
                        float 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.

FloatHistogram3D

public FloatHistogram3D(String title,
                        FloatIAxis xAxis,
                        FloatIAxis yAxis,
                        FloatIAxis 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: FloatIHistogram
Number of all entries in all (both in-range and under/overflow) bins in the histogram.

Specified by:
allEntries in interface FloatIHistogram

binEntries

public int binEntries(int indexX,
                      int indexY,
                      int indexZ)
Description copied from interface: FloatIHistogram3D
The number of entries (ie the number of times fill was called for this bin).

Specified by:
binEntries in interface FloatIHistogram3D
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 float binError(int indexX,
                      int indexY,
                      int indexZ)
Description copied from interface: FloatIHistogram3D
The error on this bin.

Specified by:
binError in interface FloatIHistogram3D
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 float binHeight(int indexX,
                       int indexY,
                       int indexZ)
Description copied from interface: FloatIHistogram3D
Total height of the corresponding bin (ie the sum of the weights in this bin).

Specified by:
binHeight in interface FloatIHistogram3D
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 float equivalentBinEntries()
Description copied from interface: FloatIHistogram
Number of equivalent entries.

Specified by:
equivalentBinEntries in interface FloatIHistogram
Returns:
SUM[ weight ] ^ 2 / SUM[ weight^2 ].

fill

public void fill(float x,
                 float y,
                 float z)
Description copied from interface: FloatIHistogram3D
Fill the histogram with weight 1; equivalent to fill(x,y,z,1)..

Specified by:
fill in interface FloatIHistogram3D

fill

public void fill(float x,
                 float y,
                 float z,
                 float weight)
Description copied from interface: FloatIHistogram3D
Fill the histogram with specified weight.

Specified by:
fill in interface FloatIHistogram3D

meanX

public float meanX()
Description copied from interface: FloatIHistogram3D
Returns the mean of the histogram, as calculated on filling-time projected on the X axis.

Specified by:
meanX in interface FloatIHistogram3D

meanY

public float meanY()
Description copied from interface: FloatIHistogram3D
Returns the mean of the histogram, as calculated on filling-time projected on the Y axis.

Specified by:
meanY in interface FloatIHistogram3D

meanZ

public float meanZ()
Description copied from interface: FloatIHistogram3D
Returns the mean of the histogram, as calculated on filling-time projected on the Z axis.

Specified by:
meanZ in interface FloatIHistogram3D

reset

public void reset()
Description copied from interface: FloatIHistogram
Reset contents; as if just constructed.

Specified by:
reset in interface FloatIHistogram

rmsX

public float rmsX()
Description copied from interface: FloatIHistogram3D
Returns the rms of the histogram as calculated on filling-time projected on the X axis.

Specified by:
rmsX in interface FloatIHistogram3D

rmsY

public float rmsY()
Description copied from interface: FloatIHistogram3D
Returns the rms of the histogram as calculated on filling-time projected on the Y axis.

Specified by:
rmsY in interface FloatIHistogram3D

rmsZ

public float rmsZ()
Description copied from interface: FloatIHistogram3D
Returns the rms of the histogram as calculated on filling-time projected on the Z axis.

Specified by:
rmsZ in interface FloatIHistogram3D

sumAllBinHeights

public float sumAllBinHeights()
Description copied from interface: FloatIHistogram
Sum of all (both in-range and under/overflow) bin heights in the histogram.

Specified by:
sumAllBinHeights in interface FloatIHistogram

dimensions

public int dimensions()
Description copied from interface: FloatIHistogram
Returns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.

Specified by:
dimensions in interface FloatIHistogram

entries

public int entries()
Description copied from interface: FloatIHistogram
Number of in-range entries in the histogram.

Specified by:
entries in interface FloatIHistogram

extraEntries

public int extraEntries()
Description copied from interface: FloatIHistogram
Number of under and overflow entries in the histogram.

Specified by:
extraEntries in interface FloatIHistogram

minMaxBins

public int[] minMaxBins()
Description copied from interface: FloatIHistogram3D
Indexes of the in-range bins containing the smallest and largest binHeight(), respectively.

Specified by:
minMaxBins in interface FloatIHistogram3D
Returns:
{minBinX,minBinY,minBinZ, maxBinX,maxBinY,maxBinZ}.

projectionXY

public FloatIHistogram2D projectionXY()
Description copied from interface: FloatIHistogram3D
Create a projection parallel to the XY plane. Equivalent to sliceXY(UNDERFLOW,OVERFLOW).

Specified by:
projectionXY in interface FloatIHistogram3D

projectionXZ

public FloatIHistogram2D projectionXZ()
Description copied from interface: FloatIHistogram3D
Create a projection parallel to the XZ plane. Equivalent to sliceXZ(UNDERFLOW,OVERFLOW).

Specified by:
projectionXZ in interface FloatIHistogram3D

projectionYZ

public FloatIHistogram2D projectionYZ()
Description copied from interface: FloatIHistogram3D
Create a projection parallel to the YZ plane. Equivalent to sliceYZ(UNDERFLOW,OVERFLOW).

Specified by:
projectionYZ in interface FloatIHistogram3D

sliceXY

public FloatIHistogram2D sliceXY(int indexZ)
Description copied from interface: FloatIHistogram3D
Create a slice parallel to the XY plane at bin indexZ and one bin wide. Equivalent to sliceXY(indexZ,indexZ).

Specified by:
sliceXY in interface FloatIHistogram3D

sliceXY

public FloatIHistogram2D sliceXY(int indexZ1,
                                 int indexZ2)
Description copied from interface: FloatIHistogram3D
Create 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:
sliceXY in interface FloatIHistogram3D

sliceXZ

public FloatIHistogram2D sliceXZ(int indexY)
Description copied from interface: FloatIHistogram3D
Create a slice parallel to the XZ plane at bin indexY and one bin wide. Equivalent to sliceXZ(indexY,indexY).

Specified by:
sliceXZ in interface FloatIHistogram3D

sliceXZ

public FloatIHistogram2D sliceXZ(int indexY1,
                                 int indexY2)
Description copied from interface: FloatIHistogram3D
Create 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:
sliceXZ in interface FloatIHistogram3D

sliceYZ

public FloatIHistogram2D sliceYZ(int indexX)
Description copied from interface: FloatIHistogram3D
Create a slice parallel to the YZ plane at bin indexX and one bin wide. Equivalent to sliceYZ(indexX,indexX).

Specified by:
sliceYZ in interface FloatIHistogram3D

sliceYZ

public FloatIHistogram2D sliceYZ(int indexX1,
                                 int indexX2)
Description copied from interface: FloatIHistogram3D
Create 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:
sliceYZ in interface FloatIHistogram3D

sumBinHeights

public float sumBinHeights()
Description copied from interface: FloatIHistogram
Sum of in-range bin heights in the histogram.

Specified by:
sumBinHeights in interface FloatIHistogram

sumExtraBinHeights

public float sumExtraBinHeights()
Description copied from interface: FloatIHistogram
Sum of under/overflow bin heights in the histogram.

Specified by:
sumExtraBinHeights in interface FloatIHistogram

xAxis

public FloatIAxis xAxis()
Description copied from interface: FloatIHistogram3D
Return the X axis.

Specified by:
xAxis in interface FloatIHistogram3D

yAxis

public FloatIAxis yAxis()
Description copied from interface: FloatIHistogram3D
Return the Y axis.

Specified by:
yAxis in interface FloatIHistogram3D

zAxis

public FloatIAxis zAxis()
Description copied from interface: FloatIHistogram3D
Return the Z axis.

Specified by:
zAxis in interface FloatIHistogram3D

title

public String title()
Description copied from interface: FloatIHistogram
Title of the histogram (will be set only in the constructor).

Specified by:
title in interface FloatIHistogram

Parallel Colt 0.7.2

Jump to the Parallel Colt Homepage