jhplot
Class HProf2D
- java.lang.Object
-
- jhplot.HProf2D
-
- All Implemented Interfaces:
- java.io.Serializable
public class HProf2D extends java.lang.Object implements java.io.SerializableProfile 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 intallEntries()Get number of all entriesintbinEntries(int indexX, int indexY)Number of entries in the corresponding bin (i.e.doublebinError(int indexX, int indexY)Error of the corresponding bin.doublebinHeight(int indexX, int indexY)Total height of the corresponding bin.voiddoc()Show online documentation.intentries()Number of in-range entries in the histogramintextraEntries()Get the number of entries in the underflow and overflow bins.voidfill(double[] x, double[] y, double[] z)Fill histogram from 2 arrays.voidfill(double[] x, double[] y, double[] z, double[] w)Fill histogram from 2 arrays.voidfill(double x, double y, double z)Fill histogram assuming all weights are unity.voidfill(double x, double y, double z, double w)Fill histogram assuming all weights are unity.Profile2Dget()Get the JAIDA Profile2DIAxisgetAxisX()Get IAxis in XIAxisgetAxisY()Get IAxis in YintgetBinsX()Get the number of bins in XintgetBinsY()Get the number of bins in YH2DgetH2D()Convert to H2D keeping the original titleH2DgetH2D(java.lang.String newtitle)Make H2D copy of the current histogram.H2DgetH2D(java.lang.String newtitle, java.lang.String option)Make H2D copy of the current histogram.doublegetLowerEdgeX(int index)Get lower edge of the bin in XdoublegetLowerEdgeY(int index)Get lower edge of the bins in YdoublegetMaxX()Get max value of axis in XdoublegetMaxY()Get max value of Y axisdoublegetMeanX()Get mean on X.doublegetMeanY()Get mean on YdoublegetMinX()Get min value of axis in XdoublegetMinY()Get min value of Y axisintgetOverflowEntriesX()Get overflow entries in YintgetOverflowEntriesY()Get overflow entries in YdoublegetOverflowHeightX()Get overflow entries in YdoublegetOverflowHeightY()Get overflow height in YdoublegetRmsX()Get RMS on XdoublegetRmsY()Get RMS on YintgetUnderflowEntriesX()Get underflow entries in XintgetUnderflowEntriesY()Get underflow entries in YdoublegetUnderflowHeightsX()Get underflow heights in XdoublegetUnderflowHeightX()Get underflow height in XdoublegetUnderflowHeightY()Get underflow height in YdoublegetUpperEdgeX(int index)Get upper edge of the bin in XdoublegetUpperEdgeY(int index)Get upper edge of the bin in YintmapBinNumber(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)voidsetContents(double[][] heights, double[][] errors)Set content of H2D histogramvoidsetMeanX(double mean)Set mean on X.voidsetMeanY(double mean)Set mean on YvoidsetNEntries(int entries)Set all entries.voidsetRmsX(double rmsX)Set RMS on X.voidsetRmsY(double rmsY)Set RMS on YvoidsetTitle(java.lang.String title)Set titlevoidsetValidEntries(int entries)Set in-range entries.doublesumAllBinHeights()Get the sum of the bin heights for all the entries, in-range and out-range ones.doublesumExtraBinHeights()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