hep.aida.tdouble.ref
Class DoubleVariableAxis
- java.lang.Object
-
- hep.aida.tdouble.ref.DoubleVariableAxis
-
- All Implemented Interfaces:
- DoubleIAxis, java.io.Serializable
public class DoubleVariableAxis extends java.lang.Object implements DoubleIAxis
Variable-width axis; A reference implementation of hep.aida.IAxis.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DoubleVariableAxis(double[] edges)Constructs and returns an axis with the given bin edges.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebinCentre(int index)Centre of the bin specified.doublebinLowerEdge(int index)Lower edge of the specified bin.intbins()The number of bins (excluding underflow and overflow) on the axis.doublebinUpperEdge(int index)Upper edge of the specified bin.doublebinWidth(int index)Width of the bin specified.intcoordToIndex(double coord)Converts a coordinate on the axis to a bin number.doublelowerEdge()Lower axis edge.doubleupperEdge()Upper axis edge.
-
-
-
Constructor Detail
-
DoubleVariableAxis
public DoubleVariableAxis(double[] edges)
Constructs and returns an axis with the given bin edges. 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:
edges- the bin boundaries the partition shall have; must be sorted ascending and must not contain multiple identical elements.- Throws:
java.lang.IllegalArgumentException- if edges.length < 1.
-
-
Method Detail
-
binCentre
public double binCentre(int index)
Description copied from interface:DoubleIAxisCentre of the bin specified.- Specified by:
binCentrein interfaceDoubleIAxis- Parameters:
index- Bin number (0...bins()-1) or OVERFLOW or UNDERFLOW.
-
binLowerEdge
public double binLowerEdge(int index)
Description copied from interface:DoubleIAxisLower edge of the specified bin.- Specified by:
binLowerEdgein interfaceDoubleIAxis- Parameters:
index- Bin number (0...bins()-1) or OVERFLOW or UNDERFLOW.- Returns:
- the lower edge of the bin; for the underflow bin this is Double.NEGATIVE_INFINITY.
-
bins
public int bins()
Description copied from interface:DoubleIAxisThe number of bins (excluding underflow and overflow) on the axis.- Specified by:
binsin interfaceDoubleIAxis
-
binUpperEdge
public double binUpperEdge(int index)
Description copied from interface:DoubleIAxisUpper edge of the specified bin.- Specified by:
binUpperEdgein interfaceDoubleIAxis- Parameters:
index- Bin number (0...bins()-1) or OVERFLOW or UNDERFLOW.- Returns:
- the upper edge of the bin; for the overflow bin this is Double.POSITIVE_INFINITY.
-
binWidth
public double binWidth(int index)
Description copied from interface:DoubleIAxisWidth of the bin specified.- Specified by:
binWidthin interfaceDoubleIAxis- Parameters:
index- Bin number (0...bins()-1) or OVERFLOW or UNDERFLOW.
-
coordToIndex
public int coordToIndex(double coord)
Description copied from interface:DoubleIAxisConverts a coordinate on the axis to a bin number. If the coordinate is < lowerEdge returns UNDERFLOW, and if the coordinate is >= upperEdge returns OVERFLOW.- Specified by:
coordToIndexin interfaceDoubleIAxis
-
lowerEdge
public double lowerEdge()
Description copied from interface:DoubleIAxisLower axis edge.- Specified by:
lowerEdgein interfaceDoubleIAxis
-
upperEdge
public double upperEdge()
Description copied from interface:DoubleIAxisUpper axis edge.- Specified by:
upperEdgein interfaceDoubleIAxis
-
-
DMelt 3.0 © DataMelt by jWork.ORG