Class Histogram

    • Field Detail

      • isHorizontal

        protected final boolean isHorizontal
    • Constructor Detail

      • Histogram

        public Histogram​(java.lang.String name,
                         int nBins,
                         double minX,
                         double maxX,
                         boolean horizontal)
        Creates histogram with name and range [minX, maxX]
        Parameters:
        name - of the data sets
        nBins - number of bins
        minX - minimum of range
        maxX - maximum of range
        horizontal - whether binning is performed in X
      • Histogram

        public Histogram​(java.lang.String name,
                         int nBins,
                         double minX,
                         double maxX)
        Creates histogram with name and range [minX, maxX]
        Parameters:
        name - of the data sets
        nBins - number of bins
        minX - minimum of range
        maxX - maximum of range
      • Histogram

        public Histogram​(java.lang.String name,
                         double[] xBins,
                         boolean horizontal)
        Creates histogram with name and range [minX, maxX]
        Parameters:
        name - of the data sets
        xBins - the initial bin array (defines [minX, maxX] and nBins)
        horizontal - whether binning is performed in X
      • Histogram

        public Histogram​(java.lang.String name,
                         double[] xBins)
        Creates histogram with name and range [minX, maxX]
        Parameters:
        name - of the data sets
        xBins - the initial bin array (defines [minX, maxX] and nBins)
    • Method Detail

      • getXDataCount

        public int getXDataCount()
        Description copied from interface: DataSet3D
        Returns number of X coordinates.
        Specified by:
        getXDataCount in interface DataSet3D
        Returns:
        the number of y axis bins
      • getYDataCount

        public int getYDataCount()
        Description copied from interface: DataSet3D
        Returns number of Y coordinates.
        Specified by:
        getYDataCount in interface DataSet3D
        Returns:
        the number of y axis bins
      • getX

        public double getX​(int i)
        Description copied from interface: DataSet
        Gets the x value of the data point with the index i
        Specified by:
        getX in interface DataSet
        Parameters:
        i - the index of the data point
        Returns:
        the x value
      • getY

        public double getY​(int i)
        Description copied from interface: DataSet
        Gets the y value of the data point with the index i
        Specified by:
        getY in interface DataSet
        Parameters:
        i - the index of the data point
        Returns:
        the y value
      • fill

        public int fill​(double x)
        Description copied from interface: Histogram1D
        Increment bin with abscissa X, Y, and Z by 1. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented The function returns the corresponding bin number which has its content incremented by 1
        Specified by:
        fill in interface Histogram1D
        Parameters:
        x - new value to be added
        Returns:
        corresponding bin number which has its content incremented by 1
      • fill

        public int fill​(double x,
                        double w)
        Description copied from interface: Histogram1D
        Increment bin with abscissa X by with a weight w. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented The function returns the corresponding bin number which has its content incremented by 1
        Specified by:
        fill in interface Histogram1D
        Parameters:
        x - new value to be added
        w - weight
        Returns:
        corresponding bin number which has its content incremented by 1
      • fill

        public int fill​(java.lang.String name)
        Description copied from interface: Histogram1D
        Increment bin with name with by 1. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented
        Specified by:
        fill in interface Histogram1D
        Parameters:
        name - name to be added
        Returns:
        corresponding bin number which has its content incremented by w
      • fill

        public int fill​(java.lang.String name,
                        double w)
        Description copied from interface: Histogram1D
        Increment bin with name with a weight w. if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented
        Specified by:
        fill in interface Histogram1D
        Parameters:
        name - name to be added
        w - weight for given name
        Returns:
        corresponding bin number which has its content incremented by w
      • fillN

        public void fillN​(double[] x,
                          double[] w,
                          int stepSize)
        Description copied from interface: Histogram1D
        Fill this histogram with an array x and weights w.
        Specified by:
        fillN in interface Histogram1D
        Parameters:
        x - x coordinates to be added.
        w - weights to be added.
        stepSize - step size through arrays x and w
      • getZ

        public double getZ​(int xIndex,
                           int yIndex)
        Description copied from interface: DataSet3D
        Returns Z coordinate for the specified data point.
        Specified by:
        getZ in interface DataSet3D
        Parameters:
        xIndex - index of X coordinate
        yIndex - index of Y coordinate
        Returns:
        Z coordinate