Documentation of 'jhplot.HProf2D' Java class.
HProf2D
jhplot

Class HProf2D

  • All Implemented Interfaces:
    java.io.Serializable


    public class HProf2D
    extends java.lang.Object
    implements java.io.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(java.lang.String title, double[] edgesX, double[] edgesY)
      Create 2D profile histogram with variable bin size.
      HProf2D(java.lang.String title, int binsX, double minX, double maxX, int binsY, double minY, double maxY)
      Create 2D histogram
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int allEntries()
      Get number of all entries
      int binEntries(int indexX, int indexY)
      Number of entries in the corresponding bin (i.e.
      double binError(int indexX, int indexY)
      Error of the corresponding bin.
      double binHeight(int indexX, int indexY)
      Total height of the corresponding bin.
      void doc()
      Show online documentation.
      int entries()
      Number of in-range entries in the histogram
      int extraEntries()
      Get the number of entries in the underflow and overflow bins.
      void fill(double[] x, double[] y, double[] z)
      Fill histogram from 2 arrays.
      void fill(double[] x, double[] y, double[] z, double[] w)
      Fill histogram from 2 arrays.
      void fill(double x, double y, double z)
      Fill histogram assuming all weights are unity.
      void fill(double x, double y, double z, double w)
      Fill histogram assuming all weights are unity.
      Profile2D get()
      Get the JAIDA Profile2D
      IAxis getAxisX()
      Get IAxis in X
      IAxis getAxisY()
      Get IAxis in Y
      int getBinsX()
      Get the number of bins in X
      int getBinsY()
      Get the number of bins in Y
      H2D getH2D()
      Convert to H2D keeping the original title
      H2D getH2D(java.lang.String newtitle)
      Make H2D copy of the current histogram.
      H2D getH2D(java.lang.String newtitle, java.lang.String option)
      Make H2D copy of the current histogram.
      double getLowerEdgeX(int index)
      Get lower edge of the bin in X
      double getLowerEdgeY(int index)
      Get lower edge of the bins in Y
      double getMaxX()
      Get max value of axis in X
      double getMaxY()
      Get max value of Y axis
      double getMeanX()
      Get mean on X.
      double getMeanY()
      Get mean on Y
      double getMinX()
      Get min value of axis in X
      double getMinY()
      Get min value of Y axis
      int getOverflowEntriesX()
      Get overflow entries in Y
      int getOverflowEntriesY()
      Get overflow entries in Y
      double getOverflowHeightX()
      Get overflow entries in Y
      double getOverflowHeightY()
      Get overflow height in Y
      double getRmsX()
      Get RMS on X
      double getRmsY()
      Get RMS on Y
      int getUnderflowEntriesX()
      Get underflow entries in X
      int getUnderflowEntriesY()
      Get underflow entries in Y
      double getUnderflowHeightsX()
      Get underflow heights in X
      double getUnderflowHeightX()
      Get underflow height in X
      double getUnderflowHeightY()
      Get underflow height in Y
      double getUpperEdgeX(int index)
      Get upper edge of the bin in X
      double getUpperEdgeY(int index)
      Get upper edge of the bin in Y
      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)
      void setContents(double[][] heights, double[][] errors)
      Set content of H2D histogram
      void setMeanX(double mean)
      Set mean on X.
      void setMeanY(double mean)
      Set mean on Y
      void setNEntries(int entries)
      Set all entries.
      void setRmsX(double rmsX)
      Set RMS on X.
      void setRmsY(double rmsY)
      Set RMS on Y
      void setTitle(java.lang.String title)
      Set title
      void setValidEntries(int entries)
      Set in-range entries.
      double sumAllBinHeights()
      Get the sum of the bin heights for all the entries, in-range and out-range ones.
      double sumExtraBinHeights()
      Get the sum of the bin heights for all the entries outside the Histogram's range.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HProf2D

        public HProf2D(java.lang.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(java.lang.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(java.lang.String title)
        Set title
        Parameters:
        title - title
      • get

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

        public H2D getH2D(java.lang.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(java.lang.String newtitle,
                          java.lang.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.

DMelt 3.0 © DataMelt by jWork.ORG