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 LogicError("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_())
edm::errors::LogicError
Definition: EDMException.h:37
TestProcess.TestProcess._test_path
_test_path
Definition: TestProcess.py:10
TestProcess.TestProcess._test_endpath
_test_endpath
Definition: TestProcess.py:12
TestProcess.TestProcess
Definition: TestProcess.py:3
TestProcess.TestProcess.options
options
Definition: TestProcess.py:23
TestProcess.TestProcess.moduleToTest
def moduleToTest(self, mod, task=cms.Task())
Definition: TestProcess.py:7
TestProcess.TestProcess.fillProcessDesc
def fillProcessDesc(self, processPSet)
Definition: TestProcess.py:13
TestProcess.TestProcess.__init__
def __init__(self, name="TEST", *modifiers)
Definition: TestProcess.py:4