Documentation of 'hep.aida.ref.histogram.VariableAxis' Java class
VariableAxis
hep.aida.ref.histogram

Class VariableAxis

  • All Implemented Interfaces:
    IAxis


    public class VariableAxis
    extends java.lang.Object
    implements IAxis
    Variable-width axis; A reference implementation of hep.aida.IAxis.
    • Constructor Summary

      Constructors 
      Constructor and Description
      VariableAxis(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
      double binCenter(int index)
      Get the center of the specified bin.
      double binLowerEdge(int index)
      Get the lower edge of the specified bin.
      int bins()
      The number of bins (excluding underflow and overflow) on the IAxis.
      double binUpperEdge(int index)
      Get the upper edge of the specified bin.
      double binWidth(int index)
      Get the width of the specified bin.
      int coordToIndex(double coord)
      Convert a coordinate on the axis to a bin number.
      boolean equals(java.lang.Object o)
      Check if two Axis are equal.
      boolean isFixedBinning()
      Check if the IAxis has fixed binning, i.e.
      double lowerEdge()
      Get the lower edge of the IAxis.
      double upperEdge()
      Get the upper edge of the IAxis.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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:
        java.lang.IllegalArgumentException - if edges.length < 1.
    • Method Detail

      • binCenter

        public double binCenter(int index)
        Description copied from interface: IAxis
        Get the center of the specified bin.
        Specified by:
        binCenter in interface IAxis
        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.
      • binLowerEdge

        public double binLowerEdge(int index)
        Description copied from interface: IAxis
        Get the lower edge of the specified bin.
        Specified by:
        binLowerEdge in interface IAxis
        Parameters:
        index - The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
        Returns:
        The lower edge of the corresponding bin; for the underflow bin this is Double.NEGATIVE_INFINITY.
      • bins

        public int bins()
        Description copied from interface: IAxis
        The number of bins (excluding underflow and overflow) on the IAxis.
        Specified by:
        bins in interface IAxis
        Returns:
        The IAxis's number of bins.
      • binUpperEdge

        public double binUpperEdge(int index)
        Description copied from interface: IAxis
        Get the upper edge of the specified bin.
        Specified by:
        binUpperEdge in interface IAxis
        Parameters:
        index - The bin number: 0 to bins()-1 for the in-range bins or OVERFLOW or UNDERFLOW.
        Returns:
        The upper edge of the corresponding bin; for the overflow bin this is Double.POSITIVE_INFINITY.
      • binWidth

        public double binWidth(int index)
        Description copied from interface: IAxis
        Get the width of the specified bin.
        Specified by:
        binWidth in interface IAxis
        Parameters:
        index - The bin number: 0 to bins()-1) for the in-range bins or OVERFLOW or UNDERFLOW.
        Returns:
        The width of the corresponding bin.
      • coordToIndex

        public int coordToIndex(double coord)
        Description copied from interface: IAxis
        Convert a coordinate on the axis to a bin number. If the coordinate is less than the lowerEdge UNDERFLOW is returned; if the coordinate is greater or equal to the upperEdge OVERFLOW is returned.
        Specified by:
        coordToIndex in interface IAxis
        Parameters:
        coord - The coordinate to be converted.
        Returns:
        The corresponding bin number.
      • lowerEdge

        public double lowerEdge()
        Description copied from interface: IAxis
        Get the lower edge of the IAxis.
        Specified by:
        lowerEdge in interface IAxis
        Returns:
        The IAxis's lower edge.
      • upperEdge

        public double upperEdge()
        Description copied from interface: IAxis
        Get the upper edge of the IAxis.
        Specified by:
        upperEdge in interface IAxis
        Returns:
        The IAxis's upper edge.
      • isFixedBinning

        public boolean isFixedBinning()
        Description copied from interface: IAxis
        Check if the IAxis has fixed binning, i.e. if all the bins have the same width.
        Specified by:
        isFixedBinning in interface IAxis
        Returns:
        true if the binning is fixed, false otherwise.
      • equals

        public boolean equals(java.lang.Object o)
        Check if two Axis are equal.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the Object to check
        Returns:
        true if o is an instance of FixedAxis and it has the same number of bins, minimum and bin width.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.