jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.model
Class Model

java.lang.Object
  extended by cedar.jetweb.model.ResultSearchPattern
      extended by cedar.jetweb.model.Model
All Implemented Interfaces:
Storeable, java.lang.Cloneable

public class Model
extends ResultSearchPattern
implements Storeable

Unique set of parameters for a generator.

Version:
$Date: 2006-06-21 12:36:40 +0100 (Wed, 21 Jun 2006) $ $Revision: 1197 $
Author:
Jon Butterworth

Field Summary
 
Fields inherited from class cedar.jetweb.model.ResultSearchPattern
generatorList, notMatching, photonpdfList, protonpdfList
 
Constructor Summary
Model()
          Build an empty Model.
Model(int newmodelId)
          Build a model from the DB.
Model(ResultSearchPattern pattern)
          Build a model from a ResultSearchPattern.
 
Method Summary
 void addAllRunSeries()
          Find all the runseries which are consistent with this model and add them to it.
 java.util.Date getDate()
          Return the last date that anything was added for this model.
 int getId()
          Return the unique ID of this model
static java.util.List<java.lang.Object> getModels(ResultSearchPattern pattern, java.lang.String sort)
          Returns a list of models matching a given ResultSearchPattern and sorted by sort.
 java.util.Vector<RunSeries> getRunSeries(MCProcessType proc)
          Gets a list of all runSeries matching a given process type.
 RunSeriesCollection getRunSeriesCollection()
          Gets the runseries collection.
 boolean predicts(DataPlot plot)
          Returns true if there is any predicted data available for this plot using this model.
 boolean retrieve()
          Populate the object in memory from the database.
 void setId(int id)
           
 void setRunSeriesCollection(RunSeriesCollection rsc)
          Sets the runseries collection.
 boolean store()
          Note that once stored, Models cannot be changed.
 void zero(MCProcessType proc)
          Remove all data from the RunSeries which match the given process type.
 
Methods inherited from class cedar.jetweb.model.ResultSearchPattern
clone, dumpParms, getConsistentModels, getGenerator, getGenerator, getGeneratorList, getNonMatchingParameters, getParms, getPhotonPDF, getPhotonPDF, getPhotonPDFList, getProtonPDF, getProtonPDF, getProtonPDFList, getPthat, matches, matches, matches, setDefaults, setGenerator, setSoftDefaults
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
      throws JetWebException
Build an empty Model.

Throws:
JetWebException


Model

public Model(ResultSearchPattern pattern)
      throws JetWebException
Build a model from a ResultSearchPattern. Any variables not specified will be set to their default values. The modelId is not set. I

Parameters:
pattern - specifies parameters for the new model
Throws:
JetWebException


Model

public Model(int newmodelId)
      throws JetWebException
Build a model from the DB.

Parameters:
newmodelId - int, the unique ID of the model.
Throws:
JetWebException

Method Detail

store

public boolean store()
              throws JetWebException
Note that once stored, Models cannot be changed. So if you try to store a Model which has an ID which exists in the DB, this method will NOT change the database or the Model, but will simply return false. The ID of the Model will be set by this method, if it was not set already. The runSeriesCollection ID will also be set, if possible.

Specified by:
store in interface Storeable
Returns:
true if the object was inserted, false otherwise.
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


getId

public int getId()
Return the unique ID of this model

Specified by:
getId in interface Storeable
Returns:
modelId


getDate

public java.util.Date getDate()
Return the last date that anything was added for this model.

Returns:
date


getRunSeries

public java.util.Vector<RunSeries> getRunSeries(MCProcessType proc)
                                         throws JetWebException
Gets a list of all runSeries matching a given process type.

Returns:
Enumeration of RunSeries
Throws:
JetWebException


getRunSeriesCollection

public RunSeriesCollection getRunSeriesCollection()
Gets the runseries collection.

Returns:
runSeriesCollection


setRunSeriesCollection

public void setRunSeriesCollection(RunSeriesCollection rsc)
Sets the runseries collection.


setId

public void setId(int id)

predicts

public boolean predicts(DataPlot plot)
                 throws JetWebException
Returns true if there is any predicted data available for this plot using this model.

Throws:
JetWebException


zero

public void zero(MCProcessType proc)
Remove all data from the RunSeries which match the given process type.


addAllRunSeries

public void addAllRunSeries()
                     throws JetWebException
Find all the runseries which are consistent with this model and add them to it.

Parameters:
model -
Throws:
JetWebException


getModels

public static java.util.List<java.lang.Object> getModels(ResultSearchPattern pattern,
                                                         java.lang.String sort)
                                                  throws JetWebException
Returns a list of models matching a given ResultSearchPattern and sorted by sort.

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