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 100 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 102 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

102  def __init__(self,name,*Mods):
103  """The argument 'name' will be the name applied to this Process
104  Can optionally pass as additional arguments cms.Modifier instances
105  that will be used to modify the Process as it is built
106  """
107  self.__dict__['_Process__name'] = name
108  if not name.isalnum():
109  raise RuntimeError("Error: The process name is an empty string or contains non-alphanumeric characters")
110  self.__dict__['_Process__filters'] = {}
111  self.__dict__['_Process__producers'] = {}
112  self.__dict__['_Process__source'] = None
113  self.__dict__['_Process__looper'] = None
114  self.__dict__['_Process__subProcesses'] = []
115  self.__dict__['_Process__schedule'] = None
116  self.__dict__['_Process__analyzers'] = {}
117  self.__dict__['_Process__outputmodules'] = {}
118  self.__dict__['_Process__paths'] = DictTypes.SortedKeysDict() # have to keep the order
119  self.__dict__['_Process__endpaths'] = DictTypes.SortedKeysDict() # of definition
120  self.__dict__['_Process__sequences'] = {}
121  self.__dict__['_Process__tasks'] = {}
122  self.__dict__['_Process__services'] = {}
123  self.__dict__['_Process__essources'] = {}
124  self.__dict__['_Process__esproducers'] = {}
125  self.__dict__['_Process__esprefers'] = {}
126  self.__dict__['_Process__aliases'] = {}
127  self.__dict__['_Process__psets']={}
128  self.__dict__['_Process__vpsets']={}
129  self.__dict__['_cloneToObjectDict'] = {}
130  # policy switch to avoid object overwriting during extend/load
131  self.__dict__['_Process__InExtendCall'] = False
132  self.__dict__['_Process__partialschedules'] = {}
133  self.__isStrict = False
134  self.__dict__['_Process__modifiers'] = Mods
135  for m in self.__modifiers:
136  m._setChosen()
137 
def __init__(self, name, Mods)
Definition: Config.py:102

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 441 of file Config.py.

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

441  def __delattr__(self,name):
442  self._delHelper(name)
443  obj = getattr(self,name)
444  if not obj is None:
445  if not isinstance(obj, Sequence) and not isinstance(obj, Task):
446  # For modules, ES modules and services we can also remove
447  # the deleted object from Sequences, Paths, EndPaths, and
448  # Tasks. Note that for Sequences and Tasks that cannot be done
449  # reliably as the places where the Sequence or Task was used
450  # might have been expanded so we do not even try. We considered
451  # raising an exception if a Sequences or Task was explicitly
452  # deleted, but did not because when done carefully deletion
453  # is sometimes OK (for example in the prune function where it
454  # has been checked that the deleted Sequence is not used).
455  if obj._isTaskComponent():
456  self._replaceInTasks(name, None)
457  self._replaceInSchedule(name, None)
458  if isinstance(obj, _Sequenceable) or obj._isTaskComponent():
459  self._replaceInSequences(name, None)
460  # now remove it from the process itself
461  try:
462  del self.__dict__[name]
463  except:
464  pass
465 
def __delattr__(self, name)
Definition: Config.py:441
def _replaceInTasks(self, label, new)
Definition: Config.py:855
def _delHelper(self, name)
Definition: Config.py:424
def _replaceInSequences(self, label, new)
Definition: Config.py:846
def _replaceInSchedule(self, label, new)
Definition: Config.py:859
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 411 of file Config.py.

References list().

Referenced by Config.Process.__setattr__().

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

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

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

Definition at line 284 of file Config.py.

References triggerObjects_cff.id, and str.

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

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

References triggerObjects_cff.id.

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

Definition at line 466 of file Config.py.

References Config.Process._delHelper().

Referenced by Config.Process.__setattr__().

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

Definition at line 424 of file Config.py.

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

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

Definition at line 723 of file Config.py.

References Config.Process.es_prefers_().

Referenced by Config.Process.dumpConfig().

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

Definition at line 644 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 654 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 649 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 814 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 733 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 728 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 1136 of file Config.py.

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

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

Definition at line 870 of file Config.py.

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

Definition at line 880 of file Config.py.

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

Definition at line 873 of file Config.py.

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

Definition at line 902 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::test::TestProcessor.schedule_, edm::SubProcess.schedule_, and edm::EventProcessor.schedule_.

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

Definition at line 889 of file Config.py.

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

Definition at line 758 of file Config.py.

References cmsPerfStripChart.dict.

Referenced by Config.Process.dumpPython().

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

Definition at line 490 of file Config.py.

References Config.Process.__isStrict.

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

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

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

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

Definition at line 553 of file Config.py.

References Config.Process._place().

553  def _placeAlias(self,name,mod):
554  self._place(name, mod, self.__aliases)
def _placeAlias(self, name, mod)
Definition: Config.py:553
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeAnalyzer (   self,
  name,
  mod 
)
private

Definition at line 525 of file Config.py.

References Config.Process._place().

525  def _placeAnalyzer(self,name,mod):
526  self._place(name, mod, self.__analyzers)
def _placeAnalyzer(self, name, mod)
Definition: Config.py:525
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeEndPath (   self,
  name,
  mod 
)
private

Definition at line 534 of file Config.py.

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

534  def _placeEndPath(self,name,mod):
535  self._validateSequence(mod, name)
536  try:
537  self._place(name, mod, self.__endpaths)
538  except ModuleCloneError as msg:
539  context = format_outerframe(4)
540  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:742
def _placeEndPath(self, name, mod)
Definition: Config.py:534
def format_outerframe(number)
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeESPrefer (   self,
  name,
  mod 
)
private

Definition at line 546 of file Config.py.

References Config.Process._place().

546  def _placeESPrefer(self,name,mod):
547  self._place(name, mod, self.__esprefers)
def _placeESPrefer(self, name, mod)
Definition: Config.py:546
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeESProducer (   self,
  name,
  mod 
)
private

Definition at line 544 of file Config.py.

References Config.Process._place().

544  def _placeESProducer(self,name,mod):
545  self._place(name, mod, self.__esproducers)
def _placeESProducer(self, name, mod)
Definition: Config.py:544
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeESSource (   self,
  name,
  mod 
)
private

Definition at line 548 of file Config.py.

References Config.Process._place().

548  def _placeESSource(self,name,mod):
549  self._place(name, mod, self.__essources)
def _placeESSource(self, name, mod)
Definition: Config.py:548
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeFilter (   self,
  name,
  mod 
)
private

Definition at line 523 of file Config.py.

References Config.Process._place().

523  def _placeFilter(self,name,mod):
524  self._place(name, mod, self.__filters)
def _placeFilter(self, name, mod)
Definition: Config.py:523
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeLooper (   self,
  name,
  mod 
)
private

Definition at line 567 of file Config.py.

Referenced by Config.Process.setLooper_().

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

Definition at line 519 of file Config.py.

References Config.Process._place().

519  def _placeOutputModule(self,name,mod):
520  self._place(name, mod, self.__outputmodules)
def _placeOutputModule(self, name, mod)
Definition: Config.py:519
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placePath (   self,
  name,
  mod 
)
private

Definition at line 527 of file Config.py.

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

527  def _placePath(self,name,mod):
528  self._validateSequence(mod, name)
529  try:
530  self._place(name, mod, self.__paths)
531  except ModuleCloneError as msg:
532  context = format_outerframe(4)
533  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:742
def _placePath(self, name, mod)
Definition: Config.py:527
def format_outerframe(number)
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeProducer (   self,
  name,
  mod 
)
private

Definition at line 521 of file Config.py.

References Config.Process._place().

521  def _placeProducer(self,name,mod):
522  self._place(name, mod, self.__producers)
def _placeProducer(self, name, mod)
Definition: Config.py:521
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placePSet (   self,
  name,
  mod 
)
private

Definition at line 555 of file Config.py.

References Config.Process._place().

555  def _placePSet(self,name,mod):
556  self._place(name, mod, self.__psets)
def _placePSet(self, name, mod)
Definition: Config.py:555
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeSequence (   self,
  name,
  mod 
)
private

Definition at line 541 of file Config.py.

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

541  def _placeSequence(self,name,mod):
542  self._validateSequence(mod, name)
543  self._place(name, mod, self.__sequences)
def _placeSequence(self, name, mod)
Definition: Config.py:541
def _validateSequence(self, sequence, label)
Definition: Config.py:742
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeService (   self,
  typeName,
  mod 
)
private

Definition at line 577 of file Config.py.

References Config.Process._place().

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

Definition at line 559 of file Config.py.

Referenced by Config.Process.setSource_().

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

Definition at line 572 of file Config.py.

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

Definition at line 550 of file Config.py.

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

550  def _placeTask(self,name,task):
551  self._validateTask(task, name)
552  self._place(name, task, self.__tasks)
def _validateTask(self, task, label)
Definition: Config.py:750
def _placeTask(self, name, task)
Definition: Config.py:550
def _place(self, name, mod, d)
Definition: Config.py:511
def Config.Process._placeVPSet (   self,
  name,
  mod 
)
private

Definition at line 557 of file Config.py.

References Config.Process._place().

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

Definition at line 1017 of file Config.py.

Referenced by Config.Process.prune().

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

Definition at line 859 of file Config.py.

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

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

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

Definition at line 846 of file Config.py.

References Config.Process.endpaths, Config.Process.paths, and Config.Process.sequences.

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

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

Definition at line 855 of file Config.py.

References Config.Process.tasks.

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

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

Definition at line 742 of file Config.py.

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

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

Definition at line 750 of file Config.py.

Referenced by Config.Process._placeTask().

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

Definition at line 475 of file Config.py.

References Config.Process.__isStrict.

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

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

Definition at line 575 of file Config.py.

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

Definition at line 263 of file Config.py.

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

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

Definition at line 146 of file Config.py.

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

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

Definition at line 204 of file Config.py.

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

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

Definition at line 661 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_, TrigObjTnPHistColl::FilterSelector::FilterSet.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.psets, Config.Process.schedule, ConfigBuilder.ConfigBuilder.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_, and Config.Process.vpsets.

Referenced by Types.SecSource.configValue().

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

Definition at line 819 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_, TrigObjTnPHistColl::FilterSelector::FilterSet.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::test::TestProcessor.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__().

819  def dumpPython(self, options=PrintOptions()):
820  """return a string containing the equivalent process defined using python"""
821  result = "import FWCore.ParameterSet.Config as cms\n\n"
822  result += "process = cms.Process(\""+self.__name+"\")\n\n"
823  if self.source_():
824  result += "process.source = "+self.source_().dumpPython(options)
825  if self.looper_():
826  result += "process.looper = "+self.looper_().dumpPython()
827  result+=self._dumpPythonList(self.psets, options)
828  result+=self._dumpPythonList(self.vpsets, options)
829  result+=self._dumpPythonSubProcesses(self.subProcesses_(), options)
830  result+=self._dumpPythonList(self.producers_(), options)
831  result+=self._dumpPythonList(self.filters_() , options)
832  result+=self._dumpPythonList(self.analyzers_(), options)
833  result+=self._dumpPythonList(self.outputModules_(), options)
834  result+=self._dumpPythonList(self.services_(), options)
835  result+=self._dumpPythonList(self.es_producers_(), options)
836  result+=self._dumpPythonList(self.es_sources_(), options)
837  result+=self._dumpPython(self.es_prefers_(), options)
838  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.tasks), options)
839  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.sequences), options)
840  result+=self._dumpPythonList(self.paths_(), options)
841  result+=self._dumpPythonList(self.endpaths_(), options)
842  result+=self._dumpPythonList(self.aliases_(), options)
843  if not self.schedule_() == None:
844  result += 'process.schedule = ' + self.schedule.dumpPython(options)
845  return result
def subProcesses_(self)
Definition: Config.py:200
def es_producers_(self)
Definition: Config.py:251
def producers_(self)
Definition: Config.py:184
def es_sources_(self)
Definition: Config.py:255
def _itemsInDependencyOrder(self, processDictionaryOfItems)
Definition: Config.py:758
def source_(self)
Definition: Config.py:188
def schedule_(self)
Definition: Config.py:228
def endpaths_(self)
Definition: Config.py:216
def _dumpPythonSubProcesses(self, l, options)
Definition: Config.py:728
def looper_(self)
Definition: Config.py:194
def es_prefers_(self)
Definition: Config.py:259
def filters_(self)
Definition: Config.py:173
def dumpPython(self, options=PrintOptions())
Definition: Config.py:819
def analyzers_(self)
Definition: Config.py:204
def _dumpPythonList(self, d, options)
Definition: Config.py:733
def paths_(self)
Definition: Config.py:212
def outputModules_(self)
Definition: Config.py:208
def services_(self)
Definition: Config.py:247
def _dumpPython(self, d, options)
Definition: Config.py:814
def aliases_(self)
Definition: Config.py:263
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths that have been added to the Process

Definition at line 216 of file Config.py.

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

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

Definition at line 259 of file Config.py.

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

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

Definition at line 251 of file Config.py.

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

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

Definition at line 255 of file Config.py.

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

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

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

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

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

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

Definition at line 149 of file Config.py.

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

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

Definition at line 173 of file Config.py.

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

173  def filters_(self):
174  """returns a dict of the filters that have been added to the Process"""
175  return DictTypes.FixedKeysDict(self.__filters)
def filters_(self)
Definition: Config.py:173
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 865 of file Config.py.

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

Definition at line 276 of file Config.py.

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

Definition at line 582 of file Config.py.

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

582  def load(self, moduleName):
583  moduleName = moduleName.replace("/",".")
584  module = __import__(moduleName)
585  self.extend(sys.modules[moduleName])
def load(self, moduleName)
Definition: Config.py:582
def extend(self, other, items=())
Definition: Config.py:586
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 194 of file Config.py.

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

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

Definition at line 177 of file Config.py.

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

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

Definition at line 208 of file Config.py.

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

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

Definition at line 152 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_.

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

Definition at line 212 of file Config.py.

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

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

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

Definition at line 143 of file Config.py.

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

143  def producerNames(self):
144  """Returns a string containing all the EDProducer labels separated by a blank"""
145  return ' '.join(self.producers_().keys())
def producerNames(self)
Definition: Config.py:143
def producers_(self)
Definition: Config.py:184
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 184 of file Config.py.

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

184  def producers_(self):
185  """returns a dict of the producers that have been added to the Process"""
186  return DictTypes.FixedKeysDict(self.__producers)
def producers_(self)
Definition: Config.py:184
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 965 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_, TrigObjTnPHistColl::FilterSelector::FilterSet.filters_, FilterOR.filters_, Config.Process.filters_(), FilterSelection.filters_, FilterSelections.filters_, join(), list(), Config.Process.paths, edm.print(), 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::test::TestProcessor.schedule_, edm::SubProcess.schedule_, edm::EventProcessor.schedule_, Config.Process.sequences, and Config.Process.vpsets_().

Referenced by dirstructure.Directory.prune().

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

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

Definition at line 956 of file Config.py.

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

Referenced by Config.Process.prune().

956  def resolve(self,keepUnresolvedSequencePlaceholders=False):
957  for x in six.itervalues(self.paths):
958  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
959  for x in six.itervalues(self.endpaths):
960  x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
961  if not self.schedule_() == None:
962  for task in self.schedule_()._tasks:
963  task.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
964 
def schedule_(self)
Definition: Config.py:228
def resolve(self, keepUnresolvedSequencePlaceholders=False)
Definition: Config.py:956
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 228 of file Config.py.

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

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

Definition at line 220 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 247 of file Config.py.

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

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

Definition at line 197 of file Config.py.

References Config.Process._placeLooper().

197  def setLooper_(self,lpr):
198  self._placeLooper('looper',lpr)
def setLooper_(self, lpr)
Definition: Config.py:197
def _placeLooper(self, name, mod)
Definition: Config.py:567
def Config.Process.setName_ (   self,
  name 
)

Definition at line 179 of file Config.py.

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

Definition at line 231 of file Config.py.

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

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

Definition at line 236 of file Config.py.

References str.

Referenced by Config.Process.setPartialSchedule_().

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

Definition at line 191 of file Config.py.

References Config.Process._placeSource().

191  def setSource_(self,src):
192  self._placeSource('source',src)
def setSource_(self, src)
Definition: Config.py:191
def _placeSource(self, name, mod)
Definition: Config.py:559
def Config.Process.setStrict (   self,
  value 
)

Definition at line 138 of file Config.py.

References Config.Process.__isStrict.

138  def setStrict(self, value):
139  self.__isStrict = value
140  _Module.__isStrict__ = True
141 
def setStrict(self, value)
Definition: Config.py:138
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 188 of file Config.py.

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

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

Definition at line 200 of file Config.py.

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

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

Definition at line 224 of file Config.py.

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

Definition at line 1100 of file Config.py.

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

Definition at line 271 of file Config.py.

Referenced by Config.Process.prune().

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

Member Data Documentation

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

Definition at line 1039 of file Config.py.

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

Definition at line 1029 of file Config.py.

Config.Process.__thelist
private

Definition at line 1028 of file Config.py.

Property Documentation

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

Definition at line 266 of file Config.py.

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

Definition at line 207 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
Config.Process.es_prefers = property(es_prefers_,doc="dictionary containing the es_prefers for the process")
static

Definition at line 262 of file Config.py.

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

Definition at line 254 of file Config.py.

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

Definition at line 258 of file Config.py.

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

Definition at line 176 of file Config.py.

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

Definition at line 199 of file Config.py.

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

Definition at line 211 of file Config.py.

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

Definition at line 187 of file Config.py.

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

Definition at line 270 of file Config.py.

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

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

Definition at line 246 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

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

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

Definition at line 274 of file Config.py.

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