cern.hep.aida.ref
Class Histogram2D

java.lang.Object
  extended by cern.hep.aida.ref.Histogram2D
All Implemented Interfaces:
colt.hep.aida.IHistogram, colt.hep.aida.IHistogram2D, java.io.Serializable

public class Histogram2D
extends java.lang.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

Field Summary
 
Fields inherited from interface colt.hep.aida.IHistogram
OVERFLOW, serialVersionUID, UNDERFLOW
 
Constructor Summary
Histogram2D(java.lang.String title, double[] xEdges, double[] yEdges)
          Creates a variable-width histogram.
Histogram2D(java.lang.String title, colt.hep.aida.IAxis xAxis, colt.hep.aida.IAxis yAxis)
          Creates a histogram with the given axis binning.
Histogram2D(java.lang.String title, int xBins, double xMin, double xMax, int yBins, double yMin, double yMax)
          Creates a fixed-width histogram.
 
Method Summary
 int allEntries()
           
 int binEntries(int indexX, int indexY)
           
 int binEntriesX(int indexX)
           
 int binEntriesY(int indexY)
           
 double binError(int indexX, int indexY)
           
 double binHeight(int indexX, int indexY)
           
 double binHeightX(int indexX)
           
 double binHeightY(int indexY)
           
 int dimensions()
           
 int entries()
           
 double equivalentBinEntries()
           
 int extraEntries()
           
 void fill(double x, double y)
           
 void fill(double x, double y, double weight)
           
 double meanX()
           
 double meanY()
           
 int[] minMaxBins()
           
 colt.hep.aida.IHistogram1D projectionX()
           
 colt.hep.aida.IHistogram1D projectionY()
           
 void reset()
           
 double rmsX()
           
 double rmsY()
           
 colt.hep.aida.IHistogram1D sliceX(int indexY)
           
 colt.hep.aida.IHistogram1D sliceX(int indexY1, int indexY2)
           
 colt.hep.aida.IHistogram1D sliceY(int indexX)
           
 colt.hep.aida.IHistogram1D sliceY(int indexX1, int indexX2)
           
 double sumAllBinHeights()
           
 double sumBinHeights()
           
 double sumExtraBinHeights()
           
 java.lang.String title()
           
 colt.hep.aida.IAxis xAxis()
           
 colt.hep.aida.IAxis yAxis()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

Histogram2D

public Histogram2D(java.lang.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:
java.lang.IllegalArgumentException - if xEdges.length < 1 || yEdges.length < 1.

Histogram2D

public Histogram2D(java.lang.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(java.lang.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.
Method Detail

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 java.lang.String title()
Specified by:
title in interface colt.hep.aida.IHistogram


jHepWork 1.1 (C) Chekanov