hep.aida.ref.histogram
Class FixedAxis
- java.lang.Object
-
- hep.aida.ref.histogram.FixedAxis
-
- All Implemented Interfaces:
- IAxis, java.io.Serializable
public class FixedAxis extends java.lang.Object implements IAxis, java.io.Serializable
Fixed-width axis; A reference implementation of hep.aida.IAxis.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface hep.aida.IAxis
OVERFLOW_BIN, UNDERFLOW_BIN
-
-
Constructor Summary
Constructors Constructor and Description FixedAxis(int bins, double min, double max)Create an Axis
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebinCenter(int index)Get the center of the specified bin.doublebinLowerEdge(int index)Get the lower edge of a bin.intbins()Get the number of bins in the Axis.doublebinUpperEdge(int index)Get the upper edge of a bin.doublebinWidth(int index)Get the bin width.intcoordToIndex(double coord)Get the bin's index corresponding to an axis's value.booleanequals(java.lang.Object o)Check if two Axis are equal.booleanisFixedBinning()Check if the IAxis has fixed binning, i.e.doublelowerEdge()Get the Axis lower edge.doubleupperEdge()Get the Axis upper edge.
-
-
-
Constructor Detail
-
FixedAxis
public FixedAxis(int bins, double min, double max)Create an Axis- Parameters:
bins- Number of binsmin- Minimum for axismax- Maximum for axis
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Check if two Axis are equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the Object to check- Returns:
trueifois an instance of FixedAxis and it has the same number of bins, minimum and bin width.
-
binCenter
public double binCenter(int index)
Description copied from interface:IAxisGet the center of the specified bin.- Specified by:
binCenterin interfaceIAxis- Parameters:
index- The bin number: 0 to bins()-1) for the in-range bins or OVERFLOW or UNDERFLOW.- Returns:
- The center of the corresponding bin. For in-range bins the middle of the upper and lower edge of the bin is returned; for out-of-range bins +/- infinity is returned.
-
bins
public int bins()
Get the number of bins in the Axis.
-
binLowerEdge
public double binLowerEdge(int index)
Get the lower edge of a bin.- Specified by:
binLowerEdgein interfaceIAxis- Parameters:
index- the bin's index- Returns:
- the bin's lower edge. If
indexcorresponds to the UNDERFLOW_BIN, Double.NEGATIVE_INFINITY is returned. Ifindexcorresponds to OVERFLOW_BIN, the upper edge of the axis is returned.
-
binUpperEdge
public double binUpperEdge(int index)
Get the upper edge of a bin.- Specified by:
binUpperEdgein interfaceIAxis- Parameters:
index- the bin's index- Returns:
- the bin's upper edge. If
indexcorresponds to the OVERFLOW_BIN, Double.POSITIVE_INFINITY is returned. Ifindexcorresponds to UNDERFLOW_BIN, the lower edge of the axis is returned.
-
binWidth
public double binWidth(int index)
Get the bin width.
-
coordToIndex
public int coordToIndex(double coord)
Get the bin's index corresponding to an axis's value.- Specified by:
coordToIndexin interfaceIAxis- Parameters:
coord- an axis value- Returns:
- the bin's index corresponding to
coord
-
lowerEdge
public double lowerEdge()
Get the Axis lower edge.
-
upperEdge
public double upperEdge()
Get the Axis upper edge.
-
isFixedBinning
public boolean isFixedBinning()
Description copied from interface:IAxisCheck if the IAxis has fixed binning, i.e. if all the bins have the same width.- Specified by:
isFixedBinningin interfaceIAxis- Returns:
trueif the binning is fixed,falseotherwise.
-
-
DMelt 3.0 © DataMelt by jWork.ORG