Package cnuphys.splot.pdata
Class HistoData
java.lang.Object
cnuphys.splot.pdata.HistoData
Xontainer class for histogram data
- Author:
- heddle
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(double value) Add a value to the histogramvoidclear()Clear the databooleanCheck whether we draw sqrt(n) statistical errorsdouble[]Get the means and standard deviationintgetBin(double val) Get the bin for a given value.doublegetBinMaxX(int bin) Get the "x" value of the right side of the bindoublegetBinMidValue(int bin) Get the "x" value of the middle of the bindoublegetBinMinX(int bin) Get the "x" value of the left side of the binlonggetCount(int bin) Get the count for a given binlong[]Get the countslongGet the number on entries in the histogram (excluding underflows and overflows)doublegetMaxX()Get the minimum value.doublegetMaxY()Get the maximum "y" value.doublegetMinX()Get the minimum "x" value.doublegetMinY()Get the minimum "y" value.getName()Get the name of the histogramintGet the number of binslongGet the number on entries in the histogram that were above the maximum valuestatic PolygonGetPolygon(PlotCanvas canvas, HistoData histo) Get the drawing polygonlongGet the total count, including the unders and overslongGet the number on entries in the histogram that were below the minimum valuevoidsetCount(double val, int count) Set a bin to a given countvoidsetDrawStatisticalErrors(boolean statErr) Set whether we draw sqrt(n) statistical errorsvoidSet the namevoidsetRmsInHistoLegend(boolean useRMS) Set whether we use rms or sigma in histogram legendsstatStr()A string displaying some statisticsstatic StringstatusString(PlotCanvas canvas, HistoData histo, Point mousePoint, Point2D.Double wp) Get the status stringbooleanCheck whether we use rms or sigma in histogram legends
- 
Field Details- 
XmlRootElementNameThe XML root element name- See Also:
 
 
- 
- 
Constructor Details- 
HistoDataThe data for a 1D histogram where the bin spacing is uniform.- Parameters:
- name- the curve name of the histogram
- valMin- the data min
- valMax- the data max
- numBins- the number of bins
 
- 
HistoDataThe data for a 1D histogram where the bin spacing is arbitrary (i.e., not uniform)- Parameters:
- name- the curve name of the histogram
- grid- the binning grid. It must be in ascending order but is otherwise arbitrary.
 
 
- 
- 
Method Details- 
getNameGet the name of the histogram- Returns:
- the name of the histogram
 
- 
setNameSet the name- Parameters:
- name- the name of the histogram
 
- 
getCountpublic long getCount(int bin) Get the count for a given bin- Parameters:
- bin- the bin
- Returns:
- the count for that bin
 
- 
clearpublic void clear()Clear the data
- 
getBasicStatisticspublic double[] getBasicStatistics()Get the means and standard deviation- Returns:
- an array with the mean in the 0 index, standard deviation is the 1 index, and rms in the 2 index
 
- 
statStrA string displaying some statistics- Parameters:
- useRms- if- trueuse rms, else use sigma
- Returns:
- a string with statistics info
 
- 
getCountspublic long[] getCounts()Get the counts- Returns:
- the counts array
 
- 
getGoodCountpublic long getGoodCount()Get the number on entries in the histogram (excluding underflows and overflows)- Returns:
- the number of entries
 
- 
getTotalCountpublic long getTotalCount()Get the total count, including the unders and overs- Returns:
- the total count, including the unders and overs
 
- 
getUnderCountpublic long getUnderCount()Get the number on entries in the histogram that were below the minimum value- Returns:
- the number of entries below the minimum value
 
- 
getOverCountpublic long getOverCount()Get the number on entries in the histogram that were above the maximum value- Returns:
- the number of entries above the maximum value
 
- 
getMinXpublic double getMinX()Get the minimum "x" value. This is the minimum of the range being binned.- Returns:
- the minimum "x" value
 
- 
getMaxXpublic double getMaxX()Get the minimum value. This is the maximum of the range being binned.- Returns:
- the minimum "x" value
 
- 
getMinYpublic double getMinY()Get the minimum "y" value. The y axis corresponds to "counts", so this always returns 0
- 
getMaxYpublic double getMaxY()Get the maximum "y" value. The y axis corresponds to "counts", so this always returns the count of the bin with the most counts.
- 
addpublic void add(double value) Add a value to the histogram- Parameters:
- value- the value to ad
 
- 
setCountpublic void setCount(double val, int count) Set a bin to a given count- Parameters:
- val- the x val will determine bin
- count- the count
 
- 
getNumberBinspublic int getNumberBins()Get the number of bins- Returns:
- the number of bins
 
- 
getBinMidValuepublic double getBinMidValue(int bin) Get the "x" value of the middle of the bin- Parameters:
- bin- the bin in question
- Returns:
- the mid value
 
- 
getBinMaxXpublic double getBinMaxX(int bin) Get the "x" value of the right side of the bin- Parameters:
- bin- the bin in question
- Returns:
- the x value of the right side
 
- 
getBinMinXpublic double getBinMinX(int bin) Get the "x" value of the left side of the bin- Parameters:
- bin- the bin in question
- Returns:
- the x value of the left side
 
- 
getBinpublic int getBin(double val) Get the bin for a given value. Will return the zero-based bin number or UNDERFLOW or OVERFLOW.- Parameters:
- val- the value.
- Returns:
- return the bin: [0..(numBin-1)] or an error
 
- 
statusStringpublic static String statusString(PlotCanvas canvas, HistoData histo, Point mousePoint, Point2D.Double wp) Get the status string- Parameters:
- canvas- the plot canvas
- histo- the histo data object
- mousePoint- where the mouse is
- wp- the data coordinates of the mouse
- Returns:
- a status string
 
- 
GetPolygonGet the drawing polygon- Parameters:
- canvas- the drawing canvas
- histo- the histo data
- Returns:
- the polygon
 
- 
setRmsInHistoLegendpublic void setRmsInHistoLegend(boolean useRMS) Set whether we use rms or sigma in histogram legends- Parameters:
- useRMS- if- trueuse rms, else use sigma
 
- 
useRmsInHistoLegendpublic boolean useRmsInHistoLegend()Check whether we use rms or sigma in histogram legends- Returns:
- trueuse rms, else use sigma
 
- 
setDrawStatisticalErrorspublic void setDrawStatisticalErrors(boolean statErr) Set whether we draw sqrt(n) statistical errors- Parameters:
- statErr- if- truedraw statistical errors
 
- 
drawStatisticalErrorspublic boolean drawStatisticalErrors()Check whether we draw sqrt(n) statistical errors- Returns:
- trueif- truedraw statistical errors
 
- 
maxBinString
 
-