jhplot
Class H2D

java.lang.Object
  extended by jhplot.DrawOptions
      extended by jhplot.H2D
All Implemented Interfaces:
java.io.Serializable

public class H2D
extends DrawOptions
implements java.io.Serializable

Main class to create a 2D histogram. Based on JAIDA class Histogram2D. You can use more method for H2D histogram, but you should use get() method to access Histogram2D histogram

See Also:
Serialized Form

Constructor Summary
H2D(Histogram2D h1)
          Create a H2D histogram from JAIDA histogram
H2D(java.lang.String title, hep.aida.IAxis xAx, hep.aida.IAxis yAy)
          Define H2D in terms of axis
H2D(java.lang.String title, int binsX, double minX, double maxX, int binsY, double minY, double maxY)
          Create 2D histogram
H2D(hep.io.root.interfaces.TH2 h2t)
          Create H2D histogram from JAIDA TH1 histogram class
 
Method Summary
 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.
 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[] value1, double[] value2)
          Fill H2D histogram from 2 arrays.
 void fill(double[] value1, double[] value2, double[] weights)
          Fill H2D histogram from arrays.
 void fill(double value1, double value2)
          Fill H2D histogram assuming all weights are unity.
 void fill(double value1, double value2, double weight)
          Fill H2D histogram with weights
 Histogram2D get()
          Get the JAIDA Histogram2D
 hep.aida.IAxis getAxisX()
          Get IAxis in X
 hep.aida.IAxis getAxisY()
          Get IAxis in Y
 int getBinsX()
          Get the number of bins in X
 int getBinsY()
          Get the number of bins in Y
 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 getOverflowHightX()
          Get overflow entries in Y
 double getOverflowHightY()
          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 getUnderflowHightsX()
          Get underflow heights in X
 double getUnderflowHightX()
          Get underflow height in X
 double getUnderflowHightY()
          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
 void setBinError(int indexX, int indexY, double error)
          Set the error on this bin.
 void setContents(double[][] heights, double[][] errors)
          Set content of H2D histogram
 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.
 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 jhplot.DrawOptions
copyLinePars, getBinWidth, getDrawOption, getDrawOptions, getLegend, getLineParm, getNameX, getNameY, getNameZ, getTitle, getType, printDrawOptions, printDrawOptions, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbolSize, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2D

public H2D(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

H2D

public H2D(java.lang.String title,
           hep.aida.IAxis xAx,
           hep.aida.IAxis yAy)
Define H2D in terms of axis

Parameters:
title - title
xAx - Axis for X
yAy - Axis for Y

H2D

public H2D(Histogram2D h1)
Create a H2D histogram from JAIDA histogram

Parameters:
h1 - Histogram2D histogram

H2D

public H2D(hep.io.root.interfaces.TH2 h2t)
Create H2D histogram from JAIDA TH1 histogram class

Parameters:
h1t - TH1 histogram from JAIDA
Method Detail

get

public Histogram2D get()
Get the JAIDA Histogram2D

Returns:
Histogram2D

setTitle

public void setTitle(java.lang.String title)
Set title

Overrides:
setTitle in class DrawOptions
Parameters:
title - title

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

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

fill

public void fill(double value1,
                 double value2)
Fill H2D histogram assuming all weights are unity.

Parameters:
value1 - value in X
value2 - value in Y

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.

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

getUnderflowHightY

public double getUnderflowHightY()
Get underflow height in Y

Returns:
underflow height in Y

getUnderflowHightX

public double getUnderflowHightX()
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

getOverflowHightY

public double getOverflowHightY()
Get overflow height in Y

Returns:
overflow in Y

getOverflowEntriesX

public int getOverflowEntriesX()
Get overflow entries in Y

Returns:
overflow in Y

getOverflowHightX

public double getOverflowHightX()
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

getUnderflowHightsX

public double getUnderflowHightsX()
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 hep.aida.IAxis getAxisX()
Get IAxis in X

Returns:
axis in X

getAxisY

public hep.aida.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 value1,
                 double value2,
                 double weight)
Fill H2D histogram with weights

Parameters:
value1 - value in X
value2 - value in Y
weight - weight

fill

public void fill(double[] value1,
                 double[] value2)
Fill H2D histogram from 2 arrays. Assume weights =1.

Parameters:
value1 - array with values in X
value2 - array with values in Y

fill

public void fill(double[] value1,
                 double[] value2,
                 double[] weights)
Fill H2D histogram from arrays. Weights are defined by the third array.

Parameters:
value1 - array with values in X
value2 - array with values in Y
weights - weights


jHepWork 1.7 (C) Chekanov