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 99 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 101 of file Config.py.

Referenced by Config.Process.fillProcessDesc().

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

Member Function Documentation

def Config.Process.__delattr__ (   self,
  name 
)

Definition at line 440 of file Config.py.

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

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

References list().

Referenced by Config.Process.__setattr__().

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

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

Definition at line 283 of file Config.py.

References triggerObjects_cff.id, and str.

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

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

References triggerObjects_cff.id.

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

Definition at line 465 of file Config.py.

References Config.Process._delHelper().

Referenced by Config.Process.__setattr__().

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

Definition at line 423 of file Config.py.

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

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

Definition at line 722 of file Config.py.

References Config.Process.es_prefers_().

Referenced by Config.Process.dumpConfig().

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

Definition at line 643 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 653 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 648 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 813 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 732 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 727 of file Config.py.

Referenced by Config.Process.dumpPython().

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

Definition at line 1135 of file Config.py.

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

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

Definition at line 869 of file Config.py.

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

Definition at line 879 of file Config.py.

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

Definition at line 872 of file Config.py.

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

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

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

Definition at line 888 of file Config.py.

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

Definition at line 757 of file Config.py.

References cmsPerfStripChart.dict.

Referenced by Config.Process.dumpPython().

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

Definition at line 489 of file Config.py.

References Config.Process.__isStrict.

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

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

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

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

Definition at line 552 of file Config.py.

References Config.Process._place().

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

Definition at line 524 of file Config.py.

References Config.Process._place().

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

Definition at line 533 of file Config.py.

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

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

Definition at line 545 of file Config.py.

References Config.Process._place().

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

Definition at line 543 of file Config.py.

References Config.Process._place().

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

Definition at line 547 of file Config.py.

References Config.Process._place().

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

Definition at line 522 of file Config.py.

References Config.Process._place().

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

Definition at line 566 of file Config.py.

Referenced by Config.Process.setLooper_().

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

Definition at line 518 of file Config.py.

References Config.Process._place().

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

Definition at line 526 of file Config.py.

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

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

Definition at line 520 of file Config.py.

References Config.Process._place().

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

Definition at line 554 of file Config.py.

References Config.Process._place().

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

Definition at line 540 of file Config.py.

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

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

Definition at line 576 of file Config.py.

References Config.Process._place().

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

Definition at line 558 of file Config.py.

Referenced by Config.Process.setSource_().

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

Definition at line 571 of file Config.py.

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

Definition at line 549 of file Config.py.

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

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

Definition at line 556 of file Config.py.

References Config.Process._place().

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

Definition at line 1016 of file Config.py.

Referenced by Config.Process.prune().

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

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

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

Definition at line 845 of file Config.py.

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

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

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

Definition at line 854 of file Config.py.

References Config.Process.tasks.

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

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

Definition at line 741 of file Config.py.

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

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

Definition at line 749 of file Config.py.

Referenced by Config.Process._placeTask().

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

Definition at line 474 of file Config.py.

References Config.Process.__isStrict.

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

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

Definition at line 574 of file Config.py.

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

Definition at line 262 of file Config.py.

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

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

Definition at line 145 of file Config.py.

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

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

Definition at line 203 of file Config.py.

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

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

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

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

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

818  def dumpPython(self, options=PrintOptions()):
819  """return a string containing the equivalent process defined using python"""
820  result = "import FWCore.ParameterSet.Config as cms\n\n"
821  result += "process = cms.Process(\""+self.__name+"\")\n\n"
822  if self.source_():
823  result += "process.source = "+self.source_().dumpPython(options)
824  if self.looper_():
825  result += "process.looper = "+self.looper_().dumpPython()
826  result+=self._dumpPythonList(self.psets, options)
827  result+=self._dumpPythonList(self.vpsets, options)
828  result+=self._dumpPythonSubProcesses(self.subProcesses_(), options)
829  result+=self._dumpPythonList(self.producers_(), options)
830  result+=self._dumpPythonList(self.filters_() , options)
831  result+=self._dumpPythonList(self.analyzers_(), options)
832  result+=self._dumpPythonList(self.outputModules_(), options)
833  result+=self._dumpPythonList(self.services_(), options)
834  result+=self._dumpPythonList(self.es_producers_(), options)
835  result+=self._dumpPythonList(self.es_sources_(), options)
836  result+=self._dumpPython(self.es_prefers_(), options)
837  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.tasks), options)
838  result+=self._dumpPythonList(self._itemsInDependencyOrder(self.sequences), options)
839  result+=self._dumpPythonList(self.paths_(), options)
840  result+=self._dumpPythonList(self.endpaths_(), options)
841  result+=self._dumpPythonList(self.aliases_(), options)
842  if not self.schedule_() == None:
843  result += 'process.schedule = ' + self.schedule.dumpPython(options)
844  return result
def subProcesses_(self)
Definition: Config.py:199
def es_producers_(self)
Definition: Config.py:250
def producers_(self)
Definition: Config.py:183
def es_sources_(self)
Definition: Config.py:254
def _itemsInDependencyOrder(self, processDictionaryOfItems)
Definition: Config.py:757
def source_(self)
Definition: Config.py:187
def schedule_(self)
Definition: Config.py:227
def endpaths_(self)
Definition: Config.py:215
def _dumpPythonSubProcesses(self, l, options)
Definition: Config.py:727
def looper_(self)
Definition: Config.py:193
def es_prefers_(self)
Definition: Config.py:258
def filters_(self)
Definition: Config.py:172
def dumpPython(self, options=PrintOptions())
Definition: Config.py:818
def analyzers_(self)
Definition: Config.py:203
def _dumpPythonList(self, d, options)
Definition: Config.py:732
def paths_(self)
Definition: Config.py:211
def outputModules_(self)
Definition: Config.py:207
def services_(self)
Definition: Config.py:246
def _dumpPython(self, d, options)
Definition: Config.py:813
def aliases_(self)
Definition: Config.py:262
def Config.Process.endpaths_ (   self)
returns a dict of the endpaths that have been added to the Process

Definition at line 215 of file Config.py.

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

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

Definition at line 258 of file Config.py.

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

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

Definition at line 250 of file Config.py.

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

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

Definition at line 254 of file Config.py.

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

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

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

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

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

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

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

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

Definition at line 172 of file Config.py.

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

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

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

Definition at line 275 of file Config.py.

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

Definition at line 581 of file Config.py.

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

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

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

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

Definition at line 176 of file Config.py.

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

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

Definition at line 207 of file Config.py.

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

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

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

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

Definition at line 211 of file Config.py.

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

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

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

Definition at line 142 of file Config.py.

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

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

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

183  def producers_(self):
184  """returns a dict of the producers that have been added to the Process"""
185  return DictTypes.FixedKeysDict(self.__producers)
def producers_(self)
Definition: Config.py:183
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 964 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, 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().

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

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

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

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

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

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

Definition at line 219 of file Config.py.

Referenced by Config.Process.dumpConfig().

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

Definition at line 246 of file Config.py.

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

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

Definition at line 196 of file Config.py.

References Config.Process._placeLooper().

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

Definition at line 178 of file Config.py.

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

Definition at line 230 of file Config.py.

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

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

Definition at line 235 of file Config.py.

References str.

Referenced by Config.Process.setPartialSchedule_().

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

Definition at line 190 of file Config.py.

References Config.Process._placeSource().

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

Definition at line 137 of file Config.py.

References Config.Process.__isStrict.

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

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

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

Definition at line 199 of file Config.py.

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

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

Definition at line 223 of file Config.py.

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

Definition at line 1099 of file Config.py.

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

Definition at line 270 of file Config.py.

Referenced by Config.Process.prune().

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

Member Data Documentation

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

Definition at line 1038 of file Config.py.

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

Definition at line 1028 of file Config.py.

Config.Process.__thelist
private

Definition at line 1027 of file Config.py.

Property Documentation

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

Definition at line 265 of file Config.py.

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

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

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

Definition at line 253 of file Config.py.

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

Definition at line 257 of file Config.py.

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

Definition at line 175 of file Config.py.

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

Definition at line 198 of file Config.py.

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

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

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

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

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

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

Definition at line 249 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 202 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 273 of file Config.py.

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