Class Histogram2

    • Field Detail

      • xProjection

        protected final Histogram xProjection
      • yProjection

        protected final Histogram yProjection
    • Constructor Detail

      • Histogram2

        public Histogram2​(java.lang.String name,
                          int nBinsX,
                          double minX,
                          double maxX,
                          int nBinsY,
                          double minY,
                          double maxY)
        Creates 2D histogram with name and ranges [minX, maxX] and [minY, maxY]
        Parameters:
        name - of the data sets
        nBinsX - number of horizontal bins
        minX - minimum of horizontal range
        maxX - maximum of horizontal range
        nBinsY - number of vertical bins
        minY - minimum of vertical range
        maxY - maximum of vertical range
    • Method Detail

      • getProjectionX

        public Histogram1D getProjectionX()
        Returns:
        1D histogram with projection in X
      • getProjectionY

        public Histogram1D getProjectionY()
        Returns:
        1D histogram with projection in Y
      • 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
      • 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,
                        double y)
        Description copied from interface: Histogram2D
        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 Histogram2D
        Parameters:
        x - new value to be added
        y - new value to be added
        Returns:
        corresponding bin number which has its content incremented by 1
      • fill

        public int fill​(double x,
                        double y,
                        double w)
        Description copied from interface: Histogram2D
        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 Histogram2D
        Parameters:
        x - new value to be added
        y - new value to be added
        w - weight
        Returns:
        corresponding bin number which has its content incremented by 1
      • findFirstBinAbove

        public int findFirstBinAbove​(double x,
                                     double y)
        Specified by:
        findFirstBinAbove in interface Histogram2D
        Parameters:
        x - spatial real-valued coordinate in X
        y - spatial real-valued coordinate in Y
        Returns:
        bin index that is above the spatial x and y coordinates
      • getSumX

        protected double getSumX​(int bin)
      • getSumY

        protected double getSumY​(int bin)