FreeHEP API
Version current

hep.aida.ref.histogram
Class FixedAxis

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

public class FixedAxis
extends Object
implements hep.aida.IAxis

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

Version:
$Id: FixedAxis.java,v 1.5 2005/06/04 00:38:02 turri Exp $
Author:
The AIDA team @ SLAC.
Source Code:
FixedAxis.java

Field Summary
 
Fields inherited from interface hep.aida.IAxis
OVERFLOW_BIN, UNDERFLOW_BIN
 
Constructor Summary
FixedAxis(int bins, double min, double max)
          Create an Axis
 
Method Summary
 double binCenter(int index)
           
 double binLowerEdge(int index)
          Get the lower edge of a bin.
 int bins()
          Get the number of bins in the Axis.
 double binUpperEdge(int index)
          Get the upper edge of a bin.
 double binWidth(int index)
          Get the bin width.
 int coordToIndex(double coord)
          Get the bin's index corresponding to an axis's value.
 boolean equals(Object o)
          Check if two Axis are equal.
 boolean isFixedBinning()
           
 double lowerEdge()
          Get the Axis lower edge.
 double upperEdge()
          Get the Axis upper edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedAxis

public FixedAxis(int bins,
                 double min,
                 double max)
Create an Axis

Parameters:
bins - Number of bins
min - Minimum for axis
max - Maximum for axis
Method Detail

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.

binCenter

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

bins

public int bins()
Get the number of bins in the Axis.

Specified by:
bins in interface hep.aida.IAxis
Returns:
the number of bins.

binLowerEdge

public double binLowerEdge(int index)
Get the lower edge of a bin.

Specified by:
binLowerEdge in interface hep.aida.IAxis
Parameters:
index - the bin's index
Returns:
the bin's lower edge. If index corresponds to the UNDERFLOW_BIN, Double.NEGATIVE_INFINITY is returned. If index corresponds to OVERFLOW_BIN, the upper edge of the axis is returned.

binUpperEdge

public double binUpperEdge(int index)
Get the upper edge of a bin.

Specified by:
binUpperEdge in interface hep.aida.IAxis
Parameters:
index - the bin's index
Returns:
the bin's upper edge. If index corresponds to the OVERFLOW_BIN, Double.POSITIVE_INFINITY is returned. If index corresponds to UNDERFLOW_BIN, the lower edge of the axis is returned.

binWidth

public double binWidth(int index)
Get the bin width.

Specified by:
binWidth in interface hep.aida.IAxis
Parameters:
index - the bin's index. For a Fixed Axis the bin's width is constant.
Returns:
the bin's width.

coordToIndex

public int coordToIndex(double coord)
Get the bin's index corresponding to an axis's value.

Specified by:
coordToIndex in interface hep.aida.IAxis
Parameters:
coord - an axis value
Returns:
the bin's index corresponding to coord

lowerEdge

public double lowerEdge()
Get the Axis lower edge.

Specified by:
lowerEdge in interface hep.aida.IAxis
Returns:
the axis lower edge

upperEdge

public double upperEdge()
Get the Axis upper edge.

Specified by:
upperEdge in interface hep.aida.IAxis
Returns:
the axis upper edge

isFixedBinning

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

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.