FreeHEP API
Version current

hep.aida.ref.histogram
Class Histogram

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.Histogram
All Implemented Interfaces:
Connectable, hep.aida.IBaseHistogram, hep.aida.dev.IDevManagedObject, hep.aida.IHistogram, hep.aida.IManagedObject, IsObservable
Direct Known Subclasses:
Histogram1D, Histogram2D, Histogram3D

public abstract class Histogram
extends AbstractBaseHistogram
implements hep.aida.IHistogram, IsObservable

Source Code:
Histogram.java

Field Summary
protected  int allEntries
           
protected  boolean isFillable
           
protected  double sumOfWeights
           
protected  double sumOfWeightsSquared
           
protected  int validEntries
           
protected static int X_AXIS
           
protected static int Y_AXIS
           
protected static int Z_AXIS
           
 
Fields inherited from class hep.aida.ref.ManagedObject
fillable
 
Fields inherited from class hep.aida.ref.event.AIDAObservable
connectionDidChange, isConnected, isValid
 
Constructor Summary
protected Histogram(String name, String title, int dimension, String options)
          Create a new Histogram.
 
Method Summary
 int allEntries()
          Get all the entries in the Histogram, i.e. the number of times the method fill was called.
protected  EventObject createEvent()
           
 int entries()
          Get the entries that are within the range of the Histogram; i.e. all the entries (the number of times the fill method was called) minus the entries in the overflow or underflow bins.
 double equivalentBinEntries()
          Get the number of equivalent entries; i.e.
abstract  int extraEntries()
          Get the number of entries in the underflow and overflow bins.
protected  int mapBinNumber(int index, hep.aida.IAxis axis)
          Utility method to map the bin number from the external representation (from -2 to nBins-1 where -2 is the overflow and -1 is the underflow) to the internal one (from 0 to nBins+1 where 0 is the underflow and nBins+1 if the overflow bin)
abstract  double maxBinHeight()
          Get the maximum height of in-range bins in the Histogram.
abstract  double minBinHeight()
          Get the minimum height of in-range bins in the Histogram.
 int nanEntries()
          Number of entries whose coordinate or weight is NaN.
protected  String options()
           
 void reset()
          Reset the Histogram.
abstract  void scale(double scaleFactor)
          Scale the weights and the errors by a given factor.
 void setNEntries(int entries)
           
protected  void setUseOutflows(boolean useOutflows)
           
 void setValidEntries(int entries)
           
abstract  double sumAllBinHeights()
          Get the sum of the bin heights for all the entries, in-range and out-range ones.
 double sumBinHeights()
          Get the sum of the bin heights for in-range entries.
abstract  double sumExtraBinHeights()
          Get the sum of the bin heights for all the entries outside the Histogram's range.
protected  boolean useOutflows()
           
 
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.IBaseHistogram
annotation, dimension, 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

X_AXIS

protected static final int X_AXIS
See Also:
Constant Field Values

Y_AXIS

protected static final int Y_AXIS
See Also:
Constant Field Values

Z_AXIS

protected static final int Z_AXIS
See Also:
Constant Field Values

allEntries

protected int allEntries

validEntries

protected int validEntries

sumOfWeights

protected double sumOfWeights

sumOfWeightsSquared

protected double sumOfWeightsSquared

isFillable

protected boolean isFillable
Constructor Detail

Histogram

protected Histogram(String name,
                    String title,
                    int dimension,
                    String options)
Create a new Histogram.

Parameters:
name - The name of the Histogram as a ManagedObject.
title - The title of the Histogram.
dimension - The dimension of the Histogram.
Method Detail

createEvent

protected EventObject createEvent()
Overrides:
createEvent in class AIDAObservable

reset

public void reset()
Reset the Histogram. After calling this method the Histogram is as it was just created.

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

entries

public int entries()
Get the entries that are within the range of the Histogram; i.e. all the entries (the number of times the fill method was called) minus the entries in the overflow or underflow bins.

Specified by:
entries in interface hep.aida.IBaseHistogram
Specified by:
entries in class AbstractBaseHistogram
Returns:
The in-range entries.

allEntries

public int allEntries()
Get all the entries in the Histogram, i.e. the number of times the method fill was called.

Specified by:
allEntries in interface hep.aida.IHistogram
Returns:
All the entries in the Histogram.

extraEntries

public abstract int extraEntries()
Get the number of entries in the underflow and overflow bins.

Specified by:
extraEntries in interface hep.aida.IHistogram
Returns:
The number of entries outside the range of the Histogram.

equivalentBinEntries

public double equivalentBinEntries()
Get the number of equivalent entries; i.e. SUM[ weight ] ^ 2 / SUM[ weight^2 ].

Specified by:
equivalentBinEntries in interface hep.aida.IHistogram
Returns:
The equivalent bin entries.

sumBinHeights

public double sumBinHeights()
Get the sum of the bin heights for in-range entries.

Specified by:
sumBinHeights in interface hep.aida.IHistogram
Returns:
The sum of the bin heights.

sumAllBinHeights

public abstract double sumAllBinHeights()
Get the sum of the bin heights for all the entries, in-range and out-range ones.

Specified by:
sumAllBinHeights in interface hep.aida.IHistogram
Returns:
The sum of all the bin's heights.

sumExtraBinHeights

public abstract double sumExtraBinHeights()
Get the sum of the bin heights for all the entries outside the Histogram's range.

Specified by:
sumExtraBinHeights in interface hep.aida.IHistogram
Returns:
The sum of the out of range bin's heights.

minBinHeight

public abstract double minBinHeight()
Get the minimum height of in-range bins in the Histogram.

Specified by:
minBinHeight in interface hep.aida.IHistogram
Returns:
The minimum bin height for in range bins.

maxBinHeight

public abstract double maxBinHeight()
Get the maximum height of in-range bins in the Histogram.

Specified by:
maxBinHeight in interface hep.aida.IHistogram
Returns:
The maximum bin height for in range bins.

scale

public abstract void scale(double scaleFactor)
Scale the weights and the errors by a given factor.

Specified by:
scale in interface hep.aida.IHistogram
Parameters:
scaleFactor - The scale factor.

mapBinNumber

protected int mapBinNumber(int index,
                           hep.aida.IAxis axis)
Utility method to map the bin number from the external representation (from -2 to nBins-1 where -2 is the overflow and -1 is the underflow) to the internal one (from 0 to nBins+1 where 0 is the underflow and nBins+1 if the overflow bin)

Parameters:
index - The bin number in the external representation.
axis - The axis to which the bin belongs to.
Returns:
The bin number in the internal representation.

setNEntries

public void setNEntries(int entries)

setValidEntries

public void setValidEntries(int entries)

options

protected String options()

useOutflows

protected boolean useOutflows()

setUseOutflows

protected void setUseOutflows(boolean useOutflows)

nanEntries

public int nanEntries()
Description copied from class: AbstractBaseHistogram
Number of entries whose coordinate or weight is NaN. Such entries are counted as allEntries but don't contribute to the statistics.

Specified by:
nanEntries in interface hep.aida.IBaseHistogram
Specified by:
nanEntries in class AbstractBaseHistogram
Returns:
The number of entries whose value or weight is NaN.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.