Class H1D
- java.lang.Object
- 
- jhplot.Plottable
- 
- jhplot.DrawOptions
- 
- jhplot.H1D
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 
 public class H1D extends DrawOptions implements java.io.Serializable Histogram in one dimension (1D). A histogram can be serialized to a file, plotted using HPlot, HPlotJa canvases. Many methods to manipulate with histogram and access its statistics are also available.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor and Description H1D()Build 1D histogram.H1D(Cloud1D c1d, int bins)Create H1D histogram from JAIDA Cloud1D class.H1D(Histogram1D h1)Create H1D histogram from JAIDA Histogram1D class.H1D(IHistogram1D h1)Create H1D histogram from JAIDA IHistogram1D classH1D(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, IAxis axis)Create 1D histogram with variable bin size.H1D(java.lang.String title, int bins, double min, double max)Build 1D histogramH1D(hep.io.root.interfaces.TH1 h1t)Create H1D histogram from JAIDA TH1 histogram class
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method and Description intallEntries()Get number of all entriesdoublebinCenter(int index)Get bin centres.double[]binCenters()Get all bin centers in form of arrayint[]binEntries()Get all entries of the histogram as an arrayintbinEntries(int index)Number of entries in a bin with index idoublebinError(int index)Error on the bin with index idouble[]binErrors()Get all bin errors of the histogram as an arraydoublebinHeight(int index)Height of the corresponding bindouble[]binHeights()Get all heights of the histogram as an arraydoublebinLowerEdge(int index)Get bin lower edge.double[]binLowerEdges()Get all lower edges in form of arraydoublebinMean(int index)Mean in a single bin with indexdoublebinRms(int index)RMS of a single bin with indexdoublebinUpperEdge(int index)Get bin upper edge.double[]binUpperEdges()Get all upper edges in form of arrayvoidclear()Make a copy of the data holderjava.util.Map<java.lang.String,java.lang.Double>compareChi2(F1D f1)Compare the histogram with a function.java.util.Map<java.lang.String,java.lang.Double>compareChi2(H1D h2)Compare two histograms.H1Dcopy()Make a copy of the data holderH1Dcopy(java.lang.String newtitle)Get exact copy of the current histogram.voiddoc()Show online documentation.intentries()Number of in-range entries in the histogramintextraEntries()Number of under and overflow entries in the histogram.voidfill(Cloud1D c1d)Fill histogram with array of double valuesvoidfill(double value)Fill histogram with a valuevoidfill(double[] values)Fill histogram with array of double valuesvoidfill(double[] values, double[] weights)Fill histogram with array of double values.voidfill(double value, double weight)Fill histogram a with weightvoidfill(int[] values)Fill histogram with array of integer valuesvoidfill(int TotNumber, AbstractDistribution random)Fill the histogram with random numbers.voidfill(P0D p0d)Fill histogram from P0D arrayvoidfill(P0I p0i)Fill histogram from P0I arrayvoidfill(PND pnd)Fill histogram with values from a PND array.voidfill(PND pnd, PND weigths)Fill histograms with values from PND array.voidfillGauss(int TotNumber, double mean, double sd)Fill the histogram with random numbers from Gaussian (Normal) distribution.voidfillInvBinSizeWeight(double value)Fill histogram with a value, weighting it by inverse of bin size.voidfillRnd(int TotNumber, double mean, double width)Fill the histogram with random numbers from a flat distribution.intfindBin(double x)Convert a coordinate on the axis to a bin numberHistogram1Dget()Get JAIDA histogramIAxisgetAxis()Get histogram Axis class.intgetBins()Get the number of binsdoublegetBinSize()Get bin width in case of fixed-size bins.doublegetBinSize(int index)Get bin width for index iH1DgetDensity()Get a density distribution dividing each bin of the histogram by the bin width and the total number of heights for all bins.H1DgetDividedByBinWidth()Divide heights of each bin by the bin width.doublegetEntropy()Returns the entropy of the histogram.doublegetMax()Get Maximum value of axisdoublegetMin()Get Minimum value of the axisintgetOverflow()Number of overflow entriesdoublegetOverflowlowHeight()Overflow heightH1DgetProbability()Return q probability distribution derived from a histogram.java.util.Map<java.lang.String,java.lang.Double>getStat()Calculate complete statistics for this histogram.java.lang.String[]getStatParameters()Get statistical parameters of a Histogram as a list of stringsintgetUnderflow()Number of underflow entriesdoublegetUnderflowHeight()Underflow heightdouble[][]getValues(int mode)Get positions in X,Y and Errors.doubleintegral()Sum of all heights multiplied by the bin size.doubleintegral(int BinMin, int BinMax)Integrate a histogram between two bin indices (between 1 and max number) By default the integral is computed as the sum of bin contents in the range.doubleintegral(int BinMin, int BinMax, boolean timesBinWidth)Integrate a histogram between two bin indices (between 1 and max number) The integral is computed as the sum of bin contents in the range if the last parameter is false.doubleintegralRegion(double xmin, double xmax)Integrate histogram in a region between Xmin and Xmax.doubleintegralRegion(double xmin, double xmax, boolean timesBinWidth)Integrate histogram in a region between Xmin and Xmax.booleanisFixedBinning()Return true if bins have constant bin widthdoublemaxBinHeight()Max value of all binsdoublemean()Get mean of the histogramdoubleminBinHeight()Min value of all binsH1Doper(H1D a, java.lang.String what)Various manipulations with histograms (+,-,*,/).H1Doper(H1D a, java.lang.String title, java.lang.String what)Various manipulations with histograms (+,-,*,/).H1DoperScale(java.lang.String title, double scaleFactor)Scale the histogram and return scaled object.H1DoperSmooth(boolean isWeighted, int k)Smooth the histogram.H1DoperSmoothGauss(double standardDeviation)Computes a Gaussian smoothed version of the histogram.voidprint()Print histogram on screenH1Drebin(int ngroup)Rebin a histogram with constant bin width.doublerms()Get RMS of histogramvoidscale(double scaleFactor)Scale the histogram.voidscale(java.lang.String title, double scaleFactor)Scale the histogram.H1DscaleErrors(double scale)Rescale errors by a some factor.voidsetBins(int bins)Sets the number of binsvoidsetContents(double[] values, double[] errors)Sets the content of H1D histogram.voidsetContents(double[] heights, double[] errors, int[] entries, double[] means, double[] rmss)Set the content of the whole Histogram at once.voidsetErrors(double[] errors)Sets errors of H1D histogram (for heights).voidsetHeights(double[] values)Sets the content of H1D histogram (heights).voidsetMax(double max)Set Maximum value of axisvoidsetMeanAndRms(double mean, double rms)Sets the Mean and RMS of H1D histogramvoidsetMin(double min)Set Min value of axisvoidsetNEntries(int entries)Sets number of entries of H1D histogram.voidsetValidEntries(int entries)Sets number of valid entries.voidshift(double d)Shift all bins by some valuedoublesumAllBinHeights()Sum of all heightsvoidtoFile(java.lang.String name)Write the H1D histogram to a filejava.lang.StringtoString()Convert the histogram to a stringvoidtoTable()Print a H1D histogram to a Table in a separate frame.- 
Methods inherited from class jhplot.DrawOptionscopyLinePars, getBinWidth, getColor, getDrawOption, getDrawOptions, getFillColor, getLegend, getLineParm, getLineStyle, getNameX, getNameY, getNameZ, getPenWidth, getSymbol, getSymbolShape, getSymbolSize, getTitle, getType, isBars, isErrX, isErrY, isFilled, printDrawOptions, printDrawOptions, setBars, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setLineStyle, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbol, setSymbolSize, setTitle, setType
 
- 
 
- 
- 
- 
Constructor Detail- 
H1Dpublic H1D() Build 1D histogram. Default constructor. Does not do anything.
 - 
H1Dpublic H1D(java.lang.String title, int bins, double min, double max)Build 1D histogram- Parameters:
- title- Title
- bins- Number of bins
- min- Minimum value
- max- Maximum value
 
 - 
H1Dpublic H1D(java.lang.String title, double[] edges)Create 1D histogram with variable bin size.- Parameters:
- title- Title of histogram.
- edges- edges
 
 - 
H1Dpublic H1D(java.lang.String title, IAxis axis)Create 1D histogram with variable bin size.- Parameters:
- title- Title of histogram.
- edges- edges
 
 - 
H1Dpublic H1D(Histogram1D h1) Create H1D histogram from JAIDA Histogram1D class.- Parameters:
- h1- Histogram1D histogram from JAIDA
 
 - 
H1Dpublic H1D(Cloud1D c1d, int bins) Create H1D histogram from JAIDA Cloud1D class. Min and Max values re determined automatically.- Parameters:
- c1d- Cloud1D histogram from JAIDA
- bins- Number of bins for plotting.
 
 - 
H1Dpublic H1D(IHistogram1D h1) Create H1D histogram from JAIDA IHistogram1D class- Parameters:
- h1- IHistogram1D histogram from JAIDA
 
 - 
H1Dpublic H1D(java.lang.String title, H1D h1d)Create H1D from another instance.- Parameters:
- title- new title
- h1d- input H1D
 
 - 
H1Dpublic H1D(hep.io.root.interfaces.TH1 h1t) Create H1D histogram from JAIDA TH1 histogram class- Parameters:
- h1t- TH1 histogram from JAIDA
 
 
- 
 - 
Method Detail- 
printpublic void print() Print histogram on screen
 - 
toStringpublic java.lang.String toString() Convert the histogram to a string- Overrides:
- toStringin class- java.lang.Object
- Returns:
- string representing a histogram
 
 - 
toTablepublic void toTable() Print a H1D histogram to a Table in a separate frame. The numbers are formatted to scientific format. One can sort and search the data in this table (cannot be modified).
 - 
fillpublic void fill(P0D p0d) Fill histogram from P0D array- Parameters:
- p0d- input P0D array
 
 - 
fillpublic void fill(int TotNumber, AbstractDistribution random)Fill the histogram with random numbers. Random generators are taken from cern.jet.random.*. Examples: Beta, Binominal, Poisson, BreitWigner,ChiSquare,Empirical Exponential, Gamma, Hyperbolic, Logarithmic, Normal, NegativeBinomial- Parameters:
- TotNumber- number generated events
- random- generator
 
 - 
fillGausspublic void fillGauss(int TotNumber, double mean, double sd)Fill the histogram with random numbers from Gaussian (Normal) distribution. Seed is taken from time.- Parameters:
- TotNumber- number generated events
- mean- mean of the gaussian
- sd- standard deviation
 
 - 
fillRndpublic void fillRnd(int TotNumber, double mean, double width)Fill the histogram with random numbers from a flat distribution. Seed is taken from time. Using mean=0 and width=1 will give a flat distribution between 0 and 1.- Parameters:
- TotNumber- number generated events
- mean- mean of the distribution
- width- width of the distribution
 
 - 
fillpublic void fill(P0I p0i) Fill histogram from P0I array- Parameters:
- p0i- input P0I array
 
 - 
getAxispublic IAxis getAxis() Get histogram Axis class.- Returns:
- Axis used for this histogram.
 
 - 
binCenterpublic double binCenter(int index) Get bin centres.- Parameters:
- index- bin index
- Returns:
- bin centre.
 
 - 
binCenterspublic double[] binCenters() Get all bin centers in form of array- Returns:
- double[] array of bin centers
 
 - 
binLowerEdgepublic double binLowerEdge(int index) Get bin lower edge.- Parameters:
- index- bin index
- Returns:
- lower edge
 
 - 
binLowerEdgespublic double[] binLowerEdges() Get all lower edges in form of array- Returns:
- double[] array of low edges
 
 - 
binUpperEdgepublic double binUpperEdge(int index) Get bin upper edge.- Parameters:
- index- bin index
- Returns:
- upper edge
 
 - 
binUpperEdgespublic double[] binUpperEdges() Get all upper edges in form of array- Returns:
- double[] array of upper edges
 
 - 
toFilepublic void toFile(java.lang.String name) Write the H1D histogram to a file- Parameters:
- name- File name
 
 - 
setHeightspublic void setHeights(double[] values) Sets the content of H1D histogram (heights). Keep errors the same. RMS and Mean will be wrong!.- Parameters:
- values- array with values in Y (dimension: bins + 2)
 
 - 
setErrorspublic void setErrors(double[] errors) Sets errors of H1D histogram (for heights). Keep values the same- Parameters:
- errors- array with errors in Y (dimension: bins + 2)
 
 - 
setContentspublic void setContents(double[] values, double[] errors)Sets the content of H1D histogram. Start from 1 to bins+2.- Parameters:
- values- array with values in Y (dimension: bins + 2)
- errors- array with errors on Y (dimension: bins + 2)
 
 - 
setContentspublic void setContents(double[] heights, double[] errors, int[] entries, double[] means, double[] rmss)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 bins heights
- errors- The bins errors
- entries- The bin entries.
- means- The means of the bins.
- rmss- The rmss of the bins
 
 - 
setMeanAndRmspublic void setMeanAndRms(double mean, double rms)Sets the Mean and RMS of H1D histogram- Parameters:
- mean- mean of the histogram
- rms- RMS to be set
 
 - 
setNEntriespublic void setNEntries(int entries) Sets number of entries of H1D histogram.- Parameters:
- entries- Number of entries
 
 - 
setValidEntriespublic void setValidEntries(int entries) Sets number of valid entries.- Parameters:
- entries- Number of valid entries
 
 - 
getpublic Histogram1D get() Get JAIDA histogram- Returns:
- JAIDA Histogram1D histogram
 
 - 
setMinpublic void setMin(double min) Set Min value of axis- Parameters:
- min- Minimum value of axis
 
 - 
getMinpublic double getMin() Get Minimum value of the axis- Returns:
- Minimum value of the axis
 
 - 
setMaxpublic void setMax(double max) Set Maximum value of axis- Parameters:
- max- Maximum value of axis
 
 - 
getMaxpublic double getMax() Get Maximum value of axis- Returns:
- Maximum value of axis
 
 - 
setBinspublic void setBins(int bins) Sets the number of bins- Parameters:
- bins- Number of bins
 
 - 
getBinspublic int getBins() Get the number of bins- Returns:
- Number of bins
 
 - 
getBinSizepublic double getBinSize() Get bin width in case of fixed-size bins.- Returns:
- bin width (max-min) /bins
 
 - 
getBinSizepublic double getBinSize(int index) Get bin width for index i- Parameters:
- index- of this bin
- Returns:
- bin width at index
 
 - 
shiftpublic void shift(double d) Shift all bins by some value- Parameters:
- d- parameter used to shift bins
 
 - 
isFixedBinningpublic boolean isFixedBinning() Return true if bins have constant bin width- Returns:
- true if bin width is fixed
 
 - 
fillpublic void fill(double value) Fill histogram with a value- Parameters:
- value- Value to be filled
 
 - 
fillpublic void fill(PND pnd) Fill histogram with values from a PND array. This means that every entry from PND contributes to histogram. All weights are 1.- Parameters:
- pnd- PND used to fill histogram
 
 - 
fillpublic void fill(PND pnd, PND weigths) Fill histograms with values from PND array. Also specify weigths in a form of PND. Make sure that both arrays has the size size and dimension.- Parameters:
- pnd- input value
- weigths- PND with weights
 
 - 
fillpublic void fill(double[] values) Fill histogram with array of double values- Parameters:
- values- array of double values
 
 - 
fillpublic void fill(Cloud1D c1d) Fill histogram with array of double values- Parameters:
- values- array of double values
 
 - 
fillpublic void fill(double[] values, double[] weights)Fill histogram with array of double values. Take into account weights.- Parameters:
- values- array of double values
- weights- array of double weights
 
 - 
fillpublic void fill(int[] values) Fill histogram with array of integer values- Parameters:
- values- array of integer values
 
 - 
fillpublic void fill(double value, double weight)Fill histogram a with weight- Parameters:
- value- Value to be filled
- weight- Weight of the value
 
 - 
meanpublic double mean() Get mean of the histogram- Returns:
- Mean of histogram
 
 - 
getStatpublic java.util.Map<java.lang.String,java.lang.Double> getStat() Calculate complete statistics for this histogram. Unlike other methods (like mean or rms), it performs calculations on the existing histogram, thus the method is somewhat slow. It return mean, error on the mean, RMS, variance, standard deviation.The key for the output map are: mean, error, rms, variance, stddev etc. Print the keys of this map to get the full access to statistics. - Returns:
- map representing histogram statistics
 
 - 
rmspublic double rms() Get RMS of histogram- Returns:
- RMS of histogram
 
 - 
allEntriespublic int allEntries() Get number of all entries- Returns:
- Number of all entries
 
 - 
extraEntriespublic int extraEntries() Number of under and overflow entries in the histogram.- Returns:
- Number of under and overflow entries
 
 - 
entriespublic int entries() Number of in-range entries in the histogram- Returns:
- Number of in-range entries
 
 - 
getUnderflowpublic int getUnderflow() Number of underflow entries- Returns:
- Number of underflow
 
 - 
getUnderflowHeightpublic double getUnderflowHeight() Underflow height- Returns:
- height of underflow
 
 - 
getOverflowlowHeightpublic double getOverflowlowHeight() Overflow height- Returns:
- Height of underflow
 
 - 
getOverflowpublic int getOverflow() Number of overflow entries- Returns:
- Number of overflow entries
 
 - 
fillInvBinSizeWeightpublic void fillInvBinSizeWeight(double value) Fill histogram with a value, weighting it by inverse of bin size. Should be useful for histograms with irregular binning.- Parameters:
- value- Value to filled histogram with.
 
 - 
scalepublic void scale(java.lang.String title, double scaleFactor)Scale the histogram.- Parameters:
- title- New title
- scaleFactor- Scale factor
 
 - 
operScalepublic H1D operScale(java.lang.String title, double scaleFactor) Scale the histogram and return scaled object.- Parameters:
- title- New title
- scaleFactor- Scale factor
 
 - 
scalepublic void scale(double scaleFactor) Scale the histogram.- Parameters:
- scaleFactor- Scale factor
 
 - 
operSmoothpublic H1D operSmooth(boolean isWeighted, int k) Smooth the histogram.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. - Parameters:
- 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.
- Returns:
- A smoothed version of the histogram.
 
 - 
operSmoothGausspublic H1D operSmoothGauss(double standardDeviation) Computes a Gaussian smoothed version of the histogram.Each band of the histogram is smoothed by discrete convolution with a kernel approximating a Gaussian impulse response with the specified standard deviation. - Parameters:
- standardDeviation- The standard deviation of the Gaussian smoothing kernel which must be non-negative or an- IllegalArgumentExceptionwill be thrown. If zero, the histogram object will be returned with no smoothing applied.
- Returns:
- A Gaussian smoothed version of the histogram.
 
 - 
getEntropypublic double getEntropy() Returns the entropy of the histogram.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. - Returns:
- The entropy of the histogram.
 
 - 
copypublic H1D copy() Make a copy of the data holder- Returns:
- New data holder
 
 - 
clearpublic void clear() Make a copy of the data holder
 - 
rebinpublic H1D rebin(int ngroup) Rebin a histogram with constant bin width. This function returns a new histogram with the rebinned contents. The bin errors are recomputed during the rebinning.- Parameters:
- ngroup- indicates how many bins of this have to me merged into one bin of hnew
- Returns:
- a new histogram with rebinned content.
 
 - 
copypublic H1D copy(java.lang.String newtitle) Get exact copy of the current histogram. This makes a new object.- Parameters:
- newtitle- New title
- Returns:
- a new copy of the histogram
 
 - 
scaleErrorspublic H1D scaleErrors(double scale) Rescale errors by a some factor. This will return a new object.- Parameters:
- scale- scale factor used to multiply errors
- Returns:
- a new copy of the histogram with rescaled errors on bin content.
 
 - 
binEntriespublic int binEntries(int index) Number of entries in a bin with index i- Parameters:
- index- Bin index
- Returns:
- Number of entries
 
 - 
binEntriespublic int[] binEntries() Get all entries of the histogram as an array- Returns:
- array with histogram entries.
 
 - 
binErrorpublic double binError(int index) Error on the bin with index i- Parameters:
- index- Bin index
- Returns:
- Error
 
 - 
binHeightpublic double binHeight(int index) Height of the corresponding bin- Parameters:
- index- Bin index
- Returns:
- Bin Height
 
 - 
binHeightspublic double[] binHeights() Get all heights of the histogram as an array- Returns:
- array with histogram heights.
 
 - 
binErrorspublic double[] binErrors() Get all bin errors of the histogram as an array- Returns:
- array with histogram errors.
 
 - 
binMeanpublic double binMean(int index) Mean in a single bin with index- Parameters:
- index- Bin index
- Returns:
- Mean value inside of this bin
 
 - 
binRmspublic double binRms(int index) RMS of a single bin with index- Parameters:
- index- Bin index
- Returns:
- RMS of this bin
 
 - 
maxBinHeightpublic double maxBinHeight() Max value of all bins- Returns:
- Max value
 
 - 
minBinHeightpublic double minBinHeight() Min value of all bins- Returns:
- Min value
 
 - 
sumAllBinHeightspublic double sumAllBinHeights() Sum of all heights- Returns:
- Sum of all Heights
 
 - 
integralpublic double integral() Sum of all heights multiplied by the bin size.- Returns:
- Sum of all heights times bin size.
 
 - 
findBinpublic int findBin(double x) Convert a coordinate on the axis to a bin number- Parameters:
- x- coordinate on axis
- Returns:
- index of the corresponding bin
 
 - 
integralpublic double integral(int BinMin, int BinMax, boolean timesBinWidth)Integrate a histogram between two bin indices (between 1 and max number) The integral is computed as the sum of bin contents in the range if the last parameter is false. If it is true, the integral is the sum of the bin contents multiplied by the bin width in x.- Parameters:
- BinMin- Min index for integration starting from 1 (included to integration)
- BinMax- Max index for integration (start from 1, included to integration)
- timesBinWidth- If true, the integral is the sum of the bin contents multiplied by the bin width in x.
- Returns:
- integral (sum of all heights)
 
 - 
integralpublic double integral(int BinMin, int BinMax)Integrate a histogram between two bin indices (between 1 and max number) By default the integral is computed as the sum of bin contents in the range.- Parameters:
- BinMin- Min index for integration starting from 1 (included to integration)
- BinMax- Max index for integration (included to integration)
- Returns:
- integral (sum of all heights)
 
 - 
integralRegionpublic double integralRegion(double xmin, double xmax, boolean timesBinWidth)Integrate histogram in a region between Xmin and Xmax. This will sum up all bin content between the regions.- Parameters:
- Xmin- Min index for integration
- Xmax- Max index for integration
- timesBinWidth- if true, multiply by the bin width.
- Returns:
- integral (sum of all heights)
 
 - 
integralRegionpublic double integralRegion(double xmin, double xmax)Integrate histogram in a region between Xmin and Xmax. This will sum up all bin content between the regions.- Parameters:
- Xmin- Min index for integration
- Xmax- Max index for integration
- Returns:
- integral (sum of all heights)
 
 - 
getProbabilitypublic H1D getProbability() Return q probability distribution derived from a histogram. The histogram is scaled by the sum of all contents.- Returns:
- probability distribution
 
 - 
getDividedByBinWidthpublic H1D getDividedByBinWidth() Divide heights of each bin by the bin width. Variable bin sizes are supported. Statistics of the histogram should be treated with care.- Returns:
- new histogram after the division by bin width.
 
 - 
getDensitypublic H1D getDensity() Get a density distribution dividing each bin of the histogram by the bin width and the total number of heights for all bins. Variable bin sizes are supported. Statistics of the histogram should be treated with care. This disreibution is normalized to 1.- Returns:
- new histogram with density distribution
 
 - 
compareChi2public java.util.Map<java.lang.String,java.lang.Double> compareChi2(F1D f1) Compare the histogram with a function. The comparison tests hypotheses that the histogram represent identical distribution with a function using Pearson's chi-squared test. The number chi2/ndf gives the estimate (values close to 1 indicates similarity between 2 histograms.). the function and histogram are identical if chi2=0. Chi2/ndf and p-value probability is 1. Maken sure that statistical errors are included correctly. Data with zero errors will be ignored.- Parameters:
- f1- function to compare to.
- Returns:
- map with the result. It gives Chi2, gives number of degrees of freedom (ndf), probability ("quality", or p-value).
 
 - 
compareChi2public java.util.Map<java.lang.String,java.lang.Double> compareChi2(H1D h2) Compare two histograms. Comparison of two histograms test hypotheses that two histograms represent identical distributions. It calculates Chi2 between 2 histograms taking into account errors on the heights of the bins. The number chi2/ndf gives the estimate (values close to 1 indicates similarity between 2 histograms.) Two histograms are identical if chi2=0. Chi2/ndf and p-value probability is 1. Make sure that both histograms have error (or set them to small values).- Parameters:
- h2- second histogram to compare to.
- Returns:
- map with the result. It gives Chi2, gives number of degrees of freedom (ndf), probability ("quality", or p-value).
 
 - 
operpublic H1D oper(H1D a, java.lang.String what) Various manipulations with histograms (+,-,*,/). Keep the original title. No new histogram object created.- Parameters:
- a- H1D histogram.
- what- String representing the operation: "+" add a histogram to the original "-" subtract a histogram from the original "*" multiply "/" divide
- Returns:
- modified H1D histogram
 
 - 
getValuespublic double[][] getValues(int mode) Get positions in X,Y and Errors. For x, we take mean values- Parameters:
- mode- if =1, take center of the bins. In all other cases - mean value in each bin
- Returns:
- array with X,Y, and Error on Y, double[3][bins];
 
 - 
operpublic H1D oper(H1D a, java.lang.String title, java.lang.String what) Various manipulations with histograms (+,-,*,/). Note: no new object will be created.- Parameters:
- a- H1D histogram.
- title- New Title
- Returns:
- same H1D object but modified
 
 - 
getStatParameterspublic java.lang.String[] getStatParameters() Get statistical parameters of a Histogram as a list of strings- Parameters:
- h1- histogram H1D
- Returns:
- list of with mean, RMS etc.
 
 - 
docpublic void doc() Show online documentation.
 
- 
 
- 
DMelt 3.0 © DataMelt by jWork.ORG