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 psets_
 
def schedule_
 
def sequences_
 
def services_
 
def setLooper_
 
def setName_
 
def setPartialSchedule_
 
def setSchedule_
 
def setSource_
 
def setStrict
 
def setSubProcess_
 
def source_
 
def subProcess_
 
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')
 
 subProcess = property(subProcess_,setSubProcess_,doc='the SubProcess 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 _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 _placeSubProcess
 
def _placeVPSet
 
def _pruneModules
 
def _replaceInSequences
 
def _sequencesInDependencyOrder
 
def _validateSequence
 

Private Attributes

 __isStrict
 
 __processPSet
 
 __thelist
 

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 
)
The argument 'name' will be the name applied to this Process

Definition at line 102 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

103  def __init__(self,name):
104  """The argument 'name' will be the name applied to this Process"""
105  self.__dict__['_Process__name'] = name
106  if not name.isalnum():
107  raise RuntimeError("Error: The process name is an empty string or contains non-alphanumeric characters")
108  self.__dict__['_Process__filters'] = {}
109  self.__dict__['_Process__producers'] = {}
110  self.__dict__['_Process__source'] = None
111  self.__dict__['_Process__looper'] = None
112  self.__dict__['_Process__subProcess'] = None
113  self.__dict__['_Process__schedule'] = None
114  self.__dict__['_Process__analyzers'] = {}
115  self.__dict__['_Process__outputmodules'] = {}
116  self.__dict__['_Process__paths'] = DictTypes.SortedKeysDict() # have to keep the order
117  self.__dict__['_Process__endpaths'] = DictTypes.SortedKeysDict() # of definition
118  self.__dict__['_Process__sequences'] = {}
119  self.__dict__['_Process__services'] = {}
120  self.__dict__['_Process__essources'] = {}
121  self.__dict__['_Process__esproducers'] = {}
122  self.__dict__['_Process__esprefers'] = {}
123  self.__dict__['_Process__psets']={}
124  self.__dict__['_Process__vpsets']={}
125  self.__dict__['_cloneToObjectDict'] = {}
126  # policy switch to avoid object overwriting during extend/load
127  self.__dict__['_Process__InExtendCall'] = False
128  self.__dict__['_Process__partialschedules'] = {}
129  self.__isStrict = False
def __init__
Definition: Config.py:102

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 312 of file Config.py.

Referenced by Config.Process.__setattr__().

313  def __delattr__(self,name):
314  if not hasattr(self,name):
315  raise KeyError('process does not know about '+name)
316  elif name.startswith('_Process__'):
317  raise ValueError('this attribute cannot be deleted')
318  else:
319  # we have to remove it from all dictionaries/registries
320  dicts = [item for item in self.__dict__.values() if (type(item)==dict or type(item)==DictTypes.SortedKeysDict)]
321  for reg in dicts:
322  if reg.has_key(name): del reg[name]
323  # if it was a labelable object, the label needs to be removed
324  obj = getattr(self,name)
325  if isinstance(obj,_Labelable):
326  getattr(self,name).setLabel(None)
327  # now remove it from the process itself
328  try:
329  del self.__dict__[name]
330  except:
331  pass
def __delattr__
Definition: Config.py:312
def Config.Process.__setattr__ (   self,
  name,
  value 
)

Definition at line 262 of file Config.py.

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

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

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

References errorMatrix2Lands_multiChannel.id.

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

Definition at line 554 of file Config.py.

References Config.Process.es_prefers_().

Referenced by Config.Process.dumpConfig().

555  def _dumpConfigESPrefers(self, options):
556  result = ''
557  for item in self.es_prefers_().itervalues():
558  result +=options.indentation()+'es_prefer '+item.targetLabel_()+' = '+item.dumpConfig(options)
return result
def _dumpConfigESPrefers
Definition: Config.py:554
def es_prefers_
Definition: Config.py:250
def Config.Process._dumpConfigNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 479 of file Config.py.

Referenced by Config.Process.dumpConfig().

480  def _dumpConfigNamedList(self,items,typeName,options):
481  returnValue = ''
482  for name,item in items:
483  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigNamedList
Definition: Config.py:479
def Config.Process._dumpConfigOptionallyNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 489 of file Config.py.

Referenced by Config.Process.dumpConfig().

490  def _dumpConfigOptionallyNamedList(self,items,typeName,options):
491  returnValue = ''
492  for name,item in items:
493  if name == item.type_():
494  name = ''
495  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigOptionallyNamedList
Definition: Config.py:489
def Config.Process._dumpConfigUnnamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 484 of file Config.py.

Referenced by Config.Process.dumpConfig().

485  def _dumpConfigUnnamedList(self,items,typeName,options):
486  returnValue = ''
487  for name,item in items:
488  returnValue +=options.indentation()+typeName+' = '+item.dumpConfig(options)
return returnValue
def _dumpConfigUnnamedList
Definition: Config.py:484
def Config.Process._dumpPython (   self,
  d,
  options 
)
private

Definition at line 608 of file Config.py.

Referenced by Config.Process.dumpPython().

609  def _dumpPython(self, d, options):
610  result = ''
611  for name, value in d.iteritems():
612  result += value.dumpPythonAs(name,options)+'\n'
return result
def _dumpPython
Definition: Config.py:608
def Config.Process._dumpPythonList (   self,
  d,
  options 
)
private

Definition at line 559 of file Config.py.

Referenced by Config.Process.dumpPython().

560  def _dumpPythonList(self, d, options):
561  returnValue = ''
562  if isinstance(d, DictTypes.SortedKeysDict):
563  for name,item in d.items():
564  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
565  else:
566  for name,item in sorted(d.items()):
567  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
return returnValue
def _dumpPythonList
Definition: Config.py:559
def Config.Process._findPreferred (   self,
  esname,
  d,
  args,
  kargs 
)
private

Definition at line 836 of file Config.py.

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

837  def _findPreferred(self, esname, d,*args,**kargs):
838  # is esname a name in the dictionary?
839  if esname in d:
840  typ = d[esname].type_()
841  if typ == esname:
842  self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) )
843  else:
844  self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) )
845  return True
846  else:
847  # maybe it's an unnamed ESModule?
848  found = False
849  for name, value in d.iteritems():
850  if value.type_() == esname:
851  if found:
852  raise RuntimeError("More than one ES module for "+esname)
853  found = True
854  self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) )
855  return found
def _findPreferred
Definition: Config.py:836
def __setattr__
Definition: Config.py:262
def Config.Process._insertInto (   self,
  parameterSet,
  itemDict 
)
private

Definition at line 656 of file Config.py.

657  def _insertInto(self, parameterSet, itemDict):
658  for name,value in itemDict.iteritems():
value.insertInto(parameterSet, name)
def _insertInto
Definition: Config.py:656
def Config.Process._insertManyInto (   self,
  parameterSet,
  label,
  itemDict,
  tracked 
)
private

Definition at line 666 of file Config.py.

667  def _insertManyInto(self, parameterSet, label, itemDict, tracked):
668  l = []
669  for name,value in itemDict.iteritems():
670  newLabel = value.nameInProcessDesc_(name)
671  l.append(newLabel)
672  value.insertInto(parameterSet, name)
673  # alphabetical order is easier to compare with old language
674  l.sort()
parameterSet.addVString(tracked, label, l)
def _insertManyInto
Definition: Config.py:666
def Config.Process._insertOneInto (   self,
  parameterSet,
  label,
  item,
  tracked 
)
private

Definition at line 659 of file Config.py.

660  def _insertOneInto(self, parameterSet, label, item, tracked):
661  vitems = []
662  if not item == None:
663  newlabel = item.nameInProcessDesc_(label)
664  vitems = [newlabel]
665  item.insertInto(parameterSet, newlabel)
parameterSet.addVString(tracked, label, vitems)
def _insertOneInto
Definition: Config.py:659
def Config.Process._insertPaths (   self,
  processPSet 
)
private

Definition at line 675 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_(), EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, edm::EventProcessor.schedule_, and cmsPerfHarvest.visit().

676  def _insertPaths(self, processPSet):
677  scheduledPaths = []
678  triggerPaths = []
679  endpaths = []
680  if self.schedule_() == None:
681  # make one from triggerpaths & endpaths
682  for name,value in self.paths_().iteritems():
683  scheduledPaths.append(name)
684  triggerPaths.append(name)
685  for name,value in self.endpaths_().iteritems():
686  scheduledPaths.append(name)
687  endpaths.append(name)
688  else:
689  for path in self.schedule_():
690  pathname = path.label_()
691  scheduledPaths.append(pathname)
692  if self.endpaths_().has_key(pathname):
693  endpaths.append(pathname)
694  else:
695  triggerPaths.append(pathname)
696  processPSet.addVString(True, "@end_paths", endpaths)
697  processPSet.addVString(True, "@paths", scheduledPaths)
698  # trigger_paths are a little different
699  p = processPSet.newPSet()
700  p.addVString(True, "@trigger_paths", triggerPaths)
701  processPSet.addPSet(True, "@trigger_paths", p)
702  # add all these paths
703  pathValidator = PathValidator()
704  endpathValidator = EndPathValidator()
705  for triggername in triggerPaths:
706  #self.paths_()[triggername].insertInto(processPSet, triggername, self.sequences_())
707  pathValidator.setLabel(triggername)
708  self.paths_()[triggername].visit(pathValidator)
709  self.paths_()[triggername].insertInto(processPSet, triggername, self.__dict__)
710  for endpathname in endpaths:
711  #self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.sequences_())
712  endpathValidator.setLabel(endpathname)
713  self.endpaths_()[endpathname].visit(endpathValidator)
714  self.endpaths_()[endpathname].insertInto(processPSet, endpathname, self.__dict__)
715  processPSet.addVString(False, "@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
def _insertPaths
Definition: Config.py:675
def visit
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def schedule_
Definition: Config.py:218
def endpaths_
Definition: Config.py:210
def Config.Process._okToPlace (   self,
  name,
  mod,
  d 
)
private

Definition at line 347 of file Config.py.

References Config.Process.__isStrict.

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

348  def _okToPlace(self, name, mod, d):
349  if not self.__InExtendCall:
350  # if going
351  return True
352  elif not self.__isStrict:
353  return True
354  elif name in d:
355  # if there's an old copy, and the new one
356  # hasn't been modified, we're done. Still
357  # not quite safe if something has been defined twice.
358  # Need to add checks
359  if mod._isModified:
360  if d[name]._isModified:
361  return False
362  else:
363  return True
364  else:
365  return True
366  else:
367  return True
def _okToPlace
Definition: Config.py:347
def Config.Process._place (   self,
  name,
  mod,
  d 
)
private

Definition at line 368 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_().

369  def _place(self, name, mod, d):
370  if self._okToPlace(name, mod, d):
371  if self.__isStrict and isinstance(mod, _ModuleSequenceType):
372  d[name] = mod._postProcessFixup(self._cloneToObjectDict)
373  else:
374  d[name] = mod
375  if isinstance(mod,_Labelable):
mod.setLabel(name)
def _okToPlace
Definition: Config.py:347
def Config.Process._placeAnalyzer (   self,
  name,
  mod 
)
private

Definition at line 382 of file Config.py.

References Config.Process._place().

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

Definition at line 391 of file Config.py.

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

392  def _placeEndPath(self,name,mod):
393  self._validateSequence(mod, name)
394  try:
395  self._place(name, mod, self.__endpaths)
396  except ModuleCloneError, msg:
397  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:568
def _placeEndPath
Definition: Config.py:391
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 403 of file Config.py.

References Config.Process._place().

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

Definition at line 401 of file Config.py.

References Config.Process._place().

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

Definition at line 405 of file Config.py.

References Config.Process._place().

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

Definition at line 380 of file Config.py.

References Config.Process._place().

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

Definition at line 419 of file Config.py.

Referenced by Config.Process.setLooper_().

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

Definition at line 376 of file Config.py.

References Config.Process._place().

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

Definition at line 384 of file Config.py.

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

385  def _placePath(self,name,mod):
386  self._validateSequence(mod, name)
387  try:
388  self._place(name, mod, self.__paths)
389  except ModuleCloneError, msg:
390  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:568
def _placePath
Definition: Config.py:384
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 378 of file Config.py.

References Config.Process._place().

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

Definition at line 407 of file Config.py.

References Config.Process._place().

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

Definition at line 398 of file Config.py.

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

399  def _placeSequence(self,name,mod):
400  self._validateSequence(mod, name)
self._place(name, mod, self.__sequences)
def _validateSequence
Definition: Config.py:568
def _placeSequence
Definition: Config.py:398
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 429 of file Config.py.

References Config.Process._place().

430  def _placeService(self,typeName,mod):
431  self._place(typeName, mod, self.__services)
self.__dict__[typeName]=mod
def _placeService
Definition: Config.py:429
def Config.Process._placeSource (   self,
  name,
  mod 
)
private
Allow the source to be referenced by 'source' or by type name

Definition at line 411 of file Config.py.

Referenced by Config.Process.setSource_().

412  def _placeSource(self,name,mod):
413  """Allow the source to be referenced by 'source' or by type name"""
414  if name != 'source':
415  raise ValueError("The label '"+name+"' can not be used for a Source. Only 'source' is allowed.")
416  if self.__dict__['_Process__source'] is not None :
417  del self.__dict__[self.__dict__['_Process__source'].type_()]
418  self.__dict__['_Process__source'] = mod
self.__dict__[mod.type_()] = mod
def _placeSource
Definition: Config.py:411
def Config.Process._placeSubProcess (   self,
  name,
  mod 
)
private

Definition at line 424 of file Config.py.

Referenced by Config.Process.setSubProcess_().

425  def _placeSubProcess(self,name,mod):
426  if name != 'subProcess':
427  raise ValueError("The label '"+name+"' can not be used for a SubProcess. Only 'subProcess' is allowed.")
428  self.__dict__['_Process__subProcess'] = mod
self.__dict__[mod.type_()] = mod
def _placeSubProcess
Definition: Config.py:424
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 409 of file Config.py.

References Config.Process._place().

410  def _placeVPSet(self,name,mod):
self._place(name, mod, self.__vpsets)
def _placeVPSet
Definition: Config.py:409
def Config.Process._pruneModules (   self,
  d,
  scheduledNames 
)
private

Definition at line 761 of file Config.py.

References runtimedef.set().

Referenced by Config.Process.prune().

762  def _pruneModules(self, d, scheduledNames):
763  moduleNames = set(d.keys())
764  junk = moduleNames - scheduledNames
765  for name in junk:
766  delattr(self, name)
def _pruneModules
Definition: Config.py:761
void set(const std::string &name, int value)
set the flag, with a run-time name
def Config.Process._replaceInSequences (   self,
  label,
  new 
)
private

Definition at line 641 of file Config.py.

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

642  def _replaceInSequences(self, label, new):
643  old = getattr(self,label)
644  #TODO - replace by iterator concatenation
645  for sequenceable in self.sequences.itervalues():
646  sequenceable.replace(old,new)
647  for sequenceable in self.paths.itervalues():
648  sequenceable.replace(old,new)
649  for sequenceable in self.endpaths.itervalues():
sequenceable.replace(old,new)
def _replaceInSequences
Definition: Config.py:641
def Config.Process._sequencesInDependencyOrder (   self)
private

Definition at line 576 of file Config.py.

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

Referenced by Config.Process.dumpPython().

577  def _sequencesInDependencyOrder(self):
578  #for each sequence, see what other sequences it depends upon
579  returnValue=DictTypes.SortedKeysDict()
580  dependencies = {}
581  for label,seq in self.sequences.iteritems():
582  d = []
583  v = SequenceVisitor(d)
584  seq.visit(v)
585  dependencies[label]=[dep.label_() for dep in d if dep.hasLabel_()]
586  resolvedDependencies=True
587  #keep looping until we can no longer get rid of all dependencies
588  # if that happens it means we have circular dependencies
589  iterCount = 0
590  while resolvedDependencies:
591  iterCount += 1
592  resolvedDependencies = (0 != len(dependencies))
593  oldDeps = dict(dependencies)
594  for label,deps in oldDeps.iteritems():
595  # don't try too hard
596  if len(deps)==0 or iterCount > 100:
597  iterCount = 0
598  resolvedDependencies=True
599  returnValue[label]=self.sequences[label]
600  #remove this as a dependency for all other sequences
601  del dependencies[label]
602  for lb2,deps2 in dependencies.iteritems():
603  while deps2.count(label):
604  deps2.remove(label)
605  if len(dependencies):
606  raise RuntimeError("circular sequence dependency discovered \n"+
607  ",".join([label for label,junk in dependencies.iteritems()]))
return returnValue
def _sequencesInDependencyOrder
Definition: Config.py:576
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def Config.Process._validateSequence (   self,
  sequence,
  label 
)
private

Definition at line 568 of file Config.py.

References runtimedef.set().

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

569  def _validateSequence(self, sequence, label):
570  # See if every module has been inserted into the process
571  try:
572  l = set()
573  nameVisitor = NodeNameVisitor(l)
574  sequence.visit(nameVisitor)
575  except:
raise RuntimeError("An entry in sequence "+label + ' has no label')
def _validateSequence
Definition: Config.py:568
void set(const std::string &name, int value)
set the flag, with a run-time name
def Config.Process.add_ (   self,
  value 
)
Allows addition of components which do not have to have a label, e.g. Services

Definition at line 332 of file Config.py.

References Config.Process.__isStrict.

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

333  def add_(self,value):
334  """Allows addition of components which do not have to have a label, e.g. Services"""
335  if not isinstance(value,_ConfigureComponent):
336  raise TypeError
337  if not isinstance(value,_Unlabelable):
338  raise TypeError
339  #clone the item
340  #clone the item
341  if self.__isStrict:
342  newValue =value.copy()
343  value.setIsFrozen()
344  else:
345  newValue =value
346  newValue._place('',self)
def Config.Process.analyzerNames (   self)
Returns a string containing all the EDAnalyzer labels separated by a blank

Definition at line 138 of file Config.py.

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

139  def analyzerNames(self):
140  """Returns a string containing all the EDAnalyzer labels separated by a blank"""
return ' '.join(self.analyzers_().keys())
def analyzers_
Definition: Config.py:198
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def analyzerNames
Definition: Config.py:138
def Config.Process.analyzers_ (   self)
returns a dict of the analyzers which have been added to the Process

Definition at line 198 of file Config.py.

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

199  def analyzers_(self):
200  """returns a dict of the analyzers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__analyzers)
def analyzers_
Definition: Config.py:198
def Config.Process.dumpConfig (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using the old configuration language

Definition at line 496 of file Config.py.

References dataset.Dataset.__name, Config.Process._dumpConfigESPrefers(), Config.Process._dumpConfigNamedList(), Config.Process._dumpConfigOptionallyNamedList(), Config.Process._dumpConfigUnnamedList(), HLTMuonValidator.analyzers_, HLTMuonOfflineAnalyzer.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths_(), Config.Process.es_producers_(), Config.Process.es_sources_(), pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, HLTTauDQMLitePathPlotter.filters_, HLTTauDQMPathPlotter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, TrigResRateMon::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_(), Config.Process.schedule, Config.Process.sequences_(), edm::ProcessDesc.services_, Config.Process.services_(), CandOneToManyDeltaRMatcher.source_, CandOneToOneDeltaRMatcher.source_, ecaldqm::DQWorkerClient.source_(), SiStripFedCablingBuilderFromDb.source_, sistrip::SpyEventMatcher.source_, Config.Process.source_(), Config.Process.subProcess_(), edm::SubProcess.subProcess_, and edm::EventProcessor.subProcess_.

Referenced by Types.SecSource.configValue().

497  def dumpConfig(self, options=PrintOptions()):
498  """return a string containing the equivalent process defined using the old configuration language"""
499  config = "process "+self.__name+" = {\n"
500  options.indent()
501  if self.source_():
502  config += options.indentation()+"source = "+self.source_().dumpConfig(options)
503  if self.looper_():
504  config += options.indentation()+"looper = "+self.looper_().dumpConfig(options)
505  if self.subProcess_():
506  config += options.indentation()+"subProcess = "+self.subProcess_().dumpConfig(options)
507 
508  config+=self._dumpConfigNamedList(self.producers_().iteritems(),
509  'module',
510  options)
511  config+=self._dumpConfigNamedList(self.filters_().iteritems(),
512  'module',
513  options)
514  config+=self._dumpConfigNamedList(self.analyzers_().iteritems(),
515  'module',
516  options)
517  config+=self._dumpConfigNamedList(self.outputModules_().iteritems(),
518  'module',
519  options)
520  config+=self._dumpConfigNamedList(self.sequences_().iteritems(),
521  'sequence',
522  options)
523  config+=self._dumpConfigNamedList(self.paths_().iteritems(),
524  'path',
525  options)
526  config+=self._dumpConfigNamedList(self.endpaths_().iteritems(),
527  'endpath',
528  options)
529  config+=self._dumpConfigUnnamedList(self.services_().iteritems(),
530  'service',
531  options)
532  config+=self._dumpConfigOptionallyNamedList(
533  self.es_producers_().iteritems(),
534  'es_module',
535  options)
536  config+=self._dumpConfigOptionallyNamedList(
537  self.es_sources_().iteritems(),
538  'es_source',
539  options)
540  config += self._dumpConfigESPrefers(options)
541  for name,item in self.psets.iteritems():
542  config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options)
543  for name,item in self.vpsets.iteritems():
544  config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options)
545  if self.schedule:
546  pathNames = [p.label_() for p in self.schedule]
547  config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n'
548 
549 # config+=self._dumpConfigNamedList(self.vpsets.iteritems(),
550 # 'VPSet',
551 # options)
552  config += "}\n"
553  options.unindent()
return config
def es_sources_
Definition: Config.py:246
def subProcess_
Definition: Config.py:192
def _dumpConfigUnnamedList
Definition: Config.py:484
def es_producers_
Definition: Config.py:242
def _dumpConfigESPrefers
Definition: Config.py:554
def _dumpConfigOptionallyNamedList
Definition: Config.py:489
def filters_
Definition: Config.py:165
def outputModules_
Definition: Config.py:202
def producers_
Definition: Config.py:176
def analyzers_
Definition: Config.py:198
def dumpConfig
Definition: Config.py:496
def services_
Definition: Config.py:238
def sequences_
Definition: Config.py:214
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def _dumpConfigNamedList
Definition: Config.py:479
def endpaths_
Definition: Config.py:210
def Config.Process.dumpPython (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using python

Definition at line 613 of file Config.py.

References dataset.Dataset.__name, Config.Process._dumpPython(), Config.Process._dumpPythonList(), Config.Process._sequencesInDependencyOrder(), HLTMuonValidator.analyzers_, HLTMuonOfflineAnalyzer.analyzers_, 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_, HLTTauDQMLitePathPlotter.filters_, HLTTauDQMPathPlotter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, TrigResRateMon::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, Config.Process.schedule, edm::ProcessDesc.services_, Config.Process.services_(), CandOneToManyDeltaRMatcher.source_, CandOneToOneDeltaRMatcher.source_, ecaldqm::DQWorkerClient.source_(), SiStripFedCablingBuilderFromDb.source_, sistrip::SpyEventMatcher.source_, Config.Process.source_(), Config.Process.subProcess_(), edm::SubProcess.subProcess_, edm::EventProcessor.subProcess_, 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__().

614  def dumpPython(self, options=PrintOptions()):
615  """return a string containing the equivalent process defined using python"""
616  result = "import FWCore.ParameterSet.Config as cms\n\n"
617  result += "process = cms.Process(\""+self.__name+"\")\n\n"
618  if self.source_():
619  result += "process.source = "+self.source_().dumpPython(options)
620  if self.looper_():
621  result += "process.looper = "+self.looper_().dumpPython()
622  if self.subProcess_():
623  result += self.subProcess_().dumpPython(options)
624  result+=self._dumpPythonList(self.producers_(), options)
625  result+=self._dumpPythonList(self.filters_() , options)
626  result+=self._dumpPythonList(self.analyzers_(), options)
627  result+=self._dumpPythonList(self.outputModules_(), options)
628  result+=self._dumpPythonList(self._sequencesInDependencyOrder(), options)
629  result+=self._dumpPythonList(self.paths_(), options)
630  result+=self._dumpPythonList(self.endpaths_(), options)
631  result+=self._dumpPythonList(self.services_(), options)
632  result+=self._dumpPythonList(self.es_producers_(), options)
633  result+=self._dumpPythonList(self.es_sources_(), options)
634  result+=self._dumpPython(self.es_prefers_(), options)
635  result+=self._dumpPythonList(self.psets, options)
636  result+=self._dumpPythonList(self.vpsets, options)
637  if self.schedule:
638  pathNames = ['process.'+p.label_() for p in self.schedule]
639  result +='process.schedule = cms.Schedule(*[ ' + ', '.join(pathNames) + ' ])\n'
640 
return result
def es_sources_
Definition: Config.py:246
def subProcess_
Definition: Config.py:192
def es_producers_
Definition: Config.py:242
def filters_
Definition: Config.py:165
def dumpPython
Definition: Config.py:613
def es_prefers_
Definition: Config.py:250
def _sequencesInDependencyOrder
Definition: Config.py:576
def outputModules_
Definition: Config.py:202
def producers_
Definition: Config.py:176
def analyzers_
Definition: Config.py:198
def services_
Definition: Config.py:238
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def _dumpPythonList
Definition: Config.py:559
def _dumpPython
Definition: Config.py:608
def endpaths_
Definition: Config.py:210
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths which have been added to the Process

Definition at line 210 of file Config.py.

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

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

Definition at line 250 of file Config.py.

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

251  def es_prefers_(self):
252  """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:250
def Config.Process.es_producers_ (   self)
returns a dict of the esproducers which have been added to the Process

Definition at line 242 of file Config.py.

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

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

Definition at line 246 of file Config.py.

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

247  def es_sources_(self):
248  """returns a the es_sources which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__essources)
def es_sources_
Definition: Config.py:246
def Config.Process.extend (   self,
  other,
  items = () 
)
Look in other and find types which we can use

Definition at line 436 of file Config.py.

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

Referenced by relval_steps.WF.__init__(), Config.Process.load(), and Mixins._ValidatingParameterListBase.setValue().

437  def extend(self,other,items=()):
438  """Look in other and find types which we can use"""
439  # enable explicit check to avoid overwriting of existing objects
440  self.__dict__['_Process__InExtendCall'] = True
441 
442  seqs = dict()
443  labelled = dict()
444  for name in dir(other):
445  #'from XX import *' ignores these, and so should we.
446  if name.startswith('_'):
447  continue
448  item = getattr(other,name)
449  if name == "source" or name == "looper" or name == "subProcess":
450  self.__setattr__(name,item)
451  elif isinstance(item,_ModuleSequenceType):
452  seqs[name]=item
453  elif isinstance(item,_Labelable):
454  self.__setattr__(name,item)
455  labelled[name]=item
456  try:
457  item.label_()
458  except:
459  item.setLabel(name)
460  continue
461  elif isinstance(item,Schedule):
462  self.__setattr__(name,item)
463  elif isinstance(item,_Unlabelable):
464  self.add_(item)
465 
466  #now create a sequence which uses the newly made items
467  for name in seqs.iterkeys():
468  seq = seqs[name]
469  #newSeq = seq.copy()
470  #
471  if id(seq) not in self._cloneToObjectDict:
472  self.__setattr__(name,seq)
473  else:
474  newSeq = self._cloneToObjectDict[id(seq)]
475  self.__dict__[name]=newSeq
476  newSeq.setLabel(name)
477  #now put in proper bucket
478  newSeq._place(name,self)
self.__dict__['_Process__InExtendCall'] = False
def __setattr__
Definition: Config.py:262
dbl *** dir
Definition: mlp_gen.cc:35
def Config.Process.fillProcessDesc (   self,
  processPSet 
)
Used by the framework to convert python to C++ objects

Definition at line 767 of file Config.py.

References Config.Process.__init__(), and dbtoconf.object.

768  def fillProcessDesc(self, processPSet):
769  """Used by the framework to convert python to C++ objects"""
770  class ServiceInjectorAdaptor(object):
771  def __init__(self,ppset,thelist):
772  self.__thelist = thelist
773  self.__processPSet = ppset
774  def addService(self,pset):
775  self.__thelist.append(pset)
776  def newPSet(self):
777  return self.__processPSet.newPSet()
778  self.validate()
779  processPSet.addString(True, "@process_name", self.name_())
780  all_modules = self.producers_().copy()
781  all_modules.update(self.filters_())
782  all_modules.update(self.analyzers_())
783  all_modules.update(self.outputModules_())
784  self._insertInto(processPSet, self.psets_())
785  self._insertInto(processPSet, self.vpsets_())
786  self._insertManyInto(processPSet, "@all_modules", all_modules, True)
787  self._insertOneInto(processPSet, "@all_sources", self.source_(), True)
788  self._insertOneInto(processPSet, "@all_loopers", self.looper_(), True)
789  self._insertOneInto(processPSet, "@all_subprocesses", self.subProcess_(), False)
790  self._insertManyInto(processPSet, "@all_esmodules", self.es_producers_(), True)
791  self._insertManyInto(processPSet, "@all_essources", self.es_sources_(), True)
792  self._insertManyInto(processPSet, "@all_esprefers", self.es_prefers_(), True)
793  self._insertPaths(processPSet)
794  #handle services differently
795  services = []
796  for n in self.services_():
797  getattr(self,n).insertInto(ServiceInjectorAdaptor(processPSet,services))
798  processPSet.addVPSet(False,"services",services)
799  return processPSet
def es_sources_
Definition: Config.py:246
def subProcess_
Definition: Config.py:192
def _insertManyInto
Definition: Config.py:666
def es_producers_
Definition: Config.py:242
def filters_
Definition: Config.py:165
def es_prefers_
Definition: Config.py:250
def _insertPaths
Definition: Config.py:675
def outputModules_
Definition: Config.py:202
def producers_
Definition: Config.py:176
def fillProcessDesc
Definition: Config.py:767
def __init__
Definition: Config.py:102
def _insertInto
Definition: Config.py:656
def analyzers_
Definition: Config.py:198
def services_
Definition: Config.py:238
def validate
Definition: Config.py:800
def _insertOneInto
Definition: Config.py:659
list object
Definition: dbtoconf.py:77
def Config.Process.filterNames (   self)
Returns a string containing all the EDFilter labels separated by a blank

Definition at line 141 of file Config.py.

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

142  def filterNames(self):
143  """Returns a string containing all the EDFilter labels separated by a blank"""
return ' '.join(self.filters_().keys())
def filterNames
Definition: Config.py:141
def filters_
Definition: Config.py:165
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 165 of file Config.py.

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

166  def filters_(self):
167  """returns a dict of the filters which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__filters)
def filters_
Definition: Config.py:165
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 650 of file Config.py.

References Config.Process._replaceInSequences().

651  def globalReplace(self,label,new):
652  """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths"""
653  if not hasattr(self,label):
654  raise LookupError("process has no item of label "+label)
655  self._replaceInSequences(label, new)
setattr(self,label,new)
def _replaceInSequences
Definition: Config.py:641
def globalReplace
Definition: Config.py:650
def Config.Process.load (   self,
  moduleName 
)

Definition at line 432 of file Config.py.

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

433  def load(self, moduleName):
434  moduleName = moduleName.replace("/",".")
435  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 186 of file Config.py.

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

187  def looper_(self):
188  """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 169 of file Config.py.

References dataset.Dataset.__name.

170  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 202 of file Config.py.

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

203  def outputModules_(self):
204  """returns a dict of the output modules which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__outputmodules)
def outputModules_
Definition: Config.py:202
def Config.Process.pathNames (   self)
Returns a string containing all the Path names separated by a blank

Definition at line 144 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_().

145  def pathNames(self):
146  """Returns a string containing all the Path names separated by a blank"""
147  return ' '.join(self.paths_().keys())
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def pathNames
Definition: Config.py:144
def Config.Process.paths_ (   self)
returns a dict of the paths which have been added to the Process

Definition at line 206 of file Config.py.

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

207  def paths_(self):
208  """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 807 of file Config.py.

808  def prefer(self, esmodule,*args,**kargs):
809  """Prefer this ES source or producer. The argument can
810  either be an object label, e.g.,
811  process.prefer(process.juicerProducer) (not supported yet)
812  or a name of an ESSource or ESProducer
813  process.prefer("juicer")
814  or a type of unnamed ESSource or ESProducer
815  process.prefer("JuicerProducer")
816  In addition, you can pass as a labelled arguments the name of the Record you wish to
817  prefer where the type passed is a cms.vstring and that vstring can contain the
818  name of the C++ types in the Record which are being preferred, e.g.,
819  #prefer all data in record 'OrangeRecord' from 'juicer'
820  process.prefer("juicer", OrangeRecord=cms.vstring())
821  or
822  #prefer only "Orange" data in "OrangeRecord" from "juicer"
823  process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
824  or
825  #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
826  ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
827  """
828  # see if this refers to a named ESProducer
829  if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer):
830  raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet")
831  elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \
832  self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
833  pass
834  else:
835  raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
def es_sources_
Definition: Config.py:246
def _findPreferred
Definition: Config.py:836
def es_producers_
Definition: Config.py:242
def Config.Process.producerNames (   self)
Returns a string containing all the EDProducer labels separated by a blank

Definition at line 135 of file Config.py.

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

136  def producerNames(self):
137  """Returns a string containing all the EDProducer labels separated by a blank"""
return ' '.join(self.producers_().keys())
def producers_
Definition: Config.py:176
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def producerNames
Definition: Config.py:135
def Config.Process.producers_ (   self)
returns a dict of the producers which have been added to the Process

Definition at line 176 of file Config.py.

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

177  def producers_(self):
178  """returns a dict of the producers which have been added to the Process"""
return DictTypes.FixedKeysDict(self.__producers)
def producers_
Definition: Config.py:176
def Config.Process.prune (   self)
Remove clutter from the process which we think is unnecessary:
tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
not in the schedule will also be removed, along with an modules and sequences used only by
those removed Paths and EndPaths.

Definition at line 716 of file Config.py.

References Config.Process._pruneModules(), HLTMuonValidator.analyzers_, HLTMuonOfflineAnalyzer.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths, pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, HLTTauDQMLitePathPlotter.filters_, HLTTauDQMPathPlotter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), Selection< C, Selector, StoreContainer >.filters_, Selections.filters_, FourVectorHLTOnline::PathInfo.filters_, FourVectorHLTOffline::PathInfo.filters_, TrigResRateMon::PathInfo.filters_, list(), Config.Process.paths, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.psets_(), EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, edm::EventProcessor.schedule_, runtimedef.set(), and Config.Process.vpsets_().

Referenced by dirstructure.Directory.prune().

717  def prune(self):
718  """ Remove clutter from the process which we think is unnecessary:
719  tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
720  not in the schedule will also be removed, along with an modules and sequences used only by
721  those removed Paths and EndPaths."""
722  for name in self.psets_():
723  if getattr(self,name).isTracked():
724  delattr(self, name)
725  for name in self.vpsets_():
726  delattr(self, name)
727  #first we need to resolve any SequencePlaceholders being used
728  for x in self.paths.itervalues():
729  x.resolve(self.__dict__)
730  for x in self.endpaths.itervalues():
731  x.resolve(self.__dict__)
732  usedModules = set()
733  if self.schedule_():
734  usedModules=set(self.schedule_().moduleNames())
735  #get rid of unused paths
736  schedNames = set(( x.label_() for x in self.schedule_()))
737  names = set(self.paths)
738  names.update(set(self.endpaths))
739  junk = names - schedNames
740  for n in junk:
741  delattr(self,n)
742  else:
743  pths = list(self.paths.itervalues())
744  pths.extend(self.endpaths.itervalues())
745  temp = Schedule(*pths)
746  usedModules=set(temp.moduleNames())
747  self._pruneModules(self.producers_(), usedModules)
748  self._pruneModules(self.filters_(), usedModules)
749  self._pruneModules(self.analyzers_(), usedModules)
750  #remove sequences that do not appear in remaining paths and endpaths
751  seqs = list()
752  sv = SequenceVisitor(seqs)
753  for p in self.paths.itervalues():
754  p.visit(sv)
755  for p in self.endpaths.itervalues():
756  p.visit(sv)
757  keepSeqSet = set(( s for s in seqs if s.hasLabel_()))
758  availableSeqs = set(self.sequences.itervalues())
759  for s in availableSeqs-keepSeqSet:
760  delattr(self,s.label_())
def filters_
Definition: Config.py:165
def producers_
Definition: Config.py:176
def analyzers_
Definition: Config.py:198
def schedule_
Definition: Config.py:218
def _pruneModules
Definition: Config.py:761
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void set(const std::string &name, int value)
set the flag, with a run-time name
def Config.Process.psets_ (   self)
returns a dict of the PSets which have been added to the Process

Definition at line 254 of file Config.py.

Referenced by Config.Process.prune().

255  def psets_(self):
256  """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 218 of file Config.py.

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

219  def schedule_(self):
220  """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:218
def Config.Process.sequences_ (   self)
returns a dict of the sequences which have been added to the Process

Definition at line 214 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 238 of file Config.py.

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

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

Definition at line 189 of file Config.py.

References Config.Process._placeLooper().

190  def setLooper_(self,lpr):
self._placeLooper('looper',lpr)
def setLooper_
Definition: Config.py:189
def _placeLooper
Definition: Config.py:419
def Config.Process.setName_ (   self,
  name 
)

Definition at line 171 of file Config.py.

172  def setName_(self,name):
173  if not name.isalnum():
174  raise RuntimeError("Error: The process name is an empty string or contains non-alphanumeric characters")
self.__dict__['_Process__name'] = name
def setName_
Definition: Config.py:171
def Config.Process.setPartialSchedule_ (   self,
  sch,
  label 
)

Definition at line 221 of file Config.py.

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

222  def setPartialSchedule_(self,sch,label):
223  if label == "schedule":
224  self.setSchedule_(sch)
225  else:
self._place(label, sch, self.__partialschedules)
def setSchedule_
Definition: Config.py:226
def setPartialSchedule_
Definition: Config.py:221
def Config.Process.setSchedule_ (   self,
  sch 
)

Definition at line 226 of file Config.py.

Referenced by Config.Process.setPartialSchedule_().

227  def setSchedule_(self,sch):
228  # See if every module has been inserted into the process
229  index = 0
230  try:
231  for p in sch:
232  p.label_()
233  index +=1
234  except:
235  raise RuntimeError("The path at index "+str(index)+" in the Schedule was not attached to the process.")
236 
self.__dict__['_Process__schedule'] = sch
def setSchedule_
Definition: Config.py:226
def Config.Process.setSource_ (   self,
  src 
)

Definition at line 183 of file Config.py.

References Config.Process._placeSource().

184  def setSource_(self,src):
self._placeSource('source',src)
def setSource_
Definition: Config.py:183
def _placeSource
Definition: Config.py:411
def Config.Process.setStrict (   self,
  value 
)

Definition at line 130 of file Config.py.

References Config.Process.__isStrict.

131  def setStrict(self, value):
132  self.__isStrict = value
133  _Module.__isStrict__ = True
def setStrict
Definition: Config.py:130
def Config.Process.setSubProcess_ (   self,
  lpr 
)

Definition at line 195 of file Config.py.

References Config.Process._placeSubProcess().

196  def setSubProcess_(self,lpr):
self._placeSubProcess('subProcess',lpr)
def setSubProcess_
Definition: Config.py:195
def _placeSubProcess
Definition: Config.py:424
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 180 of file Config.py.

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

181  def source_(self):
182  """returns the source which has been added to the Process or None if none have been added"""
return self.__source
def Config.Process.subProcess_ (   self)
returns the sub-process which has been added to the Process or None if none have been added

Definition at line 192 of file Config.py.

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

193  def subProcess_(self):
194  """returns the sub-process which has been added to the Process or None if none have been added"""
return self.__subProcess
def subProcess_
Definition: Config.py:192
def Config.Process.validate (   self)

Definition at line 800 of file Config.py.

801  def validate(self):
802  # check if there's some input
803  # Breaks too many unit tests for now
804  #if self.source_() == None and self.looper_() == None:
805  # raise RuntimeError("No input source was found for this process")
806  pass
def validate
Definition: Config.py:800
def Config.Process.vpsets_ (   self)
returns a dict of the VPSets which have been added to the Process

Definition at line 258 of file Config.py.

Referenced by Config.Process.prune().

259  def vpsets_(self):
260  """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 128 of file Config.py.

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

Config.Process.__processPSet
private

Definition at line 772 of file Config.py.

Config.Process.__thelist
private

Definition at line 771 of file Config.py.

Property Documentation

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

Definition at line 201 of file Config.py.

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

Definition at line 213 of file Config.py.

Referenced by Config.Process.prune().

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

Definition at line 253 of file Config.py.

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

Definition at line 245 of file Config.py.

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

Definition at line 249 of file Config.py.

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

Definition at line 168 of file Config.py.

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

Definition at line 191 of file Config.py.

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

Definition at line 205 of file Config.py.

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

Definition at line 209 of file Config.py.

Referenced by Config.Process.prune().

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

Definition at line 175 of file Config.py.

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

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

Definition at line 179 of file Config.py.

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

Definition at line 257 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 237 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 217 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 241 of file Config.py.

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

Definition at line 185 of file Config.py.

Config.Process.subProcess = property(subProcess_,setSubProcess_,doc='the SubProcess or None if not set')
static

Definition at line 197 of file Config.py.

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

Definition at line 261 of file Config.py.

Referenced by Config.Process.dumpPython().