AIDA API
Version 3.3

hep.aida
Interface IHistogram1D

All Superinterfaces:
IBaseHistogram, IHistogram

public interface IHistogram1D
extends IHistogram

User level interface to 1D Histogram.

Author:
The AIDA team (http://aida.freehep.org/)

Method Summary
 void add(IHistogram1D hist)
          Add to this IHistogram1D the contents of another IHistogram1D.
 IAxis axis()
          Get the x axis of the IHistogram1D.
 int binEntries(int index)
          Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
 double binError(int index)
          The error of a given bin.
 double binHeight(int index)
          Total height of the corresponding bin (ie the sum of the weights in this bin).
 double binMean(int index)
          The weighted mean of a bin.
 int coordToIndex(double coord)
          Get the bin number corresponding to a given coordinate along the x axis.
 void fill(double x)
          Fill the IHistogram1D with a value and the corresponding weight.
 void fill(double x, double weight)
          Fill the IHistogram1D with a value and the corresponding weight.
 double mean()
          The mean of the in-range data of the IHistogram1D.
 double rms()
          The RMS of the in-range data of the IHistogram1D.
 
Methods inherited from interface hep.aida.IHistogram
allEntries, equivalentBinEntries, extraEntries, maxBinHeight, minBinHeight, scale, sumAllBinHeights, sumBinHeights, sumExtraBinHeights
 
Methods inherited from interface hep.aida.IBaseHistogram
annotation, dimension, entries, nanEntries, reset, setTitle, title
 

Method Detail

fill

public void fill(double x)
          throws IllegalArgumentException
Fill the IHistogram1D with a value and the corresponding weight. If either the value or the weight is NaN the entry will be recorded but it will not contribue to the statistics.

Parameters:
x - The value to be filled in.
Throws:
IllegalArgumentException - If the weight is <0 or >1 (?).

fill

public void fill(double x,
                 double weight)
          throws IllegalArgumentException
Fill the IHistogram1D with a value and the corresponding weight. If either the value or the weight is NaN the entry will be recorded but it will not contribue to the statistics.

Parameters:
x - The value to be filled in.
weight - The corresponding weight (by default 1).
Throws:
IllegalArgumentException - If the weight is <0 or >1 (?).

binMean

public double binMean(int index)
               throws IllegalArgumentException
The weighted mean of a bin.

Parameters:
index - The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
Returns:
The mean of the corresponding bin.
Throws:
IllegalArgumentException - If index is not a valid bin number.

binEntries

public int binEntries(int index)
               throws IllegalArgumentException
Number of entries in the corresponding bin (ie the number of times fill was called for this bin).

Parameters:
index - The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
Returns:
The number of entries in the corresponding bin.
Throws:
IllegalArgumentException - If index is not a valid bin number.

binHeight

public double binHeight(int index)
                 throws IllegalArgumentException
Total height of the corresponding bin (ie the sum of the weights in this bin).

Parameters:
index - The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
Returns:
The height of the corresponding bin.
Throws:
IllegalArgumentException - If index is not a valid bin number.

binError

public double binError(int index)
                throws IllegalArgumentException
The error of a given bin.

Parameters:
index - The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
Returns:
The error on the corresponding bin.
Throws:
IllegalArgumentException - If index is not a valid bin number.

mean

public double mean()
The mean of the in-range data of the IHistogram1D.

Returns:
The mean of the IHistogram1D.

rms

public double rms()
The RMS of the in-range data of the IHistogram1D.

Returns:
The RMS if the IHistogram1D.

axis

public IAxis axis()
Get the x axis of the IHistogram1D.

Returns:
The x coordinate IAxis.

coordToIndex

public int coordToIndex(double coord)
Get the bin number corresponding to a given coordinate along the x axis. This is a convenience method, equivalent to axis().coordToIndex(coord).

Parameters:
coord - The coordinalte along the x axis.
Returns:
The corresponding bin number.
See Also:
IAxis.coordToIndex(double)

add

public void add(IHistogram1D hist)
         throws IllegalArgumentException
Add to this IHistogram1D the contents of another IHistogram1D.

Parameters:
hist - The IHistogram1D to be added to this IHistogram1D.
Throws:
IllegalArgumentException - If the IHistogram1Ds binnings are incompatible.

AIDA API
Version 3.3

Copyright © 2000-2004 AIDA Team, All Rights Reserved.