public class HProf1D extends Object implements Serializable
Constructor and Description |
---|
HProf1D()
Build 1D histogram.
|
HProf1D(hep.aida.IProfile1D h1)
Create profile histogram from JAIDA class
|
HProf1D(hep.aida.ref.histogram.Profile1D h1)
Create H1D histogram from JAIDA Histogram1D class.
|
HProf1D(String title,
double[] edges)
Create 1D profile histogram with variable bin size.
|
HProf1D(String title,
HProf1D h1d)
Create profile histogram from another instance.
|
HProf1D(String title,
hep.aida.IAxis axis)
Create 1D histogram with variable bin size.
|
HProf1D(String title,
int bins,
double min,
double max)
Build 1D profile histogram
|
HProf1D(hep.io.root.interfaces.TProfile h1t)
Create profile histogram from JAIDA histogram class
|
Modifier and Type | Method and Description |
---|---|
int |
allEntries()
Get number of all entries
|
double |
binCenter(int index)
Get bin centres.
|
double[] |
binCenters()
Get all bin centers in form of array
|
int[] |
binEntries()
Get all entries of the histogram as an array
|
int |
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
|
HProf1D |
copy()
Make a copy of the data holder
|
HProf1D |
copy(String newtitle)
Get exact copy of the current histogram.
|
void |
doc()
Show online documentation.
|
int |
entries()
Number of in-range entries in the histogram
|
int |
extraEntries()
Number of under and overflow entries in the histogram.
|
void |
fill(double[] x,
double[] y)
Fill histogram with array of double values.
|
void |
fill(double[] x,
double[] y,
double[] weight)
Fill histogram with array of double values.
|
void |
fill(double x,
double y)
Fill profile histogram with X and Y
|
void |
fill(double x,
double y,
double weight)
Fill profile histogram with X and Y
|
void |
fillInvBinSizeWeight(double value)
Fill histogram with a value, weighting it by inverse of bin size.
|
void |
fillP0D(P0D p0d,
P0D p1d)
Fill histogram from two P0D arrays
|
hep.aida.ref.histogram.Profile1D |
get()
Get JAIDA histogram
|
hep.aida.IAxis |
getAxis()
Get histogram Axis class.
|
int |
getBins()
Get the number of bins
|
double |
getBinSize()
Get bin width in case of fixed-size bins.
|
double |
getEntropy()
Returns the entropy of the histogram.
|
H1D |
getH1D()
Make H1D copy of the current histogram.
|
H1D |
getH1D(String newtitle)
Convert to H1D for graphical representation using
default graphics attributes.
|
H1D |
getH1D(String newtitle,
String option)
Convert to H1D for graphical representation using
default graphics attributes.
|
double |
getMax()
Get Maximum value of axis
|
double |
getMin()
Get Minimum value of the axis
|
int |
getOverflow()
Number of overflow entries
|
double |
getOverflowlowHeight()
Overflow height
|
String |
getTitle()
get Title of the histogram
|
int |
getUnderflow()
Number of underflow entries
|
double |
getUnderflowHeight()
Underflow height
|
double[][] |
getValues(int mode)
Get positions in X,Y and Errors.
|
boolean |
isFixedBinning()
Return true if bins have constant bin width
|
double |
maxBinHeight()
Max value of all bins
|
double |
mean()
Get mean of the histogram
|
double |
minBinHeight()
Min value of all bins
|
HProf1D |
operSmooth(boolean isWeighted,
int k)
Smooth the histogram.
|
HProf1D |
operSmoothGauss(double standardDeviation)
Computes a Gaussian smoothed version of the histogram.
|
void |
print()
Print histogram on screen
|
double |
rms()
Get RMS of histogram
|
void |
scale(double scaleFactor)
Scale the histogram.
|
void |
scale(String title,
double scaleFactor)
Scale the histogram.
|
void |
setBins(int bins)
Sets the number of bins
|
void |
setContents(double[] values,
double[] errors)
Sets the content of histogram.
|
void |
setContents(double[] heights,
double[] errors,
int[] entries,
double[] means,
double[] rmss)
Set the content of the whole Histogram at once.
|
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 the histogram.
|
void |
setTitle(String title)
Sets the title
|
void |
setValidEntries(int entries)
Sets number of valid entries.
|
void |
shift(double d)
Shift all bins by some value
|
double |
sumAllBinHeights()
Sum of all heights
|
void |
toFile(String name)
Write the profile histogram to a file
|
void |
toTable()
Print the profile histogram to a Table in a separate Frame.
|
public HProf1D()
public HProf1D(String title, int bins, double min, double max)
title
- Titlebins
- Number of binsmin
- Minimum valuemax
- Maximum valuepublic HProf1D(String title, double[] edges)
title
- Title of histogram.edges
- edgespublic HProf1D(String title, hep.aida.IAxis axis)
title
- Title of histogram.edges
- edgespublic HProf1D(hep.aida.ref.histogram.Profile1D h1)
h1
- Profile1D histogram from JAIDApublic HProf1D(hep.aida.IProfile1D h1)
h1
- IProfile1D histogram from JAIDApublic HProf1D(String title, HProf1D h1d)
title
- new titleh1d
- input H1Dpublic HProf1D(hep.io.root.interfaces.TProfile h1t)
h1t
- TProfile histogram from JAIDApublic void print()
public void fillP0D(P0D p0d, P0D p1d)
p0d
- input P0D arrayp1d
- input P1Dpublic hep.aida.IAxis getAxis()
public double binCenter(int index)
index
- bin indexpublic double[] binCenters()
public double binLowerEdge(int index)
index
- bin indexpublic double[] binLowerEdges()
public double binUpperEdge(int index)
index
- bin indexpublic double[] binUpperEdges()
public void toTable()
public void toFile(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 setContents(double[] heights, double[] errors, int[] entries, double[] means, double[] rmss)
heights
- The bins heightserrors
- The bins errorsentries
- The bin entries.means
- The means of the bins.rmss
- The rmss of the binspublic 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(String title)
title
- Titlepublic String getTitle()
public hep.aida.ref.histogram.Profile1D 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 double getBinSize()
public void shift(double d)
d
- parameter used to shift binspublic boolean isFixedBinning()
public void fill(double x, double y)
x
- value in Xy
- value in Ypublic void fill(double x, double y, double weight)
x
- value in Xy
- value in Yweight
- weight for entrypublic void fill(double[] x, double[] y)
x
- array of double X valuesy
- array of double Y valuespublic void fill(double[] x, double[] y, double[] weight)
x
- array of double X valuesy
- array of double Y valuesweight
- arrays with weightspublic double mean()
public double rms()
public int allEntries()
public int extraEntries()
public int entries()
public int getUnderflow()
public double getUnderflowHeight()
public double getOverflowlowHeight()
public int getOverflow()
public void fillInvBinSizeWeight(double value)
value
- Value to filled histogram with.public void scale(String title, double scaleFactor)
title
- New titlescaleFactor
- Scale factorpublic void scale(double scaleFactor)
scaleFactor
- Scale factorpublic HProf1D 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 HProf1D 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 HProf1D copy()
public HProf1D copy(String newtitle)
newtitle
- New titlepublic H1D getH1D()
public H1D getH1D(String newtitle)
newtitle
- New titlepublic H1D getH1D(String newtitle, String option)
newtitle
- New titleoption
- if option is "s", spread is shown as errorpublic int binEntries(int index)
index
- Bin indexpublic int[] binEntries()
public double binError(int index)
index
- Bin indexpublic double binHeight(int index)
index
- Bin indexpublic double[] binHeights()
public double[] binErrors()
public double binMean(int index)
index
- Bin indexpublic double binRms(int index)
index
- Bin indexpublic double maxBinHeight()
public double minBinHeight()
public double sumAllBinHeights()
public double[][] getValues(int mode)
mode
- if =1, take center of the bins. In all other cases - mean
value in each binpublic void doc()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics