jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.model.plots
Class DataPlot

java.lang.Object
  extended by cedar.jetweb.model.plots.DataPlot
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FittedPlot, PredictedPlot, RealPlot

public abstract class DataPlot
extends java.lang.Object
implements java.io.Serializable

Represents a generic JetWeb Dataplot.

Version:
$Date: 2006-05-05 13:01:23 +0100 (Fri, 05 May 2006) $ $Revision: 1130 $
Author:
Jon Butterworth, UCL.
See Also:
Serialized Form

Field Summary
protected  double[] chi2
           
protected  int collisionId
           
protected  int csnId
          the DB identifier in the crossection DB table
protected  java.util.Vector<DataPoint> dataPoints
          Vector of data point objects.
protected  double ecms
          Centre of mass energy at which the measurement was made.
static java.lang.String FITTED
          Fitted Data Tablename
protected  boolean hasdata
          Indicates whether the plot has points
protected  int number
          The plot number within a Paper.
protected  int paperId
           
static java.lang.String PREDICTED
          Predicted Data Tablename
protected  MCProcessType proc
           
protected  int procIdWanted
           
static java.lang.String REAL
          Real Data Tablename
protected  boolean shape
          Indicates whether the plot is a shape.
protected  double sysScale
          systematic scaling applied to data in this plot
protected  java.lang.String title
          Plot title.
 
Constructor Summary
DataPlot()
           
 
Method Summary
 void addSwitch(PlotSwitch ps)
          Add this plotSwitch to the list for this plot.
 void deleteSwitch(PlotSwitch ps)
          Delete this plotSwitch from the list and the DB.
 double[] getChi2()
          Return a double array [chi2,dof] - comparison between this plot and another.
 double[] getChi2(int fitId)
          Return a double array [chi2,dof] for this fit.
static double[] getChi2(int plotId, int fitId)
          Lightweight way of getting the chi2 for a plot without instantiating the plot.
 double getCMEnergy()
           
 int getCollisionId()
           
 java.util.Vector<DataPoint> getDataPoints()
          Return an Vector of data point objects
 int getId()
          Get csnId (the DB identifier in the crossection DB table)
abstract  MCProcessType getMCProcessType()
          Find out the MCProcessType which was actually used to Generate this plot.
 int getNDataSources()
          Number of data sources associated with this plot.
 int getNumber()
          Get plot number
 int getPaperId()
           
abstract  int getProcIdWanted()
          Return the ID of the MCProcessType which SHOULD be used to generate this plot for the current model (if there is a current model).
 int getProcIdWanted(Generator gen)
          Return the Id of the MCProcessType which should be used to generate this plot for the model which was used.
 java.util.Iterator<PlotSwitch> getSwitches()
          return all the plotSwitches relevant to this plot.
 double getSysScale()
          Get systematic scaling applied to data in this plot
 java.lang.String getTitle()
          Return the histogram title
 java.lang.String getXLabel()
          X Axis Label
 java.lang.String getYLabel()
          Y Axis Label
 double getYMax()
          Return the maximum Y value for this plot.
 double getYMin()
          Return the minimum Y value for this plot.
 double getYMinNonZero()
          Return the minimum >0 Y value for this plot.
 boolean hasData()
          Are there entries in the points table?
 boolean isDefaultFit()
          Is the plot used to determine normalisation of the fit by default?
 boolean isDefaultSum()
          Is the plot included in the chi2 sum by default?
 boolean isLogarithmic()
          logarithmic plot indicator
 boolean isPredictedBy(RunSeries rs)
          Return true if this plot is predicted by the input RunSeries.
 boolean isShape()
          Indicates whether the plot is a shape.
 boolean populateDBData()
          Populate the dataPoints array of points with points for this crossection from the data_point table of the database
 void setChi2(double[] newchi2)
          A double array [chi2,dof] - comparison between this plot and another.
 void setCMEnergy(double e)
           
 void setCollisionId(int id)
           
 void setDataPoints(java.util.Enumeration<DataPoint> newDataPoints)
          Sets data points vector.
 void setDefaultFit(boolean isit)
          Is the plot used to determine normalisation of the fit by default?
 void setDefaultSum(boolean isit)
          Is the plot included in the chi2 sum by default?
 void setFrom(DataPlot plot)
          Set everything in this plot (except the dirName, processType and data) from DataPlot plot
 void setHasData(boolean b)
           
 void setId(int newId)
          Set csnId (the DB identifier in the crossection DB table)
 void setLogarithmic(boolean b)
          logarithmic plot indicator
 void setNumber(int newnum)
          Set plot number
 void setPaperId(int newPaperId)
          Set the Id of the paper with which this plot is associated.
 void setShape(boolean isit)
          Sets whether the plot is a shape.
 void setSysScale(double scale)
          Set systematic scaling applied to data in this plot
 void setTitle(java.lang.String newtitle)
          The histogram title
 void setXLabel(java.lang.String newlabel)
          X Axis Label
 void setYLabel(java.lang.String newlabel)
          Y Axis Label
 void storeSwitches()
          Update/add plot switches.
 void zero()
          zero the y values and errors of data points in local memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REAL

public static final java.lang.String REAL
Real Data Tablename

See Also:
Constant Field Values


PREDICTED

public static final java.lang.String PREDICTED
Predicted Data Tablename

See Also:
Constant Field Values


FITTED

public static final java.lang.String FITTED
Fitted Data Tablename

See Also:
Constant Field Values


sysScale

protected double sysScale
systematic scaling applied to data in this plot


number

protected int number
The plot number within a Paper.


title

protected java.lang.String title
Plot title.


collisionId

protected int collisionId

procIdWanted

protected int procIdWanted

dataPoints

protected java.util.Vector<DataPoint> dataPoints
Vector of data point objects.

See Also:
DataPoint


paperId

protected int paperId

chi2

protected double[] chi2

ecms

protected double ecms
Centre of mass energy at which the measurement was made.


csnId

protected int csnId
the DB identifier in the crossection DB table


hasdata

protected boolean hasdata
Indicates whether the plot has points


shape

protected boolean shape
Indicates whether the plot is a shape. (i.e. does not take the fitted scale factor)


proc

protected MCProcessType proc
Constructor Detail

DataPlot

public DataPlot()
Method Detail

getId

public int getId()
Get csnId (the DB identifier in the crossection DB table)


setId

public void setId(int newId)
Set csnId (the DB identifier in the crossection DB table)


getNumber

public int getNumber()
Get plot number


setNumber

public void setNumber(int newnum)
Set plot number


getSysScale

public double getSysScale()
Get systematic scaling applied to data in this plot


setSysScale

public void setSysScale(double scale)
Set systematic scaling applied to data in this plot


isDefaultFit

public boolean isDefaultFit()
Is the plot used to determine normalisation of the fit by default?


setDefaultFit

public void setDefaultFit(boolean isit)
Is the plot used to determine normalisation of the fit by default?


isDefaultSum

public boolean isDefaultSum()
Is the plot included in the chi2 sum by default?


setDefaultSum

public void setDefaultSum(boolean isit)
Is the plot included in the chi2 sum by default?


isLogarithmic

public boolean isLogarithmic()
logarithmic plot indicator


setLogarithmic

public void setLogarithmic(boolean b)
logarithmic plot indicator


isShape

public boolean isShape()
Indicates whether the plot is a shape. (i.e. does not take the fitted scale factor)


setShape

public void setShape(boolean isit)
Sets whether the plot is a shape. (i.e. does not take the fitted scale factor)


getTitle

public java.lang.String getTitle()
Return the histogram title


setTitle

public void setTitle(java.lang.String newtitle)
The histogram title


getNDataSources

public int getNDataSources()
Number of data sources associated with this plot.


getYLabel

public java.lang.String getYLabel()
Y Axis Label


setYLabel

public void setYLabel(java.lang.String newlabel)
Y Axis Label


getXLabel

public java.lang.String getXLabel()
X Axis Label


setXLabel

public void setXLabel(java.lang.String newlabel)
X Axis Label


hasData

public boolean hasData()
                throws JetWebException
Are there entries in the points table?

Throws:
JetWebException


setHasData

public void setHasData(boolean b)

getDataPoints

public java.util.Vector<DataPoint> getDataPoints()
                                          throws JetWebException
Return an Vector of data point objects

Throws:
JetWebException
See Also:
DataPoint


setDataPoints

public void setDataPoints(java.util.Enumeration<DataPoint> newDataPoints)
Sets data points vector.

Parameters:
Enumeration - must be a collection of DataPoint objects.
See Also:
DataPoint


getYMin

public double getYMin()
Return the minimum Y value for this plot.


getYMinNonZero

public double getYMinNonZero()
Return the minimum >0 Y value for this plot. (needed for log plot with empty bins)


getYMax

public double getYMax()
Return the maximum Y value for this plot.


setFrom

public void setFrom(DataPlot plot)
Set everything in this plot (except the dirName, processType and data) from DataPlot plot


populateDBData

public boolean populateDBData()
                       throws JetWebException
Populate the dataPoints array of points with points for this crossection from the data_point table of the database

Returns:
hasData
Throws:
JetWebException


zero

public void zero()
zero the y values and errors of data points in local memory


isPredictedBy

public boolean isPredictedBy(RunSeries rs)
Return true if this plot is predicted by the input RunSeries.


getSwitches

public java.util.Iterator<PlotSwitch> getSwitches()
                                           throws JetWebException
return all the plotSwitches relevant to this plot.

Throws:
JetWebException


addSwitch

public void addSwitch(PlotSwitch ps)
Add this plotSwitch to the list for this plot.


deleteSwitch

public void deleteSwitch(PlotSwitch ps)
                  throws JetWebException
Delete this plotSwitch from the list and the DB.

Throws:
JetWebException


getCMEnergy

public double getCMEnergy()

setCMEnergy

public void setCMEnergy(double e)

setPaperId

public void setPaperId(int newPaperId)
Set the Id of the paper with which this plot is associated.


getPaperId

public int getPaperId()

storeSwitches

public void storeSwitches()
                   throws JetWebException
Update/add plot switches.

Throws:
JetWebException


getChi2

public double[] getChi2()
Return a double array [chi2,dof] - comparison between this plot and another.

Returns:
double[2] - [chi2,dof]


setChi2

public void setChi2(double[] newchi2)
A double array [chi2,dof] - comparison between this plot and another.


getCollisionId

public int getCollisionId()

setCollisionId

public void setCollisionId(int id)

getProcIdWanted

public abstract int getProcIdWanted()
                             throws JetWebException
Return the ID of the MCProcessType which SHOULD be used to generate this plot for the current model (if there is a current model).

Throws:
JetWebException


getMCProcessType

public abstract MCProcessType getMCProcessType()
                                        throws JetWebException
Find out the MCProcessType which was actually used to Generate this plot.

Throws:
JetWebException


getChi2

public static double[] getChi2(int plotId,
                               int fitId)
Lightweight way of getting the chi2 for a plot without instantiating the plot.


getChi2

public double[] getChi2(int fitId)
Return a double array [chi2,dof] for this fit.

Returns:
double[2] - [chi2,dof]


getProcIdWanted

public int getProcIdWanted(Generator gen)
                    throws JetWebException
Return the Id of the MCProcessType which should be used to generate this plot for the model which was used.

Throws:
JetWebException