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

      • 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
        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
        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
      • get

        public double get​(int dimIndex,
                          int binIndex)
        Description copied from interface: DataSet
        Gets the x value of the data point with the index i
        Specified by:
        get in interface DataSet
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        binIndex - data point index
        Returns:
        the x value
      • getIndex

        public int getIndex​(int dimIndex,
                            double value)
        Description copied from class: AbstractDataSet
        Gets the index of the data point closest to the given x coordinate. If the x coordinate lies outside the range of the data set, the index of the first/last point is returned.
        Specified by:
        getIndex in interface DataSet
        Overrides:
        getIndex in class AbstractDataSet<AbstractHistogram>
        Parameters:
        dimIndex - the dimension index
        value - the x position of the data point
        Returns:
        the index of the data point
      • getProjectionX

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

        public Histogram1D getProjectionY()
        Returns:
        1D histogram with projection in Y
      • getSum

        protected double getSum​(int dimIndex,
                                int bin)
      • getValue

        public double getValue​(int dimIndex,
                               double x)
        Description copied from interface: DataSet
        Gets the interpolated y value of the data point for given x coordinate
        Specified by:
        getValue in interface DataSet
        Parameters:
        dimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')
        x - the new x coordinate
        Returns:
        the y value
      • getZ

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