FreeHEP API
Version current

hep.aida.ref.histogram
Class Cloud1D

java.lang.Object
  extended byhep.aida.ref.event.AIDAObservable
      extended byhep.aida.ref.ManagedObject
          extended byhep.aida.ref.histogram.AbstractBaseHistogram
              extended byhep.aida.ref.histogram.Cloud
                  extended byhep.aida.ref.histogram.Cloud1D
All Implemented Interfaces:
Connectable, 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

Source Code:
Cloud1D.java

Field Summary
protected  double sumOfWeights
           
 
Fields inherited from class hep.aida.ref.histogram.Cloud
arraySize, CLOUD_ARRAY_ENTRIES, maxEntries, validEntries
 
Fields inherited from class hep.aida.ref.ManagedObject
fillable
 
Fields inherited from class hep.aida.ref.event.AIDAObservable
connectionDidChange, isConnected, isValid
 
Constructor Summary
  Cloud1D()
          Create a new Cloud1D
protected Cloud1D(String name, String title, int nMax, String options)
          Create a new Cloud1D
 
Method Summary
 int conversionBins()
           
 double conversionLowerEdge()
           
 double conversionUpperEdge()
           
 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)
           
protected  hep.aida.IHistogram hist()
           
 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 lowerEdgeWithMargin()
           
 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 setConversionParameters(int bins, double lowerEdge, double upperEdge)
          Set the parameters for the ICloud conversion to an IHistogram.
 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
 double upperEdge()
          Get the Cloud's upper edge.
 double upperEdgeWithMargin()
           
 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, nanEntries
 
Methods inherited from class hep.aida.ref.histogram.AbstractBaseHistogram
annotation, dimension, setAnnotation, setTitle, title
 
Methods inherited from class hep.aida.ref.ManagedObject
isFillable, name, setFillable, setName, type
 
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, fireStateChanged, fireStateChanged, fireStateChanged, isConnected, removeAllListeners, removeListener, setConnected, setIsValidAfterNotify, setValid, setValidForAll
 
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, nanEntries, setTitle, title
 
Methods inherited from interface hep.aida.ref.event.IsObservable
addListener, removeAllListeners, removeListener, setValid
 
Methods inherited from interface hep.aida.ref.event.Connectable
isConnected, setConnected
 

Field Detail

sumOfWeights

protected double sumOfWeights
Constructor Detail

Cloud1D

public Cloud1D()
Create a new Cloud1D


Cloud1D

protected Cloud1D(String name,
                  String title,
                  int nMax,
                  String options)
Create a new Cloud1D

Parameters:
name - The Cloud's name.
title - The Cloud's title.
nMax - The maximum number of entries stored in the Cloud. If nMax is greater than zero the Cloud will be converted to an Histogram when the number of entries is more than nMax.
options - Some 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.

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.
Throws:
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.

lowerEdgeWithMargin

public double lowerEdgeWithMargin()

upperEdgeWithMargin

public double upperEdgeWithMargin()

hist

protected hep.aida.IHistogram hist()
Specified by:
hist in class Cloud

setConversionParameters

public void setConversionParameters(int bins,
                                    double lowerEdge,
                                    double upperEdge)
Set the parameters for the ICloud conversion to an IHistogram.

Specified by:
setConversionParameters in interface hep.aida.ICloud1D
Parameters:
bins - The number of bins of the conversion IHistogram.
lowerEdge - The lower edge of the conversion IHistogram.
upperEdge - The upper edge of the conversion IHistogram.

conversionBins

public int conversionBins()

conversionLowerEdge

public double conversionLowerEdge()

conversionUpperEdge

public double conversionUpperEdge()

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.