|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hep.analysis.AbstractNamedObject | +--hep.analysis.Histogram
Class Histogram is used by user analysis programs to create and fill a wide variety of histograms. Histograms must each have unique names assigned to them at creation time.
Each histogram must have its own partition. You can set the partition using
the setPartition()
method, but if you don't, a default partition
will be selected the first time you invoke a fill(..)
method.
The partition used will depend on which fill method you call.
The Histogram class is designed to be easy to fill. If you want to be able to
extract information about a histogram after you have filled it you would probably
do better to use one of the subclasses of Histogram, which have extra convenience
functions for accessing information about the histogram.
Inner classes inherited from class hep.analysis.NamedObject |
NamedObject.RenameException |
Field Summary | |
protected Partition |
m_partition
|
Fields inherited from class hep.analysis.AbstractNamedObject |
m_parent |
Constructor Summary | |
Histogram(java.lang.String name)
Create a new histogram. |
|
Histogram(java.lang.String name,
HistogramFolder parent)
Create a new histogram in a folder. |
|
Histogram(java.lang.String name,
HistogramFolder parent,
Partition partition)
Create a new histogram in a specified folder and with the specified Partition |
|
Histogram(java.lang.String name,
Partition partition)
Create a histogram with a specified partition in the current default histogram folder. |
Method Summary | |
void |
clear()
Clears the histogram contents |
void |
fill(java.util.Date x)
Fill a histogram with a single date. |
void |
fill(java.util.Date x,
double y)
|
void |
fill(double x)
Fill a histogram with a single double. |
void |
fill(double x,
double y)
|
void |
fill(int x)
Fill a histogram with a single int. |
void |
fill(java.lang.String x)
Fill a histogram with a single string. |
void |
fillW(java.util.Date x,
double value)
Fill a histogram with a single date. |
void |
fillW(java.util.Date x,
double y,
double weight)
|
void |
fillW(double x,
double value)
Fill a histogram with a single double. |
void |
fillW(double x,
double y,
double weight)
|
void |
fillW(int x,
double value)
Fill a histogram with a single int. |
void |
fillW(java.lang.String x,
double value)
Fill a histogram with a single string. |
static Histogram |
find(java.lang.String name)
Returns the Histogram object with the given name. |
static Histogram |
find(java.lang.String name,
HistogramFolder parent)
Returns the Histogram object with the given name. |
protected Folder |
getDefaultParent()
Get default parent is called when an object is read in with no parent Folder. |
int |
getEntries()
Get the number of times this histogram has been filled |
Partition |
getPartition()
Returns the partition used by this histogram. |
Style |
getStyle()
Get the histogram style |
boolean |
isClearOnRewind()
True if the histogram should be cleared when the data is rewound |
void |
partitionDestroyedNotify()
Notifies the histogram that the partition has been destroyed. |
void |
setClearOnRewind(boolean value)
Sets if the histogram should be cleared when the data is rewound. |
void |
setPartition(Partition p)
Use this method to set the partition for this histogram. |
void |
setStyle(Style style)
|
void |
show()
Requests that this histogram be made visible to the user. |
java.lang.String |
toString()
|
Methods inherited from class hep.analysis.AbstractNamedObject |
delete, getFolder, getName, rename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Partition m_partition
Constructor Detail |
public Histogram(java.lang.String name)
name
- The name of the histogram. If a histogram of this name
already exists its contents are cleared and a reference
to the previously existing histogram is returned.public Histogram(java.lang.String name, HistogramFolder parent)
name
- The name of the histogram. If a histogram of this name
already exists its contents are cleared and a reference
to the previously existing histogram is returned.parent
- the HistogramFolder in which to store this Hsitogrampublic Histogram(java.lang.String name, Partition partition)
public Histogram(java.lang.String name, HistogramFolder parent, Partition partition)
Method Detail |
public void fill(double x)
x
- X coordinateSimplePartition
public void fillW(double x, double value)
x
- X coordinatevalue
- Value (weight) to be assigned to this fill operationSimplePartition
public void fill(int x)
x
- X coordinateSimpleIntPartition
public void fillW(int x, double value)
x
- X coordinatevalue
- Value (weight) to be assigned to this fill operationSimpleIntPartition
public void fill(java.lang.String x)
x
- String value to fillStringPartition
public void fillW(java.lang.String x, double value)
x
- String value to fillvalue
- Value (weight) to be assigned to this fill operationStringPartition
public void fill(java.util.Date x)
x
- Date value to fillSimpleDatePartition
public void fillW(java.util.Date x, double value)
x
- Date value to fillvalue
- Value (weight) to be assigned to this fill operationSimpleDatePartition
public void fill(double x, double y)
public void fillW(double x, double y, double weight)
public void fill(java.util.Date x, double y)
public void fillW(java.util.Date x, double y, double weight)
public void show()
public void clear()
public int getEntries()
public void setPartition(Partition p)
fill(..)
method. The
type of partition will depend on which fill(..)
method you use. See the notes on the individual
fill(..)
methods to see which default is used.public void partitionDestroyedNotify()
public Partition getPartition()
public static Histogram find(java.lang.String name)
name
- the name of the histogram to findname
.public static Histogram find(java.lang.String name, HistogramFolder parent)
name
- the name of the histogram to findparent
- the folder to look inname
.public java.lang.String toString()
toString
in class java.lang.Object
public void setStyle(Style style)
style
- The style to be used when displaying this histogrampublic Style getStyle()
protected Folder getDefaultParent()
AbstractNamedObject
getDefaultParent
in class AbstractNamedObject
public boolean isClearOnRewind()
public void setClearOnRewind(boolean value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |