Histogram2D
hep.aida.ref.histogram

Class Histogram2D

    • Constructor Detail

      • Histogram2D

        public Histogram2D()
        Create a 2-dimensional Histogram.
      • Histogram2D

        public Histogram2D(String name,           String title,           IAxis xAxis,           IAxis yAxis)
        Create a 2-dimensional Histogram.
        Parameters:
        name - The name of the Histogram as a ManagedObject.
        title - The title of the Histogram.
        xAxis - The x-axis of the Histogram.
        yAxis - The y-axis of the Histogram.
    • Method Detail

      • fill

        public void fill(double x,        double y)
        Fill the Histogram with unit weight.
        Specified by:
        fill in interface IHistogram2D
        Parameters:
        x - The x value to be filled.
        y - The y value to be filled.
      • fill

        public void fill(double x,        double y,        double weight)
        Fill the Histogram.
        Specified by:
        fill in interface IHistogram2D
        Parameters:
        x - The x value to be filled.
        y - The y value to be filled.
        weight - The weight for this entry.
      • reset

        public void reset()
        Reset the Histogram. After calling this method the Histogram is as it was just created.
        Specified by:
        reset in interface IBaseHistogram
        Overrides:
        reset in class Histogram
      • extraEntries

        public int extraEntries()
        Get the number of entries in the underflow and overflow bins.
        Specified by:
        extraEntries in interface IHistogram
        Specified by:
        extraEntries in class Histogram
        Returns:
        The number of entries outside the range of the Histogram.
      • sumAllBinHeights

        public double sumAllBinHeights()
        Get the sum of the bin heights for all the entries, in-range and out-range ones.
        Specified by:
        sumAllBinHeights in interface IHistogram
        Specified by:
        sumAllBinHeights in class Histogram
        Returns:
        The sum of all the bin's heights.
      • sumExtraBinHeights

        public double sumExtraBinHeights()
        Get the sum of the bin heights for all the entries outside the Histogram's range.
        Specified by:
        sumExtraBinHeights in interface IHistogram
        Specified by:
        sumExtraBinHeights in class Histogram
        Returns:
        The sum of the out of range bin's heights.
      • minBinHeight

        public double minBinHeight()
        Get the minimum height of in-range bins in the Histogram.
        Specified by:
        minBinHeight in interface IHistogram
        Specified by:
        minBinHeight in class Histogram
        Returns:
        The minimum bin height for in range bins.
      • maxBinHeight

        public double maxBinHeight()
        Get the maximum height of in-range bins in the Histogram.
        Specified by:
        maxBinHeight in interface IHistogram
        Specified by:
        maxBinHeight in class Histogram
        Returns:
        The maximum bin height for in range bins.
      • binEntries

        public int binEntries(int indexX,             int indexY)
        Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
        Specified by:
        binEntries in interface IHistogram2D
        Parameters:
        indexX - the x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - the y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The number of entries for the corresponding bin.
      • binEntriesX

        public int binEntriesX(int indexX)
        Number of entries with a given x bin number (ie the number of times fill was called for these bins). Equivalent to projectionX().binEntries(indexX).
        Specified by:
        binEntriesX in interface IHistogram2D
        Parameters:
        indexX - the x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The number of entries for the corresponding bins.
      • binEntriesY

        public int binEntriesY(int indexY)
        Number of entries with a given y bin number (ie the number of times fill was called for these bins). Equivalent to projectionY().binEntries(indexY).
        Specified by:
        binEntriesY in interface IHistogram2D
        Parameters:
        indexY - the y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The number of entries for the corresponding bins.
      • binHeight

        public double binHeight(int indexX,               int indexY)
        Total height of the corresponding bin.
        Specified by:
        binHeight in interface IHistogram2D
        Parameters:
        indexX - The x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The bin height for the corresponding bin.
      • binHeightX

        public double binHeightX(int indexX)
        Total height of the corresponding x bin along y. Equivalent to projectionX().binHeight(indexX).
        Specified by:
        binHeightX in interface IHistogram2D
        Parameters:
        indexX - The x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The bin height for the corresponding bin.
      • binHeightY

        public double binHeightY(int indexY)
        Total height of the corresponding y bin along x. Equivalent to projectionY().binHeight(indexY).
        Specified by:
        binHeightY in interface IHistogram2D
        Parameters:
        indexY - The y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The bin height for the corresponding bin.
      • binError

        public double binError(int indexX,              int indexY)
        The error on this bin.
        Specified by:
        binError in interface IHistogram2D
        Parameters:
        indexX - The x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The error on the corresponding bin.
      • meanX

        public double meanX()
        Get the mean of the whole Histogram as projected on the x axis. It includes all the entries (in and out of range).
        Specified by:
        meanX in interface IHistogram2D
        Returns:
        The mean of the Histogram on the x axis.
      • meanY

        public double meanY()
        Get the mean of the whole Histogram as projected on the y axis. It includes all the entries (in and out of range).
        Specified by:
        meanY in interface IHistogram2D
        Returns:
        The mean of the Histogram on the y axis.
      • rmsX

        public double rmsX()
        Get the RMS of the whole Histogram as projected on the x axis. It includes all the entries (in and out of range).
        Specified by:
        rmsX in interface IHistogram2D
        Returns:
        The RMS of the Histogram on the x axis.
      • rmsY

        public double rmsY()
        Get the RMS of the whole Histogram as projected on the y axis. It includes all the entries (in and out of range).
        Specified by:
        rmsY in interface IHistogram2D
        Returns:
        The RMS of the Histogram on the y axis.
      • coordToIndexX

        public int coordToIndexX(double coordX)
        Convenience method, equivalent to xAxis().coordToIndex(coord).
        Specified by:
        coordToIndexX in interface IHistogram2D
        Parameters:
        coordX - The coordinalte along the x axis.
        Returns:
        The bin's index along the x axis corresponding to the position coordX.
        See Also:
        IAxis.coordToIndex(double)
      • coordToIndexY

        public int coordToIndexY(double coordY)
        Convenience method, equivalent to yAxis().coordToIndex(coord).
        Specified by:
        coordToIndexY in interface IHistogram2D
        Parameters:
        coordY - The coordinalte along the y axis.
        Returns:
        The bin's index along the y axis corresponding to the position coordY.
        See Also:
        IAxis.coordToIndex(double)
      • scale

        public void scale(double scaleFactor)
        Scale the weights and the errors by a given factor.
        Specified by:
        scale in interface IHistogram
        Specified by:
        scale in class Histogram
        Parameters:
        scaleFactor - The scale factor.
      • setMeanX

        public void setMeanX(double meanX)
        All the non-AIDA methods should go below this point.
      • setRmsX

        public void setRmsX(double rmsX)
      • setMeanY

        public void setMeanY(double meanY)
      • setRmsY

        public void setRmsY(double rmsY)
      • binMeanX

        public double binMeanX(int indexX,              int indexY)
        Get the mean of a bin along the x axis.
        Specified by:
        binMeanX in interface IHistogram2D
        Parameters:
        indexX - The x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The mean of the corresponding bin along x. If the bin has zero height, zero is returned.
      • binMeanY

        public double binMeanY(int indexX,              int indexY)
        Get the mean of a bin along the y axis.
        Specified by:
        binMeanY in interface IHistogram2D
        Parameters:
        indexX - The x bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation: (0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The mean of the corresponding bin along y. If the bin has zero height, zero is returned.
      • binRmsX

        public double binRmsX(int indexX,             int indexY)
        Get the RMS of a bin along the x axis.
        Parameters:
        indexX - The x bin number in the external representation:(0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation:(0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The RMS of the corresponding bin along x. If the bin has zero height, zero is returned.
      • binRmsY

        public double binRmsY(int indexX,             int indexY)
        Get the RMS of a bin along the y axis.
        Parameters:
        indexX - The x bin number in the external representation:(0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - The y bin number in the external representation:(0...N-1) or OVERFLOW or UNDERFLOW.
        Returns:
        The RMS of the corresponding bin along y. If the bin has zero height, zero is returned.
      • setBinError

        public void setBinError(int indexX,               int indexY,               double error)
        Set the error on this bin.
        Parameters:
        indexX - the bin number (0...N-1) or OVERFLOW or UNDERFLOW.
        indexY - the bin number (0...N-1) or OVERFLOW or UNDERFLOW.
        error - the error.
      • setContents

        public void setContents(double[][] heights,               double[][] errors,               int[][] entries,               double[][] meanXs,               double[][] rmsXs,               double[][] meanYs,               double[][] rmsYs)
        Set the content of the whole Histogram at once. This is a convenience method for saving/restoring Histograms. Of the arguments below the heights array cannot be null. The errors array should in general be non-null, but this depends on the specific binner. The entries array can be null, in which case the entry of a bin is taken to be the integer part of the height. If the means array is null, the mean is defaulted to the geometric center of the bin. If the rms array is null, the rms is taken to be the bin width over the root of 12.
        Parameters:
        heights - The bin heights
        errors - The bin errors
        entries - The bin entries
        meanXs - The means of the bin along the x axis
        rmsXs - The rmss of the bin along the x axis
        meanYs - The means of the bin along the y axis
        rmsYs - The rmss of the bin along the y axis
      • initHistogram2D

        public void initHistogram2D(IAxis xAxis,                   IAxis yAxis,                   String options)

SCaVis 2.1 © jWork.ORG