4 from Options
import Options
10 from Mixins
import PrintOptions,_ParameterTypeBase,_SimpleParameterTypeBase, _Parameterizable, _ConfigureComponent, _TypedParameterizable, _Labelable, _Unlabelable, _ValidatingListBase, _modifyParametersFromDict
14 from Modules
import _Module
15 from SequenceTypes
import *
16 from SequenceTypes
import _ModuleSequenceType, _Sequenceable
17 from SequenceVisitors
import PathValidator, EndPathValidator
20 from ExceptionHandling
import *
23 if sys.getrecursionlimit()<5000:
24 sys.setrecursionlimit(5000)
28 Raise an exception if called by special config files. This checks
29 the call or import stack for the importing file. An exception is raised if
30 the importing module is not in allowedPatterns and if it is called too deeply:
31 minLevel = 2: inclusion by top lvel cfg only
32 minLevel = 1: No inclusion allowed
33 allowedPatterns = ['Module1','Module2/SubModule1'] allows import
34 by any module in Module1 or Submodule1
40 ignorePatterns = [
'FWCore/ParameterSet/Config.py',
'<string>']
41 CMSSWPath = [os.environ[
'CMSSW_BASE'],os.environ[
'CMSSW_RELEASE_BASE']]
45 for item
in inspect.stack():
49 for pattern
in CMSSWPath:
50 if item[1].
find(pattern) != -1:
53 if item[1].
find(
'/') == -1:
56 for pattern
in ignorePatterns:
57 if item[1].
find(pattern) != -1:
61 if inPath
and not ignore:
62 trueStack.append(item[1])
64 importedFile = trueStack[0]
66 if len(trueStack) > 1:
67 importedBy = trueStack[1]
69 for pattern
in allowedPatterns:
70 if importedBy.find(pattern) > -1:
73 if len(trueStack) <= minLevel:
76 raise ImportError(
"Inclusion of %s is allowed only by cfg or specified cfi files."
80 """Look inside the module and find the Processes it contains"""
84 if isinstance(module,dict):
85 if 'process' in module:
89 if hasattr(module,
'process'):
90 if isinstance(module.process,Process):
91 process = module.process
93 raise RuntimeError(
"The attribute named 'process' does not inherit from the Process class")
95 raise RuntimeError(
"no 'process' attribute found in the module, please add one")
100 """Root class for a CMS configuration process"""
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
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'] = {}
119 self.__dict__[
'_Process__sequences'] = {}
120 self.__dict__[
'_Process__services'] = {}
121 self.__dict__[
'_Process__essources'] = {}
122 self.__dict__[
'_Process__esproducers'] = {}
123 self.__dict__[
'_Process__esprefers'] = {}
124 self.__dict__[
'_Process__aliases'] = {}
125 self.__dict__[
'_Process__psets']={}
126 self.__dict__[
'_Process__vpsets']={}
127 self.__dict__[
'_cloneToObjectDict'] = {}
129 self.__dict__[
'_Process__InExtendCall'] =
False
130 self.__dict__[
'_Process__partialschedules'] = {}
132 self.__dict__[
'_Process__modifiers'] = Mods
133 for m
in self.__modifiers:
138 _Module.__isStrict__ =
True
142 """Returns a string containing all the EDProducer labels separated by a blank"""
145 """Returns a string containing all the EDAnalyzer labels separated by a blank"""
148 """Returns a string containing all the EDFilter labels separated by a blank"""
151 """Returns a string containing all the Path names separated by a blank"""
158 Since cloneToObjectDict stores a hash of objects by their
159 id() it needs to be updated when unpickling to use the
160 new object id values instantiated during the unpickle.
163 self.__dict__.update(pkldict)
165 for value
in self._cloneToObjectDict.values():
166 tmpDict[id(value)] = value
167 self.__dict__[
'_cloneToObjectDict'] = tmpDict
172 """returns a dict of the filters that have been added to the Process"""
174 filters = property(filters_, doc=
"dictionary containing the filters for the process")
178 if not name.isalnum():
179 raise RuntimeError(
"Error: The process name is an empty string or contains non-alphanumeric characters")
180 self.__dict__[
'_Process__name'] = name
181 process = property(name_,setName_, doc=
"name of the process")
183 """returns a dict of the producers that have been added to the Process"""
185 producers = property(producers_,doc=
"dictionary containing the producers for the process")
187 """returns the source that has been added to the Process or None if none have been added"""
191 source = property(source_,setSource_,doc=
'the main source or None if not set')
193 """returns the looper that has been added to the Process or None if none have been added"""
197 looper = property(looper_,setLooper_,doc=
'the main looper or None if not set')
199 """returns a list of the subProcesses that have been added to the Process"""
200 return self.__subProcesses
201 subProcesses = property(subProcesses_,doc=
'the SubProcesses that have been added to the Process')
203 """returns a dict of the analyzers that have been added to the Process"""
205 analyzers = property(analyzers_,doc=
"dictionary containing the analyzers for the process")
207 """returns a dict of the output modules that have been added to the Process"""
209 outputModules = property(outputModules_,doc=
"dictionary containing the output_modules for the process")
211 """returns a dict of the paths that have been added to the Process"""
213 paths = property(paths_,doc=
"dictionary containing the paths for the process")
215 """returns a dict of the endpaths that have been added to the Process"""
217 endpaths = property(endpaths_,doc=
"dictionary containing the endpaths for the process")
219 """returns a dict of the sequences that have been added to the Process"""
221 sequences = property(sequences_,doc=
"dictionary containing the sequences for the process")
223 """returns the schedule that has been added to the Process or None if none have been added"""
224 return self.__schedule
226 if label ==
"schedule":
229 self.
_place(label, sch, self.__partialschedules)
238 raise RuntimeError(
"The path at index "+str(index)+
" in the Schedule was not attached to the process.")
240 self.__dict__[
'_Process__schedule'] = sch
241 schedule = property(schedule_,setSchedule_,doc=
'the schedule or None if not set')
243 """returns a dict of the services that have been added to the Process"""
245 services = property(services_,doc=
"dictionary containing the services for the process")
247 """returns a dict of the esproducers that have been added to the Process"""
249 es_producers = property(es_producers_,doc=
"dictionary containing the es_producers for the process")
251 """returns a the es_sources that have been added to the Process"""
253 es_sources = property(es_sources_,doc=
"dictionary containing the es_sources for the process")
255 """returns a dict of the es_prefers that have been added to the Process"""
257 es_prefers = property(es_prefers_,doc=
"dictionary containing the es_prefers for the process")
259 """returns a dict of the aliases that have been added to the Process"""
261 aliases = property(aliases_,doc=
"dictionary containing the aliases for the process")
263 """returns a dict of the PSets that have been added to the Process"""
265 psets = property(psets_,doc=
"dictionary containing the PSets for the process")
267 """returns a dict of the VPSets that have been added to the Process"""
269 vpsets = property(vpsets_,doc=
"dictionary containing the PSets for the process")
272 if not object.hasLabel_() :
273 object.setLabel(newLabel)
275 if newLabel == object.label_() :
277 if newLabel
is None :
278 object.setLabel(
None)
280 if (hasattr(self, object.label_())
and id(getattr(self, object.label_())) == id(object)) :
281 msg100 =
"Attempting to change the label of an attribute of the Process\n"
282 msg101 =
"Old label = "+object.label_()+
" New label = "+newLabel+
"\n"
283 msg102 =
"Type = "+str(type(object))+
"\n"
284 msg103 =
"Some possible solutions:\n"
285 msg104 =
" 1. Clone modules instead of using simple assignment. Cloning is\n"
286 msg105 =
" also preferred for other types when possible.\n"
287 msg106 =
" 2. Declare new names starting with an underscore if they are\n"
288 msg107 =
" for temporaries you do not want propagated into the Process. The\n"
289 msg108 =
" underscore tells \"from x import *\" and process.load not to import\n"
290 msg109 =
" the name.\n"
291 msg110 =
" 3. Reorganize so the assigment is not necessary. Giving a second\n"
292 msg111 =
" name to the same object usually causes confusion and problems.\n"
293 msg112 =
" 4. Compose Sequences: newName = cms.Sequence(oldName)\n"
294 raise ValueError(msg100+msg101+msg102+msg103+msg104+msg105+msg106+msg107+msg108+msg109+msg110+msg111+msg112)
295 object.setLabel(
None)
296 object.setLabel(newLabel)
300 if not name.replace(
'_',
'').isalnum():
301 raise ValueError(
'The label '+name+
' contains forbiden characters')
304 if name.startswith(
'_Process__'):
305 self.__dict__[name]=value
307 if not isinstance(value,_ConfigureComponent):
308 raise TypeError(
"can only assign labels to an object that inherits from '_ConfigureComponent'\n"
309 +
"an instance of "+str(type(value))+
" will not work - requested label is "+name)
310 if not isinstance(value,_Labelable)
and not isinstance(value,Source)
and not isinstance(value,Looper)
and not isinstance(value,Schedule):
311 if name == value.type_():
315 raise TypeError(
"an instance of "+str(type(value))+
" can not be assigned the label '"+name+
"'.\n"+
316 "Please either use the label '"+value.type_()+
" or use the 'add_' method instead.")
319 newValue =value.copy()
321 newValue._filename = value._filename
327 if not self.
_okToPlace(name, value, self.__dict__):
328 newFile=
'top level config'
329 if hasattr(value,
'_filename'):
330 newFile = value._filename
331 oldFile=
'top level config'
332 oldValue = getattr(self,name)
333 if hasattr(oldValue,
'_filename'):
334 oldFile = oldValue._filename
335 msg =
"Trying to override definition of process."+name
336 msg +=
"\n new object defined in: "+newFile
337 msg +=
"\n existing object defined in: "+oldFile
338 raise ValueError(msg)
340 if hasattr(self,name)
and not (getattr(self,name)==newValue):
344 if isinstance(newValue, _Sequenceable):
345 if not self.__InExtendCall:
349 newFile=
'top level config'
350 if hasattr(value,
'_filename'):
351 newFile = value._filename
352 oldFile=
'top level config'
353 oldValue = getattr(self,name)
354 if hasattr(oldValue,
'_filename'):
355 oldFile = oldValue._filename
356 msg1 =
"Trying to override definition of "+name+
" while it is used by the sequence "
357 msg2 =
"\n new object defined in: "+newFile
358 msg2 +=
"\n existing object defined in: "+oldFile
361 raise ValueError(msg1+s.label_()+msg2)
364 raise ValueError(msg1+s.label_()+msg2)
367 raise ValueError(msg1+s.label_()+msg2)
369 self.__dict__[name]=newValue
370 if isinstance(newValue,_Labelable):
372 self._cloneToObjectDict[id(value)] = newValue
373 self._cloneToObjectDict[id(newValue)] = newValue
375 newValue._place(name,self)
377 """Given a container of sequences, find the first sequence containing mod
378 and return the sequence. If no sequence is found, return None"""
380 for sequenceable
in seqs.itervalues():
383 sequenceable.visit(v)
388 if not hasattr(self,name):
389 raise KeyError(
'process does not know about '+name)
390 elif name.startswith(
'_Process__'):
391 raise ValueError(
'this attribute cannot be deleted')
396 if name
in reg: del reg[name]
398 obj = getattr(self,name)
399 if isinstance(obj,_Labelable):
400 getattr(self,name).setLabel(
None)
403 del self.__dict__[name]
408 """Allows addition of components that do not have to have a label, e.g. Services"""
409 if not isinstance(value,_ConfigureComponent):
411 if not isinstance(value,_Unlabelable):
416 newValue =value.copy()
420 newValue._place(
'',self)
423 if not self.__InExtendCall:
434 if d[name]._isModified:
445 if self.
__isStrict and isinstance(mod, _ModuleSequenceType):
446 d[name] = mod._postProcessFixup(self._cloneToObjectDict)
449 if isinstance(mod,_Labelable):
452 self.
_place(name, mod, self.__outputmodules)
454 self.
_place(name, mod, self.__producers)
456 self.
_place(name, mod, self.__filters)
458 self.
_place(name, mod, self.__analyzers)
462 self.
_place(name, mod, self.__paths)
463 except ModuleCloneError
as msg:
465 raise Exception(
"%sThe module %s in path %s is unknown to the process %s." %(context, msg, name, self._Process__name))
469 self.
_place(name, mod, self.__endpaths)
470 except ModuleCloneError
as msg:
472 raise Exception(
"%sThe module %s in endpath %s is unknown to the process %s." %(context, msg, name, self._Process__name))
475 self.
_place(name, mod, self.__sequences)
477 self.
_place(name, mod, self.__esproducers)
479 self.
_place(name, mod, self.__esprefers)
481 self.
_place(name, mod, self.__essources)
483 self.
_place(name, mod, self.__aliases)
485 self.
_place(name, mod, self.__psets)
487 self.
_place(name, mod, self.__vpsets)
489 """Allow the source to be referenced by 'source' or by type name"""
491 raise ValueError(
"The label '"+name+
"' can not be used for a Source. Only 'source' is allowed.")
492 if self.__dict__[
'_Process__source']
is not None :
493 del self.__dict__[self.__dict__[
'_Process__source'].type_()]
494 self.__dict__[
'_Process__source'] = mod
495 self.__dict__[mod.type_()] = mod
498 raise ValueError(
"The label '"+name+
"' can not be used for a Looper. Only 'looper' is allowed.")
499 self.__dict__[
'_Process__looper'] = mod
500 self.__dict__[mod.type_()] = mod
502 self.__dict__[
'_Process__subProcess'] = mod
503 self.__dict__[mod.type_()] = mod
505 self.__subProcesses.append(mod)
507 self.
_place(typeName, mod, self.__services)
508 self.__dict__[typeName]=mod
510 moduleName = moduleName.replace(
"/",
".")
511 module = __import__(moduleName)
512 self.
extend(sys.modules[moduleName])
514 """Look in other and find types that we can use"""
516 self.__dict__[
'_Process__InExtendCall'] =
True
520 for name
in dir(other):
522 if name.startswith(
'_'):
524 item = getattr(other,name)
525 if name ==
"source" or name ==
"looper":
529 elif isinstance(item,_ModuleSequenceType):
531 elif isinstance(item,_Labelable):
533 if not item.hasLabel_() :
535 elif isinstance(item,Schedule):
537 elif isinstance(item,_Unlabelable):
539 elif isinstance(item,ProcessModifier):
541 elif isinstance(item,ProcessFragment):
545 for name
in seqs.iterkeys():
549 if id(seq)
not in self._cloneToObjectDict:
552 newSeq = self._cloneToObjectDict[id(seq)]
553 self.__dict__[name]=newSeq
556 newSeq._place(name,self)
562 self.__dict__[
'_Process__InExtendCall'] =
False
566 for name,item
in items:
567 returnValue +=options.indentation()+typeName+
' '+name+
' = '+item.dumpConfig(options)
571 for name,item
in items:
572 returnValue +=options.indentation()+typeName+
' = '+item.dumpConfig(options)
576 for name,item
in items:
577 if name == item.type_():
579 returnValue +=options.indentation()+typeName+
' '+name+
' = '+item.dumpConfig(options)
582 """return a string containing the equivalent process defined using the old configuration language"""
583 config =
"process "+self.__name+
" = {\n"
629 for name,item
in self.psets.iteritems():
630 config +=options.indentation()+item.configTypeName()+
' '+name+
' = '+item.configValue(options)
631 for name,item
in self.vpsets.iteritems():
632 config +=options.indentation()+
'VPSet '+name+
' = '+item.configValue(options)
634 pathNames = [p.label_()
for p
in self.
schedule]
635 config +=options.indentation()+
'schedule = {'+
','.
join(pathNames)+
'}\n'
646 result +=options.indentation()+
'es_prefer '+item.targetLabel_()+
' = '+item.dumpConfig(options)
651 returnValue += item.dumpPython(options)+
'\n\n'
656 for name,item
in d.items():
657 returnValue +=
'process.'+name+
' = '+item.dumpPython(options)+
'\n\n'
659 for name,item
in sorted(d.items()):
660 returnValue +=
'process.'+name+
' = '+item.dumpPython(options)+
'\n\n'
667 sequence.visit(nameVisitor)
669 raise RuntimeError(
"An entry in sequence "+label +
' has no label')
674 for label,seq
in self.sequences.iteritems():
678 dependencies[label]=[dep.label_()
for dep
in d
if dep.hasLabel_()]
679 resolvedDependencies=
True
683 while resolvedDependencies:
685 resolvedDependencies = (0 != len(dependencies))
686 oldDeps =
dict(dependencies)
687 for label,deps
in oldDeps.iteritems():
689 if len(deps)==0
or iterCount > 100:
691 resolvedDependencies=
True
694 del dependencies[label]
695 for lb2,deps2
in dependencies.iteritems():
696 while deps2.count(label):
698 if len(dependencies):
699 raise RuntimeError(
"circular sequence dependency discovered \n"+
700 ",".
join([label
for label,junk
in dependencies.iteritems()]))
704 for name, value
in sorted(d.iteritems()):
705 result += value.dumpPythonAs(name,options)+
'\n'
708 """return a string containing the equivalent process defined using python"""
709 result =
"import FWCore.ParameterSet.Config as cms\n\n"
710 result +=
"process = cms.Process(\""+self.__name+
"\")\n\n"
731 pathNames = [
'process.'+p.label_()
for p
in self.
schedule]
732 result +=
'process.schedule = cms.Schedule(*[ ' +
', '.
join(pathNames) +
' ])\n'
736 old = getattr(self,label)
738 for sequenceable
in self.sequences.itervalues():
739 sequenceable.replace(old,new)
740 for sequenceable
in self.paths.itervalues():
741 sequenceable.replace(old,new)
742 for sequenceable
in self.endpaths.itervalues():
743 sequenceable.replace(old,new)
745 """ Replace the item with label 'label' by object 'new' in the process and all sequences/paths"""
746 if not hasattr(self,label):
747 raise LookupError(
"process has no item of label "+label)
749 setattr(self,label,new)
751 for name,value
in itemDict.iteritems():
752 value.insertInto(parameterSet, name)
756 newlabel = item.nameInProcessDesc_(label)
758 item.insertInto(parameterSet, newlabel)
759 parameterSet.addVString(tracked, label, vitems)
762 for name,value
in itemDict.iteritems():
763 newLabel = value.nameInProcessDesc_(name)
765 value.insertInto(parameterSet, name)
768 parameterSet.addVString(tracked, label, l)
772 for value
in itemList:
773 name = value.getProcessName()
774 newLabel = value.nameInProcessDesc_(name)
776 pset = value.getSubProcessPSet(parameterSet)
777 subprocs.append(pset)
780 parameterSet.addVString(tracked, label, l)
781 parameterSet.addVPSet(
False,
"subProcesses",subprocs)
788 for name,value
in self.
paths_().iteritems():
789 scheduledPaths.append(name)
790 triggerPaths.append(name)
791 for name,value
in self.
endpaths_().iteritems():
792 scheduledPaths.append(name)
793 endpaths.append(name)
796 pathname = path.label_()
797 scheduledPaths.append(pathname)
799 endpaths.append(pathname)
801 triggerPaths.append(pathname)
802 processPSet.addVString(
True,
"@end_paths", endpaths)
803 processPSet.addVString(
True,
"@paths", scheduledPaths)
805 p = processPSet.newPSet()
806 p.addVString(
True,
"@trigger_paths", triggerPaths)
807 processPSet.addPSet(
True,
"@trigger_paths", p)
811 for triggername
in triggerPaths:
813 pathValidator.setLabel(triggername)
815 self.
paths_()[triggername].insertInto(processPSet, triggername, self.__dict__)
816 for endpathname
in endpaths:
818 endpathValidator.setLabel(endpathname)
820 self.
endpaths_()[endpathname].insertInto(processPSet, endpathname, self.__dict__)
821 processPSet.addVString(
False,
"@filters_on_endpaths", endpathValidator.filtersOnEndpaths)
823 def prune(self,verbose=False,keepUnresolvedSequencePlaceholders=False):
824 """ Remove clutter from the process that we think is unnecessary:
825 tracked PSets, VPSets and unused modules and sequences. If a Schedule has been set, then Paths and EndPaths
826 not in the schedule will also be removed, along with an modules and sequences used only by
827 those removed Paths and EndPaths."""
836 for x
in self.paths.itervalues():
837 x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
838 for x
in self.endpaths.itervalues():
839 x.resolve(self.__dict__,keepUnresolvedSequencePlaceholders)
841 unneededPaths = set()
843 usedModules=set(self.
schedule_().moduleNames())
845 schedNames = set(( x.label_()
for x
in self.
schedule_()))
846 names = set(self.
paths)
848 unneededPaths = names - schedNames
849 for n
in unneededPaths:
852 pths =
list(self.paths.itervalues())
853 pths.extend(self.endpaths.itervalues())
855 usedModules=set(temp.moduleNames())
862 for p
in self.paths.itervalues():
864 for p
in self.endpaths.itervalues():
866 keepSeqSet = set(( s
for s
in seqs
if s.hasLabel_()))
867 availableSeqs = set(self.sequences.itervalues())
868 unneededSeqs = availableSeqs-keepSeqSet
869 unneededSeqLabels = []
870 for s
in unneededSeqs:
871 unneededSeqLabels.append(s.label_())
872 delattr(self,s.label_())
874 print "prune removed the following:"
875 print " modules:"+
",".
join(unneededModules)
876 print " sequences:"+
",".
join(unneededSeqLabels)
877 print " paths/endpaths:"+
",".
join(unneededPaths)
879 moduleNames = set(d.keys())
880 junk = moduleNames - scheduledNames
886 """Used by the framework to convert python to C++ objects"""
887 class ServiceInjectorAdaptor(object):
891 def addService(self,pset):
892 self.__thelist.append(pset)
894 return self.__processPSet.newPSet()
898 class TopLevelPSetAcessorAdaptor(object):
902 def __getattr__(self,attr):
903 return getattr(self.
__ppset,attr)
904 def getTopPSet_(self,label):
907 return TopLevelPSetAcessorAdaptor(self.__ppset.newPSet(),self.
__process)
908 def addPSet(self,tracked,name,ppset):
909 return self.__ppset.addPSet(tracked,name,self.__extractPSet(ppset))
910 def addVPSet(self,tracked,name,vpset):
911 return self.__ppset.addVPSet(tracked,name,[self.__extractPSet(x)
for x
in vpset])
912 def __extractPSet(self,pset):
913 if isinstance(pset,TopLevelPSetAcessorAdaptor):
918 processPSet.addString(
True,
"@process_name", self.
name_())
923 adaptor = TopLevelPSetAcessorAdaptor(processPSet,self)
938 getattr(self,n).insertInto(ServiceInjectorAdaptor(adaptor,services))
939 adaptor.addVPSet(
False,
"services",services)
949 def prefer(self, esmodule,*args,**kargs):
950 """Prefer this ES source or producer. The argument can
951 either be an object label, e.g.,
952 process.prefer(process.juicerProducer) (not supported yet)
953 or a name of an ESSource or ESProducer
954 process.prefer("juicer")
955 or a type of unnamed ESSource or ESProducer
956 process.prefer("JuicerProducer")
957 In addition, you can pass as a labelled arguments the name of the Record you wish to
958 prefer where the type passed is a cms.vstring and that vstring can contain the
959 name of the C++ types in the Record that are being preferred, e.g.,
960 #prefer all data in record 'OrangeRecord' from 'juicer'
961 process.prefer("juicer", OrangeRecord=cms.vstring())
963 #prefer only "Orange" data in "OrangeRecord" from "juicer"
964 process.prefer("juicer", OrangeRecord=cms.vstring("Orange"))
966 #prefer only "Orange" data with label "ExtraPulp" in "OrangeRecord" from "juicer"
967 ESPrefer("ESJuicerProd", OrangeRecord=cms.vstring("Orange/ExtraPulp"))
970 if isinstance(esmodule, ESSource)
or isinstance(esmodule, ESProducer):
971 raise RuntimeError(
"Syntax of process.prefer(process.esmodule) not supported yet")
972 elif self._findPreferred(esmodule, self.es_producers_(),*args,**kargs)
or \
973 self._findPreferred(esmodule, self.es_sources_(),*args,**kargs):
976 raise RuntimeError(
"Cannot resolve prefer for "+repr(esmodule))
981 typ = d[esname].type_()
990 for name, value
in d.iteritems():
991 if value.type_() == esname:
993 raise RuntimeError(
"More than one ES module for "+esname)
1001 if isinstance(process, Process):
1003 elif isinstance(process, str):
1006 raise TypeError(
'a ProcessFragment can only be constructed from an existig Process or from process name')
1008 return [ x
for x
in dir(self.
__process)
if isinstance(getattr(self.
__process, x), _ConfigureComponent) ]
1010 if name ==
'_ProcessFragment__process':
1011 return object.__getattribute__(self,
'_ProcessFragment__process')
1015 if name ==
'_ProcessFragment__process':
1016 object.__setattr__(self, name, value)
1020 if name ==
'_ProcessFragment__process':
1027 """a dictionary with fixed keys"""
1029 raise AttributeError(
"An FilteredStream defintion cannot be modified after creation.")
1030 _blocked_attribute = property(_blocked_attribute)
1031 __setattr__ = __delitem__ = __setitem__ = clear = _blocked_attribute
1032 pop = popitem = setdefault = update = _blocked_attribute
1034 new = dict.__new__(cls)
1035 dict.__init__(new, *args, **kw)
1038 if keys != [
'content',
'dataTier',
'name',
'paths',
'responsible',
'selectEvents']:
1039 raise ValueError(
"The needed parameters are: content, dataTier, name, paths, responsible, selectEvents")
1040 if not isinstance(kw[
'name'],str):
1041 raise ValueError(
"name must be of type string")
1042 if not isinstance(kw[
'content'], vstring)
and not isinstance(kw[
'content'],str):
1043 raise ValueError(
"content must be of type vstring or string")
1044 if not isinstance(kw[
'dataTier'], string):
1045 raise ValueError(
"dataTier must be of type string")
1046 if not isinstance(kw[
'selectEvents'], PSet):
1047 raise ValueError(
"selectEvents must be of type PSet")
1048 if not isinstance(kw[
'paths'],(tuple, Path)):
1049 raise ValueError(
"'paths' must be a tuple of paths")
1054 return "FilteredStream object: %s" %self[
"name"]
1059 """Allows embedding another process within a parent process. This allows one to
1060 chain processes together directly in one cmsRun job rather than having to run
1061 separate jobs that are connected via a temporary file.
1063 def __init__(self,process, SelectEvents = untracked.PSet(), outputCommands = untracked.vstring()):
1066 if not isinstance(process, Process):
1067 raise ValueError(
"the 'process' argument must be of type cms.Process")
1068 if not isinstance(SelectEvents,PSet):
1069 raise ValueError(
"the 'SelectEvents' argument must be of type cms.untracked.PSet")
1070 if not isinstance(outputCommands,vstring):
1071 raise ValueError(
"the 'outputCommands' argument must be of type cms.untracked.vstring")
1076 out =
"parentProcess"+str(
hash(self))+
" = process\n"
1077 out += self.__process.dumpPython()
1078 out +=
"childProcess = process\n"
1079 out +=
"process = parentProcess"+str(
hash(self))+
"\n"
1080 out +=
"process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = "+self.__SelectEvents.dumpPython(options) +
", outputCommands = "+self.__outputCommands.dumpPython(options) +
"))"
1083 return self.__process.name_()
1095 process._placeSubProcess(
'subProcess',self)
1097 topPSet = parameterSet.newPSet()
1098 self.__process.fillProcessDesc(topPSet)
1099 subProcessPSet = parameterSet.newPSet()
1100 self.__SelectEvents.insertInto(subProcessPSet,
"SelectEvents")
1101 self.__outputCommands.insertInto(subProcessPSet,
"outputCommands")
1102 subProcessPSet.addPSet(
False,
"process",topPSet)
1103 return subProcessPSet
1106 """Helper class for Modifier that takes key/value pairs and uses them to reset parameters of the object"""
1111 for k
in self.__args.iterkeys():
1113 params[k] = getattr(obj,k)
1115 params[k] = self.
__args[k]
1117 for k
in self.__args.iterkeys():
1119 setattr(obj,k,params[k])
1124 raise KeyError(
"Unknown parameter name "+k+
" specified while calling Modifier")
1127 """A modifier which only applies if multiple Modifiers are chosen"""
1132 return self.__lhs.isChosen()
and self.__rhs.isChosen()
1136 self.__lhs.toModify(obj,func, **kw)
1138 """This is used to create a ProcessModifer that can perform actions on the process as a whole.
1139 This takes as argument a callable object (e.g. function) that takes as its sole argument an instance of Process.
1140 In order to work, the value returned from this function must be assigned to a uniquely named variable."""
1148 """This class is used to define standard modifications to a Process.
1149 An instance of this class is declared to denote a specific modification,e.g. era2017 could
1150 reconfigure items in a process to match our expectation of running in 2017. Once declared,
1151 these Modifier instances are imported into a configuration and items that need to be modified
1152 are then associated with the Modifier and with the action to do the modification.
1153 The registered modifications will only occur if the Modifier was passed to
1154 the cms.Process' constructor.
1160 """This is used to create a ProcessModifer that can perform actions on the process as a whole.
1161 This takes as argument a callable object (e.g. function) that takes as its sole argument an instance of Process.
1162 In order to work, the value returned from this function must be assigned to a uniquely named variable.
1166 """This is used to register an action to be performed on the specific object. Two different forms are allowed
1167 Form 1: A callable object (e.g. function) can be passed as the second. This callable object is expected to take one argument
1168 that will be the object passed in as the first argument.
1169 Form 2: A list of parameter name, value pairs can be passed
1170 mod.toModify(foo, fred=cms.int32(7), barney = cms.double(3.14))
1171 This form can also be used to remove a parameter by passing the value of None
1172 #remove the parameter foo.fred
1173 mod.toModify(foo, fred = None)
1174 Additionally, parameters embedded within PSets can also be modified using a dictionary
1175 #change foo.fred.pebbles to 3 and foo.fred.friend to "barney"
1176 mod.toModify(foo, fred = dict(pebbles = 3, friend = "barney)) )
1178 if func
is not None and len(kw) != 0:
1179 raise TypeError(
"toModify takes either two arguments or one argument and key/value pairs")
1182 if func
is not None:
1188 """If the Modifier is chosen the internals of toObj will be associated with the internals of fromObj
1190 if type(fromObj) != type(toObj):
1191 raise TypeError(
"toReplaceWith requires both arguments to be the same class type")
1194 if isinstance(fromObj,_ModuleSequenceType):
1195 toObj._seq = fromObj._seq
1196 elif isinstance(fromObj,_Parameterizable):
1198 for p
in toObj.parameterNames_():
1200 for p
in fromObj.parameterNames_():
1201 setattr(toObj,p,getattr(fromObj,p))
1202 if isinstance(fromObj,_TypedParameterizable):
1203 toObj._TypedParameterizable__type = fromObj._TypedParameterizable__type
1206 raise TypeError(
"toReplaceWith does not work with type "+str(type(toObj)))
1209 """Should only be called by cms.Process instances"""
1218 """A Modifier made up of a list of Modifiers
1224 """Should only be called by cms.Process instances
1225 applies list of accumulated changes to the process"""
1227 m._applyNewProcessModifiers(process)
1229 """Should only be called by cms.Process instances"""
1237 """A class used by a Modifier to affect an entire Process instance.
1238 When a Process 'loads' a module containing a ProcessModifier, that
1239 ProcessModifier will be applied to the Process if and only if the
1240 Modifier passed to the constructor has been chosen.
1247 if self.__modifier.isChosen():
1250 self.__seenProcesses.add(process)
1252 if __name__==
"__main__":
1257 """Has same interface as the C++ object that creates PSets
1262 self.
values[label]=(tracked,value)
1320 """Nothing to do """
1324 self.assertEqual(len(p.parameterNames_()),0)
1326 self.assert_(
'a' in p.parameterNames_())
1327 self.assertEqual(p.a.value(), 1)
1329 self.assertEqual(p.a.value(), 10)
1331 self.assertEqual(p.a.value(), 1)
1332 self.failIf(p.a.isTracked())
1333 p.a = untracked.int32(1)
1334 self.assertEqual(p.a.value(), 1)
1335 self.failIf(p.a.isTracked())
1337 self.assertEqual(p.foo.value(), 10)
1338 self.assertEqual(p.bar.value(),1.0)
1339 self.failIf(p.bar.isTracked())
1340 self.assertRaises(TypeError,setattr,(p,
'c',1))
1342 self.assertEqual(p.a.foo.value(),10)
1343 self.assertEqual(p.a.bar.value(),1.0)
1345 self.assertEqual(p.b.fii.value(),1)
1346 self.failIf(p.b.isTracked())
1351 self.assertEqual(p.a.value(),11)
1353 self.assertEqual(p.a.value(),12)
1354 self.assertEqual(v.value(),12)
1360 self.assertNotEqual(p.b,other.b)
1365 self.assert_(
'a' in p.analyzers_() )
1366 self.assert_(
'a' in p.analyzers)
1367 p.add_(
Service(
"MessageLogger"))
1368 self.assert_(
'MessageLogger' in p.services_())
1369 self.assertEqual(p.MessageLogger.type_(),
"MessageLogger")
1371 self.assert_(
'Tracer' in p.services_())
1372 self.assertRaises(TypeError, setattr, *(p,
'b',
"this should fail"))
1373 self.assertRaises(TypeError, setattr, *(p,
'bad',
Service(
"MessageLogger")))
1374 self.assertRaises(ValueError, setattr, *(p,
'bad',
Source(
"PoolSource")))
1376 self.assertEqual(p.out.type_(),
'Outer')
1377 self.assert_(
'out' in p.outputModules_() )
1380 self.assert_(
'geom' in p.es_sources_())
1382 self.assert_(
'ConfigDB' in p.es_sources_())
1385 self.assert_(
'aliasfoo1' in p.aliases_())
1388 class FromArg(object):
1389 def __init__(self,*arg,**args):
1390 for name
in args.iterkeys():
1391 self.__dict__[name]=args[name]
1410 self.assertEqual(p.a.type_(),
"MyAnalyzer")
1411 self.assertEqual(p.a.label_(),
"a")
1412 self.assertRaises(AttributeError,getattr,p,
'b')
1413 self.assertEqual(p.Full.type_(),
"Full")
1414 self.assertEqual(str(p.c),
'a')
1415 self.assertEqual(str(p.d),
'a')
1430 self.assertRaises(ValueError, p1.extend, z1)
1439 aaa=copy.deepcopy(a),
1440 s4=copy.deepcopy(s3),
1447 self.assertEqual(p2.s4.label_(),
"s4")
1449 self.assertRaises(ValueError, p2.s4.setLabel,
"foo")
1450 p2.s4.setLabel(
"s4")
1451 p2.s4.setLabel(
None)
1452 p2.s4.setLabel(
"foo")
1453 p2._Process__setObjectLabel(p2.s4,
"foo")
1454 p2._Process__setObjectLabel(p2.s4,
None)
1455 p2._Process__setObjectLabel(p2.s4,
"bar")
1467 """import FWCore.ParameterSet.Config as cms
1469 process = cms.Process("test")
1471 process.a = cms.EDAnalyzer("MyAnalyzer")
1474 process.s = cms.Sequence(process.a)
1477 process.r = cms.Sequence(process.s)
1480 process.p = cms.Path(process.a)
1483 process.p2 = cms.Path(process.s)
1486 process.schedule = cms.Schedule(*[ process.p2, process.p ])
1499 """import FWCore.ParameterSet.Config as cms
1501 process = cms.Process("test")
1503 process.a = cms.EDAnalyzer("MyAnalyzer")
1506 process.b = cms.EDAnalyzer("YourAnalyzer")
1509 process.r = cms.Sequence(process.a)
1512 process.s = cms.Sequence(process.r)
1515 process.p = cms.Path(process.a)
1518 process.p2 = cms.Path(process.r)
1521 process.schedule = cms.Schedule(*[ process.p2, process.p ])
1533 """import FWCore.ParameterSet.Config as cms
1535 process = cms.Process("test")
1537 process.a = cms.EDAnalyzer("MyAnalyzer")
1540 process.r = cms.Sequence((process.a))
1543 process.p = cms.Path(process.a)
1546 process.p2 = cms.Path(process.r)
1549 process.schedule = cms.Schedule(*[ process.p2, process.p ])
1555 self.assertEqual(p.dumpPython().
replace(
'\n',
''),
'import FWCore.ParameterSet.Config as cmsprocess = cms.Process("test")process.a = cms.SecSource("MySecSource")')
1563 p.p =
Path(p.c+p.s+p.a)
1565 p.globalReplace(
"a",new)
1573 self.assertEqual(str(p.s),
'a+b')
1574 self.assertEqual(p.s.label_(),
's')
1575 path =
Path(p.c+p.s)
1576 self.assertEqual(str(path),
'c+a+b')
1577 p._validateSequence(path,
'p1')
1579 p2 =
Path(p.c+p.s*notInProcess)
1580 self.assertRaises(RuntimeError, p._validateSequence, p2,
'p2')
1590 self.assertRaises(ValueError, p.__setattr__,
"y", testseq)
1600 self.assertEqual(str(path),
'a+b+c')
1601 path =
Path(p.a*p.b+p.c)
1602 self.assertEqual(str(path),
'a+b+c')
1605 path =
Path(p.a+ p.b*p.c)
1606 self.assertEqual(str(path),
'a+b+c')
1607 path =
Path(p.a*(p.b+p.c))
1608 self.assertEqual(str(path),
'a+b+c')
1609 path =
Path(p.a*(p.b+~p.c))
1610 self.assertEqual(str(path),
'a+b+~c')
1612 self.assertRaises(TypeError,Path,p.es)
1623 p.path =
Path(p.a*p.b)
1624 lookuptable = {id(a): p.a, id(b): p.b}
1628 self.assertEqual(str(path),str(p.path))
1641 self.assertEqual(s[0],p.path1)
1642 self.assertEqual(s[1],p.path2)
1644 self.assert_(
'b' in p.schedule.moduleNames())
1645 self.assert_(hasattr(p,
'b'))
1646 self.assert_(hasattr(p,
'c'))
1647 self.assert_(hasattr(p,
'd'))
1648 self.assert_(hasattr(p,
'path1'))
1649 self.assert_(hasattr(p,
'path2'))
1650 self.assert_(hasattr(p,
'path3'))
1652 self.assert_(
'b' in p.schedule.moduleNames())
1653 self.assert_(hasattr(p,
'b'))
1654 self.assert_(
not hasattr(p,
'c'))
1655 self.assert_(
not hasattr(p,
'd'))
1656 self.assert_(hasattr(p,
'path1'))
1657 self.assert_(hasattr(p,
'path2'))
1658 self.assert_(
not hasattr(p,
'path3'))
1665 self.assertRaises(RuntimeError,
lambda : p.setSchedule_(s) )
1674 self.assert_(
'a' in s.moduleNames())
1675 self.assert_(
'b' in s.moduleNames())
1676 self.assert_(
'c' in s.moduleNames())
1680 self.assert_(
'a' in s.moduleNames())
1681 self.assert_(
'b' in s.moduleNames())
1682 self.assert_(
'c' in s.moduleNames())
1691 self.assert_(p.schedule
is None)
1694 self.assertEqual(pths[keys[0]],p.path1)
1695 self.assertEqual(pths[keys[1]],p.path2)
1697 self.assert_(hasattr(p,
'a'))
1698 self.assert_(hasattr(p,
'b'))
1699 self.assert_(
not hasattr(p,
'c'))
1700 self.assert_(hasattr(p,
'path1'))
1701 self.assert_(hasattr(p,
'path2'))
1710 self.assert_(p.schedule
is None)
1713 self.assertEqual(pths[keys[1]],p.path1)
1714 self.assertEqual(pths[keys[0]],p.path2)
1721 self.assertEqual(p.modu.a.value(),1)
1722 self.assertEqual(p.modu.b.value(),2)
1727 self.assert_(
not a.isModified())
1729 self.assert_(a.isModified())
1731 self.assertEqual(p.a.a1.value(), 1)
1735 self.assertEqual(p.a.a1.value(), 2)
1744 self.assertRaises(ValueError, EDProducer,
'C', ps1, ps2)
1745 self.assertRaises(ValueError, EDProducer,
'C', ps1, a=
int32(3))
1753 p.bars.foos =
'Foosball'
1754 self.assertEqual(p.bars.foos,
InputTag(
'Foosball'))
1755 p.p =
Path(p.foos*p.bars)
1757 p.add_(
Service(
"MessageLogger"))
1763 p.prefer(
"ForceSource")
1765 self.assertEqual(p.dumpConfig(),
1767 es_module juicer = JuicerProducer {
1769 es_source = ForceSource {
1771 es_prefer = ForceSource {
1773 es_prefer juicer = JuicerProducer {
1777 p.prefer(
"juicer",fooRcd=
vstring(
"Foo"))
1778 self.assertEqual(p.dumpConfig(),
1780 es_module juicer = JuicerProducer {
1782 es_source = ForceSource {
1784 es_prefer = ForceSource {
1786 es_prefer juicer = JuicerProducer {
1794 self.assertEqual(p.dumpPython(),
1795 """import FWCore.ParameterSet.Config as cms
1797 process = cms.Process("Test")
1799 process.juicer = cms.ESProducer("JuicerProducer")
1802 process.ForceSource = cms.ESSource("ForceSource")
1805 process.prefer("ForceSource")
1807 process.prefer("juicer",
1808 fooRcd = cms.vstring('Foo')
1825 self.assertEqual(process.m.p.i.value(), 4)
1835 subProcess.p =
Path(subProcess.a)
1836 subProcess.add_(
Service(
"Foo"))
1837 process.addSubProcess(
SubProcess(subProcess))
1838 d = process.dumpPython()
1839 equalD =
"""import FWCore.ParameterSet.Config as cms
1841 process = cms.Process("Parent")
1843 parentProcess = process
1844 import FWCore.ParameterSet.Config as cms
1846 process = cms.Process("Child")
1848 process.a = cms.EDProducer("A")
1851 process.p = cms.Path(process.a)
1854 process.Foo = cms.Service("Foo")
1857 childProcess = process
1858 process = parentProcess
1859 process.addSubProcess(cms.SubProcess(process = childProcess, SelectEvents = cms.untracked.PSet(
1861 ), outputCommands = cms.untracked.vstring()))
1864 equalD = equalD.replace(
"parentProcess",
"parentProcess"+str(
hash(process.subProcesses_()[0])))
1865 self.assertEqual(d,equalD)
1867 process.fillProcessDesc(p)
1868 self.assertEqual((
True,[
'a']),p.values[
"subProcesses"][1][0].values[
"process"][1].values[
'@all_modules'])
1869 self.assertEqual((
True,[
'p']),p.values[
"subProcesses"][1][0].values[
"process"][1].values[
'@paths'])
1870 self.assertEqual({
'@service_type':(
True,
'Foo')}, p.values[
"subProcesses"][1][0].values[
"process"][1].values[
"services"][1][0].values)
1880 proc.fillProcessDesc(p)
1881 self.assertEqual((
True,1),p.values[
"ref"][1].values[
"a"])
1882 self.assertEqual((
True,1),p.values[
"ref3"][1].values[
"a"])
1883 self.assertEqual((
True,1),p.values[
"ref2"][1].values[
"a"])
1884 self.assertEqual((
True,1),p.values[
"ref2"][1].values[
"b"][1].values[
"a"])
1885 self.assertEqual((
True,1),p.values[
"ref4"][1][0].values[
"a"])
1886 self.assertEqual((
True,1),p.values[
"ref4"][1][1].values[
"a"])
1896 self.assert_(p.schedule
is None)
1899 self.assertEqual(pths[keys[0]],p.path1)
1900 self.assertEqual(pths[keys[1]],p.path2)
1902 p.pset2 = untracked.PSet(parA =
string(
"pset2"))
1904 p.vpset2 = untracked.VPSet()
1906 self.assert_(hasattr(p,
'a'))
1907 self.assert_(hasattr(p,
'b'))
1908 self.assert_(
not hasattr(p,
'c'))
1909 self.assert_(
not hasattr(p,
'd'))
1910 self.assert_(
not hasattr(p,
's'))
1911 self.assert_(hasattr(p,
'path1'))
1912 self.assert_(hasattr(p,
'path2'))
1929 p.path3 =
Path(p.b+p.s2)
1930 p.path4 =
Path(p.b+p.s3)
1931 p.schedule =
Schedule(p.path1,p.path2,p.path3)
1934 self.assertEqual(pths[keys[0]],p.path1)
1935 self.assertEqual(pths[keys[1]],p.path2)
1937 self.assert_(hasattr(p,
'a'))
1938 self.assert_(hasattr(p,
'b'))
1939 self.assert_(
not hasattr(p,
'c'))
1940 self.assert_(
not hasattr(p,
'd'))
1941 self.assert_(
not hasattr(p,
'e'))
1942 self.assert_(
not hasattr(p,
's'))
1943 self.assert_(hasattr(p,
's2'))
1944 self.assert_(
not hasattr(p,
's3'))
1945 self.assert_(hasattr(p,
'path1'))
1946 self.assert_(hasattr(p,
'path2'))
1947 self.assert_(hasattr(p,
'path3'))
1948 self.assert_(
not hasattr(p,
'path4'))
1956 self.assert_(hasattr(p,
'a'))
1957 self.assert_(hasattr(p,
'b'))
1958 self.assert_(hasattr(p,
's'))
1959 self.assert_(hasattr(p,
'pth'))
1965 p.prune(keepUnresolvedSequencePlaceholders=
True)
1966 self.assert_(hasattr(p,
'b'))
1967 self.assert_(hasattr(p,
's'))
1968 self.assert_(hasattr(p,
'pth'))
1969 self.assertEqual(p.s.dumpPython(
''),
'cms.Sequence(cms.SequencePlaceholder("a")+process.b)\n')
1976 m1.toModify(p.a,_mod_fred)
1977 self.assertEqual(p.a.fred.value(),2)
1979 m1.toModify(p.b, wilma = 2)
1980 self.assertEqual(p.b.wilma.value(),2)
1985 m1.toModify(p.a,_mod_fred)
1987 m1.toModify(p.b, wilma = 2)
1988 self.assertEqual(p.a.fred.value(),1)
1989 self.assertEqual(p.b.wilma.value(),1)
1994 m1.toModify(p.a, fred =
int32(2))
1995 p.b = p.a.clone(wilma =
int32(3))
1996 self.assertEqual(p.a.fred.value(),2)
1997 self.assertEqual(p.a.wilma.value(),1)
1998 self.assertEqual(p.b.fred.value(),2)
1999 self.assertEqual(p.b.wilma.value(),3)
2004 m1.toModify(p.a, fred =
None)
2005 self.assertEqual(hasattr(p.a,
"fred"),
False)
2006 self.assertEqual(p.a.wilma.value(),1)
2011 m1.toModify(p.a, wilma =
int32(2))
2012 self.assertEqual(p.a.fred.value(), 1)
2013 self.assertEqual(p.a.wilma.value(),2)
2018 m1.toModify(p.a, flintstones =
dict(fred =
int32(2)))
2019 self.assertEqual(p.a.flintstones.fred.value(),2)
2020 self.assertEqual(p.a.flintstones.wilma.value(),1)
2024 class ProcModifierMod(object):
2025 def __init__(self,modifier,func):
2027 class DummyMod(object):
2030 testMod = DummyMod()
2032 self.assert_(hasattr(p,
"a"))
2035 testProcMod = ProcModifierMod(m1,_rem_a)
2037 p.extend(testProcMod)
2038 self.assert_(
not hasattr(p,
"a"))
2043 testMod = DummyMod()
2045 m1.toModify(p.b, fred =
int32(3))
2047 testProcMod = ProcModifierMod(m1,_rem_a)
2048 p.extend(testProcMod)
2049 self.assert_(
not hasattr(p,
"a"))
2050 self.assertEqual(p.b.fred.value(),3)
2056 (m1 & m2).toModify(p.a, fred =
int32(2))
2057 self.assertEqual(p.a.fred, 1)
2062 (m1 & m2).toModify(p.a, fred =
int32(2))
2063 self.assertEqual(p.a.fred, 2)
2069 (m1 & m2 & m3).toModify(p.a, fred =
int32(2))
2070 self.assertEqual(p.a.fred, 2)
2078 m1.toReplaceWith(p.s,
Sequence(p.a+p.b))
2079 self.assertEqual(p.a.wilma.value(),3)
2080 self.assertEqual(p.a.type_(),
"YourAnalyzer")
2081 self.assertEqual(hasattr(p,
"fred"),
False)
2082 self.assertEqual(p.s.dumpPython(
""),
"cms.Sequence(process.a+process.b)\n")
2088 self.assertEqual(p.a.type_(),
"MyAnalyzer")
def _dumpConfigUnnamedList
def testProcessDumpPython
def _dumpConfigOptionallyNamedList
def _dumpPythonSubProcesses
def visit
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
def _insertSubProcessesInto
def _sequencesInDependencyOrder
def __findFirstSequenceUsingModule
static std::string join(char **cmd)
def _applyNewProcessModifiers
def _modifyParametersFromDict
def checkImportPermission
def testTypedParameterizable
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