jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.model.fit
Class Fit

java.lang.Object
  extended by cedar.jetweb.model.fit.Fit
All Implemented Interfaces:
Storeable

public class Fit
extends java.lang.Object
implements Storeable

Class containing all info about a comparison between a physics Model and a subset of measured data. Corresponds to a row in the fit table.

Version:
$Date: 2006-05-17 12:38:27 +0100 (Wed, 17 May 2006) $ $Revision: 1148 $
Author:
J.Butterworth.

Constructor Summary
Fit(int newFitId)
          Create a new Fit using the input fitId
Fit(Model newmodel, PlotSelection newselection)
          Create a new Fit using a specified data set.
 
Method Summary
static void delete(int fitId)
          Completely delete this fit from the database, and delete the associated files.
 double[] getChi2()
          Returns the total chi2 and DoF for the list of plots specified by the internal plotSelection.
 double[] getChi2(MCProcessType proc)
          Returns the total chi2 and DoF for the plots consistent with the input MCProcessType
 double[] getChi2(PlotSelection newSelection)
          Returns the total chi2 and DoF for the list of plots contained in the input PlotSelection.
 double[] getChi2(PlotSelection newSelection, MCProcessType proc)
          Returns the total chi2 and DoF for the list of plots contained in the input PlotSelection and matching the input MCProcessType
 java.util.Date getDate()
          Date of the fit
static java.util.Vector<Fit> getFits(Model model)
          Return all the fits associated with the input Model.
static java.util.List<java.lang.Object> getFits(ResultSearchPattern pattern, PlotSelection selection, java.lang.String sort)
          Returns a list of results matching a given ResultSearchPattern and given PlotSelection.
 int getId()
          Unique ID of the fit
 java.util.Map<java.lang.Integer,Paper> getMCPapers()
          Provides a copy of all the papers concerned with this result.
 Model getModel()
          Return the model used in this fit.
 PlotSelection getPlotSelection()
          Return the PlotSelection for this fit.
 double getScale()
          Scale factor for the Job Result data
 PlotSelection getSelection()
          Scale factor for the Job Result data
 boolean isValid()
          Flag allowing this job result to be rendered invalid if processing errors occur.
static void makeComparison(java.lang.String fitId1, HTMLFitWriter writer)
          Compare the parameters of a Fit to the default
static void makeComparison(java.lang.String fitId1, java.lang.String fitId2, HTMLFitWriter writer)
          Compare two Fits given their FitIDs
 boolean retrieve()
          Populate the object in memory from the database.
 void setChi2(double[] chi2)
          Sets the total chi2 and DoF
 void setDate(java.util.Date d)
          Date of the fit
 void setId(int id)
          Unique ID of the fit
 void setModelId(int newId)
          Set the model Id.
 void setPlotSelection(PlotSelection sel)
          Set the PlotSelection.
 void setScale(double d)
          Scale factor for the Job Result data
 boolean store()
          Write the object in memory to the database.
static Fit update(int fitId)
          Force an update of the Fit and return it.
 void zero()
          Zero all the data in this fit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fit

public Fit(int newFitId)
    throws JetWebException
Create a new Fit using the input fitId

Parameters:
fitId - specifies fitId.
Throws:
JetWebException


Fit

public Fit(Model newmodel,
           PlotSelection newselection)
    throws JetWebException
Create a new Fit using a specified data set.

Parameters:
newmodel - Specifies the model to be fit.
selection - Specifies which data should be used in the fit.
Throws:
JetWebException

Method Detail

getDate

public java.util.Date getDate()
                       throws JetWebException
Date of the fit

Throws:
JetWebException


setDate

public void setDate(java.util.Date d)
Date of the fit


setId

public void setId(int id)
Unique ID of the fit


getId

public int getId()
Unique ID of the fit

Specified by:
getId in interface Storeable
Returns:
-1 if undefined.


getScale

public double getScale()
                throws JetWebException
Scale factor for the Job Result data

Throws:
JetWebException


setScale

public void setScale(double d)
Scale factor for the Job Result data


getSelection

public PlotSelection getSelection()
Scale factor for the Job Result data


getModel

public Model getModel()
               throws JetWebException
Return the model used in this fit.

Throws:
JetWebException


getPlotSelection

public PlotSelection getPlotSelection()
                               throws JetWebException
Return the PlotSelection for this fit.

Throws:
JetWebException


setPlotSelection

public void setPlotSelection(PlotSelection sel)
Set the PlotSelection.


setModelId

public void setModelId(int newId)
Set the model Id. Should only be access by DB method.


isValid

public boolean isValid()
                throws JetWebException
Flag allowing this job result to be rendered invalid if processing errors occur.

Throws:
JetWebException


getMCPapers

public java.util.Map<java.lang.Integer,Paper> getMCPapers()
                                                   throws JetWebException
Provides a copy of all the papers concerned with this result.

Returns:
mcPapers : a collection of Papers.
Throws:
JetWebException


setChi2

public void setChi2(double[] chi2)
Sets the total chi2 and DoF


getChi2

public double[] getChi2()
                 throws JetWebException
Returns the total chi2 and DoF for the list of plots specified by the internal plotSelection.

Throws:
JetWebException


getChi2

public double[] getChi2(PlotSelection newSelection,
                        MCProcessType proc)
                 throws JetWebException
Returns the total chi2 and DoF for the list of plots contained in the input PlotSelection and matching the input MCProcessType

Throws:
JetWebException


getChi2

public double[] getChi2(PlotSelection newSelection)
                 throws JetWebException
Returns the total chi2 and DoF for the list of plots contained in the input PlotSelection.

Throws:
JetWebException


getChi2

public double[] getChi2(MCProcessType proc)
                 throws JetWebException
Returns the total chi2 and DoF for the plots consistent with the input MCProcessType

Throws:
JetWebException


zero

public void zero()
Zero all the data in this fit.


delete

public static void delete(int fitId)
Completely delete this fit from the database, and delete the associated files.


update

public static Fit update(int fitId)
                  throws JetWebException
Force an update of the Fit and return it.

Throws:
JetWebException


retrieve

public boolean retrieve()
                 throws JetWebException
Description copied from interface: Storeable
Populate the object in memory from the database. Return true if the information retrieved is up to date.

Specified by:
retrieve in interface Storeable
Throws:
JetWebException


store

public boolean store()
              throws JetWebException
Description copied from interface: Storeable
Write the object in memory to the database. If the ID does not exist in the DB the object is inserted as a new entry. If the ID exists, that entry is updated.

Specified by:
store in interface Storeable
Returns:
true if the object was inserted, false otherwise.
Throws:
JetWebException


makeComparison

public static void makeComparison(java.lang.String fitId1,
                                  HTMLFitWriter writer)
Compare the parameters of a Fit to the default

Parameters:
fitId - 1


makeComparison

public static void makeComparison(java.lang.String fitId1,
                                  java.lang.String fitId2,
                                  HTMLFitWriter writer)
Compare two Fits given their FitIDs

Parameters:
fitId - 1
fitId - 2


getFits

public static java.util.List<java.lang.Object> getFits(ResultSearchPattern pattern,
                                                       PlotSelection selection,
                                                       java.lang.String sort)
                                                throws JetWebException
Returns a list of results matching a given ResultSearchPattern and given PlotSelection.

Parameters:
pattern -
selection -
sort - specifies parameter on which result list is to be sorted
Returns:
List of Fits sorted as requested
Throws:
JetWebException


getFits

public static java.util.Vector<Fit> getFits(Model model)
                                     throws JetWebException
Return all the fits associated with the input Model.

Throws:
JetWebException