Package hep.aida.ref

Class AbstractHistogram2D

  • All Implemented Interfaces:
    IHistogram, IHistogram2D, java.io.Serializable
    Direct Known Subclasses:
    Histogram2D

    abstract class AbstractHistogram2D
    extends Histogram
    implements IHistogram2D
    Abstract base class extracting and implementing most of the redundancy of the interface.
    Version:
    1.0, 23/03/2000
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractHistogram2D​(java.lang.String title)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int allEntries()
      Number of all entries in all (both in-range and under/overflow) bins in the histogram.
      int binEntriesX​(int indexX)
      Equivalent to projectionX().binEntries(indexX).
      int binEntriesY​(int indexY)
      Equivalent to projectionY().binEntries(indexY).
      double binHeightX​(int indexX)
      Equivalent to projectionX().binHeight(indexX).
      double binHeightY​(int indexY)
      Equivalent to projectionY().binHeight(indexY).
      int dimensions()
      Returns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.
      int entries()
      Number of in-range entries in the histogram.
      int extraEntries()
      Number of under and overflow entries in the histogram.
      void fill​(double x, double y)
      Fill the histogram with weight 1.
      protected abstract IHistogram1D internalSliceX​(java.lang.String title, int indexY1, int indexY2)
      The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.
      protected abstract IHistogram1D internalSliceY​(java.lang.String title, int indexX1, int indexX2)
      The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.
      (package private) int mapX​(int index)
      Package private method to map from the external representation of bin number to our internal representation of bin number
      (package private) int mapY​(int index)
      Package private method to map from the external representation of bin number to our internal representation of bin number
      int[] minMaxBins()
      Indexes of the in-range bins containing the smallest and largest binHeight(), respectively.
      IHistogram1D projectionX()
      Create a projection parallel to the X axis.
      IHistogram1D projectionY()
      Create a projection parallel to the Y axis.
      IHistogram1D sliceX​(int indexY)
      Slice parallel to the Y axis at bin indexY and one bin wide.
      IHistogram1D sliceX​(int indexY1, int indexY2)
      Create a slice parallel to the axis X axis, between "indexY1" and "indexY2" (inclusive).
      IHistogram1D sliceY​(int indexX)
      Slice parallel to the X axis at bin indexX and one bin wide.
      IHistogram1D sliceY​(int indexX1, int indexX2)
      Create a slice parallel to the axis Y axis, between "indexX1" and "indexX2" (inclusive) The returned IHistogram1D represents an instantaneous snapshot of the histogram at the time the slice was created.
      double sumAllBinHeights()
      Sum of all (both in-range and under/overflow) bin heights in the histogram.
      double sumBinHeights()
      Sum of in-range bin heights in the histogram.
      double sumExtraBinHeights()
      Sum of under/overflow bin heights in the histogram.
      IAxis xAxis()
      Return the X axis.
      IAxis yAxis()
      Return the Y axis.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • xAxis

        protected IAxis xAxis
      • yAxis

        protected IAxis yAxis
    • Constructor Detail

      • AbstractHistogram2D

        AbstractHistogram2D​(java.lang.String title)
    • Method Detail

      • allEntries

        public int allEntries()
        Description copied from interface: IHistogram
        Number of all entries in all (both in-range and under/overflow) bins in the histogram.
        Specified by:
        allEntries in interface IHistogram
      • binEntriesX

        public int binEntriesX​(int indexX)
        Description copied from interface: IHistogram2D
        Equivalent to projectionX().binEntries(indexX).
        Specified by:
        binEntriesX in interface IHistogram2D
      • binEntriesY

        public int binEntriesY​(int indexY)
        Description copied from interface: IHistogram2D
        Equivalent to projectionY().binEntries(indexY).
        Specified by:
        binEntriesY in interface IHistogram2D
      • binHeightX

        public double binHeightX​(int indexX)
        Description copied from interface: IHistogram2D
        Equivalent to projectionX().binHeight(indexX).
        Specified by:
        binHeightX in interface IHistogram2D
      • binHeightY

        public double binHeightY​(int indexY)
        Description copied from interface: IHistogram2D
        Equivalent to projectionY().binHeight(indexY).
        Specified by:
        binHeightY in interface IHistogram2D
      • dimensions

        public int dimensions()
        Description copied from interface: IHistogram
        Returns 1 for one-dimensional histograms, 2 for two-dimensional histograms, and so on.
        Specified by:
        dimensions in interface IHistogram
      • entries

        public int entries()
        Description copied from interface: IHistogram
        Number of in-range entries in the histogram.
        Specified by:
        entries in interface IHistogram
      • extraEntries

        public int extraEntries()
        Description copied from interface: IHistogram
        Number of under and overflow entries in the histogram.
        Specified by:
        extraEntries in interface IHistogram
      • fill

        public void fill​(double x,
                         double y)
        Description copied from interface: IHistogram2D
        Fill the histogram with weight 1.
        Specified by:
        fill in interface IHistogram2D
      • internalSliceX

        protected abstract IHistogram1D internalSliceX​(java.lang.String title,
                                                       int indexY1,
                                                       int indexY2)
        The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.

        Note 0indexY1 and indexY2 use our INTERNAL bin numbering scheme Note 1The slice is done between indexY1 and indexY2 INCLUSIVE Note 2indexY1 and indexY2 may include the use of under and over flow bins Note 3There is no note 3 (yet)

      • internalSliceY

        protected abstract IHistogram1D internalSliceY​(java.lang.String title,
                                                       int indexX1,
                                                       int indexX2)
        The precise meaning of the arguments to the public slice methods is somewhat ambiguous, so we define this internal slice method and clearly specify its arguments.

        Note 0indexX1 and indexX2 use our INTERNAL bin numbering scheme Note 1The slice is done between indexX1 and indexX2 INCLUSIVE Note 2indexX1 and indexX2 may include the use of under and over flow bins Note 3There is no note 3 (yet)

      • mapX

        int mapX​(int index)
        Package private method to map from the external representation of bin number to our internal representation of bin number
      • mapY

        int mapY​(int index)
        Package private method to map from the external representation of bin number to our internal representation of bin number
      • minMaxBins

        public int[] minMaxBins()
        Description copied from interface: IHistogram2D
        Indexes of the in-range bins containing the smallest and largest binHeight(), respectively.
        Specified by:
        minMaxBins in interface IHistogram2D
        Returns:
        {minBinX,minBinY, maxBinX,maxBinY}.
      • projectionX

        public IHistogram1D projectionX()
        Description copied from interface: IHistogram2D
        Create a projection parallel to the X axis. Equivalent to sliceX(UNDERFLOW,OVERFLOW).
        Specified by:
        projectionX in interface IHistogram2D
      • projectionY

        public IHistogram1D projectionY()
        Description copied from interface: IHistogram2D
        Create a projection parallel to the Y axis. Equivalent to sliceY(UNDERFLOW,OVERFLOW).
        Specified by:
        projectionY in interface IHistogram2D
      • sliceX

        public IHistogram1D sliceX​(int indexY)
        Description copied from interface: IHistogram2D
        Slice parallel to the Y axis at bin indexY and one bin wide. Equivalent to sliceX(indexY,indexY).
        Specified by:
        sliceX in interface IHistogram2D
      • sliceX

        public IHistogram1D sliceX​(int indexY1,
                                   int indexY2)
        Description copied from interface: IHistogram2D
        Create a slice parallel to the axis X axis, between "indexY1" and "indexY2" (inclusive). The returned IHistogram1D represents an instantaneous snapshot of the histogram at the time the slice was created.
        Specified by:
        sliceX in interface IHistogram2D
      • sliceY

        public IHistogram1D sliceY​(int indexX)
        Description copied from interface: IHistogram2D
        Slice parallel to the X axis at bin indexX and one bin wide. Equivalent to sliceY(indexX,indexX).
        Specified by:
        sliceY in interface IHistogram2D
      • sliceY

        public IHistogram1D sliceY​(int indexX1,
                                   int indexX2)
        Description copied from interface: IHistogram2D
        Create a slice parallel to the axis Y axis, between "indexX1" and "indexX2" (inclusive) The returned IHistogram1D represents an instantaneous snapshot of the histogram at the time the slice was created.
        Specified by:
        sliceY in interface IHistogram2D
      • sumAllBinHeights

        public double sumAllBinHeights()
        Description copied from interface: IHistogram
        Sum of all (both in-range and under/overflow) bin heights in the histogram.
        Specified by:
        sumAllBinHeights in interface IHistogram
      • sumBinHeights

        public double sumBinHeights()
        Description copied from interface: IHistogram
        Sum of in-range bin heights in the histogram.
        Specified by:
        sumBinHeights in interface IHistogram
      • sumExtraBinHeights

        public double sumExtraBinHeights()
        Description copied from interface: IHistogram
        Sum of under/overflow bin heights in the histogram.
        Specified by:
        sumExtraBinHeights in interface IHistogram