CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Properties | Private Member Functions | Private Attributes
Config.Process Class Reference
Inheritance diagram for Config.Process:

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
 

Detailed Description

Root class for a CMS configuration process

Definition at line 100 of file Config.py.

Constructor & Destructor Documentation

def Config.Process.__init__ (   self,
  name 
)

Definition at line 102 of file Config.py.

103  def __init__(self,name):
104  self.__dict__['_Process__name'] = name
105  self.__dict__['_Process__filters'] = {}
106  self.__dict__['_Process__producers'] = {}
107  self.__dict__['_Process__source'] = None
108  self.__dict__['_Process__looper'] = None
109  self.__dict__['_Process__schedule'] = None
110  self.__dict__['_Process__analyzers'] = {}
111  self.__dict__['_Process__outputmodules'] = {}
112  self.__dict__['_Process__paths'] = DictTypes.SortedKeysDict() # have to keep the order
113  self.__dict__['_Process__endpaths'] = DictTypes.SortedKeysDict() # of definition
114  self.__dict__['_Process__sequences'] = {}
115  self.__dict__['_Process__services'] = {}
116  self.__dict__['_Process__essources'] = {}
117  self.__dict__['_Process__esproducers'] = {}
118  self.__dict__['_Process__esprefers'] = {}
119  self.__dict__['_Process__psets']={}
120  self.__dict__['_Process__vpsets']={}
121  self.__dict__['_cloneToObjectDict'] = {}
122  # policy switch to avoid object overwriting during extend/load
123  self.__dict__['_Process__InExtendCall'] = False
124  self.__dict__['_Process__partialschedules'] = {}
125  self.__isStrict = False
def __init__
Definition: Config.py:102

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 296 of file Config.py.

Referenced by Config.Process.__setattr__().

297  def __delattr__(self,name):
298  if not hasattr(self,name):
299  raise KeyError('process does not know about '+name)
300  elif name.startswith('_Process__'):
301  raise ValueError('this attribute cannot be deleted')
302  else:
303  # we have to remove it from all dictionaries/registries
304  dicts = [item for item in self.__dict__.values() if (type(item)==dict or type(item)==DictTypes.SortedKeysDict)]
305  for reg in dicts:
306  if reg.has_key(name): del reg[name]
307  # if it was a labelable object, the label needs to be removed
308  obj = getattr(self,name)
309  if isinstance(obj,_Labelable):
310  getattr(self,name).setLabel(None)
311  # now remove it from the process itself
312  try:
313  del self.__dict__[name]
314  except:
315  pass
def __delattr__
Definition: Config.py:296
def Config.Process.__setattr__ (   self,
  name,
  value 
)

Definition at line 246 of file Config.py.

References Config.Process.__delattr__(), Config.Process.__isStrict, Config.Process._okToPlace(), Config.Process._replaceInSequences(), Config.Process.add_(), and ExpressReco_HICollisions_FallBack.id.

Referenced by Config.Process._findPreferred(), and Config.Process.extend().

247  def __setattr__(self,name,value):
248  # check if the name is well-formed (only _ and alphanumerics are allowed)
249  if not name.replace('_','').isalnum():
250  raise ValueError('The label '+name+' contains forbiden characters')
251 
252  # private variable exempt from all this
253  if name.startswith('_Process__'):
254  self.__dict__[name]=value
255  return
256  if not isinstance(value,_ConfigureComponent):
257  raise TypeError("can only assign labels to an object which inherits from '_ConfigureComponent'\n"
258  +"an instance of "+str(type(value))+" will not work")
259  if not isinstance(value,_Labelable) and not isinstance(value,Source) and not isinstance(value,Looper) and not isinstance(value,Schedule):
260  if name == value.type_():
261  self.add_(value)
262  return
263  else:
264  raise TypeError("an instance of "+str(type(value))+" can not be assigned the label '"+name+"'.\n"+
265  "Please either use the label '"+value.type_()+" or use the 'add_' method instead.")
266  #clone the item
267  if self.__isStrict:
268  newValue =value.copy()
269  try:
270  newValue._filename = value._filename
271  except:
272  pass
273  value.setIsFrozen()
274  else:
275  newValue =value
276  if not self._okToPlace(name, value, self.__dict__):
277  msg = "Trying to override definition of process."+name
278  msg += "\n new object defined in: "+value._filename
279  msg += "\n existing object defined in: "+getattr(self,name)._filename
280  raise ValueError(msg)
281  # remove the old object of the name (if there is one)
282  if hasattr(self,name) and not (getattr(self,name)==newValue):
283  # Allow items in sequences from load() statements to have
284  # degeneratate names, but if the user overwrites a name in the
285  # main config, replace it everywhere
286  if not self.__InExtendCall and isinstance(newValue, _Sequenceable):
287  self._replaceInSequences(name, newValue)
288  self.__delattr__(name)
289  self.__dict__[name]=newValue
290  if isinstance(newValue,_Labelable):
291  newValue.setLabel(name)
292  self._cloneToObjectDict[id(value)] = newValue
293  self._cloneToObjectDict[id(newValue)] = newValue
294  #now put in proper bucket
295  newValue._place(name,self)
def _replaceInSequences
Definition: Config.py:614
def __delattr__
Definition: Config.py:296
def _okToPlace
Definition: Config.py:331
def __setattr__
Definition: Config.py:246
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.

References ExpressReco_HICollisions_FallBack.id.

141  def __setstate__(self, pkldict):
142  """
143  Unpickling hook.
144 
145  Since cloneToObjectDict stores a hash of objects by their
146  id() it needs to be updated when unpickling to use the
147  new object id values instantiated during the unpickle.
148 
149  """
150  self.__dict__.update(pkldict)
151  tmpDict = {}
152  for value in self._cloneToObjectDict.values():
153  tmpDict[id(value)] = value
154  self.__dict__['_cloneToObjectDict'] = tmpDict
155 
156 
def __setstate__
Definition: Config.py:140
def Config.Process._dumpConfigESPrefers (   self,
  options 
)
private

Definition at line 530 of file Config.py.

References Config.Process.es_prefers_().

Referenced by Config.Process.dumpConfig().

531  def _dumpConfigESPrefers(self, options):
532  result = ''
533  for item in self.es_prefers_().itervalues():
534  result +=options.indentation()+'es_prefer '+item.targetLabel_()+' = '+item.dumpConfig(options)
return result
def _dumpConfigESPrefers
Definition: Config.py:530
def es_prefers_
Definition: Config.py:234
def Config.Process._dumpConfigNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 458 of file Config.py.

Referenced by Config.Process.dumpConfig().

459  def _dumpConfigNamedList(self,items,typeName,options):
460  returnValue = ''
461  for name,item in items:
462  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigNamedList
Definition: Config.py:458
def Config.Process._dumpConfigOptionallyNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 468 of file Config.py.

Referenced by Config.Process.dumpConfig().

469  def _dumpConfigOptionallyNamedList(self,items,typeName,options):
470  returnValue = ''
471  for name,item in items:
472  if name == item.type_():
473  name = ''
474  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigOptionallyNamedList
Definition: Config.py:468
def Config.Process._dumpConfigUnnamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 463 of file Config.py.

Referenced by Config.Process.dumpConfig().

464  def _dumpConfigUnnamedList(self,items,typeName,options):
465  returnValue = ''
466  for name,item in items:
467  returnValue +=options.indentation()+typeName+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigUnnamedList
Definition: Config.py:463
def Config.Process._dumpPython (   self,
  d,
  options 
)
private

Definition at line 584 of file Config.py.

Referenced by Config.Process.dumpPython().

585  def _dumpPython(self, d, options):
586  result = ''
587  for name, value in d.iteritems():
588  result += value.dumpPythonAs(name,options)+'\n'
return result
def _dumpPython
Definition: Config.py:584
def Config.Process._dumpPythonList (   self,
  d,
  options 
)
private

Definition at line 535 of file Config.py.

Referenced by Config.Process.dumpPython().

536  def _dumpPythonList(self, d, options):
537  returnValue = ''
538  if isinstance(d, DictTypes.SortedKeysDict):
539  for name,item in d.items():
540  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
541  else:
542  for name,item in sorted(d.items()):
543  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
return returnValue
def _dumpPythonList
Definition: Config.py:535
def Config.Process._findPreferred (   self,
  esname,
  d,
  args,
  kargs 
)
private

Definition at line 777 of file Config.py.

References python.Node.Node.__setattr__(), Config.Process.__setattr__(), and Config.FilteredStream.__setattr__.

778  def _findPreferred(self, esname, d,*args,**kargs):
779  # is esname a name in the dictionary?
780  if esname in d:
781  typ = d[esname].type_()
782  if typ == esname:
783  self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) )
784  else:
785  self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) )
786  return True
787  else:
788  # maybe it's an unnamed ESModule?
789  found = False
790  for name, value in d.iteritems():
791  if value.type_() == esname:
792  if found:
793  raise RuntimeError("More than one ES module for "+esname)
794  found = True
795  self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) )
796  return found
def _findPreferred
Definition: Config.py:777
def __setattr__
Definition: Config.py:246
def Config.Process._insertInto (   self,
  parameterSet,
  itemDict 
)
private

Definition at line 629 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

630  def _insertInto(self, parameterSet, itemDict):
631  for name,value in itemDict.iteritems():
value.insertInto(parameterSet, name)
def _insertInto
Definition: Config.py:629
def Config.Process._insertManyInto (   self,
  parameterSet,
  label,
  itemDict 
)
private

Definition at line 639 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

640  def _insertManyInto(self, parameterSet, label, itemDict):
641  l = []
642  for name,value in itemDict.iteritems():
643  newLabel = value.nameInProcessDesc_(name)
644  l.append(newLabel)
645  value.insertInto(parameterSet, name)
646  # alphabetical order is easier to compare with old language
647  l.sort()
parameterSet.addVString(True, label, l)
def _insertManyInto
Definition: Config.py:639
def Config.Process._insertOneInto (   self,
  parameterSet,
  label,
  item 
)
private

Definition at line 632 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

633  def _insertOneInto(self, parameterSet, label, item):
634  vitems = []
635  if not item == None:
636  newlabel = item.nameInProcessDesc_(label)
637  vitems = [newlabel]
638  item.insertInto(parameterSet, newlabel)
parameterSet.addVString(True, label, vitems)
def _insertOneInto
Definition: Config.py:632
def Config.Process._insertPaths (   self,
  processDesc,
  processPSet 
)
private

Definition at line 651 of file Config.py.

References Config.Process.endpaths_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, GraphPath< N, E >.paths_, evf::fuep::TriggerReportHelpers.paths_, pat::TriggerEvent.paths_, edm::EventSelector.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and cmsPerfHarvest.visit().

Referenced by Config.Process.fillProcessDesc().

652  def _insertPaths(self, processDesc, processPSet):
653  scheduledPaths = []
654  triggerPaths = []
655  endpaths = []
656  if self.schedule_() == None:
657  # make one from triggerpaths & endpaths
658  for name,value in self.paths_().iteritems():
659  scheduledPaths.append(name)
660  triggerPaths.append(name)
661  for name,value in self.endpaths_().iteritems():
662  scheduledPaths.append(name)
663  endpaths.append(name)
664  else:
665  for path in self.schedule_():
666  pathname = path.label_()
667  scheduledPaths.append(pathname)
668  if self.endpaths_().has_key(pathname):
669  endpaths.append(pathname)
670  else:
671  triggerPaths.append(pathname)
672  processPSet.addVString(True, "@end_paths", endpaths)
673  processPSet.addVString(True, "@paths", scheduledPaths)
674  # trigger_paths are a little different
675  p = processDesc.newPSet()
676  p.addVString(True, "@trigger_paths", triggerPaths)
677  processPSet.addPSet(True, "@trigger_paths", p)
678  # add all these paths
679  pathValidator = PathValidator()
680  endpathValidator = EndPathValidator()
681  for triggername in triggerPaths:
682  #self.paths_()[triggername].insertInto(processPSet, triggername, self.sequences_())
683  self.paths_()[triggername].visit(pathValidator)
684  self.paths_()[triggername].insertInto(processPSet, triggername, self.__dict__)
685  for endpathname in endpaths:
686  #self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.sequences_())
687  self.endpaths_()[endpathname].visit(endpathValidator)
688  self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.__dict__)
689  processPSet.addVString(False, "@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
def _insertPaths
Definition: Config.py:651
def visit
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def schedule_
Definition: Config.py:202
def endpaths_
Definition: Config.py:194
def Config.Process._insertServices (   self,
  processDesc,
  itemDict 
)
private

Definition at line 648 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

649  def _insertServices(self, processDesc, itemDict):
650  for name,value in itemDict.iteritems():
value.insertInto(processDesc)
def _insertServices
Definition: Config.py:648
def Config.Process._okToPlace (   self,
  name,
  mod,
  d 
)
private

Definition at line 331 of file Config.py.

References Config.Process.__isStrict.

Referenced by Config.Process.__setattr__(), and Config.Process._place().

332  def _okToPlace(self, name, mod, d):
333  if not self.__InExtendCall:
334  # if going
335  return True
336  elif not self.__isStrict:
337  return True
338  elif name in d:
339  # if there's an old copy, and the new one
340  # hasn't been modified, we're done. Still
341  # not quite safe if something has been defined twice.
342  # Need to add checks
343  if mod._isModified:
344  if d[name]._isModified:
345  return False
346  else:
347  return True
348  else:
349  return True
350  else:
351  return True
def _okToPlace
Definition: Config.py:331
def Config.Process._place (   self,
  name,
  mod,
  d 
)
private

Definition at line 352 of file Config.py.

References Config.Process.__isStrict, and Config.Process._okToPlace().

Referenced by Config.Process._placeAnalyzer(), Config.Process._placeEndPath(), Config.Process._placeESPrefer(), Config.Process._placeESProducer(), Config.Process._placeESSource(), Config.Process._placeFilter(), Config.Process._placeOutputModule(), Config.Process._placePath(), Config.Process._placeProducer(), Config.Process._placePSet(), Config.Process._placeSequence(), Config.Process._placeService(), Config.Process._placeVPSet(), and Config.Process.setPartialSchedule_().

353  def _place(self, name, mod, d):
354  if self._okToPlace(name, mod, d):
355  if self.__isStrict and isinstance(mod, _ModuleSequenceType):
356  d[name] = mod._postProcessFixup(self._cloneToObjectDict)
357  else:
358  d[name] = mod
359  if isinstance(mod,_Labelable):
mod.setLabel(name)
def _okToPlace
Definition: Config.py:331
def Config.Process._placeAnalyzer (   self,
  name,
  mod 
)
private

Definition at line 366 of file Config.py.

References Config.Process._place().

367  def _placeAnalyzer(self,name,mod):
self._place(name, mod, self.__analyzers)
def _placeAnalyzer
Definition: Config.py:366
def Config.Process._placeEndPath (   self,
  name,
  mod 
)
private

Definition at line 375 of file Config.py.

References Config.Process._place(), Config.Process._validateSequence(), and ExceptionHandling.format_outerframe().

376  def _placeEndPath(self,name,mod):
377  self._validateSequence(mod, name)
378  try:
379  self._place(name, mod, self.__endpaths)
380  except ModuleCloneError, msg:
381  context = format_outerframe(4)
raise Exception("%sThe module %s in endpath %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence
Definition: Config.py:544
def _placeEndPath
Definition: Config.py:375
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 387 of file Config.py.

References Config.Process._place().

388  def _placeESPrefer(self,name,mod):
self._place(name, mod, self.__esprefers)
def _placeESPrefer
Definition: Config.py:387
def Config.Process._placeESProducer (   self,
  name,
  mod 
)
private

Definition at line 385 of file Config.py.

References Config.Process._place().

386  def _placeESProducer(self,name,mod):
self._place(name, mod, self.__esproducers)
def _placeESProducer
Definition: Config.py:385
def Config.Process._placeESSource (   self,
  name,
  mod 
)
private

Definition at line 389 of file Config.py.

References Config.Process._place().

390  def _placeESSource(self,name,mod):
self._place(name, mod, self.__essources)
def _placeESSource
Definition: Config.py:389
def Config.Process._placeFilter (   self,
  name,
  mod 
)
private

Definition at line 364 of file Config.py.

References Config.Process._place().

365  def _placeFilter(self,name,mod):
self._place(name, mod, self.__filters)
def _placeFilter
Definition: Config.py:364
def Config.Process._placeLooper (   self,
  name,
  mod 
)
private

Definition at line 403 of file Config.py.

Referenced by Config.Process.setLooper_().

404  def _placeLooper(self,name,mod):
405  if name != 'looper':
406  raise ValueError("The label '"+name+"' can not be used for a Looper. Only 'looper' is allowed.")
407  self.__dict__['_Process__looper'] = mod
self.__dict__[mod.type_()] = mod
def _placeLooper
Definition: Config.py:403
def Config.Process._placeOutputModule (   self,
  name,
  mod 
)
private

Definition at line 360 of file Config.py.

References Config.Process._place().

361  def _placeOutputModule(self,name,mod):
self._place(name, mod, self.__outputmodules)
def _placeOutputModule
Definition: Config.py:360
def Config.Process._placePath (   self,
  name,
  mod 
)
private

Definition at line 368 of file Config.py.

References Config.Process._place(), Config.Process._validateSequence(), and ExceptionHandling.format_outerframe().

369  def _placePath(self,name,mod):
370  self._validateSequence(mod, name)
371  try:
372  self._place(name, mod, self.__paths)
373  except ModuleCloneError, msg:
374  context = format_outerframe(4)
raise Exception("%sThe module %s in path %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence
Definition: Config.py:544
def _placePath
Definition: Config.py:368
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 362 of file Config.py.

References Config.Process._place().

363  def _placeProducer(self,name,mod):
self._place(name, mod, self.__producers)
def _placeProducer
Definition: Config.py:362
def Config.Process._placePSet (   self,
  name,
  mod 
)
private

Definition at line 391 of file Config.py.

References Config.Process._place().

392  def _placePSet(self,name,mod):
self._place(name, mod, self.__psets)
def _placePSet
Definition: Config.py:391
def Config.Process._placeSequence (   self,
  name,
  mod 
)
private

Definition at line 382 of file Config.py.

References Config.Process._place(), and Config.Process._validateSequence().

383  def _placeSequence(self,name,mod):
384  self._validateSequence(mod, name)
self._place(name, mod, self.__sequences)
def _validateSequence
Definition: Config.py:544
def _placeSequence
Definition: Config.py:382
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 408 of file Config.py.

References Config.Process._place().

409  def _placeService(self,typeName,mod):
410  self._place(typeName, mod, self.__services)
self.__dict__[typeName]=mod
def _placeService
Definition: Config.py:408
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.

Referenced by Config.Process.setSource_().

396  def _placeSource(self,name,mod):
397  """Allow the source to be referenced by 'source' or by type name"""
398  if name != 'source':
399  raise ValueError("The label '"+name+"' can not be used for a Source. Only 'source' is allowed.")
400  if self.__dict__['_Process__source'] is not None :
401  del self.__dict__[self.__dict__['_Process__source'].type_()]
402  self.__dict__['_Process__source'] = mod
self.__dict__[mod.type_()] = mod
def _placeSource
Definition: Config.py:395
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 393 of file Config.py.

References Config.Process._place().

394  def _placeVPSet(self,name,mod):
self._place(name, mod, self.__vpsets)
def _placeVPSet
Definition: Config.py:393
def Config.Process._replaceInSequences (   self,
  label,
  new 
)
private

Definition at line 614 of file Config.py.

Referenced by Config.Process.__setattr__(), and Config.Process.globalReplace().

615  def _replaceInSequences(self, label, new):
616  old = getattr(self,label)
617  #TODO - replace by iterator concatenation
618  for sequenceable in self.sequences.itervalues():
619  sequenceable.replace(old,new)
620  for sequenceable in self.paths.itervalues():
621  sequenceable.replace(old,new)
622  for sequenceable in self.endpaths.itervalues():
sequenceable.replace(old,new)
def _replaceInSequences
Definition: Config.py:614
def Config.Process._sequencesInDependencyOrder (   self)
private

Definition at line 552 of file Config.py.

References python.multivaluedict.dict, join(), and Config.Process.sequences.

Referenced by Config.Process.dumpPython().

553  def _sequencesInDependencyOrder(self):
554  #for each sequence, see what other sequences it depends upon
555  returnValue=DictTypes.SortedKeysDict()
556  dependencies = {}
557  for label,seq in self.sequences.iteritems():
558  d = []
559  v = SequenceVisitor(d)
560  seq.visit(v)
561  dependencies[label]=[dep.label_() for dep in d if dep.label_() != None]
562  resolvedDependencies=True
563  #keep looping until we can no longer get rid of all dependencies
564  # if that happens it means we have circular dependencies
565  iterCount = 0
566  while resolvedDependencies:
567  iterCount += 1
568  resolvedDependencies = (0 != len(dependencies))
569  oldDeps = dict(dependencies)
570  for label,deps in oldDeps.iteritems():
571  # don't try too hard
572  if len(deps)==0 or iterCount > 100:
573  iterCount = 0
574  resolvedDependencies=True
575  returnValue[label]=self.sequences[label]
576  #remove this as a dependency for all other sequences
577  del dependencies[label]
578  for lb2,deps2 in dependencies.iteritems():
579  while deps2.count(label):
580  deps2.remove(label)
581  if len(dependencies):
582  raise RuntimeError("circular sequence dependency discovered \n"+
583  ",".join([label for label,junk in dependencies.iteritems()]))
return returnValue
def _sequencesInDependencyOrder
Definition: Config.py:552
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Config.Process._validateSequence (   self,
  sequence,
  label 
)
private

Definition at line 544 of file Config.py.

Referenced by Config.Process._placeEndPath(), Config.Process._placePath(), and Config.Process._placeSequence().

545  def _validateSequence(self, sequence, label):
546  # See if every module has been inserted into the process
547  try:
548  l = set()
549  nameVisitor = NodeNameVisitor(l)
550  sequence.visit(nameVisitor)
551  except:
raise RuntimeError("An entry in sequence "+label + ' has no label')
def _validateSequence
Definition: Config.py:544
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.

References Config.Process.__isStrict.

Referenced by Config.Process.__setattr__(), and Config.Process.extend().

317  def add_(self,value):
318  """Allows addition of components which do not have to have a label, e.g. Services"""
319  if not isinstance(value,_ConfigureComponent):
320  raise TypeError
321  if not isinstance(value,_Unlabelable):
322  raise TypeError
323  #clone the item
324  #clone the item
325  if self.__isStrict:
326  newValue =value.copy()
327  value.setIsFrozen()
328  else:
329  newValue =value
330  newValue._place('',self)
def Config.Process.analyzerNames (   self)

Definition at line 133 of file Config.py.

References Config.Process.analyzers_(), join(), and relativeConstraints.keys.

134  def analyzerNames(self):
return ' '.join(self.analyzers_().keys())
def analyzers_
Definition: Config.py:182
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def analyzerNames
Definition: Config.py:133
def Config.Process.analyzers_ (   self)
returns a dict of the analyzers which have been added to the Process

Definition at line 182 of file Config.py.

Referenced by Config.Process.analyzerNames(), Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.fillProcessDesc(), and Config.Process.prune().

183  def analyzers_(self):
184  """returns a dict of the analyzers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__analyzers)
def analyzers_
Definition: Config.py:182
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.

References Config.Process._dumpConfigESPrefers(), Config.Process._dumpConfigNamedList(), Config.Process._dumpConfigOptionallyNamedList(), Config.Process._dumpConfigUnnamedList(), Config.Process.analyzers_(), Config.Process.endpaths_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, GraphPath< N, E >.paths_, evf::fuep::TriggerReportHelpers.paths_, pat::TriggerEvent.paths_, edm::EventSelector.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), pf2pat::EventHypothesis.producers_, Config.Process.producers_(), ConfigBuilder.ConfigBuilder.schedule, Config.Process.schedule, Config.Process.sequences_(), edm::ProcessDesc.services_, Config.Process.services_(), CandOneToManyDeltaRMatcher.source_, CandOneToOneDeltaRMatcher.source_, TagCaloJetProducer.source_, SiStripFedCablingBuilderFromDb.source_, sistrip::SpyEventMatcher.source_, and Config.Process.source_().

Referenced by Types.SecSource.configValue().

476  def dumpConfig(self, options=PrintOptions()):
477  """return a string containing the equivalent process defined using the configuration language"""
478  config = "process "+self.__name+" = {\n"
479  options.indent()
480  if self.source_():
481  config += options.indentation()+"source = "+self.source_().dumpConfig(options)
482  if self.looper_():
483  config += options.indentation()+"looper = "+self.looper_().dumpConfig(options)
484  config+=self._dumpConfigNamedList(self.producers_().iteritems(),
485  'module',
486  options)
487  config+=self._dumpConfigNamedList(self.filters_().iteritems(),
488  'module',
489  options)
490  config+=self._dumpConfigNamedList(self.analyzers_().iteritems(),
491  'module',
492  options)
493  config+=self._dumpConfigNamedList(self.outputModules_().iteritems(),
494  'module',
495  options)
496  config+=self._dumpConfigNamedList(self.sequences_().iteritems(),
497  'sequence',
498  options)
499  config+=self._dumpConfigNamedList(self.paths_().iteritems(),
500  'path',
501  options)
502  config+=self._dumpConfigNamedList(self.endpaths_().iteritems(),
503  'endpath',
504  options)
505  config+=self._dumpConfigUnnamedList(self.services_().iteritems(),
506  'service',
507  options)
508  config+=self._dumpConfigOptionallyNamedList(
509  self.es_producers_().iteritems(),
510  'es_module',
511  options)
512  config+=self._dumpConfigOptionallyNamedList(
513  self.es_sources_().iteritems(),
514  'es_source',
515  options)
516  config += self._dumpConfigESPrefers(options)
517  for name,item in self.psets.iteritems():
518  config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options)
519  for name,item in self.vpsets.iteritems():
520  config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options)
521  if self.schedule:
522  pathNames = [p.label_() for p in self.schedule]
523  config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n'
524 
525 # config+=self._dumpConfigNamedList(self.vpsets.iteritems(),
526 # 'VPSet',
527 # options)
528  config += "}\n"
529  options.unindent()
return config
def es_sources_
Definition: Config.py:230
def _dumpConfigUnnamedList
Definition: Config.py:463
def es_producers_
Definition: Config.py:226
def _dumpConfigESPrefers
Definition: Config.py:530
def _dumpConfigOptionallyNamedList
Definition: Config.py:468
def filters_
Definition: Config.py:157
def outputModules_
Definition: Config.py:186
def producers_
Definition: Config.py:166
def analyzers_
Definition: Config.py:182
def dumpConfig
Definition: Config.py:475
def services_
Definition: Config.py:222
def sequences_
Definition: Config.py:198
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def _dumpConfigNamedList
Definition: Config.py:458
def endpaths_
Definition: Config.py:194
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.

References Config.Process._dumpPython(), Config.Process._dumpPythonList(), Config.Process._sequencesInDependencyOrder(), Config.Process.analyzers_(), Config.Process.endpaths_(), Config.Process.es_prefers_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, GraphPath< N, E >.paths_, evf::fuep::TriggerReportHelpers.paths_, pat::TriggerEvent.paths_, edm::EventSelector.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), pf2pat::EventHypothesis.producers_, Config.Process.producers_(), CmsswTask.CmsswTask.psets, Config.Process.psets, ConfigBuilder.ConfigBuilder.schedule, Config.Process.schedule, edm::ProcessDesc.services_, Config.Process.services_(), CandOneToManyDeltaRMatcher.source_, CandOneToOneDeltaRMatcher.source_, TagCaloJetProducer.source_, SiStripFedCablingBuilderFromDb.source_, sistrip::SpyEventMatcher.source_, Config.Process.source_(), and Config.Process.vpsets.

Referenced by Mixins._Parameterizable.__addParameter(), Mixins._ParameterTypeBase.__repr__(), Mixins._Parameterizable.__repr__(), Mixins._ValidatingParameterListBase.__repr__(), Types.VPSet.__repr__(), and Mixins._Parameterizable.__setattr__().

590  def dumpPython(self, options=PrintOptions()):
591  """return a string containing the equivalent process defined using the configuration language"""
592  result = "import FWCore.ParameterSet.Config as cms\n\n"
593  result += "process = cms.Process(\""+self.__name+"\")\n\n"
594  if self.source_():
595  result += "process.source = "+self.source_().dumpPython(options)
596  if self.looper_():
597  result += "process.looper = "+self.looper_().dumpPython()
598  result+=self._dumpPythonList(self.producers_(), options)
599  result+=self._dumpPythonList(self.filters_() , options)
600  result+=self._dumpPythonList(self.analyzers_(), options)
601  result+=self._dumpPythonList(self.outputModules_(), options)
602  result+=self._dumpPythonList(self._sequencesInDependencyOrder(), options)
603  result+=self._dumpPythonList(self.paths_(), options)
604  result+=self._dumpPythonList(self.endpaths_(), options)
605  result+=self._dumpPythonList(self.services_(), options)
606  result+=self._dumpPythonList(self.es_producers_(), options)
607  result+=self._dumpPythonList(self.es_sources_(), options)
608  result+=self._dumpPython(self.es_prefers_(), options)
609  result+=self._dumpPythonList(self.psets, options)
610  result+=self._dumpPythonList(self.vpsets, options)
611  if self.schedule:
612  pathNames = ['process.'+p.label_() for p in self.schedule]
613  result +='process.schedule = cms.Schedule('+','.join(pathNames)+')\n'
return result
def es_sources_
Definition: Config.py:230
def es_producers_
Definition: Config.py:226
def filters_
Definition: Config.py:157
def dumpPython
Definition: Config.py:589
def es_prefers_
Definition: Config.py:234
def _sequencesInDependencyOrder
Definition: Config.py:552
def outputModules_
Definition: Config.py:186
def producers_
Definition: Config.py:166
def analyzers_
Definition: Config.py:182
def services_
Definition: Config.py:222
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def _dumpPythonList
Definition: Config.py:535
def _dumpPython
Definition: Config.py:584
def endpaths_
Definition: Config.py:194
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths which have been added to the Process

Definition at line 194 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process.dumpConfig(), and Config.Process.dumpPython().

195  def endpaths_(self):
196  """returns a dict of the endpaths which have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__endpaths)
def endpaths_
Definition: Config.py:194
def Config.Process.es_prefers_ (   self)
returns a dict of the es_prefers which have been added to the Process

Definition at line 234 of file Config.py.

Referenced by Config.Process._dumpConfigESPrefers(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

235  def es_prefers_(self):
236  """returns a dict of the es_prefers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__esprefers)
def es_prefers_
Definition: Config.py:234
def Config.Process.es_producers_ (   self)
returns a dict of the esproducers which have been added to the Process

Definition at line 226 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

227  def es_producers_(self):
228  """returns a dict of the esproducers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__esproducers)
def es_producers_
Definition: Config.py:226
def Config.Process.es_sources_ (   self)
returns a the es_sources which have been added to the Process

Definition at line 230 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

231  def es_sources_(self):
232  """returns a the es_sources which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__essources)
def es_sources_
Definition: Config.py:230
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.

References python.Node.Node.__setattr__(), Config.Process.__setattr__(), Config.FilteredStream.__setattr__, Config.Process.add_(), python.multivaluedict.dict, dir, and ExpressReco_HICollisions_FallBack.id.

Referenced by hltFindDuplicates.ModuleList.__init__(), Config.Process.load(), and Mixins._ValidatingParameterListBase.setValue().

416  def extend(self,other,items=()):
417  """Look in other and find types which we can use"""
418  # enable explicit check to avoid overwriting of existing objects
419  self.__dict__['_Process__InExtendCall'] = True
420 
421  seqs = dict()
422  labelled = dict()
423  for name in dir(other):
424  #'from XX import *' ignores these, and so should we.
425  if name.startswith('_'):
426  continue
427  item = getattr(other,name)
428  if name == "source" or name == "looper":
429  self.__setattr__(name,item)
430  elif isinstance(item,_ModuleSequenceType):
431  seqs[name]=item
432  elif isinstance(item,_Labelable):
433  self.__setattr__(name,item)
434  labelled[name]=item
435  try:
436  item.label_()
437  except:
438  item.setLabel(name)
439  continue
440  elif isinstance(item,Schedule):
441  self.__setattr__(name,item)
442  elif isinstance(item,_Unlabelable):
443  self.add_(item)
444 
445  #now create a sequence which uses the newly made items
446  for name in seqs.iterkeys():
447  seq = seqs[name]
448  #newSeq = seq.copy()
449  #
450  if id(seq) not in self._cloneToObjectDict:
451  self.__setattr__(name,seq)
452  else:
453  newSeq = self._cloneToObjectDict[id(seq)]
454  self.__dict__[name]=newSeq
455  newSeq.setLabel(name)
456  #now put in proper bucket
457  newSeq._place(name,self)
self.__dict__['_Process__InExtendCall'] = False
def __setattr__
Definition: Config.py:246
dbl *** dir
Definition: mlp_gen.cc:35
def Config.Process.fillProcessDesc (   self,
  processDesc,
  processPSet 
)

Definition at line 722 of file Config.py.

References Config.Process._insertInto(), Config.Process._insertManyInto(), Config.Process._insertOneInto(), Config.Process._insertPaths(), Config.Process._insertServices(), Config.Process.analyzers_(), filterCSVwithJSON.copy, Config.Process.es_prefers_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, Config.Process.looper_(), edm::EventProcessor.looper_, DDSelLevelCollector.name_, HLTPerformanceInfo::Module.name_, edm::ModuleTime.name_, funct::Parameter.name_, RemoteFile.name_, edm::service::NamedDestination.name_, NameScheme.name_, popcon::SiStripDetVOffHandler.name_, OpticalAlignMeasurementInfo.name_, EventSelector.name_, edmplugin::PluginInfo.name_, pf2pat::EventHypothesis.name_, TrackingSlaveSD.name_, TagName.name_, DQMHistAdder::cfgEntryAddJob.name_, DQMFileLoader::cfgEntryFileSet.name_, PdtEntry.name_, reco::tau::RecoTauNamedPlugin.name_, CaloValidationStatistics.name_, DQMHistPlotter::cfgEntryProcess.name_, Sym.name_, pat::helper::OverlapTest.name_, CaloSlaveSD.name_, pat::TriggerAlgorithm.name_, pat::TriggerCondition.name_, pos::PixelConfigAlias.name_, JetResolution.name_, pat::TriggerPath.name_, GPFGenParticle.name_, DCCTBDataField.name_, OpticalAlignParam.name_, DQMHistPlotter::cfgEntryAxisX.name_, TimerStack::Timer.name_, FieldHandlerBase< TOutput >.name_, Filter.name_, reco::tau::RecoTauMVAHelper.name_, HLTTauDQMLitePathPlotter.name_, HcalBaseDQClient.name_, pos::PixelDACScanRange.name_, reco::modules::RoleNames.name_, tnp::ProbeVariable.name_, DQMHistPlotter::cfgEntryAxisY.name_, HLTPerformanceInfo::Path.name_, edm::FUShmOutputModule.name_, reco::NamedCompositeCandidate.name_, SiStripBaseServiceFromDQM< T >::StringNotMatch.name_, reco::parser::LazyInvoker.name_, DQMHistPlotter::cfgEntryLegend.name_, CachingVariable.name_, DCCTBBlockPrototype.name_, MeasurementTracker.name_, CandCombinerBase< OutputCollection, CandPtr >.name_, edm::Path.name_, pf2pat::TopProjectorAlgo< Top, Bottom >.name_, OpticalAlignInfo.name_, VertexTracker.name_, TopProjector< Top, Bottom >.name_, NamedCandCombinerBase.name_, edm::eventsetup::DataKey.name_, DQMHistPlotter::cfgEntryLabel.name_, reco::modules::NamedCandCombinerBase.name_, reco::CompositeCandidate.name_, Entry.name_, pftools::SpaceManager.name_, Histograms.name_, tnp::ProbeFlag.name_, DQMHistPlotter::cfgEntryDrawOption.name_, VariableComputer.name_, edm::PathSignalSentry< T >.name_, edm::messagedrop::StringProducerWithPhase.name_, NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.name_, DQMHistPlotter::cfgEntryDrawJob.name_, Config.Process.name_(), edm::Entry.name_, ConfigurableHisto.name_, Selection< C, Selector, StoreContainer >.name_, Config.Process.outputModules_(), pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.psets_(), edm::ProcessDesc.services_, Config.Process.services_(), CandOneToManyDeltaRMatcher.source_, CandOneToOneDeltaRMatcher.source_, TagCaloJetProducer.source_, SiStripFedCablingBuilderFromDb.source_, sistrip::SpyEventMatcher.source_, Config.Process.source_(), HcalCalibDataFrame.validate(), CastorDataFrame.validate(), ZDCDataFrame.validate(), HFDataFrame.validate(), HBHEDataFrame.validate(), HODataFrame.validate(), ora::Handle< T >.validate(), edm::ConfigurationDescriptions.validate(), edm::ParameterDescriptionNode.validate(), edm::eventsetup::EventSetupRecord.validate(), edm::Entry.validate(), edm::ParameterSetDescription.validate(), Config.Process.validate(), and Config.Process.vpsets_().

723  def fillProcessDesc(self, processDesc, processPSet):
724  self.validate()
725  processPSet.addString(True, "@process_name", self.name_())
726  all_modules = self.producers_().copy()
727  all_modules.update(self.filters_())
728  all_modules.update(self.analyzers_())
729  all_modules.update(self.outputModules_())
730  self._insertInto(processPSet, self.psets_())
731  self._insertInto(processPSet, self.vpsets_())
732  self._insertManyInto(processPSet, "@all_modules", all_modules)
733  self._insertOneInto(processPSet, "@all_sources", self.source_())
734  self._insertOneInto(processPSet, "@all_loopers", self.looper_())
735  self._insertManyInto(processPSet, "@all_esmodules", self.es_producers_())
736  self._insertManyInto(processPSet, "@all_essources", self.es_sources_())
737  self._insertManyInto(processPSet, "@all_esprefers", self.es_prefers_())
738  self._insertPaths(processDesc, processPSet)
739  self._insertServices(processDesc, self.services_())
740  return processDesc
def es_sources_
Definition: Config.py:230
def _insertManyInto
Definition: Config.py:639
def es_producers_
Definition: Config.py:226
def filters_
Definition: Config.py:157
def es_prefers_
Definition: Config.py:234
def _insertPaths
Definition: Config.py:651
def outputModules_
Definition: Config.py:186
def producers_
Definition: Config.py:166
def fillProcessDesc
Definition: Config.py:722
def _insertInto
Definition: Config.py:629
def analyzers_
Definition: Config.py:182
def services_
Definition: Config.py:222
def validate
Definition: Config.py:741
def _insertOneInto
Definition: Config.py:632
def _insertServices
Definition: Config.py:648
def Config.Process.filterNames (   self)

Definition at line 135 of file Config.py.

References pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, join(), and relativeConstraints.keys.

136  def filterNames(self):
return ' '.join(self.filters_().keys())
def filterNames
Definition: Config.py:135
def filters_
Definition: Config.py:157
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Config.Process.filters_ (   self)
returns a dict of the filters which have been added to the Process

Definition at line 157 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.fillProcessDesc(), Config.Process.filterNames(), and Config.Process.prune().

158  def filters_(self):
159  """returns a dict of the filters which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__filters)
def filters_
Definition: Config.py:157
def Config.Process.globalReplace (   self,
  label,
  new 
)
Replace the item with label 'label' by object 'new' in the process and all sequences/paths

Definition at line 623 of file Config.py.

References Config.Process._replaceInSequences().

624  def globalReplace(self,label,new):
625  """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths"""
626  if not hasattr(self,label):
627  raise LookupError("process has no item of label "+label)
628  self._replaceInSequences(label, new)
setattr(self,label,new)
def _replaceInSequences
Definition: Config.py:614
def globalReplace
Definition: Config.py:623
def Config.Process.load (   self,
  moduleName 
)

Definition at line 411 of file Config.py.

References ora::ContainerSchema.extend(), python.seqvaluedict.seqdict.extend(), svgfig.SVG.extend(), and Config.Process.extend().

412  def load(self, moduleName):
413  moduleName = moduleName.replace("/",".")
414  module = __import__(moduleName)
self.extend(sys.modules[moduleName])
def Config.Process.looper_ (   self)
returns the looper which has been added to the Process or None if none have been added

Definition at line 176 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

177  def looper_(self):
178  """returns the looper which has been added to the Process or None if none have been added"""
return self.__looper
def Config.Process.name_ (   self)

Definition at line 161 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

162  def name_(self):
return self.__name
def Config.Process.outputModules_ (   self)
returns a dict of the output modules which have been added to the Process

Definition at line 186 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

187  def outputModules_(self):
188  """returns a dict of the output modules which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__outputmodules)
def outputModules_
Definition: Config.py:186
def Config.Process.pathNames (   self)

Definition at line 137 of file Config.py.

References join(), relativeConstraints.keys, edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, GraphPath< N, E >.paths_, evf::fuep::TriggerReportHelpers.paths_, pat::TriggerEvent.paths_, edm::EventSelector.paths_, HLTPerformanceInfo.paths_, and Config.Process.paths_().

138  def pathNames(self):
139  return ' '.join(self.paths_().keys())
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def pathNames
Definition: Config.py:137
def Config.Process.paths_ (   self)
returns a dict of the paths which have been added to the Process

Definition at line 190 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.pathNames().

191  def paths_(self):
192  """returns a dict of the paths which have been added to the Process"""
return DictTypes.SortedAndFixedKeysDict(self.__paths)
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.

749  def prefer(self, esmodule,*args,**kargs):
750  """Prefer this ES source or producer. The argument can
751  either be an object label, e.g.,
752  process.prefer(process.juicerProducer) (not supported yet)
753  or a name of an ESSource or ESProducer
754  process.prefer("juicer")
755  or a type of unnamed ESSource or ESProducer
756  process.prefer("JuicerProducer")
757  In addition, you can pass as a labelled arguments the name of the Record you wish to
758  prefer where the type passed is a cms.vstring and that vstring can contain the
759  name of the C++ types in the Record which are being preferred, e.g.,
760  #prefer all data in record 'OrangeRecord' from 'juicer'
761  process.prefer("juicer", OrangeRecord=cms.vstring())
762  or
763  #prefer only "Orange" data in "OrangeRecord" from "juicer"
764  process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
765  or
766  #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
767  ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
768  """
769  # see if this refers to a named ESProducer
770  if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer):
771  raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet")
772  elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \
773  self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
774  pass
775  else:
776  raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
def es_sources_
Definition: Config.py:230
def _findPreferred
Definition: Config.py:777
def es_producers_
Definition: Config.py:226
def Config.Process.producerNames (   self)

Definition at line 131 of file Config.py.

References join(), relativeConstraints.keys, pf2pat::EventHypothesis.producers_, and Config.Process.producers_().

132  def producerNames(self):
return ' '.join(self.producers_().keys())
def producers_
Definition: Config.py:166
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def producerNames
Definition: Config.py:131
def Config.Process.producers_ (   self)
returns a dict of the producers which have been added to the Process

Definition at line 166 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), Config.Process.fillProcessDesc(), Config.Process.producerNames(), and Config.Process.prune().

167  def producers_(self):
168  """returns a dict of the producers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__producers)
def producers_
Definition: Config.py:166
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.

References Config.Process.analyzers_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.pruneModules(), Config.Process.pruneSequences(), Config.Process.psets_(), edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, Config.Process.schedule_(), edm::EventProcessor.schedule_, and Config.Process.vpsets_().

691  def prune(self):
692  """ Remove clutter from the process which we think is unnecessary:
693  PSets, and unused modules. Not working yet, because I need to remove
694  all unneeded sequences and paths that contain removed modules """
695  for name in self.psets_():
696  delattr(self, name)
697  for name in self.vpsets_():
698  delattr(self, name)
699 
700  if self.schedule_():
701  self.pruneSequences()
702  scheduledNames = self.schedule_().moduleNames()
703  self.pruneModules(self.producers_(), scheduledNames)
704  self.pruneModules(self.filters_(), scheduledNames)
705  self.pruneModules(self.analyzers_(), scheduledNames)
def filters_
Definition: Config.py:157
def producers_
Definition: Config.py:166
def analyzers_
Definition: Config.py:182
def schedule_
Definition: Config.py:202
def pruneModules
Definition: Config.py:716
def pruneSequences
Definition: Config.py:706
def Config.Process.pruneModules (   self,
  d,
  scheduledNames 
)

Definition at line 716 of file Config.py.

Referenced by Config.Process.prune().

717  def pruneModules(self, d, scheduledNames):
718  moduleNames = set(d.keys())
719  junk = moduleNames - scheduledNames
720  for name in junk:
721  delattr(self, name)
def pruneModules
Definition: Config.py:716
def Config.Process.pruneSequences (   self)

Definition at line 706 of file Config.py.

Referenced by Config.Process.prune().

707  def pruneSequences(self):
708  scheduledSequences = []
709  visitor = SequenceVisitor(scheduledSequences)
710  #self.schedule_()._seq.visit(visitor)
711  #scheduledSequenceNames = set([seq.label_() for seq in scheduledSequences])
712  #sequenceNames = set(self.sequences_().keys())
713  #junk = sequenceNames - scheduledSequenceNames
714  #for name in junk:
715  # delattr(self, name)
def pruneSequences
Definition: Config.py:706
def Config.Process.psets_ (   self)
returns a dict of the PSets which have been added to the Process

Definition at line 238 of file Config.py.

Referenced by Config.Process.fillProcessDesc(), and Config.Process.prune().

239  def psets_(self):
240  """returns a dict of the PSets which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__psets)
def Config.Process.schedule_ (   self)
returns the schedule which has been added to the Process or None if none have been added

Definition at line 202 of file Config.py.

Referenced by Config.Process._insertPaths(), and Config.Process.prune().

203  def schedule_(self):
204  """returns the schedule which has been added to the Process or None if none have been added"""
return self.__schedule
def schedule_
Definition: Config.py:202
def Config.Process.sequences_ (   self)
returns a dict of the sequences which have been added to the Process

Definition at line 198 of file Config.py.

Referenced by Config.Process.dumpConfig().

199  def sequences_(self):
200  """returns a dict of the sequences which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__sequences)
def sequences_
Definition: Config.py:198
def Config.Process.services_ (   self)
returns a dict of the services which have been added to the Process

Definition at line 222 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

223  def services_(self):
224  """returns a dict of the services which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__services)
def services_
Definition: Config.py:222
def Config.Process.setLooper_ (   self,
  lpr 
)

Definition at line 179 of file Config.py.

References Config.Process._placeLooper().

180  def setLooper_(self,lpr):
self._placeLooper('looper',lpr)
def setLooper_
Definition: Config.py:179
def _placeLooper
Definition: Config.py:403
def Config.Process.setName_ (   self,
  name 
)

Definition at line 163 of file Config.py.

164  def setName_(self,name):
self.__dict__['_Process__name'] = name
def setName_
Definition: Config.py:163
def Config.Process.setPartialSchedule_ (   self,
  sch,
  label 
)

Definition at line 205 of file Config.py.

References Config.Process._place(), and Config.Process.setSchedule_().

206  def setPartialSchedule_(self,sch,label):
207  if label == "schedule":
208  self.setSchedule_(sch)
209  else:
self._place(label, sch, self.__partialschedules)
def setSchedule_
Definition: Config.py:210
def setPartialSchedule_
Definition: Config.py:205
def Config.Process.setSchedule_ (   self,
  sch 
)

Definition at line 210 of file Config.py.

Referenced by Config.Process.setPartialSchedule_().

211  def setSchedule_(self,sch):
212  # See if every module has been inserted into the process
213  index = 0
214  try:
215  for p in sch:
216  p.label_()
217  index +=1
218  except:
219  raise RuntimeError("The path at index "+str(index)+" in the Schedule was not attached to the process.")
220 
self.__dict__['_Process__schedule'] = sch
def setSchedule_
Definition: Config.py:210
def Config.Process.setSource_ (   self,
  src 
)

Definition at line 173 of file Config.py.

References Config.Process._placeSource().

174  def setSource_(self,src):
self._placeSource('source',src)
def setSource_
Definition: Config.py:173
def _placeSource
Definition: Config.py:395
def Config.Process.setStrict (   self,
  value 
)

Definition at line 126 of file Config.py.

References Config.Process.__isStrict.

127  def setStrict(self, value):
128  self.__isStrict = value
129  _Module.__isStrict__ = True
def setStrict
Definition: Config.py:126
def Config.Process.source_ (   self)
returns the source which has been added to the Process or None if none have been added

Definition at line 170 of file Config.py.

Referenced by Config.Process.dumpConfig(), Config.Process.dumpPython(), and Config.Process.fillProcessDesc().

171  def source_(self):
172  """returns the source which has been added to the Process or None if none have been added"""
return self.__source
def Config.Process.validate (   self)

Definition at line 741 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

742  def validate(self):
743  # check if there's some input
744  # Breaks too many unit tests for now
745  #if self.source_() == None and self.looper_() == None:
746  # raise RuntimeError("No input source was found for this process")
747  pass
def validate
Definition: Config.py:741
def Config.Process.vpsets_ (   self)
returns a dict of the VPSets which have been added to the Process

Definition at line 242 of file Config.py.

Referenced by Config.Process.fillProcessDesc(), and Config.Process.prune().

243  def vpsets_(self):
244  """returns a dict of the VPSets which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__vpsets)

Member Data Documentation

Config.Process.__isStrict
private

Definition at line 124 of file Config.py.

Referenced by Config.Process.__setattr__(), Config.Process._okToPlace(), Config.Process._place(), Config.Process.add_(), and Config.Process.setStrict().

Property Documentation

Config.Process.analyzers = property(analyzers_,doc="dictionary containing the analyzers for the process")
static

Definition at line 185 of file Config.py.

Config.Process.endpaths = property(endpaths_,doc="dictionary containing the endpaths for the process")
static

Definition at line 197 of file Config.py.

Config.Process.es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process")
static

Definition at line 237 of file Config.py.

Config.Process.es_producers = property(es_producers_,doc="dictionary containing the es_producers for the process")
static

Definition at line 229 of file Config.py.

Config.Process.es_sources = property(es_sources_,doc="dictionary containing the es_sources for the process")
static

Definition at line 233 of file Config.py.

Config.Process.filters = property(filters_, doc="dictionary containing the filters for the process")
static

Definition at line 160 of file Config.py.

Config.Process.looper = property(looper_,setLooper_,doc='the main looper or None if not set')
static

Definition at line 181 of file Config.py.

Config.Process.outputModules = property(outputModules_,doc="dictionary containing the output_modules for the process")
static

Definition at line 189 of file Config.py.

Config.Process.paths = property(paths_,doc="dictionary containing the paths for the process")
static

Definition at line 193 of file Config.py.

Config.Process.process = property(name_,setName_, doc="name of the process")
static

Definition at line 165 of file Config.py.

Referenced by python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.dumpPython(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.open(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.outputEventContent(), python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.setProcess(), and python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.setProperty().

Config.Process.producers = property(producers_,doc="dictionary containing the producers for the process")
static

Definition at line 169 of file Config.py.

Config.Process.psets = property(psets_,doc="dictionary containing the PSets for the process")
static

Definition at line 241 of file Config.py.

Referenced by Config.Process.dumpPython().

Config.Process.schedule = property(schedule_,setSchedule_,doc='the schedule or None if not set')
static

Definition at line 221 of file Config.py.

Referenced by Config.Process.dumpConfig(), and Config.Process.dumpPython().

Config.Process.sequences = property(sequences_,doc="dictionary containing the sequences for the process")
static

Definition at line 201 of file Config.py.

Referenced by Config.Process._sequencesInDependencyOrder().

Config.Process.services = property(services_,doc="dictionary containing the services for the process")
static

Definition at line 225 of file Config.py.

Config.Process.source = property(source_,setSource_,doc='the main source or None if not set')
static

Definition at line 175 of file Config.py.

Referenced by confdb.HLTProcess._build_source(), and confdb.HLTProcess.build_source().

Config.Process.vpsets = property(vpsets_,doc="dictionary containing the PSets for the process")
static

Definition at line 245 of file Config.py.

Referenced by Config.Process.dumpPython().