jhpro.stat
Class DataKeeper

java.lang.Object
  extended by jhpro.stat.DataKeeper

public class DataKeeper
extends java.lang.Object

A convenient class to keep data with error for an internal representation. Can be filled from histograms or P1D.


Constructor Summary
DataKeeper(H1D h1d)
          Initialize from a histogram
DataKeeper(int size)
           
DataKeeper(P1D p1d)
          Initialize from a P1D
 
Method Summary
 DataKeeper copy()
          Make a copy
 double getError(int index)
          Get error at index
 double[] getErrors()
           
 double getIntegral()
          Calculate integral, summing up all values
 int getSize()
          Get the size of container
 java.lang.String getTitle()
           
 double getValue(int index)
          Get value at index
 double[] getValues()
          Get values
 void scale(double factor)
          Scale all values and errors by a factor
 void scale(int index, double factor)
          Scale values and errors by a factor
 void setError(int index, double value)
          Set a error at index
 void setErrors(double[] errors)
           
 void setTitle(java.lang.String title)
           
 void setValue(int index, double value)
          Set a value at index
 void setValues(double[] values)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataKeeper

public DataKeeper(int size)

DataKeeper

public DataKeeper(P1D p1d)
Initialize from a P1D

Parameters:
p1d - input P1D

DataKeeper

public DataKeeper(H1D h1d)
Initialize from a histogram

Parameters:
h1d -
Method Detail

setTitle

public void setTitle(java.lang.String title)

getTitle

public java.lang.String getTitle()

setErrors

public void setErrors(double[] errors)

setValues

public void setValues(double[] values)

scale

public void scale(int index,
                  double factor)
Scale values and errors by a factor

Parameters:
index - index of the value
factor - factor to scale

scale

public void scale(double factor)
Scale all values and errors by a factor

Parameters:
factor - factor to scale

getErrors

public double[] getErrors()

copy

public DataKeeper copy()
Make a copy

Returns:

getValues

public double[] getValues()
Get values

Returns:

getIntegral

public double getIntegral()
Calculate integral, summing up all values

Returns:
H1D integral

getError

public double getError(int index)
Get error at index

Parameters:
index -

getValue

public double getValue(int index)
Get value at index

Parameters:
index -

setValue

public void setValue(int index,
                     double value)
Set a value at index

Parameters:
index - index
value - value

setError

public void setError(int index,
                     double value)
Set a error at index

Parameters:
index - index
value - value

getSize

public int getSize()
Get the size of container

Returns:


jHepWork 2.8 (©) S.Chekanov