Package de.gsi.dataset
Interface Histogram
-
- All Superinterfaces:
DataSet,DataSetMetaData,EventSource,java.io.Serializable
- All Known Subinterfaces:
CategoryHistogram,Histogram1D
- All Known Implementing Classes:
AbstractHistogram,Histogram,Histogram2
public interface Histogram extends DataSet, DataSetMetaData
Specialized DataSet interface for storing and processing Histogram data. A histogram with bins 1...N is defined by n+1 values defining the steps between the bins. The bins can be equidistant or not. The bins 0 and N+1 have a special meaning and contain the data for data which is out of range. They are not drawn by default.- Author:
- rstein
-
-
Field Summary
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBinContent(int bin)Increment bin content by 1.voidaddBinContent(int bin, double w)Increment bin content by a weight w.intfindBin(double x, double y)intfindBin(double x, double y, double z)intfindBin(int dimIndex, double x)doublegetBinCenter(int dimIndex, int binIndex)doublegetBinContent(int bin)Return content of bin number bin.booleanisEquiDistant()voidreset()reset histogram content-
Methods inherited from interface de.gsi.dataset.DataSet
get, getAxisDescription, getAxisDescriptions, getDataCount, getDataLabel, getDimension, getIndex, getName, getStyle, getStyle, getValue, getValues, lock, recomputeLimits, set, set, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSetMetaData
getErrorList, getInfoList, getMetaInfo, getWarningList
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Method Detail
-
addBinContent
void addBinContent(int bin)
Increment bin content by 1. More...- Parameters:
bin- global bin ID
-
addBinContent
void addBinContent(int bin, double w)Increment bin content by a weight w. More...- Parameters:
bin- global bin IDw- weight
-
findBin
int findBin(double x, double y)- Parameters:
x- spatial real-valued coordinate in Xy- spatial real-valued coordinate in Y- Returns:
- bin index corresponding to spatial x and y coordinates
-
findBin
int findBin(double x, double y, double z)- Parameters:
x- spatial real-valued coordinate in Xy- spatial real-valued coordinate in Yz- spatial real-valued coordinate in Z- Returns:
- bin index corresponding to spatial x, y and z coordinates
-
findBin
int findBin(int dimIndex, double x)- Parameters:
dimIndex- the dimension indexx- spatial real-valued coordinate for dimension dimIndex- Returns:
- bin index corresponding to spatial x and y coordinates
-
getBinCenter
double getBinCenter(int dimIndex, int binIndex)- Parameters:
dimIndex- the dimension indexbinIndex- index- Returns:
- bin centre for axis with dimIndex
-
getBinContent
double getBinContent(int bin)
Return content of bin number bin. Convention for numbering bins For all histogram types: nbins, xlow, xup bin = 0; underflow bin bin = 1; first bin with low-edge xlow INCLUDED bin = nbins; last bin with upper-edge xup EXCLUDED bin = nbins+1; overflow bin- Parameters:
bin- the index- Returns:
- numeric bin content
-
isEquiDistant
boolean isEquiDistant()
- Returns:
- true if bin sizes are equal
-
reset
void reset()
reset histogram content
-
-