FreeHEP API
Version 3.2.1

hep.aida
Interface IDataPointSet


public interface IDataPointSet

Basic user-level interface class for holding and managing a single set of "data points".

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

Method Summary
 IDataPoint addPoint()
          Add a new empty IDataPoint at the end of the set.
 void addPoint(IDataPoint point)
          Add a copy of an IDataPoint at the end of the set.
 IAnnotation annotation()
          Get the IAnnotation of the IDataPointSet.
 void clear()
          Remove all the IDataPoints in the set.
 int dimension()
          Get the dimension of the IDataPoints that can be stored in the set.
 double lowerExtent(int coord)
          Get the lower value for a give axis.
 IDataPoint point(int index)
          Get the IDataPoint at a give index in the set.
 void removePoint(int index)
          Remove the IDataPoint at a given index.
 void scale(double scaleFactor)
          Scales the values and the errors of all the measurements of each point by a given factor.
 void scaleErrors(double scaleFactor)
          Scales the errors of all the measurements of each point by a given factor.
 void scaleValues(double scaleFactor)
          Scales the values of all the measurements of each point by a given factor.
 void setCoordinate(int coord, double[] val, double[] err)
          Set the values and errors of a given coordinate all at once.
 void setCoordinate(int coord, double[] val, double[] errp, double[] errm)
          Set the values and errors of a given coordinate all at once.
 void setTitle(String title)
          Set the title of the IDataPointSet.
 int size()
          Get the current size of the IDataPointSet, i.e.
 String title()
          Get the title of the IDataPointSet.
 double upperExtent(int coord)
          Get the upper value for a give axis.
 

Method Detail

annotation

public IAnnotation annotation()
Get the IAnnotation of the IDataPointSet.

Returns:
The IAnnotation.

title

public String title()
Get the title of the IDataPointSet.

Returns:
The title.

setTitle

public void setTitle(String title)
              throws IllegalArgumentException
Set the title of the IDataPointSet.

Parameters:
title - The new title.
Throws:
IllegalArgumentException - If the title cannot be set.

dimension

public int dimension()
Get the dimension of the IDataPoints that can be stored in the set.

Returns:
The dimension of the IDataPoints storable in the set.

clear

public void clear()
Remove all the IDataPoints in the set. After this the IDataPointSet is as just created.


size

public int size()
Get the current size of the IDataPointSet, i.e. the number of IDataPoints contained in the set.

Returns:
The size of the IDataPointSet.

point

public IDataPoint point(int index)
Get the IDataPoint at a give index in the set.

Parameters:
index - The IDataPoint index.
Returns:
The corresponding IDataPoint.

setCoordinate

public void setCoordinate(int coord,
                          double[] val,
                          double[] err)
                   throws IllegalArgumentException
Set the values and errors of a given coordinate all at once. If this method is called on an empty IDataPointSet, a number of points equal to the size of the arrays provided is created; if the IDataPointSet is not empty the dimension of the array must match with the size of the IDataPointSet.

Parameters:
coord - The coordinate's index
val - The array of the values for the given coordinate
err - The array with the symmetric errors.
Throws:
IllegalArgumentException - if an illegal coordinate is provided or if there is a mismatch between the size of the array and the size of the IDataPointSet.

setCoordinate

public void setCoordinate(int coord,
                          double[] val,
                          double[] errp,
                          double[] errm)
                   throws IllegalArgumentException
Set the values and errors of a given coordinate all at once. If this method is called on an empty IDataPointSet, a number of points equal to the size of the arrays provided is created; if the IDataPointSet is not empty the dimension of the array must match with the size of the IDataPointSet.

Parameters:
coord - The coordinate's index
val - The array of the values for the given coordinate
errp - The array with the plus errors.
errm - The array with the minus errors.
Throws:
IllegalArgumentException - if an illegal coordinate is provided or if there is a mismatch between the size of the array and the size of the IDataPointSet.

addPoint

public IDataPoint addPoint()
                    throws RuntimeException
Add a new empty IDataPoint at the end of the set.

Returns:
The newly added point.
Throws:
RuntimeException - If a new IDataPoint cannot be added to the set.

addPoint

public void addPoint(IDataPoint point)
              throws IllegalArgumentException
Add a copy of an IDataPoint at the end of the set.

Parameters:
point - The IDataPoint to be added.
Throws:
IllegalArgumentException - If the point has the wrong dimension or if the point cannot be added.

removePoint

public void removePoint(int index)
                 throws IllegalArgumentException
Remove the IDataPoint at a given index.

Parameters:
index - The index of the IDataPoint to be removed.
Throws:
IllegalArgumentException - If the index is < 0 or >= size().

lowerExtent

public double lowerExtent(int coord)
                   throws IllegalArgumentException
Get the lower value for a give axis.

Parameters:
coord - The coordinate of the axis.
Returns:
The lower edge of the corresponding axis.
Throws:
IllegalArgumentException - if coord < 0 or coord >= dimension() or if the set is empty.

upperExtent

public double upperExtent(int coord)
                   throws IllegalArgumentException
Get the upper value for a give axis.

Parameters:
coord - The coordinate of the axis.
Returns:
The upper edge of the corresponding axis.
Throws:
IllegalArgumentException - if coord < 0 or coord >= dimension() or if the set is empty.

scale

public void scale(double scaleFactor)
           throws IllegalArgumentException
Scales the values and the errors of all the measurements of each point by a given factor.

Parameters:
scaleFactor - The scale factor.
Throws:
IllegalArgumentException - If an illegal scaleFactor is provided.

scaleValues

public void scaleValues(double scaleFactor)
                 throws IllegalArgumentException
Scales the values of all the measurements of each point by a given factor.

Parameters:
scaleFactor - The scale factor.
Throws:
IllegalArgumentException - If an illegal scaleFactor is provided.

scaleErrors

public void scaleErrors(double scaleFactor)
                 throws IllegalArgumentException
Scales the errors of all the measurements of each point by a given factor.

Parameters:
scaleFactor - The scale factor.
Throws:
IllegalArgumentException - If an illegal scaleFactor is provided.

FreeHEP API
Version 3.2.1

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