cern.hep.aida.ref
Class Histogram1D
java.lang.Object
cern.hep.aida.ref.Histogram1D
- All Implemented Interfaces:
- colt.hep.aida.IHistogram, colt.hep.aida.IHistogram1D, java.io.Serializable
public class Histogram1D
- extends java.lang.Object
- implements colt.hep.aida.IHistogram1D
A reference implementation of hep.aida.IHistogram1D.
The goal is to provide a clear implementation rather than the most efficient implementation.
However, performance seems fine - filling 1.2 * 10^6 points/sec, both using FixedAxis or VariableAxis.
- See Also:
- Serialized Form
Fields inherited from interface colt.hep.aida.IHistogram |
OVERFLOW, serialVersionUID, UNDERFLOW |
Constructor Summary |
Histogram1D(java.lang.String title,
double[] edges)
Creates a variable-width histogram. |
Histogram1D(java.lang.String title,
colt.hep.aida.IAxis axis)
Creates a histogram with the given axis binning. |
Histogram1D(java.lang.String title,
int bins,
double min,
double max)
Creates a fixed-width histogram. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface colt.hep.aida.IHistogram1D |
minMaxBins, xAxis |
Methods inherited from interface colt.hep.aida.IHistogram |
dimensions, entries, extraEntries, sumAllBinHeights, sumBinHeights, sumExtraBinHeights, title |
Histogram1D
public Histogram1D(java.lang.String title,
double[] edges)
- Creates a variable-width histogram.
Example: edges = (0.2, 1.0, 5.0) yields an axis with 2 in-range bins [0.2,1.0), [1.0,5.0) and 2 extra bins [-inf,0.2), [5.0,inf].
- Parameters:
title
- The histogram title.edges
- the bin boundaries the axis shall have;
must be sorted ascending and must not contain multiple identical elements.
- Throws:
java.lang.IllegalArgumentException
- if edges.length < 1.
Histogram1D
public Histogram1D(java.lang.String title,
int bins,
double min,
double max)
- Creates a fixed-width histogram.
- Parameters:
title
- The histogram title.bins
- The number of bins.min
- The minimum value on the X axis.max
- The maximum value on the X axis.
Histogram1D
public Histogram1D(java.lang.String title,
colt.hep.aida.IAxis axis)
- Creates a histogram with the given axis binning.
- Parameters:
title
- The histogram title.axis
- The 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 index)
- Specified by:
binEntries
in interface colt.hep.aida.IHistogram1D
binError
public double binError(int index)
- Specified by:
binError
in interface colt.hep.aida.IHistogram1D
binHeight
public double binHeight(int index)
- Specified by:
binHeight
in interface colt.hep.aida.IHistogram1D
equivalentBinEntries
public double equivalentBinEntries()
- Specified by:
equivalentBinEntries
in interface colt.hep.aida.IHistogram
fill
public void fill(double x)
- Specified by:
fill
in interface colt.hep.aida.IHistogram1D
fill
public void fill(double x,
double weight)
- Specified by:
fill
in interface colt.hep.aida.IHistogram1D
mean
public double mean()
- Specified by:
mean
in interface colt.hep.aida.IHistogram1D
reset
public void reset()
- Specified by:
reset
in interface colt.hep.aida.IHistogram
rms
public double rms()
- Specified by:
rms
in interface colt.hep.aida.IHistogram1D
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.IHistogram1D
sumAllBinHeights
public double sumAllBinHeights()
- Specified by:
sumAllBinHeights
in interface colt.hep.aida.IHistogram
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.IHistogram1D
title
public java.lang.String title()
- Specified by:
title
in interface colt.hep.aida.IHistogram
jHepWork 2.8 (©) S.Chekanov