Class VariableAxis
java.lang.Object
hep.aida.ref.VariableAxis
- All Implemented Interfaces:
IAxis, Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected double[]protected doubleFields inherited from interface IAxis
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionVariableAxis(double[] edges) Constructs and returns an axis with the given bin edges. -
Method Summary
Modifier and TypeMethodDescriptiondoublebinCentre(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.doubleLower axis edge.protected static StringtoString(double[] array) Returns a string representation of the specified array.doubleUpper axis edge.
-
Field Details
-
min
protected double min -
bins
protected int bins -
edges
protected double[] edges
-
-
Constructor Details
-
VariableAxis
public VariableAxis(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:
IllegalArgumentException- if edges.length invalid input: '<' 1.
-
-
Method Details
-
binCentre
-
binLowerEdge
public double binLowerEdge(int index) Description copied from interface:IAxisLower edge of the specified bin.- Specified by:
binLowerEdgein interfaceIAxis- 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
-
binUpperEdge
public double binUpperEdge(int index) Description copied from interface:IAxisUpper edge of the specified bin.- Specified by:
binUpperEdgein interfaceIAxis- 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
-
coordToIndex
public int coordToIndex(double coord) Description copied from interface:IAxisConverts a coordinate on the axis to a bin number. If the coordinate is invalid input: '<' lowerEdge returns UNDERFLOW, and if the coordinate is >= upperEdge returns OVERFLOW.- Specified by:
coordToIndexin interfaceIAxis
-
lowerEdge
-
toString
Returns a string representation of the specified array. The string representation consists of a list of the arrays's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space).- Returns:
- a string representation of the specified array.
-
upperEdge
-