Definition at line 33 of file ResultSearchPattern.java.
Public Member Functions | |
Enumeration< Match > | getNonMatchingParameters () |
Vector< PDF > | getProtonPDFList () |
getProtonPDF (int i) throws JetWebException | |
getProtonPDF () throws JetWebException | |
Vector< PDF > | getPhotonPDFList () |
getPhotonPDF (int i) throws JetWebException | |
getPhotonPDF () throws JetWebException | |
Vector< Generator > | getGeneratorList () |
Generator | getGenerator (int i) throws JetWebException |
void | setGenerator (Generator gen) |
String | getDescription () |
ResultSearchPattern | setDescription (String description) |
Generator | getGenerator () throws JetWebException |
Double | getPthat () throws JetWebException |
ResultSearchPattern () | |
Object | clone () |
boolean | matches (RunSeries runSeries) throws JetWebException |
boolean | matches (Model model) throws JetWebException |
boolean | matches (ResultSearchPattern pattern) throws JetWebException |
void | dumpParms () |
String | getParms () |
void | setSoftDefaults () throws JetWebException |
void | setDefaults () throws JetWebException |
Vector< Model > | getConsistentModels () throws JetWebException |
Protected Attributes | |
String | description_ |
Vector< Generator > | generatorList |
Vector< PDF > | protonpdfList |
Vector< PDF > | photonpdfList |
Vector< Match > | notMatching = new Vector<Match>() |
Package Functions | |
private< T1, T2 > boolean | compare (String name, HashMap< T1, T2 > map1, HashMap< T1, T2 > map2, Generator gen) |
Private Member Functions | |
boolean | compare (String paramName, Vector< Object > val1, Vector< Object > val2) |
boolean | compare (String paramName, String val1, String val2) |
boolean | matches (ResultSearchPattern pattern, MCProcessType proc) throws JetWebException |
Vector< Object > | PDF2Object (Vector< PDF > pdfVec) |
|
Builds a completely general result search pattern - matches all parameters Definition at line 208 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.clone(). 00208 {
00209 // do nothing.
00210 }
|
|
Definition at line 216 of file ResultSearchPattern.java. References ResultSearchPattern.generatorList, ResultSearchPattern.notMatching, ResultSearchPattern.photonpdfList, ResultSearchPattern.protonpdfList, and ResultSearchPattern.ResultSearchPattern(). 00216 { 00217 ResultSearchPattern newPattern = new ResultSearchPattern(); 00218 newPattern.generatorList = 00219 (this.generatorList==null) ? null : 00220 new Vector<Generator>(this.generatorList); 00221 newPattern.protonpdfList = 00222 (this.protonpdfList==null) ? null : 00223 new Vector<PDF>(this.protonpdfList); 00224 newPattern.photonpdfList = 00225 (this.photonpdfList==null) ? null : 00226 new Vector<PDF>(this.photonpdfList); 00227 newPattern.notMatching = 00228 (this.notMatching==null) ? null : 00229 new Vector<Match>(this.notMatching); 00230 00231 return newPattern; 00232 }
|
|
Definition at line 307 of file ResultSearchPattern.java. References ResultSearchPattern.notMatching. 00308 { 00309 00310 boolean match = true; 00311 00312 for(Map.Entry<T1, T2> entry: map1.entrySet()){ 00313 T1 key = entry.getKey(); 00314 boolean inModel = true; 00315 if(key instanceof Integer){ 00316 inModel = gen.inModel(name, (Integer)key); 00317 } 00318 if(inModel && map2.containsKey(key)){ 00319 T2 val1 = map2.get(key); 00320 T2 val2 = entry.getValue(); 00321 00322 if(val1!=null && val2 !=null && 00323 !Match.compare(val1, val2)){ 00324 match = false; 00325 if(!match){ 00326 //if(val1 instanceof Double){ 00327 // val1 = (T2)JetWebConfig.getFormat().format(val1); 00328 // val2 = (T2)JetWebConfig.getFormat().format(val2); 00329 //} 00330 System.out.println("Failed comparison on " + 00331 name + ": " + key + "." + 00332 val1 + "!=" + val2); 00333 00334 notMatching.add 00335 (new Match(name+":"+key.toString(), val1, val2)); 00336 } 00337 } 00338 } 00339 } 00340 00341 return match; 00342 }
|
|
compares 2 parameters in String form, if non-matching, record in notMatching collection Definition at line 257 of file ResultSearchPattern.java. References ResultSearchPattern.notMatching. 00257 { 00258 boolean match = false; 00259 00260 if (val1.trim().length()==0 || val2.trim().length()==0) { 00261 match = true; 00262 } else { 00263 if (val1.equals(val2)){ 00264 match = true; 00265 } else { 00266 //System.out.println("Failed"+ paramName+ ":" + val1+","+val2); 00267 notMatching.add(new Match(paramName,val1,val2)); 00268 } 00269 } 00270 00271 return match; 00272 }
|
|
compares 2 parameters in Vector form, if non-matching, record in notMatching collection Only the first element of val2 is checked! Definition at line 240 of file ResultSearchPattern.java. References ResultSearchPattern.notMatching. Referenced by Model.getModels(), and ResultSearchPattern.matches(). 00240 { 00241 boolean match = false; 00242 00243 if(val1.size()==0 ||val2.size()==0){ 00244 match = true; 00245 }else if(val1.contains(val2.elementAt(0))){ 00246 match = true; 00247 }else{ 00248 notMatching.add 00249 (new Match(paramName, val1.elementAt(0), val2.elementAt(0))); 00250 00251 } 00252 return match; 00253 }
|
|
Writes all the parameters to standard output. Definition at line 550 of file ResultSearchPattern.java. References ResultSearchPattern.getParms(). Referenced by JobRequest.main(). 00550 { 00551 00552 System.out.println(getParms()); 00553 00554 }
|
|
Return all models consistent with this pattern. Reimplemented in RunSeries. Definition at line 616 of file ResultSearchPattern.java. Referenced by Fit.getFits(). 00616 { 00617 return DBManager.getConsistentModels(this); 00618 }
|
|
Return a description of this model. Definition at line 175 of file ResultSearchPattern.java. 00175 {
00176 return description_;
00177 }
|
|
Gets a generator
Reimplemented in RunSeries. Definition at line 188 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.getPthat(), and ResultSearchPattern.matches(). 00188 { 00189 return getGenerator(0); 00190 }
|
|
Gets a generator
Reimplemented in RunSeries. Definition at line 147 of file ResultSearchPattern.java. References ResultSearchPattern.generatorList. Referenced by Searcher.doGet(), JobUtils.doJobRequest(), HTMLJobWriter.getDescription(), HTMLWriter.listHiddenPars(), JobRequest.main(), JobUtils.makeCards(), ServletUtils.makePattern(), ResultSearchPattern.matches(), and HTMLFitWriter.writeVerbose(). 00147 { 00148 if (generatorList!=null) { 00149 try { 00150 return (Generator)generatorList.elementAt(i); 00151 } catch (ArrayIndexOutOfBoundsException a){ 00152 throw new JetWebException(a,"Index was "+i+":"); 00153 } 00154 } else { 00155 return null; 00156 } 00157 }
|
|
Gets list of generators
Reimplemented in RunSeries. Definition at line 138 of file ResultSearchPattern.java. References ResultSearchPattern.generatorList. Referenced by Searcher.doGet(), ResultSearchPattern.getParms(), HTMLModelWriter.listNonDefaults(), ServletUtils.makePattern(), RunSeries.RunSeries(), ResultSearchPattern.setDefaults(), and ResultSearchPattern.setSoftDefaults(). 00138 { 00139 if (generatorList==null) { generatorList = new Vector<Generator>(); } 00140 return generatorList; 00141 }
|
|
Returns enumeration of Match objects - results of matching this pattern with another Definition at line 60 of file ResultSearchPattern.java. References ResultSearchPattern.notMatching. 00060 { 00061 return notMatching.elements(); 00062 }
|
|
Writes all the parameters to a String.
Definition at line 561 of file ResultSearchPattern.java. References ResultSearchPattern.getGeneratorList(), ResultSearchPattern.getPhotonPDFList(), ResultSearchPattern.getProtonPDFList(), and PDF.toString(). Referenced by ResultSearchPattern.dumpParms(). 00561 { 00562 00563 StringBuffer b = new StringBuffer("----------------------------"); 00564 00565 b.append("\nGenerator "+this.getGeneratorList()); 00566 b.append("\nPhoton "+this.getPhotonPDFList()); 00567 b.append("\nProton "+this.getProtonPDFList()); 00568 return b.toString(); 00569 00570 }
|
|
Gets photon particle density function
Reimplemented in RunSeries. Definition at line 129 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.matches(). 00129 { 00130 return getPhotonPDF(0); 00131 }
|
|
Gets photon particle density function
Definition at line 112 of file ResultSearchPattern.java. References ResultSearchPattern.photonpdfList. Referenced by HTMLJobWriter.getDescription(), and HTMLWriter.listHiddenPars(). 00112 { 00113 00114 if (photonpdfList!=null && i<photonpdfList.size()) { 00115 try { 00116 return photonpdfList.elementAt(i); 00117 } catch (ArrayIndexOutOfBoundsException a){ 00118 throw new JetWebException(a,"Index was "+i+":"); 00119 } 00120 } else { 00121 return null; 00122 } 00123 }
|
|
Gets a list of photon particle density functions
Reimplemented in RunSeries. Definition at line 103 of file ResultSearchPattern.java. References ResultSearchPattern.photonpdfList. Referenced by ResultSearchPattern.getParms(), JobRequest.main(), FileDownloader.makeCards(), ServletUtils.makePattern(), RunSeries.RunSeries(), ResultSearchPattern.setDefaults(), and ResultSearchPattern.setSoftDefaults(). 00103 { 00104 if (photonpdfList==null) { photonpdfList = new Vector<PDF>(); } 00105 return photonpdfList; 00106 }
|
|
Gets proton particle density function
Reimplemented in RunSeries. Definition at line 94 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.matches(). 00094 { 00095 return getProtonPDF(0); 00096 }
|
|
Gets proton particle density function
Definition at line 78 of file ResultSearchPattern.java. References ResultSearchPattern.protonpdfList. Referenced by HTMLJobWriter.getDescription(), and HTMLWriter.listHiddenPars(). 00078 { 00079 if (protonpdfList!=null && i < protonpdfList.size()) { 00080 try { 00081 return protonpdfList.elementAt(i); 00082 } catch (ArrayIndexOutOfBoundsException a){ 00083 throw new JetWebException(a,"Index was "+i+":"); 00084 } 00085 } else { 00086 return null; 00087 } 00088 }
|
|
Gets a list of proton particle density functions
Reimplemented in RunSeries. Definition at line 69 of file ResultSearchPattern.java. References ResultSearchPattern.protonpdfList. Referenced by ResultSearchPattern.getParms(), JobRequest.main(), FileDownloader.makeCards(), ServletUtils.makePattern(), RunSeries.RunSeries(), ResultSearchPattern.setDefaults(), and ResultSearchPattern.setSoftDefaults(). 00069 { 00070 if (protonpdfList==null) { protonpdfList = new Vector<PDF>(); } 00071 return protonpdfList; 00072 }
|
|
Gets PTHAT, the cutoff which seperates hard from soft scatters. In general this corresponds to a different parameter in each different generator, and should be provided by the generator class eventually. If its worth it... yes it is needed for the plotswitches.
Definition at line 200 of file ResultSearchPattern.java. References ResultSearchPattern.getGenerator(). Referenced by Fit.getFits(), and Model.getModels(). 00200 { 00201 return getGenerator().getPthat(); 00202 }
|
|
Checks whether this pattern is consistent with another pattern. An unspecified attribute on EITHER pattern will match ANY value of the attribute on the other pattern.
Definition at line 397 of file ResultSearchPattern.java. References ResultSearchPattern.compare(), PDF.equals(), ResultSearchPattern.getGenerator(), ResultSearchPattern.getPhotonPDF(), ResultSearchPattern.getProtonPDF(), and ResultSearchPattern.notMatching. 00398 { 00399 00400 boolean match = true; 00401 00402 String tmp; 00403 00404 // clear down the record of comparison of this pattern with any other. 00405 notMatching.clear(); 00406 00407 match = match && compare(Match.GEN,getGenerator().getName(), 00408 pattern.getGenerator().getName()); 00409 match = match && compare(Match.GEN,getGenerator().getVersion(), 00410 pattern.getGenerator().getVersion()); 00411 00412 if(!match){ 00413 System.out.println("Failed compare on generator name and version" ); 00414 return match; 00415 } 00416 00417 // Got to do all the generator parameters too!! 00418 match = match && compare("Integer: ",getGenerator().getIntParameters(), 00419 pattern.getGenerator().getIntParameters(), pattern.getGenerator()); 00420 00421 HashMap<String, Integer> intParams1 = new HashMap<String, Integer>(); 00422 HashMap<String, Integer> intParams2 = new HashMap<String, Integer>(); 00423 00424 for(Map.Entry<String, Integer> entry: 00425 getGenerator().getIntParameters().entrySet()){ 00426 String key = entry.getKey(); 00427 00428 if(getGenerator().inModel(key) || 00429 getGenerator().inProcessType(key)){ 00430 intParams1.put(key, entry.getValue()); 00431 } 00432 00433 } 00434 00435 for(Map.Entry<String, Integer> entry: 00436 pattern.getGenerator().getIntParameters().entrySet()){ 00437 String key = entry.getKey(); 00438 if(pattern.getGenerator().inModel(key) || 00439 pattern.getGenerator().inProcessType(key)){ 00440 intParams2.put(key, entry.getValue()); 00441 } 00442 } 00443 00444 match = match && compare("Integer: ",intParams1, intParams2, 00445 pattern.getGenerator()); 00446 00447 if(!match) return match; 00448 00449 HashMap<String, Double> realParams1 = new HashMap<String, Double>(); 00450 HashMap<String, Double> realParams2 = new HashMap<String, Double>(); 00451 for(Map.Entry entry: getGenerator().getRealParameters().entrySet()){ 00452 String key = (String)entry.getKey(); 00453 if(getGenerator().inModel(key) || 00454 getGenerator().inProcessType(key)){ 00455 realParams1.put(key, (Double)entry.getValue()); 00456 } 00457 } 00458 00459 for(Map.Entry entry: 00460 pattern.getGenerator().getRealParameters().entrySet()){ 00461 String key = (String)entry.getKey(); 00462 if(pattern.getGenerator().inModel(key)|| 00463 pattern.getGenerator().inProcessType(key)){ 00464 realParams2.put(key, (Double)entry.getValue()); 00465 } 00466 } 00467 00468 match = match && 00469 compare("Real : ", realParams1, realParams2, 00470 pattern.getGenerator()); 00471 00472 // match = match && compare("Real : ",getGenerator().getRealParameters(), 00473 // pattern.getGenerator().getRealParameters()); 00474 00475 if(!match) return match; 00476 00477 // Now the integer arrays. 00478 for (Map.Entry<String,HashMap<Integer,Integer>> entry : 00479 getGenerator().getIntParameterArrays().entrySet()){ 00480 00481 String arrayName = entry.getKey(); 00482 if(pattern.getGenerator().inModel(arrayName)){ 00483 HashMap<Integer,Integer> map2 = 00484 pattern.getGenerator().getIntParameterArrays(). 00485 get(arrayName); 00486 match = match && 00487 compare(arrayName,entry.getValue(),map2, 00488 pattern.getGenerator()); 00489 } 00490 } 00491 00492 if(!match) return match; 00493 00494 // Now the real arrays. 00495 for (Map.Entry<String,HashMap<Integer,Double>> entry : 00496 getGenerator().getRealParameterArrays().entrySet()){ 00497 00498 String arrayName = entry.getKey(); 00499 if(pattern.getGenerator().inModel(arrayName)){ 00500 HashMap<Integer,Double> map2 = 00501 pattern.getGenerator().getRealParameterArrays(). 00502 get(arrayName); 00503 match = match && 00504 compare(arrayName,entry.getValue(),map2, 00505 pattern.getGenerator()); 00506 } 00507 } 00508 /* 00509 if(photonpdfList != null && 00510 pattern.getPhotonPDFList()!=null){ 00511 match = match && compare(Match.PHPDF, 00512 PDF2Object(photonpdfList), 00513 PDF2Object(pattern.getPhotonPDFList())); 00514 } 00515 */ 00516 00517 if(getPhotonPDF() !=null && 00518 pattern.getPhotonPDF() !=null){ 00519 match = match && getPhotonPDF().equals(pattern.getPhotonPDF()); 00520 } 00521 00522 if(!match) return match; 00523 /* 00524 if(protonpdfList != null && 00525 pattern.getProtonPDFList()!=null){ 00526 match = match && compare(Match.PRPDF, 00527 PDF2Object(protonpdfList), 00528 PDF2Object(pattern.getProtonPDFList())); 00529 } 00530 */ 00531 if(getProtonPDF() != null && 00532 pattern.getProtonPDF() != null){ 00533 match = match && getProtonPDF().equals(pattern.getProtonPDF()); 00534 } 00535 00536 return match; 00537 }
|
|
Checks whether this pattern is consistent with a ResultSearchPattern. An unspecified attribute on EITHER pattern will match ANY value of the attribute on the other pattern.
Definition at line 382 of file ResultSearchPattern.java. References ResultSearchPattern.matches(). 00382 { 00383 return matches(pattern,null); 00384 }
|
|
Checks whether this pattern is consistent with a Model. An unspecified attribute on EITHER pattern will match ANY value of the attribute on the other pattern.
Definition at line 369 of file ResultSearchPattern.java. References ResultSearchPattern.matches(). 00369 { 00370 return matches(model,null); 00371 }
|
|
Checks whether this pattern is consistent with a runseries. An unspecified attribute on EITHER pattern will match ANY value of the attribute on the other pattern.
Definition at line 355 of file ResultSearchPattern.java. Referenced by DBManager.getConsistentModels(), DBManager.getConsistentRunSeries(), and ResultSearchPattern.matches(). 00355 { 00356 return matches(runSeries,runSeries.getMCProcessType()); 00357 }
|
|
Definition at line 539 of file ResultSearchPattern.java. 00539 { 00540 Vector<Object> objVec = new Vector<Object>(pdfVec.size()); 00541 for(PDF pdf: pdfVec){ 00542 objVec.add(pdf); 00543 } 00544 return objVec; 00545 }
|
|
Set all parameters to their default values. Definition at line 597 of file ResultSearchPattern.java. References ResultSearchPattern.generatorList, ResultSearchPattern.getGeneratorList(), ResultSearchPattern.getPhotonPDFList(), and ResultSearchPattern.getProtonPDFList(). Referenced by Searcher.doGet(), HTMLModelWriter.listNonDefaults(), and JobRequest.main(). 00597 { 00598 00599 getProtonPDFList().clear(); 00600 getProtonPDFList().add(JetWebConfig.defaultProtonPDF); 00601 00602 getPhotonPDFList().clear(); 00603 getPhotonPDFList().add(JetWebConfig.defaultPhotonPDF); 00604 00605 // Default generator 00606 getGeneratorList().clear(); 00607 Generator gen = Generator.Maker(); 00608 gen.setDefaults(); 00609 generatorList.add(gen); 00610 00611 }
|
|
Definition at line 179 of file ResultSearchPattern.java. References ResultSearchPattern.description_. Referenced by ServletUtils.makePattern(). 00179 { 00180 description_ = description; 00181 return this; 00182 }
|
|
Clear the list, then add the input Generator to it. Reimplemented in RunSeries. Definition at line 162 of file ResultSearchPattern.java. References ResultSearchPattern.generatorList. Referenced by Searcher.doGet(). 00162 { 00163 if (generatorList==null){ 00164 generatorList = new Vector<Generator>(); 00165 } else { 00166 generatorList.clear(); 00167 } 00168 generatorList.add(gen); 00169 }
|
|
Set any parameters which are not set to their default values. Definition at line 576 of file ResultSearchPattern.java. References ResultSearchPattern.getGeneratorList(), ResultSearchPattern.getPhotonPDFList(), and ResultSearchPattern.getProtonPDFList(). Referenced by Searcher.doGet(), JetWebLogReader.fillLog(), and Model.Model(). 00576 { 00577 00578 if (getProtonPDFList().size()==0) 00579 getProtonPDFList().add(JetWebConfig.defaultProtonPDF); 00580 if (getPhotonPDFList().size()==0) 00581 getPhotonPDFList().add(JetWebConfig.defaultPhotonPDF); 00582 00583 // Default generator 00584 if (getGeneratorList().size()==0) { 00585 // add a default generator 00586 Generator gen = Generator.Maker(); 00587 gen.setDefaults(); 00588 getGeneratorList().add(gen); 00589 } else { 00590 for (Generator gen : generatorList) 00591 gen.setSoftDefaults(); 00592 } 00593 }
|
|
Definition at line 35 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.setDescription(). |
|
List of generators. Definition at line 40 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.clone(), ResultSearchPattern.getGenerator(), ResultSearchPattern.getGeneratorList(), RunSeries.RunSeries(), ResultSearchPattern.setDefaults(), and ResultSearchPattern.setGenerator(). |
|
Vector of Match objects - contains differences between this pattern and another. Definition at line 54 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.clone(), ResultSearchPattern.compare(), ResultSearchPattern.getNonMatchingParameters(), and ResultSearchPattern.matches(). |
|
List of Photon Particle Density Functions Definition at line 48 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.clone(), ResultSearchPattern.getPhotonPDF(), ResultSearchPattern.getPhotonPDFList(), and RunSeries.RunSeries(). |
|
List of Proton Particle Density Functions Definition at line 44 of file ResultSearchPattern.java. Referenced by ResultSearchPattern.clone(), ResultSearchPattern.getProtonPDF(), ResultSearchPattern.getProtonPDFList(), and RunSeries.RunSeries(). |
Generated Wed Jan 17 09:14:27 GMT 2007