Public Member Functions | |
def | __delattr__ |
def | __init__ |
def | __setattr__ |
def | __setstate__ |
def | add_ |
def | analyzerNames |
def | analyzers_ |
def | dumpConfig |
def | dumpPython |
def | endpaths_ |
def | es_prefers_ |
def | es_producers_ |
def | es_sources_ |
def | extend |
def | fillProcessDesc |
def | filterNames |
def | filters_ |
def | globalReplace |
def | load |
def | looper_ |
def | name_ |
def | outputModules_ |
def | pathNames |
def | paths_ |
def | prefer |
def | producerNames |
def | producers_ |
def | prune |
def | pruneModules |
def | pruneSequences |
def | psets_ |
def | schedule_ |
def | sequences_ |
def | services_ |
def | setLooper_ |
def | setName_ |
def | setPartialSchedule_ |
def | setSchedule_ |
def | setSource_ |
def | setStrict |
def | source_ |
def | validate |
def | vpsets_ |
Properties | |
analyzers = property(analyzers_,doc="dictionary containing the analyzers for the process") | |
endpaths = property(endpaths_,doc="dictionary containing the endpaths for the process") | |
es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process") | |
es_producers = property(es_producers_,doc="dictionary containing the es_producers for the process") | |
es_sources = property(es_sources_,doc="dictionary containing the es_sources for the process") | |
filters = property(filters_, doc="dictionary containing the filters for the process") | |
looper = property(looper_,setLooper_,doc='the main looper or None if not set') | |
outputModules = property(outputModules_,doc="dictionary containing the output_modules for the process") | |
paths = property(paths_,doc="dictionary containing the paths for the process") | |
process = property(name_,setName_, doc="name of the process") | |
producers = property(producers_,doc="dictionary containing the producers for the process") | |
psets = property(psets_,doc="dictionary containing the PSets for the process") | |
schedule = property(schedule_,setSchedule_,doc='the schedule or None if not set') | |
sequences = property(sequences_,doc="dictionary containing the sequences for the process") | |
services = property(services_,doc="dictionary containing the services for the process") | |
source = property(source_,setSource_,doc='the main source or None if not set') | |
vpsets = property(vpsets_,doc="dictionary containing the PSets for the process") | |
Private Member Functions | |
def | _dumpConfigESPrefers |
def | _dumpConfigNamedList |
def | _dumpConfigOptionallyNamedList |
def | _dumpConfigUnnamedList |
def | _dumpPython |
def | _dumpPythonList |
def | _findPreferred |
def | _insertInto |
def | _insertManyInto |
def | _insertOneInto |
def | _insertPaths |
def | _insertServices |
def | _okToPlace |
def | _place |
def | _placeAnalyzer |
def | _placeEndPath |
def | _placeESPrefer |
def | _placeESProducer |
def | _placeESSource |
def | _placeFilter |
def | _placeLooper |
def | _placeOutputModule |
def | _placePath |
def | _placeProducer |
def | _placePSet |
def | _placeSequence |
def | _placeService |
def | _placeSource |
def | _placeVPSet |
def | _replaceInSequences |
def | _sequencesInDependencyOrder |
def | _validateSequence |
Private Attributes | |
__isStrict |
def Config::Process::__init__ | ( | self, | |
name | |||
) |
Definition at line 102 of file Config.py.
00103 : 00104 self.__dict__['_Process__name'] = name 00105 self.__dict__['_Process__filters'] = {} 00106 self.__dict__['_Process__producers'] = {} 00107 self.__dict__['_Process__source'] = None 00108 self.__dict__['_Process__looper'] = None 00109 self.__dict__['_Process__schedule'] = None 00110 self.__dict__['_Process__analyzers'] = {} 00111 self.__dict__['_Process__outputmodules'] = {} 00112 self.__dict__['_Process__paths'] = DictTypes.SortedKeysDict() # have to keep the order 00113 self.__dict__['_Process__endpaths'] = DictTypes.SortedKeysDict() # of definition 00114 self.__dict__['_Process__sequences'] = {} 00115 self.__dict__['_Process__services'] = {} 00116 self.__dict__['_Process__essources'] = {} 00117 self.__dict__['_Process__esproducers'] = {} 00118 self.__dict__['_Process__esprefers'] = {} 00119 self.__dict__['_Process__psets']={} 00120 self.__dict__['_Process__vpsets']={} 00121 self.__dict__['_cloneToObjectDict'] = {} 00122 # policy switch to avoid object overwriting during extend/load 00123 self.__dict__['_Process__InExtendCall'] = False 00124 self.__dict__['_Process__partialschedules'] = {} 00125 self.__isStrict = False
def Config::Process::__delattr__ | ( | self, | |
name | |||
) |
Definition at line 296 of file Config.py.
00297 : 00298 if not hasattr(self,name): 00299 raise KeyError('process does not know about '+name) 00300 elif name.startswith('_Process__'): 00301 raise ValueError('this attribute cannot be deleted') 00302 else: 00303 # we have to remove it from all dictionaries/registries 00304 dicts = [item for item in self.__dict__.values() if (type(item)==dict or type(item)==DictTypes.SortedKeysDict)] 00305 for reg in dicts: 00306 if reg.has_key(name): del reg[name] 00307 # if it was a labelable object, the label needs to be removed 00308 obj = getattr(self,name) 00309 if isinstance(obj,_Labelable): 00310 getattr(self,name).setLabel(None) 00311 # now remove it from the process itself 00312 try: 00313 del self.__dict__[name] 00314 except: 00315 pass
def Config::Process::__setattr__ | ( | self, | |
name, | |||
value | |||
) |
Definition at line 246 of file Config.py.
00247 : 00248 # check if the name is well-formed (only _ and alphanumerics are allowed) 00249 if not name.replace('_','').isalnum(): 00250 raise ValueError('The label '+name+' contains forbiden characters') 00251 00252 # private variable exempt from all this 00253 if name.startswith('_Process__'): 00254 self.__dict__[name]=value 00255 return 00256 if not isinstance(value,_ConfigureComponent): 00257 raise TypeError("can only assign labels to an object which inherits from '_ConfigureComponent'\n" 00258 +"an instance of "+str(type(value))+" will not work") 00259 if not isinstance(value,_Labelable) and not isinstance(value,Source) and not isinstance(value,Looper) and not isinstance(value,Schedule): 00260 if name == value.type_(): 00261 self.add_(value) 00262 return 00263 else: 00264 raise TypeError("an instance of "+str(type(value))+" can not be assigned the label '"+name+"'.\n"+ 00265 "Please either use the label '"+value.type_()+" or use the 'add_' method instead.") 00266 #clone the item 00267 if self.__isStrict: 00268 newValue =value.copy() 00269 try: 00270 newValue._filename = value._filename 00271 except: 00272 pass 00273 value.setIsFrozen() 00274 else: 00275 newValue =value 00276 if not self._okToPlace(name, value, self.__dict__): 00277 msg = "Trying to override definition of process."+name 00278 msg += "\n new object defined in: "+value._filename 00279 msg += "\n existing object defined in: "+getattr(self,name)._filename 00280 raise ValueError(msg) 00281 # remove the old object of the name (if there is one) 00282 if hasattr(self,name) and not (getattr(self,name)==newValue): 00283 # Allow items in sequences from load() statements to have 00284 # degeneratate names, but if the user overwrites a name in the 00285 # main config, replace it everywhere 00286 if not self.__InExtendCall and isinstance(newValue, _Sequenceable): 00287 self._replaceInSequences(name, newValue) 00288 self.__delattr__(name) 00289 self.__dict__[name]=newValue 00290 if isinstance(newValue,_Labelable): 00291 newValue.setLabel(name) 00292 self._cloneToObjectDict[id(value)] = newValue 00293 self._cloneToObjectDict[id(newValue)] = newValue 00294 #now put in proper bucket 00295 newValue._place(name,self)
def Config::Process::__setstate__ | ( | self, | |
pkldict | |||
) |
Unpickling hook. Since cloneToObjectDict stores a hash of objects by their id() it needs to be updated when unpickling to use the new object id values instantiated during the unpickle.
Definition at line 140 of file Config.py.
00141 : 00142 """ 00143 Unpickling hook. 00144 00145 Since cloneToObjectDict stores a hash of objects by their 00146 id() it needs to be updated when unpickling to use the 00147 new object id values instantiated during the unpickle. 00148 00149 """ 00150 self.__dict__.update(pkldict) 00151 tmpDict = {} 00152 for value in self._cloneToObjectDict.values(): 00153 tmpDict[id(value)] = value 00154 self.__dict__['_cloneToObjectDict'] = tmpDict 00155 00156
def Config::Process::_dumpConfigESPrefers | ( | self, | |
options | |||
) | [private] |
def Config::Process::_dumpConfigNamedList | ( | self, | |
items, | |||
typeName, | |||
options | |||
) | [private] |
def Config::Process::_dumpConfigOptionallyNamedList | ( | self, | |
items, | |||
typeName, | |||
options | |||
) | [private] |
def Config::Process::_dumpConfigUnnamedList | ( | self, | |
items, | |||
typeName, | |||
options | |||
) | [private] |
def Config::Process::_dumpPython | ( | self, | |
d, | |||
options | |||
) | [private] |
def Config::Process::_dumpPythonList | ( | self, | |
d, | |||
options | |||
) | [private] |
Definition at line 535 of file Config.py.
00536 : 00537 returnValue = '' 00538 if isinstance(d, DictTypes.SortedKeysDict): 00539 for name,item in d.items(): 00540 returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n' 00541 else: 00542 for name,item in sorted(d.items()): 00543 returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n' return returnValue
def Config::Process::_findPreferred | ( | self, | |
esname, | |||
d, | |||
args, | |||
kargs | |||
) | [private] |
Definition at line 777 of file Config.py.
00778 : 00779 # is esname a name in the dictionary? 00780 if esname in d: 00781 typ = d[esname].type_() 00782 if typ == esname: 00783 self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) ) 00784 else: 00785 self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) ) 00786 return True 00787 else: 00788 # maybe it's an unnamed ESModule? 00789 found = False 00790 for name, value in d.iteritems(): 00791 if value.type_() == esname: 00792 if found: 00793 raise RuntimeError("More than one ES module for "+esname) 00794 found = True 00795 self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) ) 00796 return found
def Config::Process::_insertInto | ( | self, | |
parameterSet, | |||
itemDict | |||
) | [private] |
def Config::Process::_insertManyInto | ( | self, | |
parameterSet, | |||
label, | |||
itemDict | |||
) | [private] |
Definition at line 639 of file Config.py.
00640 : 00641 l = [] 00642 for name,value in itemDict.iteritems(): 00643 newLabel = value.nameInProcessDesc_(name) 00644 l.append(newLabel) 00645 value.insertInto(parameterSet, name) 00646 # alphabetical order is easier to compare with old language 00647 l.sort() parameterSet.addVString(True, label, l)
def Config::Process::_insertOneInto | ( | self, | |
parameterSet, | |||
label, | |||
item | |||
) | [private] |
def Config::Process::_insertPaths | ( | self, | |
processDesc, | |||
processPSet | |||
) | [private] |
Definition at line 651 of file Config.py.
00652 : 00653 scheduledPaths = [] 00654 triggerPaths = [] 00655 endpaths = [] 00656 if self.schedule_() == None: 00657 # make one from triggerpaths & endpaths 00658 for name,value in self.paths_().iteritems(): 00659 scheduledPaths.append(name) 00660 triggerPaths.append(name) 00661 for name,value in self.endpaths_().iteritems(): 00662 scheduledPaths.append(name) 00663 endpaths.append(name) 00664 else: 00665 for path in self.schedule_(): 00666 pathname = path.label_() 00667 scheduledPaths.append(pathname) 00668 if self.endpaths_().has_key(pathname): 00669 endpaths.append(pathname) 00670 else: 00671 triggerPaths.append(pathname) 00672 processPSet.addVString(True, "@end_paths", endpaths) 00673 processPSet.addVString(True, "@paths", scheduledPaths) 00674 # trigger_paths are a little different 00675 p = processDesc.newPSet() 00676 p.addVString(True, "@trigger_paths", triggerPaths) 00677 processPSet.addPSet(True, "@trigger_paths", p) 00678 # add all these paths 00679 pathValidator = PathValidator() 00680 endpathValidator = EndPathValidator() 00681 for triggername in triggerPaths: 00682 #self.paths_()[triggername].insertInto(processPSet, triggername, self.sequences_()) 00683 self.paths_()[triggername].visit(pathValidator) 00684 self.paths_()[triggername].insertInto(processPSet, triggername, self.__dict__) 00685 for endpathname in endpaths: 00686 #self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.sequences_()) 00687 self.endpaths_()[endpathname].visit(endpathValidator) 00688 self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.__dict__) 00689 processPSet.addVString(False, "@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
def Config::Process::_insertServices | ( | self, | |
processDesc, | |||
itemDict | |||
) | [private] |
def Config::Process::_okToPlace | ( | self, | |
name, | |||
mod, | |||
d | |||
) | [private] |
Definition at line 331 of file Config.py.
00332 : 00333 if not self.__InExtendCall: 00334 # if going 00335 return True 00336 elif not self.__isStrict: 00337 return True 00338 elif name in d: 00339 # if there's an old copy, and the new one 00340 # hasn't been modified, we're done. Still 00341 # not quite safe if something has been defined twice. 00342 # Need to add checks 00343 if mod._isModified: 00344 if d[name]._isModified: 00345 return False 00346 else: 00347 return True 00348 else: 00349 return True 00350 else: 00351 return True
def Config::Process::_place | ( | self, | |
name, | |||
mod, | |||
d | |||
) | [private] |
def Config::Process::_placeAnalyzer | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeEndPath | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeESPrefer | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeESProducer | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeESSource | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeFilter | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeLooper | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeOutputModule | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placePath | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeProducer | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placePSet | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeSequence | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_placeService | ( | self, | |
typeName, | |||
mod | |||
) | [private] |
def Config::Process::_placeSource | ( | self, | |
name, | |||
mod | |||
) | [private] |
Allow the source to be referenced by 'source' or by type name
Definition at line 395 of file Config.py.
00396 : 00397 """Allow the source to be referenced by 'source' or by type name""" 00398 if name != 'source': 00399 raise ValueError("The label '"+name+"' can not be used for a Source. Only 'source' is allowed.") 00400 if self.__dict__['_Process__source'] is not None : 00401 del self.__dict__[self.__dict__['_Process__source'].type_()] 00402 self.__dict__['_Process__source'] = mod self.__dict__[mod.type_()] = mod
def Config::Process::_placeVPSet | ( | self, | |
name, | |||
mod | |||
) | [private] |
def Config::Process::_replaceInSequences | ( | self, | |
label, | |||
new | |||
) | [private] |
Definition at line 614 of file Config.py.
00615 : 00616 old = getattr(self,label) 00617 #TODO - replace by iterator concatenation 00618 for sequenceable in self.sequences.itervalues(): 00619 sequenceable.replace(old,new) 00620 for sequenceable in self.paths.itervalues(): 00621 sequenceable.replace(old,new) 00622 for sequenceable in self.endpaths.itervalues(): sequenceable.replace(old,new)
def Config::Process::_sequencesInDependencyOrder | ( | self | ) | [private] |
Definition at line 552 of file Config.py.
00553 : 00554 #for each sequence, see what other sequences it depends upon 00555 returnValue=DictTypes.SortedKeysDict() 00556 dependencies = {} 00557 for label,seq in self.sequences.iteritems(): 00558 d = [] 00559 v = SequenceVisitor(d) 00560 seq.visit(v) 00561 dependencies[label]=[dep.label_() for dep in d if dep.label_() != None] 00562 resolvedDependencies=True 00563 #keep looping until we can no longer get rid of all dependencies 00564 # if that happens it means we have circular dependencies 00565 iterCount = 0 00566 while resolvedDependencies: 00567 iterCount += 1 00568 resolvedDependencies = (0 != len(dependencies)) 00569 oldDeps = dict(dependencies) 00570 for label,deps in oldDeps.iteritems(): 00571 # don't try too hard 00572 if len(deps)==0 or iterCount > 100: 00573 iterCount = 0 00574 resolvedDependencies=True 00575 returnValue[label]=self.sequences[label] 00576 #remove this as a dependency for all other sequences 00577 del dependencies[label] 00578 for lb2,deps2 in dependencies.iteritems(): 00579 while deps2.count(label): 00580 deps2.remove(label) 00581 if len(dependencies): 00582 raise RuntimeError("circular sequence dependency discovered \n"+ 00583 ",".join([label for label,junk in dependencies.iteritems()])) return returnValue
def Config::Process::_validateSequence | ( | self, | |
sequence, | |||
label | |||
) | [private] |
def Config::Process::add_ | ( | self, | |
value | |||
) |
Allows addition of components which do not have to have a label, e.g. Services
Definition at line 316 of file Config.py.
00317 : 00318 """Allows addition of components which do not have to have a label, e.g. Services""" 00319 if not isinstance(value,_ConfigureComponent): 00320 raise TypeError 00321 if not isinstance(value,_Unlabelable): 00322 raise TypeError 00323 #clone the item 00324 #clone the item 00325 if self.__isStrict: 00326 newValue =value.copy() 00327 value.setIsFrozen() 00328 else: 00329 newValue =value 00330 newValue._place('',self)
def Config::Process::analyzerNames | ( | self | ) |
def Config::Process::analyzers_ | ( | self | ) |
def Config::Process::dumpConfig | ( | self, | |
options = PrintOptions() |
|||
) |
return a string containing the equivalent process defined using the configuration language
Definition at line 475 of file Config.py.
00476 : 00477 """return a string containing the equivalent process defined using the configuration language""" 00478 config = "process "+self.__name+" = {\n" 00479 options.indent() 00480 if self.source_(): 00481 config += options.indentation()+"source = "+self.source_().dumpConfig(options) 00482 if self.looper_(): 00483 config += options.indentation()+"looper = "+self.looper_().dumpConfig(options) 00484 config+=self._dumpConfigNamedList(self.producers_().iteritems(), 00485 'module', 00486 options) 00487 config+=self._dumpConfigNamedList(self.filters_().iteritems(), 00488 'module', 00489 options) 00490 config+=self._dumpConfigNamedList(self.analyzers_().iteritems(), 00491 'module', 00492 options) 00493 config+=self._dumpConfigNamedList(self.outputModules_().iteritems(), 00494 'module', 00495 options) 00496 config+=self._dumpConfigNamedList(self.sequences_().iteritems(), 00497 'sequence', 00498 options) 00499 config+=self._dumpConfigNamedList(self.paths_().iteritems(), 00500 'path', 00501 options) 00502 config+=self._dumpConfigNamedList(self.endpaths_().iteritems(), 00503 'endpath', 00504 options) 00505 config+=self._dumpConfigUnnamedList(self.services_().iteritems(), 00506 'service', 00507 options) 00508 config+=self._dumpConfigOptionallyNamedList( 00509 self.es_producers_().iteritems(), 00510 'es_module', 00511 options) 00512 config+=self._dumpConfigOptionallyNamedList( 00513 self.es_sources_().iteritems(), 00514 'es_source', 00515 options) 00516 config += self._dumpConfigESPrefers(options) 00517 for name,item in self.psets.iteritems(): 00518 config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options) 00519 for name,item in self.vpsets.iteritems(): 00520 config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options) 00521 if self.schedule: 00522 pathNames = [p.label_() for p in self.schedule] 00523 config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n' 00524 00525 # config+=self._dumpConfigNamedList(self.vpsets.iteritems(), 00526 # 'VPSet', 00527 # options) 00528 config += "}\n" 00529 options.unindent() return config
def Config::Process::dumpPython | ( | self, | |
options = PrintOptions() |
|||
) |
return a string containing the equivalent process defined using the configuration language
Definition at line 589 of file Config.py.
00590 : 00591 """return a string containing the equivalent process defined using the configuration language""" 00592 result = "import FWCore.ParameterSet.Config as cms\n\n" 00593 result += "process = cms.Process(\""+self.__name+"\")\n\n" 00594 if self.source_(): 00595 result += "process.source = "+self.source_().dumpPython(options) 00596 if self.looper_(): 00597 result += "process.looper = "+self.looper_().dumpPython() 00598 result+=self._dumpPythonList(self.producers_(), options) 00599 result+=self._dumpPythonList(self.filters_() , options) 00600 result+=self._dumpPythonList(self.analyzers_(), options) 00601 result+=self._dumpPythonList(self.outputModules_(), options) 00602 result+=self._dumpPythonList(self._sequencesInDependencyOrder(), options) 00603 result+=self._dumpPythonList(self.paths_(), options) 00604 result+=self._dumpPythonList(self.endpaths_(), options) 00605 result+=self._dumpPythonList(self.services_(), options) 00606 result+=self._dumpPythonList(self.es_producers_(), options) 00607 result+=self._dumpPythonList(self.es_sources_(), options) 00608 result+=self._dumpPython(self.es_prefers_(), options) 00609 result+=self._dumpPythonList(self.psets, options) 00610 result+=self._dumpPythonList(self.vpsets, options) 00611 if self.schedule: 00612 pathNames = ['process.'+p.label_() for p in self.schedule] 00613 result +='process.schedule = cms.Schedule('+','.join(pathNames)+')\n' return result
def Config::Process::endpaths_ | ( | self | ) |
def Config::Process::es_prefers_ | ( | self | ) |
def Config::Process::es_producers_ | ( | self | ) |
def Config::Process::es_sources_ | ( | self | ) |
def Config::Process::extend | ( | self, | |
other, | |||
items = () |
|||
) |
Look in other and find types which we can use
Definition at line 415 of file Config.py.
00416 : 00417 """Look in other and find types which we can use""" 00418 # enable explicit check to avoid overwriting of existing objects 00419 self.__dict__['_Process__InExtendCall'] = True 00420 00421 seqs = dict() 00422 labelled = dict() 00423 for name in dir(other): 00424 #'from XX import *' ignores these, and so should we. 00425 if name.startswith('_'): 00426 continue 00427 item = getattr(other,name) 00428 if name == "source" or name == "looper": 00429 self.__setattr__(name,item) 00430 elif isinstance(item,_ModuleSequenceType): 00431 seqs[name]=item 00432 elif isinstance(item,_Labelable): 00433 self.__setattr__(name,item) 00434 labelled[name]=item 00435 try: 00436 item.label_() 00437 except: 00438 item.setLabel(name) 00439 continue 00440 elif isinstance(item,Schedule): 00441 self.__setattr__(name,item) 00442 elif isinstance(item,_Unlabelable): 00443 self.add_(item) 00444 00445 #now create a sequence which uses the newly made items 00446 for name in seqs.iterkeys(): 00447 seq = seqs[name] 00448 #newSeq = seq.copy() 00449 # 00450 if id(seq) not in self._cloneToObjectDict: 00451 self.__setattr__(name,seq) 00452 else: 00453 newSeq = self._cloneToObjectDict[id(seq)] 00454 self.__dict__[name]=newSeq 00455 newSeq.setLabel(name) 00456 #now put in proper bucket 00457 newSeq._place(name,self) self.__dict__['_Process__InExtendCall'] = False
def Config::Process::fillProcessDesc | ( | self, | |
processDesc, | |||
processPSet | |||
) |
Definition at line 722 of file Config.py.
00723 : 00724 self.validate() 00725 processPSet.addString(True, "@process_name", self.name_()) 00726 all_modules = self.producers_().copy() 00727 all_modules.update(self.filters_()) 00728 all_modules.update(self.analyzers_()) 00729 all_modules.update(self.outputModules_()) 00730 self._insertInto(processPSet, self.psets_()) 00731 self._insertInto(processPSet, self.vpsets_()) 00732 self._insertManyInto(processPSet, "@all_modules", all_modules) 00733 self._insertOneInto(processPSet, "@all_sources", self.source_()) 00734 self._insertOneInto(processPSet, "@all_loopers", self.looper_()) 00735 self._insertManyInto(processPSet, "@all_esmodules", self.es_producers_()) 00736 self._insertManyInto(processPSet, "@all_essources", self.es_sources_()) 00737 self._insertManyInto(processPSet, "@all_esprefers", self.es_prefers_()) 00738 self._insertPaths(processDesc, processPSet) 00739 self._insertServices(processDesc, self.services_()) 00740 return processDesc
def Config::Process::filterNames | ( | self | ) |
def Config::Process::filters_ | ( | self | ) |
def Config::Process::globalReplace | ( | self, | |
label, | |||
new | |||
) |
Replace the item with label 'label' by object 'new' in the process and all sequences/paths
def Config::Process::load | ( | self, | |
moduleName | |||
) |
def Config::Process::looper_ | ( | self | ) |
def Config::Process::name_ | ( | self | ) |
def Config::Process::outputModules_ | ( | self | ) |
def Config::Process::pathNames | ( | self | ) |
def Config::Process::paths_ | ( | self | ) |
def Config::Process::prefer | ( | self, | |
esmodule, | |||
args, | |||
kargs | |||
) |
Prefer this ES source or producer. The argument can either be an object label, e.g., process.prefer(process.juicerProducer) (not supported yet) or a name of an ESSource or ESProducer process.prefer("juicer") or a type of unnamed ESSource or ESProducer process.prefer("JuicerProducer") In addition, you can pass as a labelled arguments the name of the Record you wish to prefer where the type passed is a cms.vstring and that vstring can contain the name of the C++ types in the Record which are being preferred, e.g., #prefer all data in record 'OrangeRecord' from 'juicer' process.prefer("juicer", OrangeRecord=cms.vstring()) or #prefer only "Orange" data in "OrangeRecord" from "juicer" process.prefer("juicer", OrangeRecord=cms.vstring("Orange")) or #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer" ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
Definition at line 748 of file Config.py.
00749 : 00750 """Prefer this ES source or producer. The argument can 00751 either be an object label, e.g., 00752 process.prefer(process.juicerProducer) (not supported yet) 00753 or a name of an ESSource or ESProducer 00754 process.prefer("juicer") 00755 or a type of unnamed ESSource or ESProducer 00756 process.prefer("JuicerProducer") 00757 In addition, you can pass as a labelled arguments the name of the Record you wish to 00758 prefer where the type passed is a cms.vstring and that vstring can contain the 00759 name of the C++ types in the Record which are being preferred, e.g., 00760 #prefer all data in record 'OrangeRecord' from 'juicer' 00761 process.prefer("juicer", OrangeRecord=cms.vstring()) 00762 or 00763 #prefer only "Orange" data in "OrangeRecord" from "juicer" 00764 process.prefer("juicer", OrangeRecord=cms.vstring("Orange")) 00765 or 00766 #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer" 00767 ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp")) 00768 """ 00769 # see if this refers to a named ESProducer 00770 if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer): 00771 raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet") 00772 elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \ 00773 self._findPreferred(esmodule, self.es_sources_(),*args,**kargs): 00774 pass 00775 else: 00776 raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
def Config::Process::producerNames | ( | self | ) |
def Config::Process::producers_ | ( | self | ) |
def Config::Process::prune | ( | self | ) |
Remove clutter from the process which we think is unnecessary: PSets, and unused modules. Not working yet, because I need to remove all unneeded sequences and paths that contain removed modules
Definition at line 690 of file Config.py.
00691 : 00692 """ Remove clutter from the process which we think is unnecessary: 00693 PSets, and unused modules. Not working yet, because I need to remove 00694 all unneeded sequences and paths that contain removed modules """ 00695 for name in self.psets_(): 00696 delattr(self, name) 00697 for name in self.vpsets_(): 00698 delattr(self, name) 00699 00700 if self.schedule_(): 00701 self.pruneSequences() 00702 scheduledNames = self.schedule_().moduleNames() 00703 self.pruneModules(self.producers_(), scheduledNames) 00704 self.pruneModules(self.filters_(), scheduledNames) 00705 self.pruneModules(self.analyzers_(), scheduledNames)
def Config::Process::pruneModules | ( | self, | |
d, | |||
scheduledNames | |||
) |
def Config::Process::pruneSequences | ( | self | ) |
Definition at line 706 of file Config.py.
00707 : 00708 scheduledSequences = [] 00709 visitor = SequenceVisitor(scheduledSequences) 00710 #self.schedule_()._seq.visit(visitor) 00711 #scheduledSequenceNames = set([seq.label_() for seq in scheduledSequences]) 00712 #sequenceNames = set(self.sequences_().keys()) 00713 #junk = sequenceNames - scheduledSequenceNames 00714 #for name in junk: 00715 # delattr(self, name)
def Config::Process::psets_ | ( | self | ) |
def Config::Process::schedule_ | ( | self | ) |
def Config::Process::sequences_ | ( | self | ) |
def Config::Process::services_ | ( | self | ) |
def Config::Process::setLooper_ | ( | self, | |
lpr | |||
) |
def Config::Process::setName_ | ( | self, | |
name | |||
) |
def Config::Process::setPartialSchedule_ | ( | self, | |
sch, | |||
label | |||
) |
def Config::Process::setSchedule_ | ( | self, | |
sch | |||
) |
Definition at line 210 of file Config.py.
00211 : 00212 # See if every module has been inserted into the process 00213 index = 0 00214 try: 00215 for p in sch: 00216 p.label_() 00217 index +=1 00218 except: 00219 raise RuntimeError("The path at index "+str(index)+" in the Schedule was not attached to the process.") 00220 self.__dict__['_Process__schedule'] = sch
def Config::Process::setSource_ | ( | self, | |
src | |||
) |
def Config::Process::setStrict | ( | self, | |
value | |||
) |
def Config::Process::source_ | ( | self | ) |
def Config::Process::validate | ( | self | ) |
def Config::Process::vpsets_ | ( | self | ) |
Config::Process::__isStrict [private] |
Config::Process::analyzers = property(analyzers_,doc="dictionary containing the analyzers for the process") [static] |
Config::Process::endpaths = property(endpaths_,doc="dictionary containing the endpaths for the process") [static] |
Config::Process::es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process") [static] |
Config::Process::es_producers = property(es_producers_,doc="dictionary containing the es_producers for the process") [static] |
Config::Process::es_sources = property(es_sources_,doc="dictionary containing the es_sources for the process") [static] |
Config::Process::filters = property(filters_, doc="dictionary containing the filters for the process") [static] |
Config::Process::looper = property(looper_,setLooper_,doc='the main looper or None if not set') [static] |
Config::Process::outputModules = property(outputModules_,doc="dictionary containing the output_modules for the process") [static] |
Config::Process::paths = property(paths_,doc="dictionary containing the paths for the process") [static] |
Config::Process::process = property(name_,setName_, doc="name of the process") [static] |
Config::Process::producers = property(producers_,doc="dictionary containing the producers for the process") [static] |
Config::Process::psets = property(psets_,doc="dictionary containing the PSets for the process") [static] |
Config::Process::schedule = property(schedule_,setSchedule_,doc='the schedule or None if not set') [static] |
Config::Process::sequences = property(sequences_,doc="dictionary containing the sequences for the process") [static] |
Config::Process::services = property(services_,doc="dictionary containing the services for the process") [static] |
Config::Process::source = property(source_,setSource_,doc='the main source or None if not set') [static] |