|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.DrawOptions
jhplot.H1D
public class H1D
Class to create a histogram in one dimension (1D). Based on JAIDA Histogram1D class.
Constructor Summary | |
---|---|
H1D()
Build 1D histogram. |
|
H1D(hep.aida.ref.histogram.Histogram1D h1)
Create H1D histogram from JAIDA Histogram1D class. |
|
H1D(hep.aida.IHistogram1D h1)
Create H1D histogram from JAIDA IHistogram1D class |
|
H1D(java.lang.String title,
double[] edges)
Create 1D histogram with variable bin size. |
|
H1D(java.lang.String title,
H1D h1d)
Create H1D from another instance. |
|
H1D(java.lang.String title,
int bins,
double min,
double max)
Build 1D histogram |
|
H1D(hep.io.root.interfaces.TH1 h1t)
Create H1D histogram from JAIDA TH1 histogram class |
Method Summary | |
---|---|
int |
allEntries()
Get number of all entries |
double |
binCenter(int index)
Get bin centres. |
double[] |
binCenters()
Get all bin centers in form of array |
double |
binEntries(int index)
Number of entries in a bin with index i |
double |
binError(int index)
Error on the bin with index i |
double[] |
binErrors()
Get all bin errors of the histogram as an array |
double |
binHeight(int index)
Height of the corresponding bin |
double[] |
binHeights()
Get all heights of the histogram as an array |
double |
binLowerEdge(int index)
Get bin lower edge. |
double[] |
binLowerEdges()
Get all lower edges in form of array |
double |
binMean(int index)
Mean in a single bin with index |
double |
binRms(int index)
RMS of a single bin with index |
double |
binUpperEdge(int index)
Get bin upper edge. |
double[] |
binUpperEdges()
Get all upper edges in form of array |
H1D |
copy()
Make a copy of the data holder |
H1D |
copy(java.lang.String newtitle)
Get exact copy of the current histogram. |
int |
entries()
Number of in-range entries in the histogram |
int |
extraEntries()
Number of under and overflow entries in the histogram. |
void |
fill(double value)
Fill histogram with a value |
void |
fill(double[] values)
Fill histogram with array of double values |
void |
fill(double[] values,
double[] weights)
Fill histogram with array of double values. |
void |
fill(double value,
double weight)
Fill histogram a with weight |
void |
fill(int[] values)
Fill histogram with array of integer values |
void |
fillInvBinSizeWeight(double value)
Fill histogram with a value, weighting it by inverse of bin size. |
void |
fillP0D(P0D p0d)
Fill histogram from P0D array |
hep.aida.ref.histogram.Histogram1D |
get()
Get JAIDA histogram |
hep.aida.IAxis |
getAxis()
Get histogram Axis class. |
int |
getBins()
Get the number of bins |
double |
getEntropy()
Returns the entropy of the histogram. |
double |
getMax()
Get Maximum value of axis |
double |
getMin()
Get Minimum value of the axis |
int |
getOverflow()
Number of overflow entries |
double |
getOverflowlowHight()
Overflow height |
java.lang.String |
getTitle()
get Title of the histogram |
int |
getUnderflow()
Number of underflow entries |
double |
getUnderflowHight()
Underflow height |
double[][] |
getValues(int mode)
Get positions in X,Y and Errors. |
double |
maxBinHeight()
Max value of all bins |
double |
mean()
Get mean of the histogram |
double |
minBinHeight()
Min value of all bins |
H1D |
oper(double scale)
Scale of the histogram. |
H1D |
oper(H1D a,
java.lang.String what)
Various manipulations with histograms (+,-,*,/). |
H1D |
oper(H1D a,
java.lang.String title,
java.lang.String what)
Various manipulations with histograms (+,-,*,/). |
H1D |
oper(int scale)
Scale histogram. |
H1D |
oper(java.lang.String title,
double scale)
Scale the histogram. |
H1D |
oper(java.lang.String title,
int scale)
Scale the histogram. |
H1D |
operScale(java.lang.String title,
double scaleFactor)
Scale the histogram. |
H1D |
operSmooth(boolean isWeighted,
int k)
Smooth the histogram. |
H1D |
operSmoothGauss(double standardDeviation)
Computes a Gaussian smoothed version of the histogram. |
void |
print()
Print histogram on screen |
double |
rms()
Get RMS of histogram |
void |
setBins(int bins)
Sets the number of bins |
void |
setContents(double[] values,
double[] errors)
Sets the content of H1D histogram. |
void |
setMax(double max)
Set Maximum value of axis |
void |
setMeanAndRms(double mean,
double rms)
Sets the Mean and RMS of H1D histogram |
void |
setMin(double min)
Set Min value of axis |
void |
setNEntries(int entries)
Sets number of entries of H1D histogram. |
void |
setTitle(java.lang.String title)
Sets the title |
void |
setValidEntries(int entries)
Sets number of valid entries. |
double |
sumAllBinHeights()
Sum of all heights |
void |
toFile(java.lang.String name)
Write the H1D histogram to a file |
void |
toTable()
Print a H1D histogram to a Table in a separate frame. |
void |
toTable(boolean format)
Print the H1D histogram to a Table in a separate Frame. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public H1D()
public H1D(java.lang.String title, int bins, double min, double max)
title
- Titlebins
- Number of binsmin
- Minimum valuemax
- Maximum valuepublic H1D(java.lang.String title, double[] edges)
title
- Title of histogram.edges
- edgespublic H1D(hep.aida.ref.histogram.Histogram1D h1)
h1
- Histogram1D histogram from JAIDApublic H1D(hep.aida.IHistogram1D h1)
h1
- IHistogram1D histogram from JAIDApublic H1D(java.lang.String title, H1D h1d)
title
- new titleh1d
- input H1Dpublic H1D(hep.io.root.interfaces.TH1 h1t)
h1t
- TH1 histogram from JAIDAMethod Detail |
---|
public void print()
public void toTable()
public void fillP0D(P0D p0d)
p0d
- input P0D arraypublic hep.aida.IAxis getAxis()
public double binCenter(int index)
index
- bin index
public double[] binCenters()
public double binLowerEdge(int index)
index
- bin index
public double[] binLowerEdges()
public double binUpperEdge(int index)
index
- bin index
public double[] binUpperEdges()
public void toTable(boolean format)
format
- if true, the numbers will be formatted using the Java
scientific format.public void toFile(java.lang.String name)
name
- File namepublic void setContents(double[] values, double[] errors)
values
- array with values in Y (dimension: bins + 2)errors
- array with errors on Y (dimension: bins + 2)public void setMeanAndRms(double mean, double rms)
mean
- mean of the histogramrms
- RMS to be setpublic void setNEntries(int entries)
entries
- Number of entriespublic void setValidEntries(int entries)
entries
- Number of valid entriespublic void setTitle(java.lang.String title)
setTitle
in class DrawOptions
title
- Titlepublic java.lang.String getTitle()
getTitle
in class DrawOptions
public hep.aida.ref.histogram.Histogram1D get()
public void setMin(double min)
min
- Minimum value of axispublic double getMin()
public void setMax(double max)
max
- Maximum value of axispublic double getMax()
public void setBins(int bins)
bins
- Number of binspublic int getBins()
public void fill(double value)
value
- Value to be filledpublic void fill(double[] values)
values
- array of double valuespublic void fill(double[] values, double[] weights)
values
- array of double valuesweights
- array of double weightspublic void fill(int[] values)
values
- array of integer valuespublic void fill(double value, double weight)
value
- Value to be filledweight
- Weight of the valuepublic double mean()
public double rms()
public int allEntries()
public int extraEntries()
public int entries()
public int getUnderflow()
public double getUnderflowHight()
public double getOverflowlowHight()
public int getOverflow()
public H1D oper(double scale)
scale
- Scaling factor
public void fillInvBinSizeWeight(double value)
value
- Value to filled histogram with.public H1D oper(int scale)
scale
- Scale factor
public H1D oper(java.lang.String title, int scale)
title
- New titlescale
- Scale factor
public H1D oper(java.lang.String title, double scale)
title
- New titlescale
- Scale factor
public H1D operScale(java.lang.String title, double scaleFactor)
title
- New titlescaleFactor
- Scale factor
public H1D operSmooth(boolean isWeighted, int k)
Each band of the histogram is smoothed by averaging over a moving window of a size specified by the method parameter: if the value of the parameter is k then the width of the window is 2*k + 1. If the window runs off the end of the histogram only those values which intersect the histogram are taken into consideration. The smoothing may optionally be weighted to favor the central value using a "triangular" weighting. For example, for a value of k equal to 2 the central bin would have weight 1/3, the adjacent bins 2/9, and the next adjacent bins 1/9. Errors are kept the same as before.
isWeighted
- Whether bins will be weighted using a triangular weighting
scheme favoring bins near the central bin.k
- The smoothing parameter which must be non-negative. If zero,
the histogram object will be returned with no smoothing
applied.
public H1D operSmoothGauss(double standardDeviation)
Each band of the histogram is smoothed by discrete convolution with a kernel approximating a Gaussian impulse response with the specified standard deviation.
standardDeviation
- The standard deviation of the Gaussian smoothing kernel which
must be non-negative or an
IllegalArgumentException
will be thrown. If
zero, the histogram object will be returned with no smoothing
applied.
public double getEntropy()
The entropy is defined to be the negation of the sum of the products of the probability associated with each bin with the base-2 log of the probability.
public H1D copy()
public H1D copy(java.lang.String newtitle)
newtitle
- New title
public double binEntries(int index)
index
- Bin index
public double binError(int index)
index
- Bin index
public double binHeight(int index)
index
- Bin index
public double[] binHeights()
public double[] binErrors()
public double binMean(int index)
index
- Bin index
public double binRms(int index)
index
- Bin index
public double maxBinHeight()
public double minBinHeight()
public double sumAllBinHeights()
public H1D oper(H1D a, java.lang.String what)
a
- H1D histogram.what
- String representing the operation: "+" add a histogram to the
original "-" subtract a histogram from the original "*"
multiply "/" divide
public double[][] getValues(int mode)
mode
- if =1, take center of the bins. In all other cases - mean
value in each bin
public H1D oper(H1D a, java.lang.String title, java.lang.String what)
a
- H1D histogram.title
- New Title
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |