public class P1D extends DrawOptions implements Serializable
This is a vast high-performance low-memory footprint data container.
Constructor and Description |
---|
P1D()
Construct an empty container
|
P1D(hep.aida.ref.histogram.Cloud2D c2d)
Construct P1D from a Cloud2D
|
P1D(DataHolder dh,
int i1,
int i2)
Create P1D data holder from multidimensional data holder.
|
P1D(DataHolder dh,
String title,
int i1,
int i2)
Create P1D data holder from multidimensional data holder.
|
P1D(H1D histo)
Create a P1D container from a histogram.
|
P1D(H1D histo,
boolean binMean)
Create a P1D container from a histogram.
|
P1D(H1D histo,
boolean binMean,
boolean fillXerrors)
Create a P1D container from a histogram.
|
P1D(hep.aida.IDataPointSet pd)
Create a P1D container from IDataPointSet.
|
P1D(P0D p1,
P0D p2)
Construct a container from pairs of P0D (one for X, second for Y)
|
P1D(String title)
Construct an empty container with a title.
|
P1D(String title,
Color color)
Construct an empty container with a title and color for points
|
P1D(String title,
Color color,
int symbolstyle)
Construct an empty container with a title and color and symbol style for
points
|
P1D(String title,
double[] p1,
double[] p2)
Construct a container from pairs X and Y
|
P1D(String title,
DoubleArrayList Xval,
DoubleArrayList Yval)
Construct an empty container with a title.
|
P1D(String title,
H1D histo)
Create a P1D container from a histogram.
|
P1D(String title,
H1D histo,
boolean binMean)
Create a P1D container from a histogram.
|
P1D(String title,
H1D histo,
boolean binMean,
boolean fillXerrors)
Create a P1D container from a histogram
|
P1D(String title,
int dimension)
Construct an empty container with a title
|
P1D(String title,
P0D p1,
P0D p2)
Construct a container from pairs of P0D (one for X, second for Y)
|
P1D(String title,
P1D p1d)
Construct a new copy of the data container.
|
P1D(String title,
String sfile)
Construct a P1D from a file.
|
P1D(String title,
URL url)
Construct a P1D from a file on the we web.
|
P1D(URL url)
Construct a P1D from a file on the we web.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x,
double y)
Adds values of a plot-point pair (X,Y).
|
void |
add(double x,
double y,
double err)
Adds the values of a plot-point pair (X,Y).
|
void |
add(double x,
double y,
double upper,
double lower)
Add values of a plot-point pair (X,Y).
|
void |
add(double x,
double y,
double left,
double right,
double upper,
double lower)
Adds the values of a plot-point pair (X,Y).
|
void |
add(double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Adds the values of a plot-point pair (x,y).
|
P1D |
addAndAverage(P1D[] p1darray)
Return P1D array with weighted average of several measurements.
|
void |
addQuick(double x,
double y,
double err)
Adds the values of a plot-point pair (X,Y).
|
void |
addQuick(double x,
double y,
double upper,
double lower)
Add values of a plot-point pair (X,Y).
|
void |
addQuick(double x,
double y,
double left,
double right,
double upper,
double lower)
Adds the values of a plot-point pair (X,Y).
|
void |
addQuick(double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Adds the values of a plot-point pair (x,y).
|
void |
clear()
Clear the container.
|
void |
combineErr(int axis)
Add 1st and 2nd level in quadrature and attribute the combined error to
1st level error.
|
P1D |
copy()
Make a new data holder with the same title from the current one.
|
P1D |
copy(String newtitle)
create a copy of this container.
|
P1D |
derivative()
Calculate derivative for X-Y data points.
|
int |
dimension()
Returns the dimension of this P1D holder.
|
void |
doc()
Show online documentation.
|
void |
fill(hep.aida.ref.histogram.Cloud2D c2d)
Fill a P1D container from a Cloud2D.
|
void |
fill(double[] xa,
double[] ya)
Fill a P1D container from 2 arrays.
|
void |
fill(double[] xa,
double[] ya,
double[] yerror)
Fill a P1D container from 3 arrays (one represents symmetrical errors on
Y).
|
void |
fill(double[] xa,
double[] ya,
double[] yupper,
double[] ylower)
Fill a P1D container from 4 arrays (last represents asymmetrical upper
and lower errors on Y).
|
void |
fill(double[] x,
double[] y,
double[] left,
double[] right,
double[] upper,
double[] lower,
double[] left_sys,
double[] right_sys,
double[] upper_sys,
double[] lower_sys)
Fill the values of a X-Y plot-points with full errors.
|
void |
fill(int[] xa,
int[] ya)
Fill a P1D container from 2 integer arrays.
|
void |
fill(P0D xa,
P0D ya)
Fill a P1D container from 2 P0D arrays.
|
void |
fill(P0D xa,
P0D ya,
P0D yerror)
Fill a P1D container from P0D arrays (one represents symmetrical errors
on Y).
|
void |
fillIDataPointSet(hep.aida.IDataPointSet fDps2D)
Fill IDataPointSet.
|
double[] |
getArrayErr()
Get array representing (symmetric) error on Y.
|
double[] |
getArrayX()
Get array representing X-values
|
double[] |
getArrayXleft()
Get array representing X-left errors
|
double[] |
getArrayXleftSys()
Get array representing X-left 2nd level errors
|
double[] |
getArrayXright()
Get array representing X-right errors
|
double[] |
getArrayXrightSys()
Get array representing X-right 2nd level errors
|
double[] |
getArrayY()
Get array representing Y-values
|
double[] |
getArrayYlower()
Get array representing Y lower errors
|
double[] |
getArrayYlowerSys()
Get array representing Y lower 2nd level errors
|
double[] |
getArrayYupper()
Get array representing Y upper errors
|
double[] |
getArrayYupperSys()
Get array representing Y upper 2nd level errors
|
DataArray |
getDataArray()
Return a DataArray container from JPlot
|
int |
getDimension()
Returns the dimension of this P1D holder.
|
double |
getErr(int i)
Return (symmetric) error on Y-value.
|
double |
getError(int i)
Return error (uncertainty) on the Y value.
|
hep.aida.IDataPointSet |
getIDataPointSet()
Get IDataPointSet.
|
LinePars |
getLinePars()
get LinePars class which holds graphical attributes
|
double |
getMax(int axis)
Returns the maximum value in the range.
|
int |
getMaxIndex(int axis)
Returns the index of maximum value in the range.
|
double |
getMin(int axis)
Returns the minimum value in the range.
|
int |
getMinIndex(int axis)
Returns the index of minimum value in the range.
|
double |
getQuickX(int i)
Return a specific X-value quickly (no bound check).
|
double |
getQuickY(int i)
Return a specific Y-value quickly (no bound check).
|
Map<String,Double> |
getStat(int axis)
Get complete statistics for this container for a given axis.
|
P1D |
getSys(P1D[] p1darray)
Return P1D array which contains 2nd level errors (or systematic errors)
evaluated from an array of P1D data holders.
|
double |
getX(int i)
Return a specific X-value.
|
DoubleArrayList |
getXE1left()
Left error on X (1st level)
|
DoubleArrayList |
getXE1right()
Right eroor on X
|
DoubleArrayList |
getXE2left()
Left error on X (2nd level)
|
DoubleArrayList |
getXE2right()
Right error (2nd level) on X
|
double |
getXleft(int i)
Return a specific left error on X-value.
|
double |
getXleftSys(int i)
Return a specific left error on X-value (systematic error).
|
double |
getXright(int i)
Return a specific right error on X-value.
|
double |
getXrightSys(int i)
Return a specific right error on X-value (systematic error).
|
DoubleArrayList |
getXval()
Get array of X values;
|
double |
getY(int i)
Return a specific Y-value.
|
DoubleArrayList |
getYE1down()
Down error on Y (1st level)
|
DoubleArrayList |
getYE1upper()
Upper error on Y (1st level)
|
DoubleArrayList |
getYE2down()
Down error on Y (2nd level)
|
DoubleArrayList |
getYE2upper()
Upper error on Y (2nd level)
|
double |
getYlower(int i)
Return a specific lower error on Y-value.
|
double |
getYlowerSys(int i)
Return a specific total lower error on Y-value.
|
double |
getYupper(int i)
Return a specific upper error on Y-value.
|
double |
getYupperSys(int i)
Return a specific systematical upper error on Y-value.
|
DoubleArrayList |
getYval()
Get array of Y values;
|
int |
hashCode()
Returns the hash code value for this collection (onoy X,Y values)
|
int |
indexOf(double valueX,
double valueY)
Searches the list front to back for the index of value, starting at offset.
|
int |
indexOfX(double valueX)
Searches the list front to back for the index of value, starting at offset.
|
int |
indexOfY(double valueY)
Searches for a Y value starting at offset.
|
double |
integral()
Integrate P1D (sum up all Y values)
|
double |
integral(int IndexMin,
int IndexMax)
Integrate P1D between two indices (between 1 and max index)
|
int |
lastIndexOf(double valueX,
double valueY)
Searches for the index of value, starting at offset, but backwards
Here we search for (X,Y) pairs only.
|
int |
lastIndexOfX(double valueX)
Searches for value in X backwards.
|
int |
lastIndexOfY(double valueY)
Searches for a Y value backewards.
|
double |
meanX()
Returns the mean value in X.
|
double |
meanXerror()
Returns the standard error of the mean values for X.
|
double |
meanY()
Returns the mean value in Y.
|
double |
meanYerror()
Returns the standard error of the mean values for Y.
|
P1D |
merge(P1D p1d)
Merge two P1D containers.
|
P1D |
move(String what,
String how)
Transform a P1D data holder to some function with error propagation (for
both levels)
|
int |
oper(P1D a,
String what)
Operations on P1D container: add, subtract, multiply, divide.
|
int |
oper(P1D a,
String title,
String what)
Operations on P1D containers: add, subtract, multiply, divide.
|
P1D |
oper(P1D a,
String title,
String what,
String how,
P1D corr)
Operations on P1D containers: add, subtract, multiply, divide.
|
P1D |
operErrSys(String title,
int axis,
P1D left,
P1D right)
Obtain a new P1D with 2nd-level errors on X or Y obtained from two P1D
objects, one represents left on X (or lower on Y) error and the other
represents the right on X (or upper on Y) error.
|
void |
operPlusY(P1D p1)
Add all Y-values from another P1D.
|
void |
operScale(int axis,
double scale)
Scale X-values (axis=0) or Y values (axis=1) and their errors with a
scale factor.
|
void |
operScaleErr(int axis,
double scale)
Scale 1st level errors with a scale factor.
|
void |
operScaleErrSys(int axis,
double scale)
Scale 2nd level errors with a scale factor.
|
P1D |
operSmooth(int axis,
boolean isWeighted,
int k)
Smooth P1D data points in either X or Y.
|
P1D |
operSmoothGauss(int axis,
double standardDeviation)
Computes a Gaussian smoothed version of P1D.
|
void |
print()
Print a P1D container on the screen
|
P1D |
range(int IndexMin,
int IndexMax)
Obtain a new PD1 in the range between Min and Max indexes.
|
P1D |
rangeCut(int axis,
double Min,
double Max)
Construct P1D removing a range of values defined by Min and Max.
|
int |
read(BufferedReader br)
Read data using 10-column format.
|
int |
read(String sfile)
Read P1D from a file.
|
int |
read(URL url)
Read data from URL.
|
int |
readGZip(String sfile)
Read P1D from a GZiped file.
|
P1D |
readSerialized(String name)
Read a P1D object from a serialized file
|
int |
readZip(String sfile)
Read P1D from a Zipped file.
|
P1D |
remove(int position)
Removes at the position
|
void |
removeAt(int index)
Remove a (X,Y) value at a given index
|
double |
rmsX()
Returns RMS for X-values.
|
double |
rmsY()
Returns RMS for Y-values.
|
void |
set(int i,
double x,
double y)
Sets the values of a plot-point pair (X,Y).
|
void |
set(int i,
double x,
double y,
double err)
Sets the values of a plot-point pair (x,y).
|
void |
set(int i,
double x,
double y,
double upper,
double lower)
Sets the values of a plot-point pair (x,y).
|
void |
set(int i,
double x,
double y,
double left,
double right,
double upper,
double lower)
Sets the values of a plot-point pair (x,y).
|
void |
set(int i,
double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
Sets the values of a plot-point pair (x,y).
|
void |
setArrayX(double[] x)
Set array at once
|
void |
setArrayY(double[] y)
Set array at once
|
void |
setDataArray(DataArray data)
Set data in a form of DataArray
|
void |
setDimension(int dimension)
Set the dimension for the container.
|
void |
setErrAllToZero(String title,
int axis)
Set all (1st and 2nd) level errors to zero.
|
void |
setErrSqrt(int axis)
Set 1st level error to sqrt of X or Y values.
|
void |
setErrSysToZero(int axis)
Set 2nd level errors to zero.
|
void |
setErrToZero(int axis)
Set 1st level errors to zero.
|
void |
setLinePars(LinePars pnew)
Sets LinePars class for graphical attributes
|
void |
setQuick(int i,
double x,
double y)
setQuicks the ith value of a plot-point pair (x,y).
|
void |
setQuick(int i,
double x,
double y,
double err)
setQuicks the ith value of a plot-point pair (x,y).
|
void |
setQuick(int i,
double x,
double y,
double upper,
double lower)
setQuicks the ith value of a plot-point pair (x,y).
|
void |
setQuick(int i,
double x,
double y,
double left,
double right,
double upper,
double lower)
setQuicks the ith value of a plot-point pair (x,y).
|
void |
setQuick(int i,
double x,
double y,
double left,
double right,
double upper,
double lower,
double left_sys,
double right_sys,
double upper_sys,
double lower_sys)
setQuicks the ith value of a plot-point pair (x,y).
|
void |
setXE1left(DoubleArrayList xE1left)
Error on X left.Statistical error.
|
void |
setXE1right(DoubleArrayList xE1right)
Error on X.
|
void |
setXE2left(DoubleArrayList xE2left)
Set left second-level errors
|
void |
setXE2right(DoubleArrayList xE2right)
Set right second-level errors
|
void |
setXval(DoubleArrayList X)
Set X values as array
|
void |
setYE1down(DoubleArrayList yE1down)
Set statististical down error
|
void |
setYE1upper(DoubleArrayList yE1upper)
Set statistical error on Y 91st level)
|
void |
setYE2down(DoubleArrayList yE2down)
Set second level down error on Y
|
void |
setYE2upper(DoubleArrayList yE2upper)
Set second level upper error on Y
|
void |
setYval(DoubleArrayList yval)
Set Y values
|
int |
size()
Return the length of the data vector.
|
void |
sort(int axis)
Sorting the original array using either X or Y values.
|
double |
stddeviationX()
Standard deviation of values X.
|
double |
stddeviationY()
Standard deviation of values Y.
|
void |
toFile(String name)
Write a P1D to an external file.
|
void |
toFileAsLatex(String name,
DecimalFormat dx,
DecimalFormat dy)
Write a File in form of LaTeX table from values in the container P1D
|
String |
toString()
Convert to a string
|
void |
toTable()
Show in a Table in a separate Frame.
|
void |
updateSummary()
Deprecated.
Debricated!
|
double |
varianceX()
Returns variance for X-values.
|
double |
varianceY()
Returns variance for Y-values.
|
int |
writeSerialized(String name)
Write a P0D object to a serialized file
|
copyLinePars, getBinWidth, getColor, getDrawOption, getDrawOptions, getFillColor, getLegend, getLineParm, getLineStyle, getNameX, getNameY, getNameZ, getPenWidth, getSymbol, getSymbolShape, getSymbolSize, getTitle, getType, isBars, isErrX, isErrY, isFilled, printDrawOptions, printDrawOptions, setBars, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setLineStyle, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbol, setSymbolSize, setTitle, setType
public P1D()
public P1D(String title)
title
- New titlepublic P1D(String title, DoubleArrayList Xval, DoubleArrayList Yval)
title
- New titlepublic P1D(String title, int dimension)
title
- New titledimension
- dimension (2,4,6,10)public P1D(String title, Color color)
title
- New titlecolor
- for pointspublic P1D(String title, Color color, int symbolstyle)
title
- New titlecolor
- for pointsstyle
- used to draw symbols (1,2,3,4..)public P1D(P0D p1, P0D p2)
p1
- P1D representing Xp2
- P1D representing Ypublic P1D(String title, P0D p1, P0D p2)
title
- new titlep1
- P1D representing Xp2
- P1D representing Ypublic P1D(hep.aida.ref.histogram.Cloud2D c2d)
c2d
- input cloud2dpublic P1D(String title, double[] p1, double[] p2)
title
- new titlep1
- array representing Xp2
- array representing Ypublic P1D(String title, P1D p1d)
title
- New titlep1d
- input P1D objectpublic P1D(DataHolder dh, String title, int i1, int i2)
dh
- Input data containertitle
- New titlei1
- Index of the first columni2
- Index of the second columnpublic P1D(DataHolder dh, int i1, int i2)
dh
- Input data containeri1
- Index of the first columni2
- Index of the second columnpublic P1D(String title, String sfile)
The file should contain 2, or 4, or 6, or 10 columns: 1) x,y: data without any errors 2) x,y, y(upper), y(lower) - data with 1st level errors on Y 3) x,y, x(left), x(right), y(upper), y(lower) - data with 1st level errors on X and Y 4) x,y, x(left), x(right), y(upper), y(lower), x(leftSys), x(rightSys), y(upperSys), y(lowerSys) - data with X and Y and 1st and 2nd level errors. Comments lines starting with "#" and "*" are ignored.
title
- Title of the containersfile
- File name with input. input file name. It can be either a file
on a file system or URL location (must start from http or ftp)public P1D(hep.aida.IDataPointSet pd)
pd
- Imported IDataPointSet.public P1D(String title, H1D histo, boolean binMean, boolean fillXerrors)
title
- New titlehisto
- Imported histogrambinMean
- If true, Y values are put to the mean values in each bin. If
false, is just a height in the histogram binfillXerrors
- If true, errors are set to X values (half of the bin width) If
false, errors on X are set to zeropublic P1D(H1D histo, boolean binMean, boolean fillXerrors)
histo
- Imported histogrambinMean
- If true, Y values are put to the mean values in each bin. If
false, Y corresponds to height of the histogram binfillXerrors
- If true, errors are set to X values (half of the bin width) If
false, errors on X are set to zeropublic P1D(String title, H1D histo, boolean binMean)
title
- New titlehisto
- Imported histogrambinMean
- If true, Y values are put to the mean values in each bin. If
false, Y is just a center of the histogram binpublic P1D(H1D histo, boolean binMean)
histo
- Imported histogrambinMean
- If true, Y values are put to the mean values in each bin. If
false, Y is just a height of the histogram binpublic P1D(H1D histo)
histo
- Imported histogrampublic P1D(String title, H1D histo)
title
- New titlehisto
- Imported histogrampublic P1D(String title, URL url)
title
- Title of the containerurl
- URL locationpublic P1D(URL url)
url
- URL locationpublic void setDimension(int dimension)
dimension
- dimension used.public LinePars getLinePars()
public void setLinePars(LinePars pnew)
pnew
- Graphic attributespublic void toFileAsLatex(String name, DecimalFormat dx, DecimalFormat dy)
name
- Name of the filedx
- Format of x valuesdy
- Format of y valuespublic void toFile(String name)
name
- File name with outputpublic void print()
public String toString()
public P1D merge(P1D p1d)
p1d
- Container to be addedpublic P1D remove(int position)
position
- public int hashCode()
public int indexOf(double valueX, double valueY)
valueX
- X valuevalueY
- Y valuepublic int lastIndexOf(double valueX, double valueY)
valueX
- X valuevalueY
- Y valuepublic int indexOfX(double valueX)
valueX
- X valuepublic int lastIndexOfX(double valueX)
valueX
- X valuepublic int indexOfY(double valueY)
valueY
- Y valuepublic int lastIndexOfY(double valueY)
valueY
- Y valuepublic void setDataArray(DataArray data)
data
- input datapublic void operScale(int axis, double scale)
axis
- axis for which scaling is applied. set to 0 for X and set to 1
for Y.scale
- Scale factorpublic void setErrToZero(int axis)
axis
- axis = 0 for X, axis =1 for Ypublic void setErrAllToZero(String title, int axis)
axis
- axis = 0 for X, axis =1 for Ypublic void setErrSysToZero(int axis)
axis
- axis = 0 for X, axis =1 for Ypublic void setErrSqrt(int axis)
axis
- axis (=0 for X, 1 for Y).public void operScaleErrSys(int axis, double scale)
axis
- axis to a which a scale factor is applied (=0 for X, =1 for
Y).scale
- Scale factor to be applied to 2nd level errors defined by axispublic void operPlusY(P1D p1)
p1d
- P1D to be added to the original. Only Y-values are added, x-values are unchanged.public void operScaleErr(int axis, double scale)
axis
- axis to which a scale factor is applied (=0 for X, 1 for Y).scale
- Scale factor to be applied to 1st level errors defined by axispublic P1D operErrSys(String title, int axis, P1D left, P1D right)
title
- New Titleaxis
- axis=0, errors will be set to X (left and right). If axis=1,
errors will be set as lower and upper error.left
- P1D used to build left errors on the central values (in X,
when axis=0) or lower error on Y (when axis=1)right
- P1D used to build right errors on the central values (in X,
when axis=0) or upper error on Y (when axis=1)public int oper(P1D a, String what)
a
- Input P1D containerwhat
- the operation type (+,-,*,/)public int oper(P1D a, String title, String what)
a
- Input P1D container for operation (may contain errors on Y).title
- New titlewhat
- String representing the operation: public P1D oper(P1D a, String title, String what, String how, P1D corr)
This container assumes the dimension 10 (2 X,Y values and 6 errors)
a
- Input P1D container for the operationtitle
- New titlewhat
- String representing the operation: "+" add a P1D to the
original; "-" subtract a P1D from the original "*"; multiply
"/" dividehow
- how the operation should be performed: "X" - for X values; "Y"
- do it for Y values; XY - do for X and Y values. Normally,
however, you should do this for the Y option.corr
- P1D container which keeps correlation coefficients for each
point. In most general case, this container should be filled
as: add(0,0,x1,x2,x3,x4,y1,y2,y3,y4), where x1 (left),
x2(right), x3(leftSys), x4(rightSys) - coefficients on X y1
(up), y2(down), y3(upSys), x4(downSys) - coefficients on Y.
For example, in a simplest case when Y has 1st level
(symmetrical statistical) errors and X does not have any, you
need just define "corr" by filling it with:
add(0,0,0,0,0,0,c,c,0,0), where c is a correlation
coefficient. If "Y" values have both statistical and
systematic errors, use the correlation P1D holder of the form
add(0,0,0,0,0,0,c,c,c1,c2),public P1D move(String what, String how)
what
- what operation should be performed: "inverse" - inverse to
(1/a); "sqrt" - sqrt(a); "exp" - exp(a); "log" - log10(a);
"cos" - cos(a) ;"sin" - sin(a); "tan" - tan(a); "acos" -
acos(a); "asin" - asin(a); "atan" - atan(a); "cosh" - cosh(a);
"sinh" - sinh(a); "tanh" - tanh(a); "square" - a**2how
- how the operation should be performed: "X" - for X values; "Y"
- do it for Y values; XY - do for X and Ypublic DataArray getDataArray()
public void add(double x, double y)
x
- X-value of the plot-pointy
- Y-value of the plot-pointpublic void addQuick(double x, double y, double err)
This is a fast implementation. Not check of the dimension is done. The dimension of this container should be set to 3 before you use this method.
x
- X-value of the plot-pointy
- Y-value of the plot-pointerr
- an error on Y (assume symmetrical)public void add(double x, double y, double err)
This is a slower implementation than addQuick(), since if the dimension is set wrong, it will be adjusted to 3.
x
- X-value of the plot-pointy
- Y-value of the plot-pointerr
- an error on Y (assume symmetrical)public void addQuick(double x, double y, double upper, double lower)
The container should be initialized with dimenstion 4 before using this method. This is a fast implementation without dimension check.
x
- X-value of the plot-pointy
- Y-value of the plot-pointupper
- - upper error on Ylower
- - lower error on Ypublic void add(double x, double y, double upper, double lower)
This is a slower implementation than addQuick(), since if the dimension is set wrong, it will be adjusted to 4.
x
- X-value of the plot-pointy
- Y-value of the plot-pointupper
- - upper error on Ylower
- - lower error on Ypublic void add(double x, double y, double left, double right, double upper, double lower)
This is a slower implementation than addQuick(), since if the dimension is set wrong, it will be adjusted to 6.
x
- X-value of the plot-pointy
- Y-value of the plot-pointleft
- - left error on Xright
- - right error on Xupper
- - upper error on Ylower
- - lower error on Ypublic void addQuick(double x, double y, double left, double right, double upper, double lower)
The container should be initialized with dimenstion 6 before using this method. This is a fast implementation without dimension check.
x
- X-value of the plot-pointy
- Y-value of the plot-pointleft
- - left error on Xright
- - right error on Xupper
- - upper error on Ylower
- - lower error on Ypublic void add(double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
This is a slower implementation than addQuick(), since if the dimension is set wrong, it will be adjusted to 10.
x
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void addQuick(double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
The container should be initialized with dimenstion 6 before using this method. This is a fast implementation without dimension check.
x
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void set(int i, double x, double y)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointpublic void set(int i, double x, double y, double upper, double lower)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointupper
- upper error on ylower
- lower error on ypublic void set(int i, double x, double y, double err)
If dimension is wrong, extend it to 3.
i
- index of the plot-pointx
- x-value of the plot-pointerr
- error on Y (symmetric)public void set(int i, double x, double y, double left, double right, double upper, double lower)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)public void set(int i, double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void updateSummary()
public void setQuick(int i, double x, double y, double left, double right, double upper, double lower, double left_sys, double right_sys, double upper_sys, double lower_sys)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)left_sys
- - error on x (left) - second level, used for systematicsright_sys
- - error on x (right)upper_sys
- - error on y (upper)lower_sys
- - error on y (lower)public void setQuick(int i, double x, double y, double left, double right, double upper, double lower)
The dimension must be 6.
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointleft
- - error on x (left)right
- - error on x (right)upper
- - error on y (upper)lower
- - error on y (lower)public void setQuick(int i, double x, double y, double upper, double lower)
The dimension must be 4.
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointupper
- - error on y (upper)lower
- - error on y (lower)public void setQuick(int i, double x, double y, double err)
The dimension must be 3.
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointerr
- - error on y (symmetric)public void setQuick(int i, double x, double y)
i
- index of the plot-pointx
- x-value of the plot-pointy
- y-value of the plot-pointpublic int size()
public double[] getArrayX()
public P1D copy(String newtitle)
newtitle
- new titlepublic void setXE2left(DoubleArrayList xE2left)
xE2left
- public void setXE2right(DoubleArrayList xE2right)
xE2right
- public int writeSerialized(String name)
name
- serialized file name for output.public P1D readSerialized(String name)
name
- serialized file name for input. Can be URL if starts from
http.public int read(BufferedReader br)
br
- BufferedReaderpublic int read(URL url)
url
- URL location of input filepublic int readGZip(String sfile)
Use a space to separate values in columns and new line to put new row.
sfile
- File name with input (extension .gz)public int read(String sfile)
The old content will be lost. The file should contain 2, or 4, or 6, or 10 columns: 1) x,y: data without any errors 2) x,y, y(upper), y(lower) - data with 1st level errors on Y 3) x,y, x(left), x(right), y(upper), y(lower) - data with 1st level errors on X and Y 4) x,y, x(left), x(right), y(upper), y(lower), x(leftSys), x(rightSys), y(upperSys), y(lowerSys) - data with X and Y and 1st and 2nd level errors. Comment lines starting with "#" and "*" are ignored. It can read URL if the string starts from http or ftp, otherwise a file on the file system is assumed.
sfile
- File name with input. If the string starts from http or ftp,
otherwise a file on the file system is assumed.public int readZip(String sfile)
sfile
- File name with input (extension zip)public P1D copy()
public P1D operSmooth(int axis, boolean isWeighted, int k)
It is smoothed by averaging over a moving window of a size specified by the method parameter: if the value of the parameter is k then the width of the window is 2*k + 1. If the window runs off the end of the P1D only those values which intersect the histogram are taken into consideration. The smoothing may optionally be weighted to favor the central value using a "triangular" weighting. For example, for a value of k equal to 2 the central bin would have weight 1/3, the adjacent bins 2/9, and the next adjacent bins 1/9. Errors are kept the same as before.
axis
- axis to which smoothing is applied (axis=0 for X, axis=1 for
Y)isWeighted
- Whether values in X or Y will be weighted using a triangular
weighting scheme favoring bins near the central bin.k
- The smoothing parameter which must be non-negative. If zero,
the histogram object will be returned with no smoothing
applied.public P1D operSmoothGauss(int axis, double standardDeviation)
Each band of the P1D is smoothed by discrete convolution with a kernel approximating a Gaussian impulse response with the specified standard deviation.
axis
- axis to which smoothing is applied (axis=0 for X, axis=1 for
Y)standardDeviation
- The standard deviation of the Gaussian smoothing kernel which
must be non-negative or an
IllegalArgumentException
will be thrown. If zero,
the P1D object will be returned with no smoothing applied.public P1D getSys(P1D[] p1darray)
p1darray
- Input P1D arrayspublic void combineErr(int axis)
Dimension should be 10.
axis
- is 0 for X errors, 1 for Y errorspublic P1D addAndAverage(P1D[] p1darray)
p1darray
- Input P1D arrays. They will be added to the original P1Dpublic double[] getArrayXleft()
public double[] getArrayXright()
public double[] getArrayXrightSys()
public double[] getArrayXleftSys()
public double[] getArrayY()
public double getX(int i)
i
- index of the arraypublic double getXleft(int i)
i
- index of the arraypublic double getXright(int i)
i
- index of the arraypublic double getXleftSys(int i)
i
- index of the arraypublic double getXrightSys(int i)
i
- index of the arraypublic double getY(int i)
i
- index of the arraypublic double getErr(int i)
i
- index of the arraypublic double getQuickY(int i)
i
- index of the arraypublic double getQuickX(int i)
i
- index of the arraypublic double getYupper(int i)
i
- index of the arraypublic double getError(int i)
i
- index of the arraypublic double getYlower(int i)
i
- index of the arraypublic double[] getArrayYlower()
public double[] getArrayYlowerSys()
public double getYupperSys(int i)
i
- index of the arraypublic double[] getArrayYupper()
public double[] getArrayErr()
public int dimension()
public int getDimension()
public double getYlowerSys(int i)
i
- index of the arraypublic double[] getArrayYupperSys()
public hep.aida.IDataPointSet getIDataPointSet()
public void fillIDataPointSet(hep.aida.IDataPointSet fDps2D)
public double getMax(int axis)
axis
- defines to which axis this function applies (0=X; 1=Y);public int getMaxIndex(int axis)
axis
- defines to which axis this function applies (0=X; 1=Y);public double getMin(int axis)
axis
- defines to which axis this function applies (0=X; 1=Y);public int getMinIndex(int axis)
axis
- defines to which axis this function applies (0=X; 1=Y);public void removeAt(int index)
index
- indexpublic P1D range(int IndexMin, int IndexMax)
IndexMin
- Min indexIndexMax
- Max indexpublic P1D derivative()
Data points can have errors (statistical), with upper and lower error on Y (dimen=4). Statistical uncertainties on Y are propagated and included into the final P1D with derivatives. Second-level errors are ignored.
public P1D rangeCut(int axis, double Min, double Max)
axis
- if axis=0, applied for X, if axis=1, applied for Y.Min
- Min valueMax
- Max valuepublic void sort(int axis)
axis
- if axis=0, sorting applied for X, if axis=1, sorting is applied for Y.public double integral(int IndexMin, int IndexMax)
IndexMin
- Min minimal index for integration starting from 1 (included to
integration)IndexMax
- Max maximal index for integration (included to integration)public double integral()
public double varianceX()
public double stddeviationX()
public double stddeviationY()
public double varianceY()
public double rmsX()
public double rmsY()
public double meanX()
public double meanXerror()
public double meanYerror()
public Map<String,Double> getStat(int axis)
The key for the output map are: mean, error, rms, variance, stddev .
axis
- axis=0 for X and axis=1 for Ypublic double meanY()
public void clear()
public void toTable()
public void fill(double[] xa, double[] ya)
xa
- array with X valuesya
- array with Y valuespublic void fill(int[] xa, int[] ya)
xa
- integer array with X valuesya
- integer array with Y valuespublic void fill(P0D xa, P0D ya)
xa
- P0D with X valuesya
- P0D with Y valuespublic void fill(hep.aida.ref.histogram.Cloud2D c2d)
c2D
- input Cloudpublic DoubleArrayList getXval()
public DoubleArrayList getYval()
public DoubleArrayList getXE1left()
public DoubleArrayList getXE2left()
public DoubleArrayList getXE1right()
public DoubleArrayList getXE2right()
public DoubleArrayList getYE1down()
public DoubleArrayList getYE1upper()
public DoubleArrayList getYE2down()
public DoubleArrayList getYE2upper()
public void setXE1left(DoubleArrayList xE1left)
xE1left
- left statistical error.public void setXval(DoubleArrayList X)
array
- with X valuespublic void setXE1right(DoubleArrayList xE1right)
xE1right
- public void setYE1down(DoubleArrayList yE1down)
yE1down
- down errorpublic void setYE1upper(DoubleArrayList yE1upper)
yE1upper
- upper error on Ypublic void setYE2down(DoubleArrayList yE2down)
yE2down
- error on Y down (2nd level)public void setYE2upper(DoubleArrayList yE2upper)
yE2upper
- upper error on Ypublic void setYval(DoubleArrayList yval)
yval
- Y valuepublic void fill(double[] xa, double[] ya, double[] yerror)
xa
- array with X valuesya
- array with Y valuesyerror
- array with errors on Y valuespublic void fill(P0D xa, P0D ya, P0D yerror)
xa
- P0D array with X valuesya
- P0D array with Y valuesyerror
- P0D array with errors on Y valuespublic void fill(double[] xa, double[] ya, double[] yupper, double[] ylower)
xa
- array with X valuesya
- array with Y valuesyupper
- array with upper errors on Y valuesylower
- array with upper errors on Y valuespublic void fill(double[] x, double[] y, double[] left, double[] right, double[] upper, double[] lower, double[] left_sys, double[] right_sys, double[] upper_sys, double[] lower_sys)
x
- array of x-value of the plot-pointy
- array of y-value of the plot-pointleft
- - array of error on x (left)right
- - array of error on x (right)upper
- - array of error on y (upper)lower
- - array of error on y (lower)left_sys
- - array of error on x (left) - second level, used for
systematicsright_sys
- - array of error on x (right)upper_sys
- - array of error on y (upper)lower_sys
- - array of error on y (lower)public void setArrayX(double[] x)
x
- X-valuespublic void setArrayY(double[] y)
x
- Y-valuespublic void doc()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics