jhpro.stat
Class DataKeeper
- java.lang.Object
-
- jhpro.stat.DataKeeper
-
public class DataKeeper extends java.lang.ObjectA convenient class to keep data with error for an internal representation. Can be filled from histograms or P1D.
-
-
Constructor Summary
Constructors Constructor and Description DataKeeper(H1D h1d)Initialize from a histogramDataKeeper(int size)DataKeeper(P1D p1d)Initialize from a P1D
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DataKeepercopy()Make a copydoublegetError(int index)Get error at indexdouble[]getErrors()doublegetIntegral()Calculate integral, summing up all valuesintgetSize()Get the size of containerjava.lang.StringgetTitle()doublegetValue(int index)Get value at indexdouble[]getValues()Get valuesvoidscale(double factor)Scale all values and errors by a factorvoidscale(int index, double factor)Scale values and errors by a factorvoidsetError(int index, double value)Set a error at indexvoidsetErrors(double[] errors)voidsetTitle(java.lang.String title)voidsetValue(int index, double value)Set a value at indexvoidsetValues(double[] values)
-
-
-
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 valuefactor- 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- indexvalue- value
-
setError
public void setError(int index, double value)Set a error at index- Parameters:
index- indexvalue- value
-
getSize
public int getSize()
Get the size of container- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG