CMS 3D CMS Logo

List of all members | Public Member Functions
Utilities.TestModuleCommand Class Reference
Inheritance diagram for Utilities.TestModuleCommand:

Public Member Functions

def setup (self)
 
def testConvertToSingleModuleEndPaths (self)
 
def testCreateTaskWithAllProducersAndFilters (self)
 
def testIgnoreFiltersOnPath (self)
 
def testNoSchedule (self)
 
def testWithSchedule (self)
 

Detailed Description

Definition at line 214 of file Utilities.py.

Member Function Documentation

◆ setup()

def Utilities.TestModuleCommand.setup (   self)

Definition at line 215 of file Utilities.py.

215  def setup(self):
216  None

◆ testConvertToSingleModuleEndPaths()

def Utilities.TestModuleCommand.testConvertToSingleModuleEndPaths (   self)

Definition at line 379 of file Utilities.py.

379  def testConvertToSingleModuleEndPaths(self):
380  import FWCore.ParameterSet.Config as cms
381  process = cms.Process("TEST")
382  process.a = cms.EDAnalyzer("A")
383  process.b = cms.EDAnalyzer("B")
384  process.c = cms.EDProducer("C")
385  process.ep = cms.EndPath(process.a+process.b,cms.Task(process.c))
386  self.assertEqual(process.ep.dumpPython(),'cms.EndPath(process.a+process.b, cms.Task(process.c))\n')
388  self.assertEqual(False,hasattr(process,"ep"))
389  self.assertEqual(process.a_endpath.dumpPython(),'cms.EndPath(process.a, cms.Task(process.c))\n')
390  self.assertEqual(process.b_endpath.dumpPython(),'cms.EndPath(process.b, cms.Task(process.c))\n')
391 
392  unittest.main()

References Utilities.convertToSingleModuleEndPaths().

◆ testCreateTaskWithAllProducersAndFilters()

def Utilities.TestModuleCommand.testCreateTaskWithAllProducersAndFilters (   self)

Definition at line 354 of file Utilities.py.

354  def testCreateTaskWithAllProducersAndFilters(self):
355 
356  import FWCore.ParameterSet.Config as cms
357  process = cms.Process("TEST")
358 
359  process.a = cms.EDProducer("AProd")
360  process.b = cms.EDProducer("BProd")
361  process.c = cms.EDProducer("CProd")
362 
363  process.f1 = cms.EDFilter("Filter")
364  process.f2 = cms.EDFilter("Filter2")
365  process.f3 = cms.EDFilter("Filter3")
366 
367  process.out1 = cms.OutputModule("Output1")
368  process.out2 = cms.OutputModule("Output2")
369 
370  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
371  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
372 
373  process.task = createTaskWithAllProducersAndFilters(process)
374  process.path = cms.Path(process.a, process.task)
375 
376  self.assertEqual(process.task.dumpPython(),'cms.Task(process.a, process.b, process.c, process.f1, process.f2, process.f3)\n')
377  self.assertEqual(process.path.dumpPython(),'cms.Path(process.a, process.task)\n')
378 

References Utilities.createTaskWithAllProducersAndFilters().

◆ testIgnoreFiltersOnPath()

def Utilities.TestModuleCommand.testIgnoreFiltersOnPath (   self)

Definition at line 217 of file Utilities.py.

217  def testIgnoreFiltersOnPath(self):
218  import FWCore.ParameterSet.Config as cms
219  process = cms.Process("Test")
220 
221  process.f1 = cms.EDFilter("F1")
222  process.f2 = cms.EDFilter("F2")
223  process.f3 = cms.EDFilter("F3")
224  process.f4 = cms.EDFilter("F4")
225  process.f5 = cms.EDFilter("F5")
226  process.f6 = cms.EDFilter("F6")
227  process.t1 = cms.Task(process.f5)
228  process.t2 = cms.Task(process.f6)
229  process.s = cms.Sequence(process.f4, process.t1)
230 
231  process.p = cms.Path(process.f1+cms.ignore(process.f2)+process.f3+process.s, process.t2)
232  ignoreAllFiltersOnPath(process.p)
233  self.assertEqual(process.p.dumpPython(),'cms.Path(cms.ignore(process.f1)+cms.ignore(process.f2)+cms.ignore(process.f3)+cms.ignore(process.f4), process.t1, process.t2)\n')
234 

◆ testNoSchedule()

def Utilities.TestModuleCommand.testNoSchedule (   self)

Definition at line 235 of file Utilities.py.

235  def testNoSchedule(self):
236  import FWCore.ParameterSet.Config as cms
237  process = cms.Process("TEST")
238 
239  process.a = cms.EDProducer("AProd")
240  process.b = cms.EDProducer("BProd")
241  process.c = cms.EDProducer("CProd")
242  process.d = cms.EDProducer("DProd")
243  process.m = cms.EDProducer("MProd")
244  process.n = cms.EDProducer("NProd")
245  process.r = cms.EDProducer("RProd")
246  process.s = cms.EDProducer("SProd")
247 
248  process.t1 = cms.Task(process.m)
249  t2 = cms.Task(process.n)
250 
251  process.f1 = cms.EDFilter("Filter")
252  process.f2 = cms.EDFilter("Filter2")
253  process.f3 = cms.EDFilter("Filter3")
254  process.f4 = cms.EDFilter("FIlter4")
255 
256  process.out1 = cms.OutputModule("Output1")
257  process.out2 = cms.OutputModule("Output2")
258 
259  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
260  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
261 
262  process.p1 = cms.Path(process.a+process.b+process.f1+process.analyzer1+cms.ignore(process.d)+cms.ignore(process.f2))
263  process.p4 = cms.Path(process.a+process.f2+process.b+~process.f1+cms.ignore(process.f4))
264  process.p2 = cms.Path(process.a+process.b)
265  process.p3 = cms.Path(process.f1, process.t1, t2)
266 
267  process.t3 = cms.Task(process.r)
268  process.t4 = cms.Task(process.s)
269  process.s1 = cms.Sequence(~process.a, process.t3)
270  process.p5 = cms.Path(process.b + process.s1, process.t4)
271  process.end1 = cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2+process.a+process.b+cms.ignore(process.f1))
272  process.end2 = cms.EndPath()
273  convertToUnscheduled(process)
274  self.assert_(hasattr(process,'p2'))
275  self.assert_(hasattr(process,'a'))
276  self.assert_(hasattr(process,'b'))
277  self.assert_(hasattr(process,'c'))
278  self.assert_(hasattr(process,'d'))
279  self.assert_(hasattr(process,'f1'))
280  self.assert_(hasattr(process,'f2'))
281  self.assert_(hasattr(process,'f3'))
282  self.assert_(hasattr(process,'f4'))
283  self.assert_(hasattr(process,'out1'))
284  self.assert_(hasattr(process,'out2'))
285  self.assert_(hasattr(process,'analyzer1'))
286  self.assert_(hasattr(process,'analyzer2'))
287 
288  self.assertEqual(process.p1.dumpPython(),'cms.Path(process.f1+process.analyzer1, cms.Task(process.a, process.b, process.d, process.f2))\n')
289  self.assertEqual(process.p2.dumpPython(),'cms.Path(cms.Task(process.a, process.b))\n')
290  self.assertEqual(process.p3.dumpPython(),'cms.Path(process.f1, cms.Task(process.m, process.n))\n')
291  self.assertEqual(process.p4.dumpPython(),'cms.Path(process.f2+~process.f1, cms.Task(process.a, process.b, process.f4))\n')
292  self.assertEqual(process.p5.dumpPython(),'cms.Path(cms.Task(process.a, process.b), cms.Task(process.r, process.s))\n')
293  self.assertEqual(process.end1.dumpPython(),'cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2, cms.Task(process.a, process.b, process.f1))\n')
294  self.assertEqual(process.end2.dumpPython(),'cms.EndPath()\n')
295 

References Utilities.convertToUnscheduled().

◆ testWithSchedule()

def Utilities.TestModuleCommand.testWithSchedule (   self)

Definition at line 296 of file Utilities.py.

296  def testWithSchedule(self):
297  import FWCore.ParameterSet.Config as cms
298  process = cms.Process("TEST")
299 
300  process.a = cms.EDProducer("AProd")
301  process.b = cms.EDProducer("BProd")
302  process.c = cms.EDProducer("CProd")
303  process.d = cms.EDProducer("DProd")
304  process.m = cms.EDProducer("MProd")
305  process.n = cms.EDProducer("NProd")
306 
307  process.t1 = cms.Task(process.m)
308  t2 = cms.Task(process.n)
309 
310  process.f1 = cms.EDFilter("Filter")
311  process.f2 = cms.EDFilter("Filter2")
312  process.f3 = cms.EDFilter("Filter3")
313  process.f4 = cms.EDFilter("Filter4")
314 
315  process.out1 = cms.OutputModule("Output1")
316  process.out2 = cms.OutputModule("Output2")
317 
318  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
319  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
320 
321  process.p1 = cms.Path(process.a+process.b+cms.ignore(process.f1)+process.d+process.f2)
322  process.p4 = cms.Path(process.a+process.f2+process.b+~process.f1)
323  process.p2 = cms.Path(process.a+process.b)
324  process.p3 = cms.Path(process.f1)
325  process.p5 = cms.Path(process.a+process.f4) #not used on schedule
326  process.end1 = cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2+process.a+process.b+cms.ignore(process.f1))
327  process.end2 = cms.EndPath()
328 
329  process.schedule = cms.Schedule(process.p1,process.p4,process.p2,process.p3,process.end1,process.end2,tasks=[process.t1,t2])
330  convertToUnscheduled(process)
331  self.assert_(hasattr(process,'p2'))
332  self.assert_(hasattr(process,'a'))
333  self.assert_(hasattr(process,'b'))
334  self.assert_(hasattr(process,'c'))
335  self.assert_(hasattr(process,'d'))
336  self.assert_(hasattr(process,'f1'))
337  self.assert_(hasattr(process,'f2'))
338  self.assert_(hasattr(process,'f3'))
339  self.assert_(hasattr(process,"f4"))
340  self.assert_(hasattr(process,"p5"))
341 
342  self.assertEqual(process.p1.dumpPython(),'cms.Path(process.f2, cms.Task(process.a, process.b, process.d, process.f1))\n')
343  self.assertEqual(process.p2.dumpPython(),'cms.Path(cms.Task(process.a, process.b))\n')
344  self.assertEqual(process.p3.dumpPython(),'cms.Path(process.f1)\n')
345  self.assertEqual(process.p4.dumpPython(),'cms.Path(process.f2+~process.f1, cms.Task(process.a, process.b))\n')
346  self.assertEqual(process.p5.dumpPython(),'cms.Path(process.f4, cms.Task(process.a))\n')
347  self.assertEqual(process.end1.dumpPython(),'cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2, cms.Task(process.a, process.b, process.f1))\n')
348  self.assertEqual(process.end2.dumpPython(),'cms.EndPath()\n')
349 
350  self.assertEqual([p for p in process.schedule],[process.p1,process.p4,process.p2,process.p3,process.end1,process.end2])
351  listOfTasks = list(process.schedule._tasks)
352  self.assertEqual(listOfTasks, [process.t1,t2])
353 

References Utilities.convertToUnscheduled(), and list().

Utilities.convertToUnscheduled
def convertToUnscheduled(proc)
Definition: Utilities.py:46
Utilities.ignoreAllFiltersOnPath
def ignoreAllFiltersOnPath(path)
Definition: Utilities.py:2
Utilities.createTaskWithAllProducersAndFilters
def createTaskWithAllProducersAndFilters(process)
Definition: Utilities.py:167
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
list
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
Utilities.convertToSingleModuleEndPaths
def convertToSingleModuleEndPaths(process)
Definition: Utilities.py:175