FreeHEP API
Version v1.2.2

hep.aida.ref.function
Class Variable

java.lang.Object
  |
  +--hep.aida.ref.function.Variable
All Implemented Interfaces:
IVariable

public class Variable
extends Object
implements IVariable

Implementaion of IVariable

Author:
Tony Johnson, Victor Serbo, Max Turri

Constructor Summary
Variable(String name, String label, double value)
          Create a new Variable.
Variable(String name, String label, double lowerBound, double upperBound)
          Create a new Variable.
Variable(String name, String label, double value, double lowerBound, double upperBound)
          Create a new Variable.
 
Method Summary
 void addRange(double lower, double upper)
          Add a new range to the existing range set for the IVariable.
 void addRange(IRange range)
          Add a new range to the existing range set for the IVariable.
 void connect(hep.aida.IEvaluator ev)
           
 void connect(hep.aida.ITuple data)
           
 hep.aida.ITuple connection()
           
 double error()
          Get the error on the IVariable.
 IRange getRange(int index)
          Get the Variable's ith ranges.
 boolean isConnected()
          Check if the IVariable is connected.
 boolean isDependent()
          Check if the IVariable represents variable or parameter.
 boolean isFixed()
          Get how the IVariable can be used in fitting.
 boolean isInRange()
          Check if current value of the IVariable is in the valid range set.
 boolean isInRange(double value)
          Check if provided value is in the IVariable valid range set.
 String label()
          Get label for this IVariable.
 String name()
          Get name for this IVariable.
 int nRanges()
          Get the number of ranges.
 void setDependent(boolean state)
          Set IVariable to represent variable or parameter.
 void setError(double error)
          Set the error on the IVariable.
 void setFixed(boolean state)
          Set how the IVariable can be used in fitting.
 void setRange(double lower, double upper)
          Set new range for the IVariable.
 void setStep(double step)
          Set the Variable's step size.
 void setUnits(String units)
          Set units.
 void setUseBounds(boolean state)
          Set how fitter should treat bounds for the IVariable.
 boolean setValue(double value)
          Set value for the IVariable.
 double step()
          Get the Variable's step size.
 String units()
          Get units.
 boolean useBounds()
          Get how fitter should treat bounds for the IVariable.
 double value()
          Get current value of the IVariable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable(String name,
                String label,
                double value)
Create a new Variable.

Parameters:
name - The variable's name.
label - The variable's label
value - The variable's value.

Variable

public Variable(String name,
                String label,
                double value,
                double lowerBound,
                double upperBound)
Create a new Variable.

Parameters:
name - The variable's name.
label - The variable's label
value - The variable's value.
lowerBound - The variable's lower bound.
upperBound - The variable's upper bound.

Variable

public Variable(String name,
                String label,
                double lowerBound,
                double upperBound)
Create a new Variable.

Parameters:
name - The variable's name.
label - The variable's label
lowerBound - The variable's lower bound.
upperBound - The variable's upper bound.
Method Detail

label

public String label()
Get label for this IVariable.

Specified by:
label in interface IVariable
Returns:
label.

name

public String name()
Get name for this IVariable.

Specified by:
name in interface IVariable
Returns:
name.

setValue

public boolean setValue(double value)
Set value for the IVariable.

Specified by:
setValue in interface IVariable
Parameters:
value - Value of IVariable.
Returns:
true if the value was set succesfully, false otherwise, for example if the IVariable is bounded and value is out of range.

value

public double value()
Get current value of the IVariable.

Specified by:
value in interface IVariable
Returns:
Current value of the IVariable.

error

public double error()
Get the error on the IVariable.

Specified by:
error in interface IVariable
Returns:
The Variable's error.

setError

public void setError(double error)
Set the error on the IVariable.


setRange

public void setRange(double lower,
                     double upper)
Set new range for the IVariable. All previous ranges are discarded first.

Specified by:
setRange in interface IVariable
Parameters:
lower - Lower edge of the valid range.
upper - Upper edge of the valid range.

addRange

public void addRange(double lower,
                     double upper)
Add a new range to the existing range set for the IVariable.

Specified by:
addRange in interface IVariable
Parameters:
lower - Lower edge of the valid range.
upper - Upper edge of the valid range.

addRange

public void addRange(IRange range)
Add a new range to the existing range set for the IVariable.

Parameters:
range - the IRange being added.

isInRange

public boolean isInRange()
Check if current value of the IVariable is in the valid range set.

Specified by:
isInRange in interface IVariable
Returns:
true if current value of the IVariable is in the valid range set.

isInRange

public boolean isInRange(double value)
Check if provided value is in the IVariable valid range set.

Specified by:
isInRange in interface IVariable
Parameters:
value - Value to be checked
Returns:
true if provided value is in the IVariable valid range set.

nRanges

public int nRanges()
Get the number of ranges.

Returns:
The number of ranges.

setDependent

public void setDependent(boolean state)
Set IVariable to represent variable or parameter.

Specified by:
setDependent in interface IVariable
Parameters:
state - true for variable, false for parameter

isDependent

public boolean isDependent()
Check if the IVariable represents variable or parameter.

Specified by:
isDependent in interface IVariable
Returns:
true if this is variable, false if this is parameter

setStep

public void setStep(double step)
Set the Variable's step size.

Specified by:
setStep in interface IVariable
Parameters:
step - The variable's step size.

step

public double step()
Get the Variable's step size.

Returns:
The Variable's step size.

setFixed

public void setFixed(boolean state)
Set how the IVariable can be used in fitting.

Specified by:
setFixed in interface IVariable
Parameters:
state - true for fixed parameter, false for variable parameter.

isFixed

public boolean isFixed()
Get how the IVariable can be used in fitting.

Specified by:
isFixed in interface IVariable
Returns:
true for fixed parameter, false for variable parameter.

setUseBounds

public void setUseBounds(boolean state)
Set how fitter should treat bounds for the IVariable.

Specified by:
setUseBounds in interface IVariable
Parameters:
state - true use bounds, false don't use bounds.

useBounds

public boolean useBounds()
Get how fitter should treat bounds for the IVariable.

Specified by:
useBounds in interface IVariable
Returns:
true use bounds, false don't use bounds.

connect

public void connect(hep.aida.ITuple data)
Specified by:
connect in interface IVariable

connect

public void connect(hep.aida.IEvaluator ev)
Specified by:
connect in interface IVariable

isConnected

public boolean isConnected()
Check if the IVariable is connected.

Specified by:
isConnected in interface IVariable
Returns:
true if IVariable is connected, false if IVariable is not connected.

connection

public hep.aida.ITuple connection()
Specified by:
connection in interface IVariable

setUnits

public void setUnits(String units)
Set units. Units can be used to annotate plot axis

Specified by:
setUnits in interface IVariable
Parameters:
units - String that describes units

units

public String units()
Get units. Units can be used to annotate plot axis

Specified by:
units in interface IVariable
Returns:
String that describes units

getRange

public IRange getRange(int index)
Get the Variable's ith ranges.

Parameters:
index - The IRange's index.
Returns:
The ith IRange.

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.