HProf2D
jhplot

Class HProf2D

  • All Implemented Interfaces:
    Serializable


    public class HProf2Dextends Objectimplements Serializable
    Profile histogram in 2D. The profile histogram is used to show the mean value in each bin as a function of a second variable. Use getH2D() method for plotting. Points can have errors shown as error on mean or RMS. Based on JAIDA class Profile2D.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      HProf2D(Profile2D h1)
      Create a H2D histogram from JAIDA histogram
      HProf2D(String title, double[] edgesX, double[] edgesY)
      Create 2D profile histogram with variable bin size.
      HProf2D(String title, int binsX, double minX, double maxX, int binsY, double minY, double maxY)
      Create 2D histogram
    • Constructor Detail

      • HProf2D

        public HProf2D(String title,       int binsX,       double minX,       double maxX,       int binsY,       double minY,       double maxY)
        Create 2D histogram
        Parameters:
        title - Title
        binsX - Number of bins in X
        minX - Min value in X
        maxX - Max value in X
        binsY - Number of bins in Y
        minY - Min value in Y
        maxY - Max value in Y
      • HProf2D

        public HProf2D(String title,       double[] edgesX,       double[] edgesY)
        Create 2D profile histogram with variable bin size.
        Parameters:
        title - Title of histogram.
        edgesX - edges for X
        edgesY - edges for Y
      • HProf2D

        public HProf2D(Profile2D h1)
        Create a H2D histogram from JAIDA histogram
        Parameters:
        h1 - Histogram2D histogram
    • Method Detail

      • setTitle

        public void setTitle(String title)
        Set title
        Parameters:
        title - title
      • get

        public Profile2D get()
        Get the JAIDA Profile2D
        Returns:
        Profile2D
      • getH2D

        public H2D getH2D(String newtitle)
        Make H2D copy of the current histogram. Default graphical attributes are assumed. Errors for points show errors on mean.
        Parameters:
        newtitle - New title
        Returns:
        H2D histogram
      • getH2D

        public H2D getH2D(String newtitle,         String option)
        Make H2D copy of the current histogram. Default graphical attributes are assumed.
        Parameters:
        newtitle - New title
        option - id option is "s", spread (RMS) is used as error
        Returns:
        H2D histogram
      • getH2D

        public H2D getH2D()
        Convert to H2D keeping the original title
        Returns:
        H2D histogram
      • setRmsY

        public void setRmsY(double rmsY)
        Set RMS on Y
        Parameters:
        rmsY - RMS on Y
      • setMeanY

        public void setMeanY(double mean)
        Set mean on Y
        Parameters:
        mean - on Y
      • getRmsY

        public double getRmsY()
        Get RMS on Y
      • getMeanY

        public double getMeanY()
        Get mean on Y
      • getMeanX

        public double getMeanX()
        Get mean on X.
      • getRmsX

        public double getRmsX()
        Get RMS on X
      • setNEntries

        public void setNEntries(int entries)
        Set all entries.
        Parameters:
        entries - entries
      • setValidEntries

        public void setValidEntries(int entries)
        Set in-range entries.
        Parameters:
        entries - entries
      • setRmsX

        public void setRmsX(double rmsX)
        Set RMS on X.
      • setMeanX

        public void setMeanX(double mean)
        Set mean on X.
        Parameters:
        mean - on X
      • setContents

        public void setContents(double[][] heights,               double[][] errors)
        Set content of H2D histogram
        Parameters:
        heights - heights
        errors - errors
      • fill

        public void fill(double x,        double y,        double z)
        Fill histogram assuming all weights are unity.
        Parameters:
        x - value in X
        y - value in Y
        z - value in Z
      • fill

        public void fill(double x,        double y,        double z,        double w)
        Fill histogram assuming all weights are unity.
        Parameters:
        x - value in X
        y - value in Y
        z - value in Z
        w - weight
      • binHeight

        public double binHeight(int indexX,               int indexY)
        Total height of the corresponding bin.
        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.
      • extraEntries

        public int extraEntries()
        Get the number of entries in the underflow and overflow bins.
        Returns:
        The number of entries outside the range of the Histogram.
      • sumExtraBinHeights

        public double sumExtraBinHeights()
        Get the sum of the bin heights for all the entries outside the Histogram's range.
        Returns:
        The sum of the out of range bin's heights.
      • sumAllBinHeights

        public double sumAllBinHeights()
        Get the sum of the bin heights for all the entries, in-range and out-range ones.
        Returns:
        The sum of all the bin's heights.
      • getBinsX

        public int getBinsX()
        Get the number of bins in X
        Returns:
        binsX number of bins in X
      • getBinsY

        public int getBinsY()
        Get the number of bins in Y
        Returns:
        binsY number of bins in Y
      • getMinX

        public double getMinX()
        Get min value of axis in X
        Returns:
        min value of X axis
      • getMaxX

        public double getMaxX()
        Get max value of axis in X
        Returns:
        max value of X axis
      • getMaxY

        public double getMaxY()
        Get max value of Y axis
        Returns:
        max value of Y axis
      • getMinY

        public double getMinY()
        Get min value of Y axis
        Returns:
        min value of X axis
      • getUnderflowEntriesY

        public int getUnderflowEntriesY()
        Get underflow entries in Y
        Returns:
        underflow in Y
      • getUnderflowHeightY

        public double getUnderflowHeightY()
        Get underflow height in Y
        Returns:
        underflow height in Y
      • getUnderflowHeightX

        public double getUnderflowHeightX()
        Get underflow height in X
        Returns:
        underflow height in X
      • getUnderflowEntriesX

        public int getUnderflowEntriesX()
        Get underflow entries in X
        Returns:
        underflow in X
      • getOverflowEntriesY

        public int getOverflowEntriesY()
        Get overflow entries in Y
        Returns:
        overflow in Y
      • getOverflowHeightY

        public double getOverflowHeightY()
        Get overflow height in Y
        Returns:
        overflow in Y
      • getOverflowEntriesX

        public int getOverflowEntriesX()
        Get overflow entries in Y
        Returns:
        overflow in Y
      • getOverflowHeightX

        public double getOverflowHeightX()
        Get overflow entries in Y
        Returns:
        overflow in Y
      • getLowerEdgeX

        public double getLowerEdgeX(int index)
        Get lower edge of the bin in X
        Parameters:
        index - of the bin
        Returns:
        lower edge of the bin
      • getUpperEdgeX

        public double getUpperEdgeX(int index)
        Get upper edge of the bin in X
        Parameters:
        index - of the bin
        Returns:
        lower edge of the bin
      • getUpperEdgeY

        public double getUpperEdgeY(int index)
        Get upper edge of the bin in Y
        Parameters:
        index - of the bin
        Returns:
        lower edge of the bin
      • getLowerEdgeY

        public double getLowerEdgeY(int index)
        Get lower edge of the bins in Y
        Parameters:
        index - of the bin
        Returns:
        lower edge of the bin
      • getUnderflowHeightsX

        public double getUnderflowHeightsX()
        Get underflow heights in X
        Returns:
        underflow heights in Y
      • allEntries

        public int allEntries()
        Get number of all entries
        Returns:
        Number of all entries
      • entries

        public int entries()
        Number of in-range entries in the histogram
        Returns:
        Number of in-range entries
      • getAxisX

        public IAxis getAxisX()
        Get IAxis in X
        Returns:
        axis in X
      • getAxisY

        public IAxis getAxisY()
        Get IAxis in Y
        Returns:
        axis in Y
      • binEntries

        public int binEntries(int indexX,             int indexY)
        Number of entries in the corresponding bin (i.e. the number of times fill was called for this bin).
        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.
      • binError

        public double binError(int indexX,              int indexY)
        Error of the corresponding bin.
        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:
        errors for the corresponding bin.
      • fill

        public void fill(double[] x,        double[] y,        double[] z)
        Fill histogram from 2 arrays. Assume weights =1. Make sure that all arrays have the same size.
        Parameters:
        x - array with values in X
        y - array with values in Y
        z - array wih values in z
      • fill

        public void fill(double[] x,        double[] y,        double[] z,        double[] w)
        Fill histogram from 2 arrays. Assume weights =1. Make sure that all arrays have the same size.
        Parameters:
        x - array with values in X
        y - array with values in Y
        z - array with values in z
        w - array with weights
      • mapBinNumber

        public int mapBinNumber(int index,               IAxis axis)
        Utility method to map the bin number from the external representation (from -2 to nBins-1 where -2 is the overflow and -1 is the underflow) to the internal one (from 0 to nBins+1 where 0 is the underflow and nBins+1 if the overflow bin)
        Parameters:
        index - The bin number in the external representation.
        axis - The axis to which the bin belongs to.
        Returns:
        The bin number in the internal representation.
      • doc

        public void doc()
        Show online documentation.

SCaVis 2.2 © jWork.ORG