|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjhplot.DrawOptions
jhplot.P1D
public class P1D
A container to hold data points with 1st and 2nd level errors. The first errors are usully statistical, the second error are systematical. P1D can be used for drawing, manipulation with data etc.
Constructor Summary | |
---|---|
P1D(DataHolder dh,
int i1,
int i2)
Create P1D data holder from multidimensional data holder. |
|
P1D(DataHolder dh,
java.lang.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(java.lang.String title)
Construct an empty container with a title |
|
P1D(java.lang.String title,
H1D histo)
Create a P1D container from a histogram. |
|
P1D(java.lang.String title,
H1D histo,
boolean binMean)
Create a P1D container from a histogram. |
|
P1D(java.lang.String title,
H1D histo,
boolean binMean,
boolean fillXerrors)
Create a P1D container from a histogram |
|
P1D(java.lang.String title,
int dimension)
Construct an empty container with a title |
|
P1D(java.lang.String title,
java.lang.String sfile)
Construct a P1D from a file. |
Method Summary | |
---|---|
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 |
clear()
Clear the container |
int |
dimention()
Returns the dimention of this P1D holder. |
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 |
P1D |
getCopy()
get a copy of the current holder |
jplot.DataArray |
getDataArray()
Return a DataArray container from JPlot |
hep.aida.IDataPointSet |
getIDataPointSet()
Get IDataPointSet. |
jplot.LinePars |
getLinePars()
get LinePars class which holds graphical attributes |
double |
getMax(int axis)
Returns the maximum value in the range. |
double |
getMin(int axis)
Returns the minimum value in the range. |
P1D |
getSys(P1D[] p1darray)
Return P1D array which contains 2nd level errors (or systematical errors) evaluated from an array of P1D data holders. |
java.lang.String |
getTitle()
Get a new title |
double |
getX(int i)
Return a specific X-value. |
double |
getXleft(int i)
Return a specific left error on X-value. |
double |
getXleftSys(int i)
Return a specific left error on X-value (systematical 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 (systematical error). |
double |
getY(int i)
Return a specific Y-value. |
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. |
double |
mean()
Returm the mean value |
P1D |
merge(P1D a)
Merge two P1D containers |
P1D |
move(java.lang.String what,
java.lang.String how)
Transform a P1D data holder to some function with error propagation (for both levels) |
P1D |
oper(double scale)
Scale P1D container |
P1D |
oper(int scale)
Scale P1D container by keeping the original title |
P1D |
oper(P1D a,
java.lang.String what)
Operations on P1D container: add, subtract, multiply, divide. |
P1D |
oper(P1D a,
java.lang.String title,
java.lang.String what)
Operations on P1D conatiner: add, subtract, multiply, divide. |
P1D |
oper(P1D a,
java.lang.String title,
java.lang.String what,
java.lang.String how,
P1D corr)
Operations on P1D container: add, subtract, multiply, divide. |
P1D |
oper(java.lang.String title,
double scale)
Scale P1D container |
P1D |
oper(java.lang.String title,
int scale)
Scale P1D container |
void |
print()
Print a P1D container on the screen |
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 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 |
setDataArray(jplot.DataArray data)
Set data in a form of DataArray |
void |
setDimension(int dimension)
Set dimension. |
void |
setLinePars(jplot.LinePars pnew)
Sets LinePars class for graphical attributes |
void |
setTitle(java.lang.String title)
Set a new title |
int |
size()
Return the length of the data vector. |
void |
toFile(java.lang.String name)
Write a P1D to an external file. |
void |
toFileAsLatex(java.lang.String name,
java.text.DecimalFormat dx,
java.text.DecimalFormat dy)
Write a File in form of LaTeX table from values in the container P1D |
void |
toTable()
Print the P1D container to a Table in a separate Frame. |
void |
toTable(boolean format)
Print the P1D container to a Table in a separate Frame. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public P1D(java.lang.String title)
title
- New titlepublic P1D(java.lang.String title, int dimension)
title
- New titledimension
- dimension (2,4,6,10)public P1D(DataHolder dh, java.lang.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(java.lang.String title, java.lang.String sfile)
title
- Title of the containersfile
- File name with inputpublic P1D(hep.aida.IDataPointSet pd)
pd
- Imported IDataPointSet.public P1D(java.lang.String title, H1D histo, boolean binMean, boolean fillXerrors)
title
- New titlehisto
- Imported histogrambinMean
- If true, X values are put to the mean values in each bin. If
false, X is just a center 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(H1D histo, boolean binMean, boolean fillXerrors)
histo
- Imported histogrambinMean
- If true, X values are put to the mean values in each bin. If
false, X is just a center 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(java.lang.String title, H1D histo, boolean binMean)
title
- New titlehisto
- Imported histogrambinMean
- If true, X values are put to the mean values in each bin. If
false, X is just a center of the histogram binpublic P1D(H1D histo, boolean binMean)
histo
- Imported histogrambinMean
- If true, X values are put to the mean values in each bin. If
false, X is just a center of the histogram binpublic P1D(H1D histo)
histo
- Imported histogrampublic P1D(java.lang.String title, H1D histo)
title
- New titlehisto
- Imported histogramMethod Detail |
---|
public void setDimension(int dimension)
dimension
- dimensionpublic void setTitle(java.lang.String title)
setTitle
in class DrawOptions
title
- New Titlepublic java.lang.String getTitle()
getTitle
in class DrawOptions
public jplot.LinePars getLinePars()
public void setLinePars(jplot.LinePars pnew)
pnew
- Graphic attributespublic void toFileAsLatex(java.lang.String name, java.text.DecimalFormat dx, java.text.DecimalFormat dy)
name
- Name of the filedx
- Format of x valuesdy
- Format of y valuespublic void toFile(java.lang.String name)
name
- File name with outputpublic void print()
public P1D merge(P1D a)
a
- Container to be added
public void setDataArray(jplot.DataArray data)
data
- input datapublic P1D oper(double scale)
scale
- Scale factor
public P1D oper(int scale)
scale
- Scale factor
public P1D oper(java.lang.String title, int scale)
title
- New titlescale
- Scale factor
public P1D oper(java.lang.String title, double scale)
title
- New titlescale
- Scale factor
public P1D oper(P1D a, java.lang.String what)
a
- Input P1D container
public P1D oper(P1D a, java.lang.String title, java.lang.String what)
a
- Input P1D container for operationtitle
- New titlewhat
- String representing the operation: "+" add a P1D container to
the original; "-" subtract a P1D from the original; "*"
multiply; "/" divide by P1D
public P1D oper(P1D a, java.lang.String title, java.lang.String what, java.lang.String how, P1D corr)
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
(symetrical 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
systematical errors, use the correlation P1D holder of the
form add(0,0,0,0,0,0,c,c,c1,c2),
public P1D move(java.lang.String what, java.lang.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 Y
public jplot.DataArray getDataArray()
public void add(double x, double y)
x
- X-value of the plot-pointy
- Y-value of the plot-pointpublic void add(double x, double y, double err)
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 upper, double lower)
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)
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)
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 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 int size()
public double[] getArrayX()
public P1D getCopy()
public P1D getSys(P1D[] p1darray)
p1darray
- Input P1D arrays
public P1D addAndAverage(P1D[] p1darray)
p1darray
- Input P1D arrays. They will be added to the original P1D
public double[] getArrayXleft()
public double[] getArrayXright()
public double[] getArrayXrightSys()
public double[] getArrayXleftSys()
public double[] getArrayY()
public double getX(int i)
i
- index of the array
public double getXleft(int i)
i
- index of the array
public double getXright(int i)
i
- index of the array
public double getXleftSys(int i)
i
- index of the array
public double getXrightSys(int i)
i
- index of the array
public double getY(int i)
i
- index of the array
public double getYupper(int i)
i
- index of the array
public double getYlower(int i)
i
- index of the array
public double[] getArrayYlower()
public double[] getArrayYlowerSys()
public double getYupperSys(int i)
i
- index of the array
public double[] getArrayYupper()
public int dimention()
public double getYlowerSys(int i)
i
- index of the array
public double[] getArrayYupperSys()
public hep.aida.IDataPointSet getIDataPointSet()
public double getMax(int axis)
axis
- defines to which axis this function applies.
public double getMin(int axis)
axis
- defines to which axis this function applies.
public double mean()
public void clear()
public void toTable()
public void toTable(boolean format)
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |