CMS 3D CMS Logo

TestProcess.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 class TestProcess(cms.Process):
4  def __init__(self,name="TEST",*modifiers):
5  super(TestProcess,self).__init__(name,*modifiers)
6  self.__dict__["_TestProcess__moduleToTest"] = None
7  def moduleToTest(self,mod,task=cms.Task()):
8  self.__dict__["_TestProcess__moduleToTest"] = mod
9  if isinstance(mod,cms.EDFilter):
10  self._test_path = cms.Path(mod,task)
11  else:
12  self._test_endpath = cms.EndPath(mod,task)
13  def fillProcessDesc(self, processPSet):
14  if self.__dict__["_TestProcess__moduleToTest"] is None:
15  raise RuntimeError("moduleToTest was not called")
16  for p in self.paths.iterkeys():
17  if p != "_test_path":
18  delattr(self,p)
19  for p in self.endpaths.iterkeys():
20  if p != "_test_endpath":
21  delattr(self,p)
22  if not hasattr(self,"options"):
23  self.options = cms.untracked.PSet()
24  cms.Process.fillProcessDesc(self,processPSet)
25  processPSet.addString(True, "@moduleToTest",self.__dict__["_TestProcess__moduleToTest"].label_())
def moduleToTest(self, mod, task=cms.Task())
Definition: TestProcess.py:7
def __init__(self, name="TEST", modifiers)
Definition: TestProcess.py:4
def fillProcessDesc(self, processPSet)
Definition: TestProcess.py:13