|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.analysis.plot.OpenGraph
uchicago.src.sim.analysis.Histogram
public class Histogram
A histogram plot allowing the user to histogram data from a list of objects. Histogram works on a model / view pattern where the model is the hep.aida.ref.Histogram1D from the colt package. This differs from OpenHistogram in that the xaxis interval is not dynamic, allowing for empty bins. The xaxis interval can be fixed or variable. Note that this Histogram only plots a single dataset.
Histogram1D| Field Summary | |
|---|---|
protected BinDataSource |
dataSource
The data source for this Histogram |
protected java.text.NumberFormat |
format
|
protected java.util.List |
histList
|
protected hep.aida.ref.Histogram1D |
histogram
The actual Histogram model of which this is the view. |
protected int |
numBins
The number of bins in this Histogram |
protected boolean |
showStats
|
protected boolean |
xTickDrawn
|
| Fields inherited from class uchicago.src.sim.analysis.plot.OpenGraph |
|---|
CIRCLE, CROSS, DIAMOND, fileName, FILLED_CIRCLE, FILLED_DIAMOND, FILLED_SQUARE, FILLED_TRIANGLE, frame, HISTOGRAM, inNormalState, location, model, movieMaker, plot, PLUS_SIGN, SEQUENCE, SQUARE, title, TRIANGLE, xIncr, xMax, xMin, yIncr, yMax, yMin |
| Fields inherited from interface uchicago.src.sim.gui.MediaProducer |
|---|
MPEG, QUICK_TIME |
| Constructor Summary | |
|---|---|
Histogram(java.lang.String title,
double[] xedges)
Constructs a histogram with a variable xaxis interval. |
|
Histogram(java.lang.String title,
double[] xedges,
SimModel model)
Constructs a histogram with a variable xaxis interval. |
|
Histogram(java.lang.String title,
int numBins,
double min,
double max)
Constructs a histogram with a fixed xaxis interval. |
|
Histogram(java.lang.String title,
int numBins,
double min,
double max,
SimModel model)
Constructs a histogram with a fixed xaxis interval. |
|
| Method Summary | |
|---|---|
void |
createHistogramItem(java.lang.String name,
java.util.List list,
BinDataSource source)
Creates an item to be histogramed by this Histogram. |
void |
createHistogramItem(java.lang.String name,
java.util.List list,
BinDataSource source,
int maxIntegerDigits,
int maxFractionDigits)
Creates an item to be histogramed by this Histogram. |
void |
createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.Object bdsTarget,
java.lang.String bdsMethodName)
Creates an item to be histogrammed by this Histogram. |
void |
createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.Object bdsTarget,
java.lang.String bdsMethodName,
int maxIntegerDigits,
int maxFractionDigits)
Creates an item to be histogrammed by this Histogram. |
void |
createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.String listObjMethodName)
Creates an item to be histogrammed by this Histogram. |
void |
createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.String listObjMethodName,
int maxIntegerDigits,
int maxFractionDigits)
Creates an item to be histogrammed by this Histogram. |
hep.aida.ref.Histogram1D |
getHistogram()
Returns the Histogram1D object of which this Histogram is a view. |
boolean |
isStatsVisible()
Returns whether the stats are visible or not. |
void |
record()
Histograms the data from the HistogramItems without updating the display. |
void |
record(double[] data)
Histograms the specified data without updating the display. |
void |
record(cern.colt.list.DoubleArrayList data)
Histograms the specified data without updating the display. |
void |
setBarWidth(double width)
Sets the plot bar width in xaxis coordinates. |
void |
setStatsVisible(boolean isVisible)
Sets the statistics display on the plot to visible. |
void |
step()
Histograms the data from the histogram items and updates the displayed graph. |
void |
step(double[] data)
Histograms the specified double array and updates the graph. |
void |
step(cern.colt.list.DoubleArrayList data)
Histograms the specified DoubleArrayList and updates the graph. |
java.lang.String |
toString()
Returns a String representation of the histogram. |
void |
updateGraph()
Updates the graph. |
| Methods inherited from class uchicago.src.sim.analysis.plot.OpenGraph |
|---|
addMovieFrame, closeMovie, createBinDataSource, createListBinDataSource, createSequence, display, dispose, getAxisTitles, getSize, getTitle, getXIncrement, getXRange, getYIncrement, getYRange, setAxisTitles, setBars, setLocation, setMovieName, setSize, setSnapshotFileName, setXIncrement, setXRange, setXTick, setYIncrement, setYRange, takeSnapshot, updateXTick, zoom |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected hep.aida.ref.Histogram1D histogram
protected java.util.List histList
protected BinDataSource dataSource
protected int numBins
protected boolean xTickDrawn
protected boolean showStats
protected java.text.NumberFormat format
| Constructor Detail |
|---|
public Histogram(java.lang.String title,
int numBins,
double min,
double max)
Histogram("sample", 2, 0.0, 20.0)
contains two in-range bins and one bin for underflow and one
for overflow. The bin boundaries are [Double.NEGATIVE_INFINITY,0.0),
[0.0, 10.0), [10.0, 20.0), [20.0, Double.POSITIVE_INFINITY], the first
and last bins being for underflow and overflow. The height of the
overflow and underflow bins can be seen by setting setStatsVisible
to true.
title - the title of the histogramnumBins - the number of bins in the histogrammin - the minimum value of the histogram. Anything lower than
this value is put in the underflow bin.max - the maximum value of the histogram. Anything greater than
or equal to this value is put in the overflow bin.
public Histogram(java.lang.String title,
int numBins,
double min,
double max,
SimModel model)
Histogram("sample", 2, 0.0, 20.0, aModel)
contains two in-range bins and one bin for underflow and one
for overflow. The bin boundaries are [Double.NEGATIVE_INFINITY,0.0),
[0.0, 10.0), [10.0, 20.0), [20.0, Double.POSITIVE_INFINITY], the first
and last bins being for underflow and overflow. The height of the
overflow and underflow bins can be seen by setting setStatsVisible
to true.
title - the title of the histogramnumBins - the number of bins in the histogrammin - the minimum value of the histogram. Anything lower than
this value is put in the underflow bin.max - the maximum value of the histogram. Anything greater than
or equal to this value is put in the overflow bin.model - a reference to the model associated with this histogram.
public Histogram(java.lang.String title,
double[] xedges,
SimModel model)
Histogram("sample", new double[] { 10.0, 20.0, 22.0}, aModel)
contains two in-range bins and one bin for underflow and one
bin for overflow. Its boundaries are [Double.NEGATIVE_INFINITY,10.0),
[10.0, 20.0), [20.0, 22.0), [22.0, Double.POSITIVE_INFINITY], the first
and last bins being for underflow and overflow. The height of the
overflow and underflow bins can be seen by setting setStatsVisible
to true.Note that this doesn't display as well as it might. The scale of plot will show the appropriate amount of distance between an xaxis value of 0 and one of 10.
title - the title of the histogramxedges - the xaxis bin boundariesmodel - a reference to the model associated with this histogram.
public Histogram(java.lang.String title,
double[] xedges)
Histogram("sample", new double[] { 10.0, 20.0, 22.0})
contains two in-range bins and one bin for underflow and one
bin for overflow. Its boundaries are [Double.NEGATIVE_INFINITY,10.0),
[10.0, 20.0), [20.0, 22.0), [22.0, Double.POSITIVE_INFINITY], the first
and last bins being for underflow and overflow. The height of the
overflow and underflow bins can be seen by setting setStatsVisible
to true.
Note that this doesn't display as well as it might. The scale of
plot will show the appropriate amount of distance between an
xaxis value of 0 and one of 10.
title - the title of the histogramxedges - the xaxis bin boundaries| Method Detail |
|---|
public void setBarWidth(double width)
width - the width in xaxis coordinates.public void setStatsVisible(boolean isVisible)
isVisible - if true the stats will be visible, if not then they
won't be visiblepublic boolean isStatsVisible()
public hep.aida.ref.Histogram1D getHistogram()
public void createHistogramItem(java.lang.String name,
java.util.List list,
BinDataSource source)
name - the name of the itemlist - the list of objects that provided the data for the itemsource - the BinDataSource used to get the data from the objects
in the list.
public void createHistogramItem(java.lang.String name,
java.util.List list,
BinDataSource source,
int maxIntegerDigits,
int maxFractionDigits)
name - the name of the itemlist - the list of objects that provided the data for the itemsource - the BinDataSource used to get the data from the objects
in the list.maxIntegerDigits - the maximum number of digits before the
decimal point in the bin labels. A value of -1 will record all the digits.maxFractionDigits - the maximum number of digits after the
decimal point in the bin labels. A value of -1 will record all the digits.
public void createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.Object bdsTarget,
java.lang.String bdsMethodName)
name - the name of the itemlist - the list of objects that provided the data for the itembdsTarget - the target of the named methodbdsMethodName - the name of the method to call on the target
public void createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.Object bdsTarget,
java.lang.String bdsMethodName,
int maxIntegerDigits,
int maxFractionDigits)
name - the name of the itemlist - the list of objects that provided the data for the itembdsTarget - the target of the named methodbdsMethodName - the name of the method to call on the targetmaxIntegerDigits - the maximum number of digits before the
decimal point in the bin labels. A value of -1 will record all the digits.maxFractionDigits - the maximum number of digits after the
decimal point in the bin labels. A value of -1 will record all the digits.
public void createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.String listObjMethodName)
Note this method assumes that the specified list is not empty when this method is called.
name - the name of the itemlist - the list of objects that provided the data for the itemlistObjMethodName - the name of the method to be called on each
object in the list, the results of which are then histogrammed
public void createHistogramItem(java.lang.String name,
java.util.List list,
java.lang.String listObjMethodName,
int maxIntegerDigits,
int maxFractionDigits)
Note this method assumes that the specified list is not empty when this method is called.
name - the name of the itemlist - the list of objects that provided the data for the itemlistObjMethodName - the name of the method to be called on each
object in the list, the results of which are then histogrammedmaxIntegerDigits - the maximum number of digits before the
decimal point in the bin labels. A value of -1 will record all the digits.maxFractionDigits - the maximum number of digits after the
decimal point in the bin labels. A value of -1 will record all the digits.public void record()
record in class OpenGraphpublic void record(double[] data)
data - the double-s to histogrampublic void record(cern.colt.list.DoubleArrayList data)
data - the double-s to histogrampublic void step()
step in class OpenGraphpublic void step(double[] data)
data - the array of doubles to histogrampublic void step(cern.colt.list.DoubleArrayList data)
data - the DoubleList of doubles to histogrampublic java.lang.String toString()
toString in class java.lang.Objectpublic void updateGraph()
updateGraph in class OpenGraph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||