FreeHEP API
Version current

hep.aida.ref.histogram
Class VariableAxis

java.lang.Object
  extended byhep.aida.ref.histogram.VariableAxis
All Implemented Interfaces:
hep.aida.IAxis

public class VariableAxis
extends Object
implements hep.aida.IAxis

Variable-width axis; A reference implementation of hep.aida.IAxis.

Version:
1.0, 23/03/2000
Author:
The AIDA team @ SLAC.
Source Code:
VariableAxis.java

Field Summary
 
Fields inherited from interface hep.aida.IAxis
OVERFLOW_BIN, UNDERFLOW_BIN
 
Constructor Summary
VariableAxis(double[] edges)
          Constructs and returns an axis with the given bin edges.
 
Method Summary
 double binCenter(int index)
           
 double binLowerEdge(int index)
           
 int bins()
           
 double binUpperEdge(int index)
           
 double binWidth(int index)
           
 int coordToIndex(double coord)
           
 boolean equals(Object o)
          Check if two Axis are equal.
 boolean isFixedBinning()
           
 double lowerEdge()
           
protected static String toString(double[] array)
          Returns a string representation of the specified array.
 double upperEdge()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableAxis

public VariableAxis(double[] edges)
Constructs and returns an axis with the given bin edges. Example: edges = (0.2, 1.0, 5.0) yields an axis with 2 in-range bins [0.2,1.0), [1.0,5.0) and 2 extra bins [-inf,0.2), [5.0,inf].

Parameters:
edges - the bin boundaries the partition shall have; must be sorted ascending and must not contain multiple identical elements.
Throws:
IllegalArgumentException - if edges.length < 1.
Method Detail

binCenter

public double binCenter(int index)
Specified by:
binCenter in interface hep.aida.IAxis

binLowerEdge

public double binLowerEdge(int index)
Specified by:
binLowerEdge in interface hep.aida.IAxis

bins

public int bins()
Specified by:
bins in interface hep.aida.IAxis

binUpperEdge

public double binUpperEdge(int index)
Specified by:
binUpperEdge in interface hep.aida.IAxis

binWidth

public double binWidth(int index)
Specified by:
binWidth in interface hep.aida.IAxis

coordToIndex

public int coordToIndex(double coord)
Specified by:
coordToIndex in interface hep.aida.IAxis

lowerEdge

public double lowerEdge()
Specified by:
lowerEdge in interface hep.aida.IAxis

toString

protected static String toString(double[] array)
Returns a string representation of the specified array. The string representation consists of a list of the arrays's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space).

Returns:
a string representation of the specified array.

upperEdge

public double upperEdge()
Specified by:
upperEdge in interface hep.aida.IAxis

isFixedBinning

public boolean isFixedBinning()
Specified by:
isFixedBinning in interface hep.aida.IAxis

equals

public boolean equals(Object o)
Check if two Axis are equal.

Parameters:
o - the Object to check
Returns:
true if o is an instance of FixedAxis and it has the same number of bins, minimum and bin width.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.