CMS 3D CMS Logo

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__ (self, name)
 
def __init__ (self, name, Mods)
 
def __setattr__ (self, name, value)
 
def __setstate__ (self, pkldict)
 
def add_ (self, value)
 
def addSubProcess (self, mod)
 
def aliases_ (self)
 
def analyzerNames (self)
 
def analyzers_ (self)
 
def dumpConfig (self, options=PrintOptions())
 
def dumpPython (self, options=PrintOptions())
 
def endpaths_ (self)
 
def es_prefers_ (self)
 
def es_producers_ (self)
 
def es_sources_ (self)
 
def extend (self, other, items=())
 
def fillProcessDesc (self, processPSet)
 
def filterNames (self)
 
def filters_ (self)
 
def globalReplace (self, label, new)
 
def isUsingModifier (self, mod)
 
def load (self, moduleName)
 
def looper_ (self)
 
def name_ (self)
 
def outputModules_ (self)
 
def pathNames (self)
 
def paths_ (self)
 
def prefer (self, esmodule, args, kargs)
 
def producerNames (self)
 
def producers_ (self)
 
def prune (self, verbose=False, keepUnresolvedSequencePlaceholders=False)
 
def psets_ (self)
 
def resolve (self, keepUnresolvedSequencePlaceholders=False)
 
def schedule_ (self)
 
def sequences_ (self)
 
def services_ (self)
 
def setLooper_ (self, lpr)
 
def setName_ (self, name)
 
def setPartialSchedule_ (self, sch, label)
 
def setSchedule_ (self, sch)
 
def setSource_ (self, src)
 
def setStrict (self, value)
 
def source_ (self)
 
def subProcesses_ (self)
 
def tasks_ (self)
 
def validate (self)
 
def vpsets_ (self)
 

Properties

 aliases = property(aliases_,doc="dictionary containing the aliases for the process")
 
 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')
 
 subProcesses = property(subProcesses_,doc='the SubProcesses that have been added to the Process')
 
 tasks = property(tasks_,doc="dictionary containing the tasks for the process")
 
 vpsets = property(vpsets_,doc="dictionary containing the PSets for the process")
 

Private Member Functions

def __findFirstUsingModule (self, seqsOrTasks, mod)
 
def __setObjectLabel (self, object, newLabel)
 
def _delattrFromSetattr (self, name)
 
def _delHelper (self, name)
 
def _dumpConfigESPrefers (self, options)
 
def _dumpConfigNamedList (self, items, typeName, options)
 
def _dumpConfigOptionallyNamedList (self, items, typeName, options)
 
def _dumpConfigUnnamedList (self, items, typeName, options)
 
def _dumpPython (self, d, options)
 
def _dumpPythonList (self, d, options)
 
def _dumpPythonSubProcesses (self, l, options)
 
def _findPreferred (self, esname, d, args, kargs)
 
def _insertInto (self, parameterSet, itemDict)
 
def _insertManyInto (self, parameterSet, label, itemDict, tracked)
 
def _insertOneInto (self, parameterSet, label, item, tracked)
 
def _insertPaths (self, processPSet, nodeVisitor)
 
def _insertSubProcessesInto (self, parameterSet, label, itemList, tracked)
 
def _itemsInDependencyOrder (self, processDictionaryOfItems)
 
def _okToPlace (self, name, mod, d)
 
def _place (self, name, mod, d)
 
def _placeAlias (self, name, mod)
 
def _placeAnalyzer (self, name, mod)
 
def _placeEndPath (self, name, mod)
 
def _placeESPrefer (self, name, mod)
 
def _placeESProducer (self, name, mod)
 
def _placeESSource (self, name, mod)
 
def _placeFilter (self, name, mod)
 
def _placeLooper (self, name, mod)
 
def _placeOutputModule (self, name, mod)
 
def _placePath (self, name, mod)
 
def _placeProducer (self, name, mod)
 
def _placePSet (self, name, mod)
 
def _placeSequence (self, name, mod)
 
def _placeService (self, typeName, mod)
 
def _placeSource (self, name, mod)
 
def _placeSubProcess (self, name, mod)
 
def _placeTask (self, name, task)
 
def _placeVPSet (self, name, mod)
 
def _pruneModules (self, d, scheduledNames)
 
def _replaceInSchedule (self, label, new)
 
def _replaceInSequences (self, label, new)
 
def _replaceInTasks (self, label, new)
 
def _validateSequence (self, sequence, label)
 
def _validateTask (self, task, label)
 

Private Attributes

 __isStrict
 
 __ppset
 
 __process
 
 __processPSet
 
 __thelist
 

Detailed Description

Root class for a CMS configuration process

Definition at line 98 of file Config.py.

Constructor & Destructor Documentation

def Config.Process.__init__ (   self,
  name,
  Mods 
)
The argument 'name' will be the name applied to this Process
    Can optionally pass as additional arguments cms.Modifier instances
    that will be used to modify the Process as it is built

Definition at line 100 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

100  def __init__(self,name,*Mods):
101  """The argument 'name' will be the name applied to this Process
102  Can optionally pass as additional arguments cms.Modifier instances
103  that will be used to modify the Process as it is built
104  """
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__subProcesses'] = []
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__tasks'] = {}
120  self.__dict__['_Process__services'] = {}
121  self.__dict__['_Process__essources'] = {}
122  self.__dict__['_Process__esproducers'] = {}
123  self.__dict__['_Process__esprefers'] = {}
124  self.__dict__['_Process__aliases'] = {}
125  self.__dict__['_Process__psets']={}
126  self.__dict__['_Process__vpsets']={}
127  self.__dict__['_cloneToObjectDict'] = {}
128  # policy switch to avoid object overwriting during extend/load
129  self.__dict__['_Process__InExtendCall'] = False
130  self.__dict__['_Process__partialschedules'] = {}
131  self.__isStrict = False
132  self.__dict__['_Process__modifiers'] = Mods
133  for m in self.__modifiers:
134  m._setChosen()
135 
def __init__(self, name, Mods)
Definition: Config.py:100

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 439 of file Config.py.

References Config.Process._delHelper(), Config.Process._replaceInSchedule(), Config.Process._replaceInSequences(), and Config.Process._replaceInTasks().

439  def __delattr__(self,name):
440  self._delHelper(name)
441  obj = getattr(self,name)
442  if not obj is None:
443  if not isinstance(obj, Sequence) and not isinstance(obj, Task):
444  # For modules, ES modules and services we can also remove
445  # the deleted object from Sequences, Paths, EndPaths, and
446  # Tasks. Note that for Sequences and Tasks that cannot be done
447  # reliably as the places where the Sequence or Task was used
448  # might have been expanded so we do not even try. We considered
449  # raising an exception if a Sequences or Task was explicitly
450  # deleted, but did not because when done carefully deletion
451  # is sometimes OK (for example in the prune function where it
452  # has been checked that the deleted Sequence is not used).
453  if obj._isTaskComponent():
454  self._replaceInTasks(name, None)
455  self._replaceInSchedule(name, None)
456  if isinstance(obj, _Sequenceable) or obj._isTaskComponent():
457  self._replaceInSequences(name, None)
458  # now remove it from the process itself
459  try:
460  del self.__dict__[name]
461  except:
462  pass
463 
def __delattr__(self, name)
Definition: Config.py:439
def _replaceInTasks(self, label, new)
Definition: Config.py:853
def _delHelper(self, name)
Definition: Config.py:422
def _replaceInSequences(self, label, new)
Definition: Config.py:844
def _replaceInSchedule(self, label, new)
Definition: Config.py:857
def Config.Process.__findFirstUsingModule (   self,
  seqsOrTasks,
  mod 
)
private
Given a container of sequences or tasks, find the first sequence or task
containing mod and return it. If none is found, return None

Definition at line 409 of file Config.py.

References list().

Referenced by Config.Process.__setattr__().

409  def __findFirstUsingModule(self, seqsOrTasks, mod):
410  """Given a container of sequences or tasks, find the first sequence or task
411  containing mod and return it. If none is found, return None"""
412  from FWCore.ParameterSet.SequenceTypes import ModuleNodeVisitor
413  l = list()
414  for seqOrTask in seqsOrTasks.itervalues():
415  l[:] = []
416  v = ModuleNodeVisitor(l)
417  seqOrTask.visit(v)
418  if mod in l:
419  return seqOrTask
420  return None
421 
def __findFirstUsingModule(self, seqsOrTasks, mod)
Definition: Config.py:409
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
def Config.Process.__setattr__ (   self,
  name,
  value 
)

Definition at line 309 of file Config.py.

References Config.Process.__findFirstUsingModule(), Config.Process.__isStrict, Config.Process.__setObjectLabel(), Config.Process._delattrFromSetattr(), Config.Process._okToPlace(), Config.Process._replaceInSchedule(), Config.Process._replaceInSequences(), Config.Process._replaceInTasks(), Config.Process.add_(), Config.Process.endpaths, triggerObjects_cff.id, Config.Process.paths, Config.Process.sequences, harvestTrackValidationPlots.str, and Config.Process.tasks.

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

309  def __setattr__(self,name,value):
310  # check if the name is well-formed (only _ and alphanumerics are allowed)
311  if not name.replace('_','').isalnum():
312  raise ValueError('The label '+name+' contains forbiden characters')
313 
314  # private variable exempt from all this
315  if name.startswith('_Process__'):
316  self.__dict__[name]=value
317  return
318  if not isinstance(value,_ConfigureComponent):
319  raise TypeError("can only assign labels to an object that inherits from '_ConfigureComponent'\n"
320  +"an instance of "+str(type(value))+" will not work - requested label is "+name)
321  if not isinstance(value,_Labelable) and not isinstance(value,Source) and not isinstance(value,Looper) and not isinstance(value,Schedule):
322  if name == value.type_():
323  # Only Services get handled here
324  self.add_(value)
325  return
326  else:
327  raise TypeError("an instance of "+str(type(value))+" can not be assigned the label '"+name+"'.\n"+
328  "Please either use the label '"+value.type_()+" or use the 'add_' method instead.")
329  #clone the item
330  if self.__isStrict:
331  newValue =value.copy()
332  try:
333  newValue._filename = value._filename
334  except:
335  pass
336  value.setIsFrozen()
337  else:
338  newValue =value
339  if not self._okToPlace(name, value, self.__dict__):
340  newFile='top level config'
341  if hasattr(value,'_filename'):
342  newFile = value._filename
343  oldFile='top level config'
344  oldValue = getattr(self,name)
345  if hasattr(oldValue,'_filename'):
346  oldFile = oldValue._filename
347  msg = "Trying to override definition of process."+name
348  msg += "\n new object defined in: "+newFile
349  msg += "\n existing object defined in: "+oldFile
350  raise ValueError(msg)
351  # remove the old object of the name (if there is one)
352  if hasattr(self,name) and not (getattr(self,name)==newValue):
353  # Complain if items in sequences or tasks from load() statements have
354  # degenerate names, but if the user overwrites a name in the
355  # main config, replace it everywhere
356  if newValue._isTaskComponent():
357  if not self.__InExtendCall:
358  self._replaceInTasks(name, newValue)
359  self._replaceInSchedule(name, newValue)
360  else:
361  if not isinstance(newValue, Task):
362  #should check to see if used in task before complaining
363  newFile='top level config'
364  if hasattr(value,'_filename'):
365  newFile = value._filename
366  oldFile='top level config'
367  oldValue = getattr(self,name)
368  if hasattr(oldValue,'_filename'):
369  oldFile = oldValue._filename
370  msg1 = "Trying to override definition of "+name+" while it is used by the task "
371  msg2 = "\n new object defined in: "+newFile
372  msg2 += "\n existing object defined in: "+oldFile
373  s = self.__findFirstUsingModule(self.tasks,oldValue)
374  if s is not None:
375  raise ValueError(msg1+s.label_()+msg2)
376 
377  if isinstance(newValue, _Sequenceable) or newValue._isTaskComponent():
378  if not self.__InExtendCall:
379  self._replaceInSequences(name, newValue)
380  else:
381  #should check to see if used in sequence before complaining
382  newFile='top level config'
383  if hasattr(value,'_filename'):
384  newFile = value._filename
385  oldFile='top level config'
386  oldValue = getattr(self,name)
387  if hasattr(oldValue,'_filename'):
388  oldFile = oldValue._filename
389  msg1 = "Trying to override definition of "+name+" while it is used by the "
390  msg2 = "\n new object defined in: "+newFile
391  msg2 += "\n existing object defined in: "+oldFile
392  s = self.__findFirstUsingModule(self.sequences,oldValue)
393  if s is not None:
394  raise ValueError(msg1+"sequence "+s.label_()+msg2)
395  s = self.__findFirstUsingModule(self.paths,oldValue)
396  if s is not None:
397  raise ValueError(msg1+"path "+s.label_()+msg2)
398  s = self.__findFirstUsingModule(self.endpaths,oldValue)
399  if s is not None:
400  raise ValueError(msg1+"endpath "+s.label_()+msg2)
401  self._delattrFromSetattr(name)
402  self.__dict__[name]=newValue
403  if isinstance(newValue,_Labelable):
404  self.__setObjectLabel(newValue, name)
405  self._cloneToObjectDict[id(value)] = newValue
406  self._cloneToObjectDict[id(newValue)] = newValue
407  #now put in proper bucket
408  newValue._place(name,self)
def __findFirstUsingModule(self, seqsOrTasks, mod)
Definition: Config.py:409
def _okToPlace(self, name, mod, d)
Definition: Config.py:488
def _replaceInTasks(self, label, new)
Definition: Config.py:853
def __setattr__(self, name, value)
Definition: Config.py:309
def __setObjectLabel(self, object, newLabel)
Definition: Config.py:282
def _replaceInSequences(self, label, new)
Definition: Config.py:844
def add_(self, value)
Definition: Config.py:473
def _delattrFromSetattr(self, name)
Definition: Config.py:464
def _replaceInSchedule(self, label, new)
Definition: Config.py:857
def Config.Process.__setObjectLabel (   self,
  object,
  newLabel 
)
private

Definition at line 282 of file Config.py.

References triggerObjects_cff.id, and harvestTrackValidationPlots.str.

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

282  def __setObjectLabel(self, object, newLabel) :
283  if not object.hasLabel_() :
284  object.setLabel(newLabel)
285  return
286  if newLabel == object.label_() :
287  return
288  if newLabel is None :
289  object.setLabel(None)
290  return
291  if (hasattr(self, object.label_()) and id(getattr(self, object.label_())) == id(object)) :
292  msg100 = "Attempting to change the label of an attribute of the Process\n"
293  msg101 = "Old label = "+object.label_()+" New label = "+newLabel+"\n"
294  msg102 = "Type = "+str(type(object))+"\n"
295  msg103 = "Some possible solutions:\n"
296  msg104 = " 1. Clone modules instead of using simple assignment. Cloning is\n"
297  msg105 = " also preferred for other types when possible.\n"
298  msg106 = " 2. Declare new names starting with an underscore if they are\n"
299  msg107 = " for temporaries you do not want propagated into the Process. The\n"
300  msg108 = " underscore tells \"from x import *\" and process.load not to import\n"
301  msg109 = " the name.\n"
302  msg110 = " 3. Reorganize so the assigment is not necessary. Giving a second\n"
303  msg111 = " name to the same object usually causes confusion and problems.\n"
304  msg112 = " 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
305  raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
306  object.setLabel(None)
307  object.setLabel(newLabel)
308 
def __setObjectLabel(self, object, newLabel)
Definition: Config.py:282
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 154 of file Config.py.

References triggerObjects_cff.id.

154  def __setstate__(self, pkldict):
155  """
156  Unpickling hook.
157 
158  Since cloneToObjectDict stores a hash of objects by their
159  id() it needs to be updated when unpickling to use the
160  new object id values instantiated during the unpickle.
161 
162  """
163  self.__dict__.update(pkldict)
164  tmpDict = {}
165  for value in self._cloneToObjectDict.values():
166  tmpDict[id(value)] = value
167  self.__dict__['_cloneToObjectDict'] = tmpDict
168 
169 
170 
def __setstate__(self, pkldict)
Definition: Config.py:154
def Config.Process._delattrFromSetattr (   self,
  name 
)
private
Similar to __delattr__ but we need different behavior when called from __setattr__

Definition at line 464 of file Config.py.

References Config.Process._delHelper().

Referenced by Config.Process.__setattr__().

464  def _delattrFromSetattr(self,name):
465  """Similar to __delattr__ but we need different behavior when called from __setattr__"""
466  self._delHelper(name)
467  # now remove it from the process itself
468  try:
469  del self.__dict__[name]
470  except:
471  pass
472 
def _delHelper(self, name)
Definition: Config.py:422
def _delattrFromSetattr(self, name)
Definition: Config.py:464
def Config.Process._delHelper (   self,
  name 
)
private

Definition at line 422 of file Config.py.

Referenced by Config.Process.__delattr__(), and Config.Process._delattrFromSetattr().

422  def _delHelper(self,name):
423  if not hasattr(self,name):
424  raise KeyError('process does not know about '+name)
425  elif name.startswith('_Process__'):
426  raise ValueError('this attribute cannot be deleted')
427 
428  # we have to remove it from all dictionaries/registries
429  dicts = [item for item in self.__dict__.values() if (type(item)==dict or type(item)==DictTypes.SortedKeysDict)]
430  for reg in dicts:
431  if name in reg: del reg[name]
432  # if it was a labelable object, the label needs to be removed
433  obj = getattr(self,name)
434  if isinstance(obj,_Labelable):
435  obj.setLabel(None)
436  if isinstance(obj,Service):
437  obj._inProcess = False
438 
def _delHelper(self, name)
Definition: Config.py:422
def Config.Process._dumpConfigESPrefers (   self,
  options 
)
private

Definition at line 721 of file Config.py.

References Config.Process.es_prefers_().

Referenced by Config.Process.dumpConfig().

721  def _dumpConfigESPrefers(self, options):
722  result = ''
723  for item in self.es_prefers_().itervalues():
724  result +=options.indentation()+'es_prefer '+item.targetLabel_()+' = '+item.dumpConfig(options)
725  return result
def _dumpConfigESPrefers(self, options)
Definition: Config.py:721
def es_prefers_(self)
Definition: Config.py:257
def Config.Process._dumpConfigNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 642 of file Config.py.

Referenced by Config.Process.dumpConfig().

642  def _dumpConfigNamedList(self,items,typeName,options):
643  returnValue = ''
644  for name,item in items:
645  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
646  return returnValue
def _dumpConfigNamedList(self, items, typeName, options)
Definition: Config.py:642
def Config.Process._dumpConfigOptionallyNamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 652 of file Config.py.

Referenced by Config.Process.dumpConfig().

652  def _dumpConfigOptionallyNamedList(self,items,typeName,options):
653  returnValue = ''
654  for name,item in items:
655  if name == item.type_():
656  name = ''
657  returnValue +=options.indentation()+typeName+' '+name+' = '+item.dumpConfig(options)
658  return returnValue
def _dumpConfigOptionallyNamedList(self, items, typeName, options)
Definition: Config.py:652
def Config.Process._dumpConfigUnnamedList (   self,
  items,
  typeName,
  options 
)
private

Definition at line 647 of file Config.py.

Referenced by Config.Process.dumpConfig().

647  def _dumpConfigUnnamedList(self,items,typeName,options):
648  returnValue = ''
649  for name,item in items:
650  returnValue +=options.indentation()+typeName+' = '+item.dumpConfig(options)
651  return returnValue
def _dumpConfigUnnamedList(self, items, typeName, options)
Definition: Config.py:647
def Config.Process._dumpPython (   self,
  d,
  options 
)
private

Definition at line 812 of file Config.py.

Referenced by Config.Process.dumpPython().

812  def _dumpPython(self, d, options):
813  result = ''
814  for name, value in sorted(d.iteritems()):
815  result += value.dumpPythonAs(name,options)+'\n'
816  return result
def _dumpPython(self, d, options)
Definition: Config.py:812
def Config.Process._dumpPythonList (   self,
  d,
  options 
)
private

Definition at line 731 of file Config.py.

Referenced by Config.Process.dumpPython().

731  def _dumpPythonList(self, d, options):
732  returnValue = ''
733  if isinstance(d, DictTypes.SortedKeysDict):
734  for name,item in d.items():
735  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
736  else:
737  for name,item in sorted(d.items()):
738  returnValue +='process.'+name+' = '+item.dumpPython(options)+'\n\n'
739  return returnValue
def _dumpPythonList(self, d, options)
Definition: Config.py:731
def Config.Process._dumpPythonSubProcesses (   self,
  l,
  options 
)
private

Definition at line 726 of file Config.py.

Referenced by Config.Process.dumpPython().

726  def _dumpPythonSubProcesses(self, l, options):
727  returnValue = ''
728  for item in l:
729  returnValue += item.dumpPython(options)+'\n\n'
730  return returnValue
def _dumpPythonSubProcesses(self, l, options)
Definition: Config.py:726
def Config.Process._findPreferred (   self,
  esname,
  d,
  args,
  kargs 
)
private

Definition at line 1134 of file Config.py.

References psClasses.BuildTreeNode.__setattr__(), and Config.Process.__setattr__().

1134  def _findPreferred(self, esname, d,*args,**kargs):
1135  # is esname a name in the dictionary?
1136  if esname in d:
1137  typ = d[esname].type_()
1138  if typ == esname:
1139  self.__setattr__( esname+"_prefer", ESPrefer(typ,*args,**kargs) )
1140  else:
1141  self.__setattr__( esname+"_prefer", ESPrefer(typ, esname,*args,**kargs) )
1142  return True
1143  else:
1144  # maybe it's an unnamed ESModule?
1145  found = False
1146  for name, value in d.iteritems():
1147  if value.type_() == esname:
1148  if found:
1149  raise RuntimeError("More than one ES module for "+esname)
1150  found = True
1151  self.__setattr__(esname+"_prefer", ESPrefer(d[esname].type_()) )
1152  return found
1153 
1154 
def _findPreferred(self, esname, d, args, kargs)
Definition: Config.py:1134
def __setattr__(self, name, value)
Definition: Config.py:309
def Config.Process._insertInto (   self,
  parameterSet,
  itemDict 
)
private

Definition at line 868 of file Config.py.

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

Definition at line 878 of file Config.py.

878  def _insertManyInto(self, parameterSet, label, itemDict, tracked):
879  l = []
880  for name,value in itemDict.iteritems():
881  newLabel = value.nameInProcessDesc_(name)
882  l.append(newLabel)
883  value.insertInto(parameterSet, name)
884  # alphabetical order is easier to compare with old language
885  l.sort()
886  parameterSet.addVString(tracked, label, l)
def _insertManyInto(self, parameterSet, label, itemDict, tracked)
Definition: Config.py:878
def Config.Process._insertOneInto (   self,
  parameterSet,
  label,
  item,
  tracked 
)
private

Definition at line 871 of file Config.py.

871  def _insertOneInto(self, parameterSet, label, item, tracked):
872  vitems = []
873  if not item == None:
874  newlabel = item.nameInProcessDesc_(label)
875  vitems = [newlabel]
876  item.insertInto(parameterSet, newlabel)
877  parameterSet.addVString(tracked, label, vitems)
def _insertOneInto(self, parameterSet, label, item, tracked)
Definition: Config.py:871
def Config.Process._insertPaths (   self,
  processPSet,
  nodeVisitor 
)
private

Definition at line 900 of file Config.py.

References Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.endpaths_, edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, and edm::EventProcessor.schedule_.

900  def _insertPaths(self, processPSet, nodeVisitor):
901  scheduledPaths = []
902  triggerPaths = []
903  endpaths = []
904  if self.schedule_() == None:
905  # make one from triggerpaths & endpaths
906  for name in self.paths_():
907  scheduledPaths.append(name)
908  triggerPaths.append(name)
909  for name in self.endpaths_():
910  scheduledPaths.append(name)
911  endpaths.append(name)
912  else:
913  for path in self.schedule_():
914  pathname = path.label_()
915  scheduledPaths.append(pathname)
916  if pathname in self.endpaths_():
917  endpaths.append(pathname)
918  else:
919  triggerPaths.append(pathname)
920  for task in self.schedule_()._tasks:
921  task.resolve(self.__dict__)
922  scheduleTaskValidator = ScheduleTaskValidator()
923  task.visit(scheduleTaskValidator)
924  task.visit(nodeVisitor)
925  processPSet.addVString(True, "@end_paths", endpaths)
926  processPSet.addVString(True, "@paths", scheduledPaths)
927  # trigger_paths are a little different
928  p = processPSet.newPSet()
929  p.addVString(True, "@trigger_paths", triggerPaths)
930  processPSet.addPSet(True, "@trigger_paths", p)
931  # add all these paths
932  pathValidator = PathValidator()
933  endpathValidator = EndPathValidator()
934  decoratedList = []
935  lister = DecoratedNodeNameVisitor(decoratedList)
936  pathCompositeVisitor = CompositeVisitor(pathValidator, nodeVisitor, lister)
937  endpathCompositeVisitor = CompositeVisitor(endpathValidator, nodeVisitor, lister)
938  for triggername in triggerPaths:
939  iPath = self.paths_()[triggername]
940  iPath.resolve(self.__dict__)
941  pathValidator.setLabel(triggername)
942  lister.initialize()
943  iPath.visit(pathCompositeVisitor)
944  iPath.insertInto(processPSet, triggername, decoratedList)
945  for endpathname in endpaths:
946  iEndPath = self.endpaths_()[endpathname]
947  iEndPath.resolve(self.__dict__)
948  endpathValidator.setLabel(endpathname)
949  lister.initialize()
950  iEndPath.visit(endpathCompositeVisitor)
951  iEndPath.insertInto(processPSet, endpathname, decoratedList)
952  processPSet.addVString(False, "@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
953 
def _insertPaths(self, processPSet, nodeVisitor)
Definition: Config.py:900
def schedule_(self)
Definition: Config.py:226
def endpaths_(self)
Definition: Config.py:214
def paths_(self)
Definition: Config.py:210
def Config.Process._insertSubProcessesInto (   self,
  parameterSet,
  label,
  itemList,
  tracked 
)
private

Definition at line 887 of file Config.py.

887  def _insertSubProcessesInto(self, parameterSet, label, itemList, tracked):
888  l = []
889  subprocs = []
890  for value in itemList:
891  name = value.getProcessName()
892  newLabel = value.nameInProcessDesc_(name)
893  l.append(newLabel)
894  pset = value.getSubProcessPSet(parameterSet)
895  subprocs.append(pset)
896  # alphabetical order is easier to compare with old language
897  l.sort()
898  parameterSet.addVString(tracked, label, l)
899  parameterSet.addVPSet(False,"subProcesses",subprocs)
def _insertSubProcessesInto(self, parameterSet, label, itemList, tracked)
Definition: Config.py:887
def Config.Process._itemsInDependencyOrder (   self,
  processDictionaryOfItems 
)
private

Definition at line 756 of file Config.py.

References cmsPerfStripChart.dict.

Referenced by Config.Process.dumpPython().

756  def _itemsInDependencyOrder(self, processDictionaryOfItems):
757  # The items can be Sequences or Tasks and the input
758  # argument should either be the dictionary of sequences
759  # or the dictionary of tasks from the process.
760 
761  returnValue=DictTypes.SortedKeysDict()
762 
763  # For each item, see what other items it depends upon
764  # For our purpose here, an item depends on the items it contains.
765  dependencies = {}
766  for label,item in processDictionaryOfItems.iteritems():
767  containedItems = []
768  if isinstance(item, Task):
769  v = TaskVisitor(containedItems)
770  else:
771  v = SequenceVisitor(containedItems)
772  try:
773  item.visit(v)
774  except RuntimeError:
775  if isinstance(item, Task):
776  raise RuntimeError("Failed in a Task visitor. Probably " \
777  "a circular dependency discovered in Task with label " + label)
778  else:
779  raise RuntimeError("Failed in a Sequence visitor. Probably a " \
780  "circular dependency discovered in Sequence with label " + label)
781  for containedItem in containedItems:
782  # Check for items that both have labels and are not in the process.
783  # This should not normally occur unless someone explicitly assigns a
784  # label without putting the item in the process (which should not ever
785  # be done). We check here because this problem could cause the code
786  # in the 'while' loop below to go into an infinite loop.
787  if containedItem.hasLabel_():
788  testItem = processDictionaryOfItems.get(containedItem.label_())
789  if testItem is None or containedItem != testItem:
790  if isinstance(item, Task):
791  raise RuntimeError("Task has a label, but using its label to get an attribute" \
792  " from the process yields a different object or None\n"+
793  "label = " + containedItem.label_())
794  else:
795  raise RuntimeError("Sequence has a label, but using its label to get an attribute" \
796  " from the process yields a different object or None\n"+
797  "label = " + containedItem.label_())
798  dependencies[label]=[dep.label_() for dep in containedItems if dep.hasLabel_()]
799 
800  # keep looping until we get rid of all dependencies
801  while dependencies:
802  oldDeps = dict(dependencies)
803  for label,deps in oldDeps.iteritems():
804  if len(deps)==0:
805  returnValue[label]=processDictionaryOfItems[label]
806  #remove this as a dependency for all other tasks
807  del dependencies[label]
808  for lb2,deps2 in dependencies.iteritems():
809  while deps2.count(label):
810  deps2.remove(label)
811  return returnValue
def _itemsInDependencyOrder(self, processDictionaryOfItems)
Definition: Config.py:756
def Config.Process._okToPlace (   self,
  name,
  mod,
  d 
)
private

Definition at line 488 of file Config.py.

References Config.Process.__isStrict.

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

488  def _okToPlace(self, name, mod, d):
489  if not self.__InExtendCall:
490  # if going
491  return True
492  elif not self.__isStrict:
493  return True
494  elif name in d:
495  # if there's an old copy, and the new one
496  # hasn't been modified, we're done. Still
497  # not quite safe if something has been defined twice.
498  # Need to add checks
499  if mod._isModified:
500  if d[name]._isModified:
501  return False
502  else:
503  return True
504  else:
505  return True
506  else:
507  return True
508 
def _okToPlace(self, name, mod, d)
Definition: Config.py:488
def Config.Process._place (   self,
  name,
  mod,
  d 
)
private

Definition at line 509 of file Config.py.

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

Referenced by Config.Process._placeAlias(), 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._placeTask(), Config.Process._placeVPSet(), and Config.Process.setPartialSchedule_().

509  def _place(self, name, mod, d):
510  if self._okToPlace(name, mod, d):
511  if self.__isStrict and isinstance(mod, _ModuleSequenceType):
512  d[name] = mod._postProcessFixup(self._cloneToObjectDict)
513  else:
514  d[name] = mod
515  if isinstance(mod,_Labelable):
516  self.__setObjectLabel(mod, name)
def _okToPlace(self, name, mod, d)
Definition: Config.py:488
def __setObjectLabel(self, object, newLabel)
Definition: Config.py:282
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeAlias (   self,
  name,
  mod 
)
private

Definition at line 551 of file Config.py.

References Config.Process._place().

551  def _placeAlias(self,name,mod):
552  self._place(name, mod, self.__aliases)
def _placeAlias(self, name, mod)
Definition: Config.py:551
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeAnalyzer (   self,
  name,
  mod 
)
private

Definition at line 523 of file Config.py.

References Config.Process._place().

523  def _placeAnalyzer(self,name,mod):
524  self._place(name, mod, self.__analyzers)
def _placeAnalyzer(self, name, mod)
Definition: Config.py:523
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeEndPath (   self,
  name,
  mod 
)
private

Definition at line 532 of file Config.py.

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

532  def _placeEndPath(self,name,mod):
533  self._validateSequence(mod, name)
534  try:
535  self._place(name, mod, self.__endpaths)
536  except ModuleCloneError as msg:
537  context = format_outerframe(4)
538  raise Exception("%sThe module %s in endpath %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence(self, sequence, label)
Definition: Config.py:740
def _placeEndPath(self, name, mod)
Definition: Config.py:532
def format_outerframe(number)
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 544 of file Config.py.

References Config.Process._place().

544  def _placeESPrefer(self,name,mod):
545  self._place(name, mod, self.__esprefers)
def _placeESPrefer(self, name, mod)
Definition: Config.py:544
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeESProducer (   self,
  name,
  mod 
)
private

Definition at line 542 of file Config.py.

References Config.Process._place().

542  def _placeESProducer(self,name,mod):
543  self._place(name, mod, self.__esproducers)
def _placeESProducer(self, name, mod)
Definition: Config.py:542
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeESSource (   self,
  name,
  mod 
)
private

Definition at line 546 of file Config.py.

References Config.Process._place().

546  def _placeESSource(self,name,mod):
547  self._place(name, mod, self.__essources)
def _placeESSource(self, name, mod)
Definition: Config.py:546
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeFilter (   self,
  name,
  mod 
)
private

Definition at line 521 of file Config.py.

References Config.Process._place().

521  def _placeFilter(self,name,mod):
522  self._place(name, mod, self.__filters)
def _placeFilter(self, name, mod)
Definition: Config.py:521
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeLooper (   self,
  name,
  mod 
)
private

Definition at line 565 of file Config.py.

Referenced by Config.Process.setLooper_().

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

Definition at line 517 of file Config.py.

References Config.Process._place().

517  def _placeOutputModule(self,name,mod):
518  self._place(name, mod, self.__outputmodules)
def _placeOutputModule(self, name, mod)
Definition: Config.py:517
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placePath (   self,
  name,
  mod 
)
private

Definition at line 525 of file Config.py.

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

525  def _placePath(self,name,mod):
526  self._validateSequence(mod, name)
527  try:
528  self._place(name, mod, self.__paths)
529  except ModuleCloneError as msg:
530  context = format_outerframe(4)
531  raise Exception("%sThe module %s in path %s is unknown to the process %s." %(context, msg, name, self._Process__name))
def _validateSequence(self, sequence, label)
Definition: Config.py:740
def _placePath(self, name, mod)
Definition: Config.py:525
def format_outerframe(number)
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 519 of file Config.py.

References Config.Process._place().

519  def _placeProducer(self,name,mod):
520  self._place(name, mod, self.__producers)
def _placeProducer(self, name, mod)
Definition: Config.py:519
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placePSet (   self,
  name,
  mod 
)
private

Definition at line 553 of file Config.py.

References Config.Process._place().

553  def _placePSet(self,name,mod):
554  self._place(name, mod, self.__psets)
def _placePSet(self, name, mod)
Definition: Config.py:553
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeSequence (   self,
  name,
  mod 
)
private

Definition at line 539 of file Config.py.

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

539  def _placeSequence(self,name,mod):
540  self._validateSequence(mod, name)
541  self._place(name, mod, self.__sequences)
def _placeSequence(self, name, mod)
Definition: Config.py:539
def _validateSequence(self, sequence, label)
Definition: Config.py:740
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 575 of file Config.py.

References Config.Process._place().

575  def _placeService(self,typeName,mod):
576  self._place(typeName, mod, self.__services)
577  if typeName in self.__dict__:
578  self.__dict__[typeName]._inProcess = False
579  self.__dict__[typeName]=mod
def _placeService(self, typeName, mod)
Definition: Config.py:575
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeSource (   self,
  name,
  mod 
)
private
Allow the source to be referenced by 'source' or by type name

Definition at line 557 of file Config.py.

Referenced by Config.Process.setSource_().

557  def _placeSource(self,name,mod):
558  """Allow the source to be referenced by 'source' or by type name"""
559  if name != 'source':
560  raise ValueError("The label '"+name+"' can not be used for a Source. Only 'source' is allowed.")
561  if self.__dict__['_Process__source'] is not None :
562  del self.__dict__[self.__dict__['_Process__source'].type_()]
563  self.__dict__['_Process__source'] = mod
564  self.__dict__[mod.type_()] = mod
def _placeSource(self, name, mod)
Definition: Config.py:557
def Config.Process._placeSubProcess (   self,
  name,
  mod 
)
private

Definition at line 570 of file Config.py.

570  def _placeSubProcess(self,name,mod):
571  self.__dict__['_Process__subProcess'] = mod
572  self.__dict__[mod.type_()] = mod
def _placeSubProcess(self, name, mod)
Definition: Config.py:570
def Config.Process._placeTask (   self,
  name,
  task 
)
private

Definition at line 548 of file Config.py.

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

548  def _placeTask(self,name,task):
549  self._validateTask(task, name)
550  self._place(name, task, self.__tasks)
def _validateTask(self, task, label)
Definition: Config.py:748
def _placeTask(self, name, task)
Definition: Config.py:548
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 555 of file Config.py.

References Config.Process._place().

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

Definition at line 1015 of file Config.py.

Referenced by Config.Process.prune().

1015  def _pruneModules(self, d, scheduledNames):
1016  moduleNames = set(d.keys())
1017  junk = moduleNames - scheduledNames
1018  for name in junk:
1019  delattr(self, name)
1020  return junk
1021 
def _pruneModules(self, d, scheduledNames)
Definition: Config.py:1015
def Config.Process._replaceInSchedule (   self,
  label,
  new 
)
private

Definition at line 857 of file Config.py.

References EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, and edm::EventProcessor.schedule_.

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

857  def _replaceInSchedule(self, label, new):
858  if self.schedule_() == None:
859  return
860  old = getattr(self,label)
861  for task in self.schedule_()._tasks:
862  task.replace(old, new)
def schedule_(self)
Definition: Config.py:226
def _replaceInSchedule(self, label, new)
Definition: Config.py:857
def Config.Process._replaceInSequences (   self,
  label,
  new 
)
private

Definition at line 844 of file Config.py.

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

844  def _replaceInSequences(self, label, new):
845  old = getattr(self,label)
846  #TODO - replace by iterator concatenation
847  for sequenceable in self.sequences.itervalues():
848  sequenceable.replace(old,new)
849  for sequenceable in self.paths.itervalues():
850  sequenceable.replace(old,new)
851  for sequenceable in self.endpaths.itervalues():
852  sequenceable.replace(old,new)
def _replaceInSequences(self, label, new)
Definition: Config.py:844
def Config.Process._replaceInTasks (   self,
  label,
  new 
)
private

Definition at line 853 of file Config.py.

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

853  def _replaceInTasks(self, label, new):
854  old = getattr(self,label)
855  for task in self.tasks.itervalues():
856  task.replace(old, new)
def _replaceInTasks(self, label, new)
Definition: Config.py:853
def Config.Process._validateSequence (   self,
  sequence,
  label 
)
private

Definition at line 740 of file Config.py.

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

740  def _validateSequence(self, sequence, label):
741  # See if every module has been inserted into the process
742  try:
743  l = set()
744  visitor = NodeNameVisitor(l)
745  sequence.visit(visitor)
746  except:
747  raise RuntimeError("An entry in sequence "+label + ' has no label')
def _validateSequence(self, sequence, label)
Definition: Config.py:740
def Config.Process._validateTask (   self,
  task,
  label 
)
private

Definition at line 748 of file Config.py.

Referenced by Config.Process._placeTask().

748  def _validateTask(self, task, label):
749  # See if every module and service has been inserted into the process
750  try:
751  l = set()
752  visitor = NodeNameVisitor(l)
753  task.visit(visitor)
754  except:
755  raise RuntimeError("An entry in task " + label + ' has not been attached to the process')
def _validateTask(self, task, label)
Definition: Config.py:748
def Config.Process.add_ (   self,
  value 
)
Allows addition of components that do not have to have a label, e.g. Services

Definition at line 473 of file Config.py.

References Config.Process.__isStrict.

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

473  def add_(self,value):
474  """Allows addition of components that do not have to have a label, e.g. Services"""
475  if not isinstance(value,_ConfigureComponent):
476  raise TypeError
477  if not isinstance(value,_Unlabelable):
478  raise TypeError
479  #clone the item
480  #clone the item
481  if self.__isStrict:
482  newValue =value.copy()
483  value.setIsFrozen()
484  else:
485  newValue =value
486  newValue._place('',self)
487 
def add_(self, value)
Definition: Config.py:473
def Config.Process.addSubProcess (   self,
  mod 
)

Definition at line 573 of file Config.py.

573  def addSubProcess(self,mod):
574  self.__subProcesses.append(mod)
def addSubProcess(self, mod)
Definition: Config.py:573
def Config.Process.aliases_ (   self)
returns a dict of the aliases that have been added to the Process

Definition at line 261 of file Config.py.

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

261  def aliases_(self):
262  """returns a dict of the aliases that have been added to the Process"""
263  return DictTypes.FixedKeysDict(self.__aliases)
def aliases_(self)
Definition: Config.py:261
def Config.Process.analyzerNames (   self)
Returns a string containing all the EDAnalyzer labels separated by a blank

Definition at line 144 of file Config.py.

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

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

Definition at line 202 of file Config.py.

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

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

Definition at line 659 of file Config.py.

References dataset.Dataset.__name, genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name, Config.Process._dumpConfigESPrefers(), Config.Process._dumpConfigNamedList(), Config.Process._dumpConfigOptionallyNamedList(), Config.Process._dumpConfigUnnamedList(), Config.Process.aliases_(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.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_(), FilterSelection.filters_, FilterSelections.filters_, join(), Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.schedule, Config.Process.sequences_(), edm::ProcessDesc.services_, Config.Process.services_(), ecaldqm::DBWriterWorker.source_, SiStripFedCablingBuilderFromDb.source_, jsoncollector::DataPoint.source_, sistrip::SpyEventMatcher.source_, ProcessCallGraph.source_, Config.Process.source_(), edm::InputSource::EventSourceSentry.source_, edm::InputSource::LumiSourceSentry.source_, edm::InputSource::RunSourceSentry.source_, Config.Process.subProcesses_(), edm::SubProcess.subProcesses_, and edm::EventProcessor.subProcesses_.

Referenced by Types.SecSource.configValue().

659  def dumpConfig(self, options=PrintOptions()):
660  """return a string containing the equivalent process defined using the old configuration language"""
661  config = "process "+self.__name+" = {\n"
662  options.indent()
663  if self.source_():
664  config += options.indentation()+"source = "+self.source_().dumpConfig(options)
665  if self.looper_():
666  config += options.indentation()+"looper = "+self.looper_().dumpConfig(options)
667 
668  config+=self._dumpConfigNamedList(self.subProcesses_(),
669  'subProcess',
670  options)
671  config+=self._dumpConfigNamedList(self.producers_().iteritems(),
672  'module',
673  options)
674  config+=self._dumpConfigNamedList(self.filters_().iteritems(),
675  'module',
676  options)
677  config+=self._dumpConfigNamedList(self.analyzers_().iteritems(),
678  'module',
679  options)
680  config+=self._dumpConfigNamedList(self.outputModules_().iteritems(),
681  'module',
682  options)
683  config+=self._dumpConfigNamedList(self.sequences_().iteritems(),
684  'sequence',
685  options)
686  config+=self._dumpConfigNamedList(self.paths_().iteritems(),
687  'path',
688  options)
689  config+=self._dumpConfigNamedList(self.endpaths_().iteritems(),
690  'endpath',
691  options)
692  config+=self._dumpConfigUnnamedList(self.services_().iteritems(),
693  'service',
694  options)
695  config+=self._dumpConfigNamedList(self.aliases_().iteritems(),
696  'alias',
697  options)
698  config+=self._dumpConfigOptionallyNamedList(
699  self.es_producers_().iteritems(),
700  'es_module',
701  options)
702  config+=self._dumpConfigOptionallyNamedList(
703  self.es_sources_().iteritems(),
704  'es_source',
705  options)
706  config += self._dumpConfigESPrefers(options)
707  for name,item in self.psets.iteritems():
708  config +=options.indentation()+item.configTypeName()+' '+name+' = '+item.configValue(options)
709  for name,item in self.vpsets.iteritems():
710  config +=options.indentation()+'VPSet '+name+' = '+item.configValue(options)
711  if self.schedule:
712  pathNames = [p.label_() for p in self.schedule]
713  config +=options.indentation()+'schedule = {'+','.join(pathNames)+'}\n'
714 
715 # config+=self._dumpConfigNamedList(self.vpsets.iteritems(),
716 # 'VPSet',
717 # options)
718  config += "}\n"
719  options.unindent()
720  return config
def _dumpConfigOptionallyNamedList(self, items, typeName, options)
Definition: Config.py:652
def _dumpConfigUnnamedList(self, items, typeName, options)
Definition: Config.py:647
def subProcesses_(self)
Definition: Config.py:198
def es_producers_(self)
Definition: Config.py:249
def producers_(self)
Definition: Config.py:182
def es_sources_(self)
Definition: Config.py:253
def source_(self)
Definition: Config.py:186
def _dumpConfigESPrefers(self, options)
Definition: Config.py:721
def endpaths_(self)
Definition: Config.py:214
def sequences_(self)
Definition: Config.py:218
def looper_(self)
Definition: Config.py:192
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def filters_(self)
Definition: Config.py:171
def analyzers_(self)
Definition: Config.py:202
def _dumpConfigNamedList(self, items, typeName, options)
Definition: Config.py:642
def dumpConfig(self, options=PrintOptions())
Definition: Config.py:659
def paths_(self)
Definition: Config.py:210
def outputModules_(self)
Definition: Config.py:206
def services_(self)
Definition: Config.py:245
def aliases_(self)
Definition: Config.py:261
def Config.Process.dumpPython (   self,
  options = PrintOptions() 
)
return a string containing the equivalent process defined using python

Definition at line 817 of file Config.py.

References dataset.Dataset.__name, genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name, Config.Process._dumpPython(), Config.Process._dumpPythonList(), Config.Process._dumpPythonSubProcesses(), Config.Process._itemsInDependencyOrder(), Config.Process.aliases_(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths_(), FastTimerService::PlotsPerProcess.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_(), FilterSelection.filters_, FilterSelections.filters_, Config.Process.looper_(), edm::EventProcessor.looper_, Config.Process.outputModules_(), edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), FastTimerService::PlotsPerProcess.paths_, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Config.Process.psets, EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, edm::EventProcessor.schedule_, Config.Process.sequences, edm::ProcessDesc.services_, Config.Process.services_(), ecaldqm::DBWriterWorker.source_, SiStripFedCablingBuilderFromDb.source_, jsoncollector::DataPoint.source_, sistrip::SpyEventMatcher.source_, ProcessCallGraph.source_, Config.Process.source_(), edm::InputSource::EventSourceSentry.source_, edm::InputSource::LumiSourceSentry.source_, edm::InputSource::RunSourceSentry.source_, Config.Process.subProcesses_(), edm::SubProcess.subProcesses_, edm::EventProcessor.subProcesses_, Config.Process.tasks, and Config.Process.vpsets.

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

817  def dumpPython(self, options=PrintOptions()):
818  """return a string containing the equivalent process defined using python"""
819  result = "import FWCore.ParameterSet.Config as cms\n\n"
820  result += "process = cms.Process(\""+self.__name+"\")\n\n"
821  if self.source_():
822  result += "process.source = "+self.source_().dumpPython(options)
823  if self.looper_():
824  result += "process.looper = "+self.looper_().dumpPython()
825  result+=self._dumpPythonList(self.psets, options)
826  result+=self._dumpPythonList(self.vpsets, options)
827  result+=self._dumpPythonSubProcesses(self.subProcesses_(), options)
828  result+=self._dumpPythonList(self.producers_(), options)
829  result+=self._dumpPythonList(self.filters_() , options)
830  result+=self._dumpPythonList(self.analyzers_(), options)
831  result+=self._dumpPythonList(self.outputModules_(), options)
832  result+=self._dumpPythonList(self.services_(), options)
833  result+=self._dumpPythonList(self.es_producers_(), options)
834  result+=self._dumpPythonList(self.es_sources_(), options)
835  result+=self._dumpPython(self.es_prefers_(), options)
836  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.tasks), options)
837  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.sequences), options)
838  result+=self._dumpPythonList(self.paths_(), options)
839  result+=self._dumpPythonList(self.endpaths_(), options)
840  result+=self._dumpPythonList(self.aliases_(), options)
841  if not self.schedule_() == None:
842  result += 'process.schedule = ' + self.schedule.dumpPython(options)
843  return result
def subProcesses_(self)
Definition: Config.py:198
def es_producers_(self)
Definition: Config.py:249
def producers_(self)
Definition: Config.py:182
def es_sources_(self)
Definition: Config.py:253
def _itemsInDependencyOrder(self, processDictionaryOfItems)
Definition: Config.py:756
def source_(self)
Definition: Config.py:186
def schedule_(self)
Definition: Config.py:226
def endpaths_(self)
Definition: Config.py:214
def _dumpPythonSubProcesses(self, l, options)
Definition: Config.py:726
def looper_(self)
Definition: Config.py:192
def es_prefers_(self)
Definition: Config.py:257
def filters_(self)
Definition: Config.py:171
def dumpPython(self, options=PrintOptions())
Definition: Config.py:817
def analyzers_(self)
Definition: Config.py:202
def _dumpPythonList(self, d, options)
Definition: Config.py:731
def paths_(self)
Definition: Config.py:210
def outputModules_(self)
Definition: Config.py:206
def services_(self)
Definition: Config.py:245
def _dumpPython(self, d, options)
Definition: Config.py:812
def aliases_(self)
Definition: Config.py:261
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths that have been added to the Process

Definition at line 214 of file Config.py.

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

214  def endpaths_(self):
215  """returns a dict of the endpaths that have been added to the Process"""
216  return DictTypes.SortedAndFixedKeysDict(self.__endpaths)
def endpaths_(self)
Definition: Config.py:214
def Config.Process.es_prefers_ (   self)
returns a dict of the es_prefers that have been added to the Process

Definition at line 257 of file Config.py.

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

257  def es_prefers_(self):
258  """returns a dict of the es_prefers that have been added to the Process"""
259  return DictTypes.FixedKeysDict(self.__esprefers)
def es_prefers_(self)
Definition: Config.py:257
def Config.Process.es_producers_ (   self)
returns a dict of the esproducers that have been added to the Process

Definition at line 249 of file Config.py.

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

249  def es_producers_(self):
250  """returns a dict of the esproducers that have been added to the Process"""
251  return DictTypes.FixedKeysDict(self.__esproducers)
def es_producers_(self)
Definition: Config.py:249
def Config.Process.es_sources_ (   self)
returns a the es_sources that have been added to the Process

Definition at line 253 of file Config.py.

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

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

Definition at line 584 of file Config.py.

References psClasses.BuildTreeNode.__setattr__(), Config.Process.__setattr__(), Config.Process.__setObjectLabel(), Config.Process.add_(), cmsPerfStripChart.dict, dir, svgfig.SVG.extend(), Config.Process.extend(), and triggerObjects_cff.id.

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

584  def extend(self,other,items=()):
585  """Look in other and find types that we can use"""
586  # enable explicit check to avoid overwriting of existing objects
587  self.__dict__['_Process__InExtendCall'] = True
588 
589  seqs = dict()
590  tasksToAttach = dict()
591  mods = []
592  for name in dir(other):
593  #'from XX import *' ignores these, and so should we.
594  if name.startswith('_'):
595  continue
596  item = getattr(other,name)
597  if name == "source" or name == "looper":
598  # In these cases 'item' could be None if the specific object was not defined
599  if item is not None:
600  self.__setattr__(name,item)
601  elif isinstance(item,_ModuleSequenceType):
602  seqs[name]=item
603  elif isinstance(item,Task):
604  tasksToAttach[name] = item
605  elif isinstance(item,_Labelable):
606  self.__setattr__(name,item)
607  if not item.hasLabel_() :
608  item.setLabel(name)
609  elif isinstance(item,Schedule):
610  self.__setattr__(name,item)
611  elif isinstance(item,_Unlabelable):
612  self.add_(item)
613  elif isinstance(item,ProcessModifier):
614  mods.append(item)
615  elif isinstance(item,ProcessFragment):
616  self.extend(item)
617 
618  #now create a sequence that uses the newly made items
619  for name in seqs.iterkeys():
620  seq = seqs[name]
621  #newSeq = seq.copy()
622  #
623  if id(seq) not in self._cloneToObjectDict:
624  self.__setattr__(name,seq)
625  else:
626  newSeq = self._cloneToObjectDict[id(seq)]
627  self.__dict__[name]=newSeq
628  self.__setObjectLabel(newSeq, name)
629  #now put in proper bucket
630  newSeq._place(name,self)
631 
632  for name in tasksToAttach.iterkeys():
633  task = tasksToAttach[name]
634  self.__setattr__(name, task)
635 
636  #apply modifiers now that all names have been added
637  for item in mods:
638  item.apply(self)
639 
640  self.__dict__['_Process__InExtendCall'] = False
641 
def extend(self, other, items=())
Definition: Config.py:584
def __setattr__(self, name, value)
Definition: Config.py:309
def __setObjectLabel(self, object, newLabel)
Definition: Config.py:282
def add_(self, value)
Definition: Config.py:473
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 1022 of file Config.py.

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

1022  def fillProcessDesc(self, processPSet):
1023  """Used by the framework to convert python to C++ objects"""
1024  class ServiceInjectorAdaptor(object):
1025  def __init__(self,ppset,thelist):
1026  self.__thelist = thelist
1027  self.__processPSet = ppset
1028  def addService(self,pset):
1029  self.__thelist.append(pset)
1030  def newPSet(self):
1031  return self.__processPSet.newPSet()
1032  #This adaptor is used to 'add' the method 'getTopPSet_'
1033  # to the ProcessDesc and PythonParameterSet C++ classes.
1034  # This method is needed for the PSet refToPSet_ functionality.
1035  class TopLevelPSetAcessorAdaptor(object):
1036  def __init__(self,ppset,process):
1037  self.__ppset = ppset
1038  self.__process = process
1039  def __getattr__(self,attr):
1040  return getattr(self.__ppset,attr)
1041  def getTopPSet_(self,label):
1042  return getattr(self.__process,label)
1043  def newPSet(self):
1044  return TopLevelPSetAcessorAdaptor(self.__ppset.newPSet(),self.__process)
1045  def addPSet(self,tracked,name,ppset):
1046  return self.__ppset.addPSet(tracked,name,self.__extractPSet(ppset))
1047  def addVPSet(self,tracked,name,vpset):
1048  return self.__ppset.addVPSet(tracked,name,[self.__extractPSet(x) for x in vpset])
1049  def __extractPSet(self,pset):
1050  if isinstance(pset,TopLevelPSetAcessorAdaptor):
1051  return pset.__ppset
1052  return pset
1053 
1054  self.validate()
1055  processPSet.addString(True, "@process_name", self.name_())
1056  all_modules = self.producers_().copy()
1057  all_modules.update(self.filters_())
1058  all_modules.update(self.analyzers_())
1059  all_modules.update(self.outputModules_())
1060  adaptor = TopLevelPSetAcessorAdaptor(processPSet,self)
1061  self._insertInto(adaptor, self.psets_())
1062  self._insertInto(adaptor, self.vpsets_())
1063  self._insertOneInto(adaptor, "@all_sources", self.source_(), True)
1064  self._insertOneInto(adaptor, "@all_loopers", self.looper_(), True)
1065  self._insertSubProcessesInto(adaptor, "@all_subprocesses", self.subProcesses_(), False)
1066  self._insertManyInto(adaptor, "@all_esprefers", self.es_prefers_(), True)
1067  self._insertManyInto(adaptor, "@all_aliases", self.aliases_(), True)
1068  # This will visit all the paths and endpaths that are scheduled to run,
1069  # as well as the Tasks associated to them and the schedule. It remembers
1070  # the modules, ESSources, ESProducers, and services it visits.
1071  nodeVisitor = NodeVisitor()
1072  self._insertPaths(adaptor, nodeVisitor)
1073  all_modules_onTasksOrScheduled = { key:value for key, value in all_modules.iteritems() if value in nodeVisitor.modules }
1074  self._insertManyInto(adaptor, "@all_modules", all_modules_onTasksOrScheduled, True)
1075  # Same as nodeVisitor except this one visits all the Tasks attached
1076  # to the process.
1077  processNodeVisitor = NodeVisitor()
1078  for pTask in self.tasks.itervalues():
1079  pTask.visit(processNodeVisitor)
1080  esProducersToEnable = {}
1081  for esProducerName, esProducer in self.es_producers_().iteritems():
1082  if esProducer in nodeVisitor.esProducers or not (esProducer in processNodeVisitor.esProducers):
1083  esProducersToEnable[esProducerName] = esProducer
1084  self._insertManyInto(adaptor, "@all_esmodules", esProducersToEnable, True)
1085  esSourcesToEnable = {}
1086  for esSourceName, esSource in self.es_sources_().iteritems():
1087  if esSource in nodeVisitor.esSources or not (esSource in processNodeVisitor.esSources):
1088  esSourcesToEnable[esSourceName] = esSource
1089  self._insertManyInto(adaptor, "@all_essources", esSourcesToEnable, True)
1090  #handle services differently
1091  services = []
1092  for serviceName, serviceObject in self.services_().iteritems():
1093  if serviceObject in nodeVisitor.services or not (serviceObject in processNodeVisitor.services):
1094  serviceObject.insertInto(ServiceInjectorAdaptor(adaptor,services))
1095  adaptor.addVPSet(False,"services",services)
1096  return processPSet
1097 
def subProcesses_(self)
Definition: Config.py:198
def vpsets_(self)
Definition: Config.py:269
def copy(args, dbName)
def _insertPaths(self, processPSet, nodeVisitor)
Definition: Config.py:900
def es_producers_(self)
Definition: Config.py:249
def producers_(self)
Definition: Config.py:182
def _insertOneInto(self, parameterSet, label, item, tracked)
Definition: Config.py:871
def es_sources_(self)
Definition: Config.py:253
def __init__(self, name, Mods)
Definition: Config.py:100
def source_(self)
Definition: Config.py:186
def psets_(self)
Definition: Config.py:265
def _insertSubProcessesInto(self, parameterSet, label, itemList, tracked)
Definition: Config.py:887
def validate(self)
Definition: Config.py:1098
def looper_(self)
Definition: Config.py:192
def es_prefers_(self)
Definition: Config.py:257
def filters_(self)
Definition: Config.py:171
def analyzers_(self)
Definition: Config.py:202
def _insertManyInto(self, parameterSet, label, itemDict, tracked)
Definition: Config.py:878
def name_(self)
Definition: Config.py:175
def outputModules_(self)
Definition: Config.py:206
def _insertInto(self, parameterSet, itemDict)
Definition: Config.py:868
def services_(self)
Definition: Config.py:245
def fillProcessDesc(self, processPSet)
Definition: Config.py:1022
def aliases_(self)
Definition: Config.py:261
def Config.Process.filterNames (   self)
Returns a string containing all the EDFilter labels separated by a blank

Definition at line 147 of file Config.py.

References pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), FilterSelection.filters_, FilterSelections.filters_, join(), and relativeConstraints.keys.

147  def filterNames(self):
148  """Returns a string containing all the EDFilter labels separated by a blank"""
149  return ' '.join(self.filters_().keys())
def filterNames(self)
Definition: Config.py:147
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def filters_(self)
Definition: Config.py:171
def Config.Process.filters_ (   self)
returns a dict of the filters that have been added to the Process

Definition at line 171 of file Config.py.

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

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

Definition at line 863 of file Config.py.

863  def globalReplace(self,label,new):
864  """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths/tasks"""
865  if not hasattr(self,label):
866  raise LookupError("process has no item of label "+label)
867  setattr(self,label,new)
def globalReplace(self, label, new)
Definition: Config.py:863
def Config.Process.isUsingModifier (   self,
  mod 
)
returns True if the Modifier is in used by this Process

Definition at line 274 of file Config.py.

274  def isUsingModifier(self,mod):
275  """returns True if the Modifier is in used by this Process"""
276  if mod.isChosen():
277  for m in self.__modifiers:
278  if m._isOrContains(mod):
279  return True
280  return False
281 
def isUsingModifier(self, mod)
Definition: Config.py:274
def Config.Process.load (   self,
  moduleName 
)

Definition at line 580 of file Config.py.

References svgfig.SVG.extend(), and Config.Process.extend().

580  def load(self, moduleName):
581  moduleName = moduleName.replace("/",".")
582  module = __import__(moduleName)
583  self.extend(sys.modules[moduleName])
def load(self, moduleName)
Definition: Config.py:580
def extend(self, other, items=())
Definition: Config.py:584
def Config.Process.looper_ (   self)
returns the looper that 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().

192  def looper_(self):
193  """returns the looper that has been added to the Process or None if none have been added"""
194  return self.__looper
def looper_(self)
Definition: Config.py:192
def Config.Process.name_ (   self)

Definition at line 175 of file Config.py.

References dataset.Dataset.__name, and genericValidation.ValidationWithPlotsSummaryBase.SummaryItem.__name.

175  def name_(self):
176  return self.__name
def name_(self)
Definition: Config.py:175
def Config.Process.outputModules_ (   self)
returns a dict of the output modules that have been added to the Process

Definition at line 206 of file Config.py.

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

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

Definition at line 150 of file Config.py.

References join(), relativeConstraints.keys, edm::MainParameterSet.paths_, edm::HLTGlobalStatus.paths_, heppy::TriggerBitChecker.paths_, edm::PathsAndConsumesOfModules.paths_, ProcessCallGraph::ProcessType.paths_, pat::TriggerEvent.paths_, HLTPerformanceInfo.paths_, Config.Process.paths_(), and FastTimerService::PlotsPerProcess.paths_.

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

Definition at line 210 of file Config.py.

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

210  def paths_(self):
211  """returns a dict of the paths that have been added to the Process"""
212  return DictTypes.SortedAndFixedKeysDict(self.__paths)
def paths_(self)
Definition: Config.py:210
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 that 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 1105 of file Config.py.

1105  def prefer(self, esmodule,*args,**kargs):
1106  """Prefer this ES source or producer. The argument can
1107  either be an object label, e.g.,
1108  process.prefer(process.juicerProducer) (not supported yet)
1109  or a name of an ESSource or ESProducer
1110  process.prefer("juicer")
1111  or a type of unnamed ESSource or ESProducer
1112  process.prefer("JuicerProducer")
1113  In addition, you can pass as a labelled arguments the name of the Record you wish to
1114  prefer where the type passed is a cms.vstring and that vstring can contain the
1115  name of the C++ types in the Record that are being preferred, e.g.,
1116  #prefer all data in record 'OrangeRecord' from 'juicer'
1117  process.prefer("juicer", OrangeRecord=cms.vstring())
1118  or
1119  #prefer only "Orange" data in "OrangeRecord" from "juicer"
1120  process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
1121  or
1122  #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
1123  ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
1124  """
1125  # see if this refers to a named ESProducer
1126  if isinstance(esmodule, ESSource) or isinstance(esmodule, ESProducer):
1127  raise RuntimeError("Syntax of process.prefer(process.esmodule) not supported yet")
1128  elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs) or \
1129  self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
1130  pass
1131  else:
1132  raise RuntimeError("Cannot resolve prefer for "+repr(esmodule))
1133 
def es_producers_(self)
Definition: Config.py:249
def _findPreferred(self, esname, d, args, kargs)
Definition: Config.py:1134
def es_sources_(self)
Definition: Config.py:253
def prefer(self, esmodule, args, kargs)
Definition: Config.py:1105
def Config.Process.producerNames (   self)
Returns a string containing all the EDProducer labels separated by a blank

Definition at line 141 of file Config.py.

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

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

Definition at line 182 of file Config.py.

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

182  def producers_(self):
183  """returns a dict of the producers that have been added to the Process"""
184  return DictTypes.FixedKeysDict(self.__producers)
def producers_(self)
Definition: Config.py:182
def Config.Process.prune (   self,
  verbose = False,
  keepUnresolvedSequencePlaceholders = False 
)
Remove clutter from the process that 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 963 of file Config.py.

References Config.Process._pruneModules(), HLTMuonValidator.analyzers_, Config.Process.analyzers_(), Config.Process.endpaths, pat::eventhypothesis::AndFilter.filters_, pat::eventhypothesis::OrFilter.filters_, pat::TriggerEvent.filters_, FilterOR.filters_, Config.Process.filters_(), FilterSelection.filters_, FilterSelections.filters_, join(), list(), Config.Process.paths, pf2pat::EventHypothesis.producers_, Config.Process.producers_(), Json::Path.resolve(), Config.Process.resolve(), EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, edm::EventProcessor.schedule_, and Config.Process.vpsets_().

Referenced by dirstructure.Directory.prune().

963  def prune(self,verbose=False,keepUnresolvedSequencePlaceholders=False):
964  """ Remove clutter from the process that we think is unnecessary:
965  tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
966  not in the schedule will also be removed, along with an modules and sequences used only by
967  those removed Paths and EndPaths."""
968 # need to update this to only prune psets not on refToPSets
969 # but for now, remove the delattr
970 # for name in self.psets_():
971 # if getattr(self,name).isTracked():
972 # delattr(self, name)
973  for name in self.vpsets_():
974  delattr(self, name)
975  #first we need to resolve any SequencePlaceholders being used
976  self.resolve(keepUnresolvedSequencePlaceholders)
977  usedModules = set()
978  unneededPaths = set()
979  if self.schedule_():
980  usedModules=set(self.schedule_().moduleNames())
981  #get rid of unused paths
982  schedNames = set(( x.label_() for x in self.schedule_()))
983  names = set(self.paths)
984  names.update(set(self.endpaths))
985  unneededPaths = names - schedNames
986  for n in unneededPaths:
987  delattr(self,n)
988  else:
989  pths = list(self.paths.itervalues())
990  pths.extend(self.endpaths.itervalues())
991  temp = Schedule(*pths)
992  usedModules=set(temp.moduleNames())
993  unneededModules = self._pruneModules(self.producers_(), usedModules)
994  unneededModules.update(self._pruneModules(self.filters_(), usedModules))
995  unneededModules.update(self._pruneModules(self.analyzers_(), usedModules))
996  #remove sequences that do not appear in remaining paths and endpaths
997  seqs = list()
998  sv = SequenceVisitor(seqs)
999  for p in self.paths.itervalues():
1000  p.visit(sv)
1001  for p in self.endpaths.itervalues():
1002  p.visit(sv)
1003  keepSeqSet = set(( s for s in seqs if s.hasLabel_()))
1004  availableSeqs = set(self.sequences.itervalues())
1005  unneededSeqs = availableSeqs-keepSeqSet
1006  unneededSeqLabels = []
1007  for s in unneededSeqs:
1008  unneededSeqLabels.append(s.label_())
1009  delattr(self,s.label_())
1010  if verbose:
1011  print "prune removed the following:"
1012  print " modules:"+",".join(unneededModules)
1013  print " sequences:"+",".join(unneededSeqLabels)
1014  print " paths/endpaths:"+",".join(unneededPaths)
def _pruneModules(self, d, scheduledNames)
Definition: Config.py:1015
def vpsets_(self)
Definition: Config.py:269
def producers_(self)
Definition: Config.py:182
def schedule_(self)
Definition: Config.py:226
def resolve(self, keepUnresolvedSequencePlaceholders=False)
Definition: Config.py:954
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def filters_(self)
Definition: Config.py:171
def analyzers_(self)
Definition: Config.py:202
def prune(self, verbose=False, keepUnresolvedSequencePlaceholders=False)
Definition: Config.py:963
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
def Config.Process.psets_ (   self)
returns a dict of the PSets that have been added to the Process

Definition at line 265 of file Config.py.

265  def psets_(self):
266  """returns a dict of the PSets that have been added to the Process"""
267  return DictTypes.FixedKeysDict(self.__psets)
def psets_(self)
Definition: Config.py:265
def Config.Process.resolve (   self,
  keepUnresolvedSequencePlaceholders = False 
)

Definition at line 954 of file Config.py.

References EcalDQMonitorTask.schedule_, edm::ModuleChanger.schedule_, edm::ScheduleInfo.schedule_, edm::PathsAndConsumesOfModules.schedule_, Config.Process.schedule_(), edm::SubProcess.schedule_, and edm::EventProcessor.schedule_.

Referenced by Config.Process.prune().

954  def resolve(self,keepUnresolvedSequencePlaceholders=False):
955  for x in self.paths.itervalues():
956  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
957  for x in self.endpaths.itervalues():
958  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
959  if not self.schedule_() == None:
960  for task in self.schedule_()._tasks:
961  task.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
962 
def schedule_(self)
Definition: Config.py:226
def resolve(self, keepUnresolvedSequencePlaceholders=False)
Definition: Config.py:954
def Config.Process.schedule_ (   self)
returns the schedule that has been added to the Process or None if none have been added

Definition at line 226 of file Config.py.

Referenced by Config.Process._insertPaths(), Config.Process._replaceInSchedule(), Config.Process.dumpPython(), Config.Process.prune(), and Config.Process.resolve().

226  def schedule_(self):
227  """returns the schedule that has been added to the Process or None if none have been added"""
228  return self.__schedule
def schedule_(self)
Definition: Config.py:226
def Config.Process.sequences_ (   self)
returns a dict of the sequences that have been added to the Process

Definition at line 218 of file Config.py.

Referenced by Config.Process.dumpConfig().

218  def sequences_(self):
219  """returns a dict of the sequences that have been added to the Process"""
220  return DictTypes.FixedKeysDict(self.__sequences)
def sequences_(self)
Definition: Config.py:218
def Config.Process.services_ (   self)
returns a dict of the services that have been added to the Process

Definition at line 245 of file Config.py.

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

245  def services_(self):
246  """returns a dict of the services that have been added to the Process"""
247  return DictTypes.FixedKeysDict(self.__services)
def services_(self)
Definition: Config.py:245
def Config.Process.setLooper_ (   self,
  lpr 
)

Definition at line 195 of file Config.py.

References Config.Process._placeLooper().

195  def setLooper_(self,lpr):
196  self._placeLooper('looper',lpr)
def setLooper_(self, lpr)
Definition: Config.py:195
def _placeLooper(self, name, mod)
Definition: Config.py:565
def Config.Process.setName_ (   self,
  name 
)

Definition at line 177 of file Config.py.

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

Definition at line 229 of file Config.py.

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

229  def setPartialSchedule_(self,sch,label):
230  if label == "schedule":
231  self.setSchedule_(sch)
232  else:
233  self._place(label, sch, self.__partialschedules)
def setPartialSchedule_(self, sch, label)
Definition: Config.py:229
def setSchedule_(self, sch)
Definition: Config.py:234
def _place(self, name, mod, d)
Definition: Config.py:509
def Config.Process.setSchedule_ (   self,
  sch 
)

Definition at line 234 of file Config.py.

References harvestTrackValidationPlots.str.

Referenced by Config.Process.setPartialSchedule_().

234  def setSchedule_(self,sch):
235  # See if every path and endpath has been inserted into the process
236  index = 0
237  try:
238  for p in sch:
239  p.label_()
240  index +=1
241  except:
242  raise RuntimeError("The path at index "+str(index)+" in the Schedule was not attached to the process.")
243  self.__dict__['_Process__schedule'] = sch
def setSchedule_(self, sch)
Definition: Config.py:234
def Config.Process.setSource_ (   self,
  src 
)

Definition at line 189 of file Config.py.

References Config.Process._placeSource().

189  def setSource_(self,src):
190  self._placeSource('source',src)
def setSource_(self, src)
Definition: Config.py:189
def _placeSource(self, name, mod)
Definition: Config.py:557
def Config.Process.setStrict (   self,
  value 
)

Definition at line 136 of file Config.py.

References Config.Process.__isStrict.

136  def setStrict(self, value):
137  self.__isStrict = value
138  _Module.__isStrict__ = True
139 
def setStrict(self, value)
Definition: Config.py:136
def Config.Process.source_ (   self)
returns the source that 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().

186  def source_(self):
187  """returns the source that has been added to the Process or None if none have been added"""
188  return self.__source
def source_(self)
Definition: Config.py:186
def Config.Process.subProcesses_ (   self)
returns a list of the subProcesses that have been added to the Process

Definition at line 198 of file Config.py.

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

198  def subProcesses_(self):
199  """returns a list of the subProcesses that have been added to the Process"""
200  return self.__subProcesses
def subProcesses_(self)
Definition: Config.py:198
def Config.Process.tasks_ (   self)
returns a dict of the tasks that have been added to the Process

Definition at line 222 of file Config.py.

222  def tasks_(self):
223  """returns a dict of the tasks that have been added to the Process"""
224  return DictTypes.FixedKeysDict(self.__tasks)
def tasks_(self)
Definition: Config.py:222
def Config.Process.validate (   self)

Definition at line 1098 of file Config.py.

1098  def validate(self):
1099  # check if there's some input
1100  # Breaks too many unit tests for now
1101  #if self.source_() == None and self.looper_() == None:
1102  # raise RuntimeError("No input source was found for this process")
1103  pass
1104 
def validate(self)
Definition: Config.py:1098
def Config.Process.vpsets_ (   self)
returns a dict of the VPSets that have been added to the Process

Definition at line 269 of file Config.py.

Referenced by Config.Process.prune().

269  def vpsets_(self):
270  """returns a dict of the VPSets that have been added to the Process"""
271  return DictTypes.FixedKeysDict(self.__vpsets)
def vpsets_(self)
Definition: Config.py:269

Member Data Documentation

Config.Process.__isStrict
private
Config.Process.__ppset
private

Definition at line 1037 of file Config.py.

Config.Process.__process
private
Config.Process.__processPSet
private

Definition at line 1027 of file Config.py.

Config.Process.__thelist
private

Definition at line 1026 of file Config.py.

Property Documentation

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

Definition at line 264 of file Config.py.

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

Definition at line 205 of file Config.py.

Referenced by looper.Looper.loop(), and looper.Looper.write().

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

Definition at line 217 of file Config.py.

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

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

Definition at line 260 of file Config.py.

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

Definition at line 252 of file Config.py.

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

Definition at line 256 of file Config.py.

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

Definition at line 174 of file Config.py.

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

Definition at line 197 of file Config.py.

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

Definition at line 209 of file Config.py.

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

Definition at line 213 of file Config.py.

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

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

Definition at line 185 of file Config.py.

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

Definition at line 268 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 244 of file Config.py.

Referenced by Config.Process.dumpConfig(), and ConfigBuilder.ConfigBuilder.prepare().

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

Definition at line 221 of file Config.py.

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

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

Definition at line 248 of file Config.py.

Referenced by config.Config.__str__().

Config.Process.source = property(source_,setSource_,doc='the main source or None if not set')
static
Config.Process.subProcesses = property(subProcesses_,doc='the SubProcesses that have been added to the Process')
static

Definition at line 201 of file Config.py.

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

Definition at line 225 of file Config.py.

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

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

Definition at line 272 of file Config.py.

Referenced by Config.Process.dumpPython().