Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

PlotSelection Class Reference

List of all members.

Detailed Description

Container for a pair of lists of plots - required plots and summary plots.

Author:
S.Butterworth, UCL
Version:
Date
2006-11-13 19:59:09 +0000 (Mon, 13 Nov 2006)
Revision
1308

Definition at line 26 of file PlotSelection.java.


Public Member Functions

 PlotSelection ()
 PlotSelection (int newCssId) throws JetWebException
PlotSelection restrictCutCollection (CutCollection phaseSpace) throws JetWebException
PlotSelection restrictCutCollection (MCProcessType proc, CutCollection phaseSpace) throws JetWebException
Vector< Integer > getPlotIds () throws JetWebException
ArrayList< DataPlotgetRequiredPlots () throws JetWebException
void setRequiredPlots (ArrayList< DataPlot > rp) throws JetWebException
ArrayList< DataPlotgetSumPlots () throws JetWebException
void setSumPlots (ArrayList< DataPlot > sp) throws JetWebException
ArrayList< DataPlotgetFitPlots () throws JetWebException
void setFitPlots (ArrayList< DataPlot > fp) throws JetWebException
boolean isDefaultSum () throws JetWebException
boolean isDefaultFit () throws JetWebException
boolean isDefault () throws JetWebException
void setFitDefault () throws JetWebException
void setSumDefault () throws JetWebException
boolean fitEquals (PlotSelection selection) throws JetWebException
boolean sumEquals (PlotSelection selection) throws JetWebException
int getId () throws JetWebException
void setSumToBest (Model model) throws JetWebException
void setFitToBest (Model model) throws JetWebException
boolean isAvailable (Model model) throws JetWebException
Object clone ()
void requireLatest () throws JetWebException
void requireLatest (MCProcessType proc) throws JetWebException
void requirePaper (String identifier) throws JetWebException
boolean fitIsEmpty () throws JetWebException
boolean sumIsEmpty () throws JetWebException
String toString ()
void addFitPlot (DataPlot plot)
void clearFitPlots ()

Protected Attributes

int cssId = -1

Private Member Functions

void initialize () throws JetWebException
List< Integer > makeFitPlotList ()
List< Integer > makeSumPlotList ()

Static Private Member Functions

void checkCuts (ArrayList< DataPlot > plots, MCProcessType proc, CutCollection phaseSpace)
void checkCuts (ArrayList< DataPlot > plots, CutCollection phaseSpace)

Private Attributes

ArrayList< DataPlotchi2SumPlots = new ArrayList<DataPlot>()
ArrayList< DataPlotchi2FitPlots = new ArrayList<DataPlot>()
ArrayList< DataPlotrequiredPlots = new ArrayList<DataPlot>()
boolean initialized = false

Constructor & Destructor Documentation

PlotSelection  ) 
 

Instantiate an empty PlotSelection

Definition at line 35 of file PlotSelection.java.

Referenced by PlotSelection.clone(), PlotSelection.isDefault(), PlotSelection.isDefaultFit(), and PlotSelection.isDefaultSum().

00035 {    }

PlotSelection int  newCssId  )  throws JetWebException
 

Instantiate a PlotSelection based on a cross section set ID

Definition at line 38 of file PlotSelection.java.

References PlotSelection.cssId.

00038                                                                {
00039     cssId=newCssId;
00040     }


Member Function Documentation

void addFitPlot DataPlot  plot  ) 
 

Definition at line 529 of file PlotSelection.java.

References PlotSelection.chi2FitPlots.

00529                                          {
00530     chi2FitPlots.add(plot);
00531     }

void checkCuts ArrayList< DataPlot plots,
CutCollection  phaseSpace
[static, private]
 

Definition at line 122 of file PlotSelection.java.

00123                                            {
00124 
00125     int ii=0;
00126     while(ii<plots.size()){
00127         
00128         //if(phaseSpace.isWithin(plots.get(ii).getCutCollection())){
00129         if(!plots.get(ii).getCutCollection().isWithin(phaseSpace)){
00130 
00131         plots.remove(ii);
00132         }else{
00133         ++ii;
00134         }
00135 
00136     }
00137     return;
00138     }

void checkCuts ArrayList< DataPlot plots,
MCProcessType  proc,
CutCollection  phaseSpace
[static, private]
 

Definition at line 91 of file PlotSelection.java.

Referenced by PlotSelection.restrictCutCollection().

00093                                            {
00094     int ii=0;
00095     while(ii<plots.size()){
00096 
00097         boolean incr = true;
00098         try{
00099         if(plots.get(ii).getMCProcessType().equals(proc) || 
00100            proc==null){
00101             
00102             if(!plots.get(ii).getCutCollection().isWithin
00103                (phaseSpace)){
00104 
00105             plots.remove(ii);
00106             incr = false;
00107             }
00108         }
00109         }catch(JetWebException err){
00110         System.out.println
00111             ("PlotSelection: unable to get process type for plot " +
00112              plots.get(ii).getId());
00113         System.out.println(err.getStackTrace());
00114         System.out.println(err.getMessage());
00115         }
00116         if(incr) ++ii;
00117     }
00118 
00119     return;
00120     }

void clearFitPlots  ) 
 

Definition at line 533 of file PlotSelection.java.

References PlotSelection.chi2FitPlots.

00533                                {
00534     chi2FitPlots.clear();
00535     }

Object clone  ) 
 

Shallow clone.

Definition at line 443 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), PlotSelection.initialized, PlotSelection.PlotSelection(), PlotSelection.requiredPlots, PlotSelection.setFitPlots(), PlotSelection.setRequiredPlots(), and PlotSelection.setSumPlots().

Referenced by Fit.Fit().

00443                           {
00444 
00445     PlotSelection ps = new PlotSelection();
00446 
00447     try {
00448         if (!initialized && cssId>=0) initialize();
00449 
00450 
00451         ArrayList<DataPlot> rp = (ArrayList<DataPlot>)chi2FitPlots.clone();
00452         ps.setFitPlots(rp);
00453         ArrayList<DataPlot> sp = (ArrayList<DataPlot>)chi2SumPlots.clone();
00454         ps.setSumPlots(sp);
00455         ArrayList<DataPlot> qp = (ArrayList<DataPlot>)requiredPlots.clone();
00456         ps.setRequiredPlots(qp);
00457         
00458         ps.cssId=cssId;
00459     } catch (JetWebException jwe) {
00460         jwe.printStackTrace(System.out);
00461     }
00462 
00463     return ps;
00464     }

boolean fitEquals PlotSelection  selection  )  throws JetWebException
 

Do these selections specify the same plots.

Definition at line 277 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by PlotSelection.isDefault(), and PlotSelection.isDefaultFit().

00277                                                                               {
00278     if (!initialized && cssId>=0) initialize();
00279 
00280     //System.out.println(chi2FitPlots.size()+" , "+selection.chi2FitPlots.size());
00281     //System.out.println(chi2FitPlots);
00282     //System.out.println(selection.getFitPlots());
00283 
00284     return (((chi2FitPlots.size()==selection.getFitPlots().size()))
00285         && (chi2FitPlots.containsAll(selection.getFitPlots())));
00286 
00287     }

boolean fitIsEmpty  )  throws JetWebException
 

Definition at line 500 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by Searcher.doGet(), Maintainer.doGet(), and FileUploader.doModelUpload().

00500                                                         {
00501     if (!initialized && cssId>=0) initialize();
00502     return (chi2FitPlots.size()==0);
00503 
00504     }

ArrayList<DataPlot> getFitPlots  )  throws JetWebException
 

Return the List of plots that are required to be included in the chi2 sum.

Definition at line 211 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by Fit.Fit(), PlotSelection.getPlotIds(), ServletUtils.makePlotSelection(), and JobUtils.updateJobs().

00211                                                                      {
00212     if (!initialized && cssId>=0) initialize();
00213     return chi2FitPlots;
00214     }

int getId  )  throws JetWebException
 

Gets the cross section set ID corresponding to this plotselection. If there isn't one, it makes one and adds it to the DB. (The fitPlotList determines the cross section set)

Returns:
cssId.
Exceptions:
JetWebException 

move this over to FitPlotList will generate a whole new bunch!!!

Definition at line 326 of file PlotSelection.java.

References PlotSelection.cssId, and PlotSelection.makeFitPlotList().

Referenced by Fit.Fit(), PlotSelection.getPlotIds(), DBFitManager.makeInsertFitString(), DBFitManager.select(), and Fit.store().

00326                                               {
00327 
00328     if (cssId<0) {
00329 
00330         // get list of all csnIds for this plotSelection
00331         List<Integer> fitPlotList = makeFitPlotList();
00332         Iterator<Integer> cssIds = null;
00333         try {
00336         cssIds = DBPlotManager.getCSSIds((fitPlotList.get(0)).intValue(),false).iterator();
00337         } catch (JetWebException e){
00338         throw e;
00339         } catch (Exception e){
00340         throw new JetWebException(e,"Attempt to read from Empty Plot Selection");
00341         }
00342         
00343         boolean found = false;                          
00344         while (cssIds.hasNext() && !found){
00345         
00346         int localCssId = ((Integer)cssIds.next()).intValue();
00347         List<Integer> csnIdList = DBPlotManager.getCsnIds(localCssId,false);
00348         
00349         //test whether set of csnIds for this Plot Selection 
00350         // is same as set of csnIds for localCssId
00351         
00352         if ((fitPlotList.size() == csnIdList.size()) && 
00353             (csnIdList.containsAll(fitPlotList))){
00354             
00355             cssId = localCssId;
00356             found = true;
00357         }
00358         }
00359         
00360         if (!found){
00361         System.out.println("No matching css found");
00362         // No matching set found. Make a new one.
00363         cssId = DBPlotManager.getMaxCssId();
00364         //System.out.println("Max cssId is "+cssId);
00365         DBPlotManager.insertCrossSectionSet(fitPlotList.iterator(),++cssId);
00366         System.out.println("PlotSelection: Allocated cssId is "+cssId);
00367         }
00368     } 
00369 
00370     return cssId;
00371    }

Vector<Integer> getPlotIds  )  throws JetWebException
 

Definition at line 140 of file PlotSelection.java.

References PlotSelection.getFitPlots(), PlotSelection.getId(), PlotSelection.getRequiredPlots(), and PlotSelection.getSumPlots().

Referenced by Fit.insertPlots().

00140                                                               {
00141 
00142     ArrayList<DataPlot> list = getRequiredPlots();
00143 
00144     Vector<Integer> ids = new Vector<Integer>();
00145 
00146     for(DataPlot plot: list){
00147         Integer id = plot.getId();
00148         if(!ids.contains(id)) ids.add(id);
00149     }
00150 
00151     list = getSumPlots();
00152 
00153     for(DataPlot plot: list){
00154         Integer id = plot.getId();
00155         if(!ids.contains(id)) ids.add(id);
00156     }
00157 
00158     list = getFitPlots();
00159 
00160     for(DataPlot plot: list){
00161         Integer id = plot.getId();
00162         if(!ids.contains(id)) ids.add(id);
00163     }
00164 
00165     return ids;
00166     }

ArrayList<DataPlot> getRequiredPlots  )  throws JetWebException
 

Return the List of plots that are required to be present before a Fit can be made.

Definition at line 173 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), PlotSelection.initialized, and PlotSelection.requiredPlots.

Referenced by PlotSelection.getPlotIds(), PlotSelection.isAvailable(), and PlotSelection.toString().

00173                                                                           {
00174 
00175     if (!initialized && cssId>=0) initialize();
00176 
00177     if (requiredPlots.size()==0){
00178         // Build the required plots.
00179         for (DataPlot plot : chi2SumPlots){
00180         requiredPlots.add(plot);
00181         }
00182         for (DataPlot plot : chi2FitPlots){
00183         if (!requiredPlots.contains(plot)){
00184             requiredPlots.add(plot);
00185         }
00186         }
00187 
00188     }
00189     return requiredPlots;
00190     }

ArrayList<DataPlot> getSumPlots  )  throws JetWebException
 

Return the List of plots that are required to be included in the chi2 sum.

Definition at line 199 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by HTMLPlotWriter.display(), Fit.Fit(), Fit.getChi2(), PlotSelection.getPlotIds(), ServletUtils.makePlotSelection(), and JobUtils.updateJobs().

00199                                                                      {
00200     if (!initialized && cssId>=0) initialize();
00201     return chi2SumPlots;
00202     }

void initialize  )  throws JetWebException [private]
 

Definition at line 42 of file PlotSelection.java.

References PlotSelection.initialized, and PlotSelection.setSumDefault().

Referenced by PlotSelection.clone(), PlotSelection.fitEquals(), PlotSelection.fitIsEmpty(), PlotSelection.getFitPlots(), PlotSelection.getRequiredPlots(), PlotSelection.getSumPlots(), PlotSelection.isAvailable(), PlotSelection.isDefault(), PlotSelection.isDefaultFit(), PlotSelection.isDefaultSum(), PlotSelection.requireLatest(), PlotSelection.requirePaper(), PlotSelection.restrictCutCollection(), PlotSelection.setFitDefault(), PlotSelection.setFitPlots(), PlotSelection.setFitToBest(), PlotSelection.setRequiredPlots(), PlotSelection.setSumPlots(), PlotSelection.setSumToBest(), PlotSelection.sumEquals(), PlotSelection.sumIsEmpty(), and PlotSelection.toString().

00042                                                      {
00043 
00044     // Pick up the default sumplots but not the default fit plots.
00045     setSumDefault();
00046     try {
00047         DBPlotManager.populateSelection(this);
00048         
00049     } catch (JetWebException e){
00050         throw e;
00051     }
00052 
00053     // find the runseries with largest phase space (i.e. lowest PTMIN)
00054     // that has data for this fit and set the CutCollection of this 
00055 
00056 
00057     initialized = true;
00058     }

boolean isAvailable Model  model  )  throws JetWebException
 

Check whether all the required plots are actually available for this model.

Returns:
true if isAvailable
Exceptions:
JetWebException 

Definition at line 431 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.getRequiredPlots(), PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by Fit.Fit().

00431                                                                    {
00432     if (!initialized && cssId>=0) initialize();
00433 
00434     for (DataPlot plot : getRequiredPlots()){
00435         if ( !model.predicts((RealPlot)plot) ){ return false; }
00436     }
00437     return true;
00438     }

boolean isDefault  )  throws JetWebException
 

Does this paper selection contain all & only the "recommended" data?

Definition at line 240 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.fitEquals(), PlotSelection.initialize(), PlotSelection.initialized, PlotSelection.isDefault(), PlotSelection.PlotSelection(), PlotSelection.setFitDefault(), PlotSelection.setSumDefault(), and PlotSelection.sumEquals().

Referenced by PlotSelection.isDefault(), and PlotSelection.isDefaultSum().

00240                                                        { 
00241     if (!initialized && cssId>=0) initialize();
00242     boolean isDefault = false;
00243     PlotSelection selection = new PlotSelection();
00244     selection.setSumDefault();
00245     selection.setFitDefault();
00246     if (sumEquals(selection) && fitEquals(selection))
00247         isDefault = true; 
00248     return isDefault;
00249     }

boolean isDefaultFit  )  throws JetWebException
 

Does this paper selection contain all & only the "recommended" data?

Definition at line 232 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.fitEquals(), PlotSelection.initialize(), PlotSelection.initialized, PlotSelection.PlotSelection(), and PlotSelection.setFitDefault().

00232                                                           { 
00233     if (!initialized && cssId>=0) initialize();
00234     PlotSelection selection = new PlotSelection();
00235     selection.setFitDefault();
00236     return (fitEquals(selection));
00237     }

boolean isDefaultSum  )  throws JetWebException
 

Does this paper selection contain all & only the "recommended" data?

Definition at line 221 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), PlotSelection.initialized, PlotSelection.isDefault(), PlotSelection.PlotSelection(), PlotSelection.setSumDefault(), and PlotSelection.sumEquals().

00221                                                           { 
00222     if (!initialized && cssId>=0) initialize();
00223     boolean isDefault = false;
00224     PlotSelection selection = new PlotSelection();
00225     selection.setSumDefault();
00226     if (sumEquals(selection))
00227         isDefault = true; 
00228     return isDefault;
00229     }

List<Integer> makeFitPlotList  )  [private]
 

Definition at line 301 of file PlotSelection.java.

Referenced by PlotSelection.getId().

00301                                            {
00302 
00303     List<Integer> plotList= new ArrayList<Integer>();
00304     for (DataPlot plot : chi2FitPlots){
00305         plotList.add(plot.getId());
00306     }
00307 
00308     return plotList;
00309     }

List<Integer> makeSumPlotList  )  [private]
 

Definition at line 310 of file PlotSelection.java.

00310                                            {
00311     List<Integer> plotList= new ArrayList<Integer>();
00312     for (DataPlot plot : chi2SumPlots){
00313         plotList.add(plot.getId());
00314     }
00315     return plotList;
00316     }

void requireLatest MCProcessType  proc  )  throws JetWebException
 

Require the latest data of MCProcessType proc.

Definition at line 481 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

00481                                                                           {
00482     if (!initialized && cssId>=0) initialize();
00483     System.out.println("PlotSelection.requireLatest(proc) not yet implemented.");
00484     }

void requireLatest  )  throws JetWebException
 

Require all the latest data.

Definition at line 470 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

00470                                                        {
00471     if (!initialized && cssId>=0) initialize();
00472     // now add the default papers to this selection.
00473     for (DataPlot plot: PaperBank.getAllPlots()){
00474         chi2FitPlots.add(plot);
00475     }
00476     }

void requirePaper String  identifier  )  throws JetWebException
 

Require a specific paper.

Definition at line 489 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

00489                                                                         {
00490     if (!initialized && cssId>=0) initialize();
00491 
00492     // now add the default papers to this selection.
00493     for (Paper paper : PaperBank.getPapers()){
00494         if (paper.getDirName().equals(identifier)){
00495         chi2FitPlots.addAll( paper.getPlots() );
00496         }
00497     }
00498     }

PlotSelection restrictCutCollection MCProcessType  proc,
CutCollection  phaseSpace
throws JetWebException
 

Restricts this PlotSelection by removing any plots which require data for the given process type outside of the phase space

Definition at line 82 of file PlotSelection.java.

References PlotSelection.checkCuts(), PlotSelection.chi2FitPlots, PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

00083                           {
00084     if (!initialized && cssId>=0) initialize();
00085     checkCuts(chi2SumPlots, proc, phaseSpace);
00086     checkCuts(chi2FitPlots, proc, phaseSpace);
00087     
00088     return this;
00089     }

PlotSelection restrictCutCollection CutCollection  phaseSpace  )  throws JetWebException
 

Restricts this PlotSelection by removing any plots which require data outside of the phase space

Definition at line 65 of file PlotSelection.java.

Referenced by DBFitManager.fill(), and JobUtils.updateJobs().

00066                           {
00067     restrictCutCollection(null, phaseSpace);
00068     //checkCuts(chi2SumPlots, null, phaseSpace);
00069     //checkCuts(chi2FitPlots, null, phaseSpace);
00070 
00071     // don't check required plots
00072     // because those are the plots that are necessary for a fit
00073     return this;
00074     }

void setFitDefault  )  throws JetWebException
 

Set the plots to be fit for this PlotSelection to be the default one

Definition at line 253 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by Searcher.doGet(), Maintainer.doGet(), FileUploader.doModelUpload(), PlotSelection.isDefault(), PlotSelection.isDefaultFit(), and JobUtils.updateJobs().

00253                                                         { 
00254     if (!initialized && cssId>=0) initialize();
00255     chi2FitPlots.clear();
00256 
00257     // now add the default papers to this selection.
00258     Collection<? extends DataPlot> list = PaperBank.getAllPlots();
00259     for (DataPlot plot : list){
00260         if (plot.isDefaultFit()) {chi2FitPlots.add(plot);}
00261     }
00262     }

void setFitPlots ArrayList< DataPlot fp  )  throws JetWebException
 

Definition at line 215 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by PlotSelection.clone(), Searcher.doGet(), Fit.Fit(), and JobUtils.updateJobs().

00215                                                                             {
00216     if (!initialized && cssId>=0) initialize();
00217         chi2FitPlots = fp;
00218     }

void setFitToBest Model  model  )  throws JetWebException
 

Set the fit plots to the best selection available for this model. That is, to the selection containing the most available data which is flagged as in the default requirement.

Parameters:
model 
Exceptions:
JetWebException 

Definition at line 405 of file PlotSelection.java.

References PlotSelection.chi2FitPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by JobUtils.updateJobs().

00405                                                                  {
00406     if (!initialized && cssId>=0) initialize();
00407 
00408     chi2FitPlots.clear();
00409     
00410     for (Paper dataPaper : PaperBank.getPapers()){
00411         for (DataPlot plot : dataPaper.getPlots()){
00412         try {
00413             if (plot.isDefaultFit() && model.predicts((RealPlot)plot)){
00414             chi2FitPlots.add(plot);
00415             }
00416         } catch (ClassCastException e){
00417             System.out.println("Attempt to cast RealPlot, for paper id " 
00418                        + dataPaper.getId() );
00419         }
00420         }
00421     }
00422 
00423     }

void setRequiredPlots ArrayList< DataPlot rp  )  throws JetWebException
 

Definition at line 191 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.initialize(), PlotSelection.initialized, and PlotSelection.requiredPlots.

Referenced by PlotSelection.clone().

00191                                                                                  {
00192     if (!initialized && cssId>=0) initialize();
00193     requiredPlots = rp;
00194     }

void setSumDefault  )  throws JetWebException
 

Set the chi2 summary plots for this PlotSelection to be the default one

Definition at line 264 of file PlotSelection.java.

References PlotSelection.chi2SumPlots.

Referenced by Searcher.doGet(), Maintainer.doGet(), FileUploader.doModelUpload(), PlotSelection.initialize(), PlotSelection.isDefault(), PlotSelection.isDefaultSum(), and JobUtils.updateJobs().

00264                                                         { 
00265 
00266     chi2SumPlots.clear();
00267 
00268     // now add the default papers to this selection.
00269     Collection<? extends DataPlot> list = PaperBank.getAllPlots();
00270     for (DataPlot plot : list){
00271         if (plot.isDefaultSum()) {chi2SumPlots.add(plot);}
00272     }
00273     }

void setSumPlots ArrayList< DataPlot sp  )  throws JetWebException
 

Definition at line 203 of file PlotSelection.java.

References PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by PlotSelection.clone(), Searcher.doGet(), and Fit.Fit().

00203                                                                             {
00204     if (!initialized && cssId>=0) initialize();
00205         chi2SumPlots = sp;
00206     }

void setSumToBest Model  model  )  throws JetWebException
 

Set the sum plots to the best selection available for this model. That is, to the selection containing the most available data which is flagged as in the default requirement.

Parameters:
model 
Exceptions:
JetWebException 

Definition at line 381 of file PlotSelection.java.

References PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by JobUtils.updateJobs().

00381                                                                  {
00382     if (!initialized && cssId>=0) initialize();
00383 
00384     chi2SumPlots.clear();
00385 
00386     for (Paper dataPaper : PaperBank.getPapers()){
00387         for (DataPlot plot : dataPaper.getPlots()){
00388         if (plot.isDefaultSum() && model.predicts(plot)){
00389             chi2SumPlots.add(plot);
00390         }
00391         }       
00392     }
00393 
00394     }

boolean sumEquals PlotSelection  selection  )  throws JetWebException
 

Do these selections specify the same plots.

Definition at line 289 of file PlotSelection.java.

References PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by PlotSelection.isDefault(), and PlotSelection.isDefaultSum().

00289                                                                               {
00290     if (!initialized && cssId>=0) initialize();
00291 
00292     boolean equals = false;
00293 
00294     if (((chi2SumPlots.size()==selection.getSumPlots().size()))
00295         && (chi2SumPlots.containsAll(selection.getSumPlots())))
00296         equals = true;
00297 
00298     return equals;
00299     }

boolean sumIsEmpty  )  throws JetWebException
 

Definition at line 505 of file PlotSelection.java.

References PlotSelection.chi2SumPlots, PlotSelection.cssId, PlotSelection.initialize(), and PlotSelection.initialized.

Referenced by Searcher.doGet(), Maintainer.doGet(), and FileUploader.doModelUpload().

00505                                                         {
00506     if (!initialized && cssId>=0) initialize();
00507     return (chi2SumPlots.size()==0);
00508 
00509     }

String toString  ) 
 

Returns PlotSelection in a readable form, mainly for debugging.

Definition at line 514 of file PlotSelection.java.

References PlotSelection.cssId, PlotSelection.getRequiredPlots(), PlotSelection.initialize(), and PlotSelection.initialized.

00514                              {
00515     StringBuffer strbuff = new StringBuffer();
00516     try {
00517         if (!initialized && cssId>=0) initialize();
00518         for (DataPlot plot : getRequiredPlots()){
00519         strbuff.append("Plot "+plot.getId()+": "+plot.getTitle());
00520         strbuff.append("\n");
00521         }
00522     } catch (JetWebException jwe){
00523         jwe.printStackTrace(System.out);
00524     }
00525     return strbuff.toString();
00526     }


Member Data Documentation

ArrayList<DataPlot> chi2FitPlots = new ArrayList<DataPlot>() [private]
 

Definition at line 29 of file PlotSelection.java.

Referenced by PlotSelection.addFitPlot(), PlotSelection.clearFitPlots(), PlotSelection.clone(), PlotSelection.fitEquals(), PlotSelection.fitIsEmpty(), PlotSelection.requireLatest(), PlotSelection.requirePaper(), PlotSelection.restrictCutCollection(), PlotSelection.setFitDefault(), PlotSelection.setFitPlots(), and PlotSelection.setFitToBest().

ArrayList<DataPlot> chi2SumPlots = new ArrayList<DataPlot>() [private]
 

Definition at line 28 of file PlotSelection.java.

Referenced by PlotSelection.clone(), PlotSelection.restrictCutCollection(), PlotSelection.setSumDefault(), PlotSelection.setSumPlots(), PlotSelection.setSumToBest(), PlotSelection.sumEquals(), and PlotSelection.sumIsEmpty().

int cssId = -1 [protected]
 

Definition at line 31 of file PlotSelection.java.

Referenced by PlotSelection.clone(), PlotSelection.fitEquals(), PlotSelection.fitIsEmpty(), PlotSelection.getFitPlots(), PlotSelection.getId(), PlotSelection.getRequiredPlots(), PlotSelection.getSumPlots(), PlotSelection.isAvailable(), PlotSelection.isDefault(), PlotSelection.isDefaultFit(), PlotSelection.isDefaultSum(), PlotSelection.PlotSelection(), PlotSelection.requireLatest(), PlotSelection.requirePaper(), PlotSelection.restrictCutCollection(), PlotSelection.setFitDefault(), PlotSelection.setFitPlots(), PlotSelection.setFitToBest(), PlotSelection.setRequiredPlots(), PlotSelection.setSumPlots(), PlotSelection.setSumToBest(), PlotSelection.sumEquals(), PlotSelection.sumIsEmpty(), and PlotSelection.toString().

boolean initialized = false [private]
 

Definition at line 32 of file PlotSelection.java.

Referenced by PlotSelection.clone(), PlotSelection.fitEquals(), PlotSelection.fitIsEmpty(), PlotSelection.getFitPlots(), PlotSelection.getRequiredPlots(), PlotSelection.getSumPlots(), PlotSelection.initialize(), PlotSelection.isAvailable(), PlotSelection.isDefault(), PlotSelection.isDefaultFit(), PlotSelection.isDefaultSum(), PlotSelection.requireLatest(), PlotSelection.requirePaper(), PlotSelection.restrictCutCollection(), PlotSelection.setFitDefault(), PlotSelection.setFitPlots(), PlotSelection.setFitToBest(), PlotSelection.setRequiredPlots(), PlotSelection.setSumPlots(), PlotSelection.setSumToBest(), PlotSelection.sumEquals(), PlotSelection.sumIsEmpty(), and PlotSelection.toString().

ArrayList<DataPlot> requiredPlots = new ArrayList<DataPlot>() [private]
 

Definition at line 30 of file PlotSelection.java.

Referenced by PlotSelection.clone(), PlotSelection.getRequiredPlots(), and PlotSelection.setRequiredPlots().


The documentation for this class was generated from the following file:

Generated Wed Jan 17 09:14:27 GMT 2007