FreeHEP API
Version v1.2.2

hep.aida.ref.histogram
Class Cloud1D

java.lang.Object
  |
  +--hep.aida.ref.event.AIDAObservable
        |
        +--hep.aida.ref.ManagedObject
              |
              +--hep.aida.ref.histogram.AbstractBaseHistogram
                    |
                    +--hep.aida.ref.histogram.Cloud
                          |
                          +--hep.aida.ref.histogram.Cloud1D
All Implemented Interfaces:
hep.aida.IBaseHistogram, hep.aida.ICloud, hep.aida.ICloud1D, hep.aida.dev.IDevManagedObject, hep.aida.IManagedObject, IsObservable

public class Cloud1D
extends Cloud
implements hep.aida.ICloud1D


Field Summary
protected  double sumOfWeights
           
 
Fields inherited from class hep.aida.ref.histogram.Cloud
arraySize, CLOUD_ARRAY_ENTRIES, convBins, maxEntries
 
Fields inherited from class hep.aida.ref.ManagedObject
fillable
 
Fields inherited from class hep.aida.ref.event.AIDAObservable
isValid
 
Constructor Summary
Cloud1D()
          Create a new Cloud1D
Cloud1D(String name, String title, int nMax, String options)
           
 
Method Summary
 void convert(double[] binEdges)
          Convert the ICloud to an IHistogram by specifying the bin edges.
 void convert(int nBins, double lowerEdge, double upperEdge)
          Convert the ICloud to an IHistogram.
 void convertToHistogram()
          Convert the ICloud to an IHistogram using the default number of bins.
 int entries()
          Get the Cloud's entries.
 void fill(double value)
          Fill the Cloud with a new value with unit weight
 void fill(double value, double weight)
          Fill the Cloud with a new value with given weight
 void fillHistogram(hep.aida.IHistogram1D hist1d)
           
 hep.aida.IHistogram1D histogram()
          Get the Histogram representing the Cloud
 boolean isConverted()
          Has the Cloud been converted to a Histogram?
 double lowerEdge()
          Get the Cloud's lower edge.
 double mean()
          Get the Cloud's mean.
 void reset()
          Reset the histogram; as if just created.
 double rms()
          Get the Cloud's rms.
 void scale(double scaleFactor)
          Scale the weights by a given factor.
 void setHistogram(hep.aida.IHistogram1D hist)
          Set the Histogram representation of the Cloud.
 void setLowerEdge(double lowerEdge)
          Set the Cloud's lower edge
 void setUpperEdge(double upperEdge)
          Set the Cloud's upper edge
 double sumOfWeights()
          Get the sum of weights of of all the entries
 hep.aida.IHistogram1D toShowableHistogram(int nBins, double lowerEdge, double upperEdge, boolean useMargin)
          Represent the Cloud as a Histogram.
 double upperEdge()
          Get the Cloud's upper edge.
 double value(int index)
          Get a given value from the Cloud.
 double weight(int index)
          Get a given weight from the Cloud.
 
Methods inherited from class hep.aida.ref.histogram.Cloud
autoConvert, createEvent, getOptions, initCloud, margin, maxEntries
 
Methods inherited from class hep.aida.ref.histogram.AbstractBaseHistogram
annotation, dimension, setAnnotation, setTitle, title
 
Methods inherited from class hep.aida.ref.ManagedObject
getAIDAType, isFillable, name, setFillable, setName
 
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, fireStateChanged, fireStateChanged, removeListener, setIsValidAfterNotify, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.aida.ICloud
maxEntries
 
Methods inherited from interface hep.aida.IBaseHistogram
annotation, dimension, setTitle, title
 
Methods inherited from interface hep.aida.ref.event.IsObservable
addListener, removeListener, setValid
 

Field Detail

sumOfWeights

protected double sumOfWeights
Constructor Detail

Cloud1D

public Cloud1D()
Create a new Cloud1D


Cloud1D

public Cloud1D(String name,
               String title,
               int nMax,
               String options)
Method Detail

fill

public void fill(double value)
Fill the Cloud with a new value with unit weight

Specified by:
fill in interface hep.aida.ICloud1D
Parameters:
value - The value to add to the Cloud.
Returns:
true if the fill was successful.

fill

public void fill(double value,
                 double weight)
Fill the Cloud with a new value with given weight

Specified by:
fill in interface hep.aida.ICloud1D
Parameters:
value - The value to add to the Cloud.
weight - The value's weight.
Returns:
true if the fill was successful.

lowerEdge

public double lowerEdge()
Get the Cloud's lower edge.

Specified by:
lowerEdge in interface hep.aida.ICloud1D
Returns:
The Cloud's lower edge.

upperEdge

public double upperEdge()
Get the Cloud's upper edge.

Specified by:
upperEdge in interface hep.aida.ICloud1D
Returns:
The Cloud's upper edge.

setUpperEdge

public void setUpperEdge(double upperEdge)
Set the Cloud's upper edge

Parameters:
upperEdge - The Cloud's upper edge.

setLowerEdge

public void setLowerEdge(double lowerEdge)
Set the Cloud's lower edge

Parameters:
lowerEdge - The Cloud's lower edge.

value

public double value(int index)
Get a given value from the Cloud.

Specified by:
value in interface hep.aida.ICloud1D
Parameters:
index - The value's index.
Returns:
The Cloud's corresponding value.
Throws:
RuntimeException - if the Cloud has been converted

weight

public double weight(int index)
Get a given weight from the Cloud.

Specified by:
weight in interface hep.aida.ICloud1D
Parameters:
index - The weight's index.
Returns:
The Cloud's corresponding weight.
Throws:
RuntimeException - if the Cloud has been converted

mean

public double mean()
Get the Cloud's mean.

Specified by:
mean in interface hep.aida.ICloud1D
Returns:
The Cloud's mean.

rms

public double rms()
Get the Cloud's rms.

Specified by:
rms in interface hep.aida.ICloud1D
Returns:
The Cloud's rms.

entries

public int entries()
Get the Cloud's entries.

Specified by:
entries in interface hep.aida.IBaseHistogram
Specified by:
entries in class AbstractBaseHistogram
Returns:
The Cloud's entries.

toShowableHistogram

public hep.aida.IHistogram1D toShowableHistogram(int nBins,
                                                 double lowerEdge,
                                                 double upperEdge,
                                                 boolean useMargin)
Represent the Cloud as a Histogram.

Parameters:
nBins - The Histogram's number of bins.
lowerEdge - The Histogram's lower edge.
upperEdge - The Histogram's upper edge.
Returns:
The Histogram representing the Cloud.

convert

public void convert(int nBins,
                    double lowerEdge,
                    double upperEdge)
Convert the ICloud to an IHistogram.

Specified by:
convert in interface hep.aida.ICloud1D

convert

public void convert(double[] binEdges)
Convert the ICloud to an IHistogram by specifying the bin edges.

Specified by:
convert in interface hep.aida.ICloud1D

isConverted

public boolean isConverted()
Has the Cloud been converted to a Histogram?

Specified by:
isConverted in interface hep.aida.ICloud
Specified by:
isConverted in class Cloud
Returns:
true<\code> if the Cloud has been converted to a Histogram.

histogram

public hep.aida.IHistogram1D histogram()
                                throws RuntimeException
Get the Histogram representing the Cloud

Specified by:
histogram in interface hep.aida.ICloud1D
Returns:
the histogram.
Throws:
RuntimeException - if the histogram is not auto-convertible and "convert" has not been called.

setHistogram

public void setHistogram(hep.aida.IHistogram1D hist)
Set the Histogram representation of the Cloud.

Parameters:
hist - The Histogram representing the Cloud.

fillHistogram

public void fillHistogram(hep.aida.IHistogram1D hist1d)
Specified by:
fillHistogram in interface hep.aida.ICloud1D

reset

public void reset()
Description copied from class: Cloud
Reset the histogram; as if just created.

Specified by:
reset in interface hep.aida.IBaseHistogram
Overrides:
reset in class Cloud

convertToHistogram

public void convertToHistogram()
Description copied from class: Cloud
Convert the ICloud to an IHistogram using the default number of bins.

Specified by:
convertToHistogram in interface hep.aida.ICloud
Specified by:
convertToHistogram in class Cloud

scale

public void scale(double scaleFactor)
           throws IllegalArgumentException
Description copied from class: Cloud
Scale the weights by a given factor.

Specified by:
scale in interface hep.aida.ICloud
Specified by:
scale in class Cloud
Parameters:
scaleFactor - The scale factor.
IllegalArgumentException

sumOfWeights

public double sumOfWeights()
Get the sum of weights of of all the entries

Specified by:
sumOfWeights in interface hep.aida.ICloud
Specified by:
sumOfWeights in class Cloud
Returns:
The sum of the weights of all the entries.

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.