jhplot
Class HProf2D
- java.lang.Object
-
- jhplot.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 histogramHProf2D(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 entriesint
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 histogramint
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 Profile2DIAxis
getAxisX()
Get IAxis in XIAxis
getAxisY()
Get IAxis in Yint
getBinsX()
Get the number of bins in Xint
getBinsY()
Get the number of bins in YH2D
getH2D()
Convert to H2D keeping the original titleH2D
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 Xdouble
getLowerEdgeY(int index)
Get lower edge of the bins in Ydouble
getMaxX()
Get max value of axis in Xdouble
getMaxY()
Get max value of Y axisdouble
getMeanX()
Get mean on X.double
getMeanY()
Get mean on Ydouble
getMinX()
Get min value of axis in Xdouble
getMinY()
Get min value of Y axisint
getOverflowEntriesX()
Get overflow entries in Yint
getOverflowEntriesY()
Get overflow entries in Ydouble
getOverflowHeightX()
Get overflow entries in Ydouble
getOverflowHeightY()
Get overflow height in Ydouble
getRmsX()
Get RMS on Xdouble
getRmsY()
Get RMS on Yint
getUnderflowEntriesX()
Get underflow entries in Xint
getUnderflowEntriesY()
Get underflow entries in Ydouble
getUnderflowHeightsX()
Get underflow heights in Xdouble
getUnderflowHeightX()
Get underflow height in Xdouble
getUnderflowHeightY()
Get underflow height in Ydouble
getUpperEdgeX(int index)
Get upper edge of the bin in Xdouble
getUpperEdgeY(int index)
Get upper edge of the bin in Yint
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 histogramvoid
setMeanX(double mean)
Set mean on X.void
setMeanY(double mean)
Set mean on Yvoid
setNEntries(int entries)
Set all entries.void
setRmsX(double rmsX)
Set RMS on X.void
setRmsY(double rmsY)
Set RMS on Yvoid
setTitle(java.lang.String title)
Set titlevoid
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.
-
-
-
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
- TitlebinsX
- Number of bins in XminX
- Min value in XmaxX
- Max value in XbinsY
- Number of bins in YminY
- Min value in YmaxY
- 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 XedgesY
- 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 titleoption
- 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
- heightserrors
- errors
-
fill
public void fill(double x, double y, double z)
Fill histogram assuming all weights are unity.- Parameters:
x
- value in Xy
- value in Yz
- 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 Xy
- value in Yz
- value in Zw
- 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 Xy
- array with values in Yz
- 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 Xy
- array with values in Yz
- array with values in zw
- 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