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 209 of file Utilities.py.

Member Function Documentation

def Utilities.TestModuleCommand.setup (   self)

Definition at line 210 of file Utilities.py.

210  def setup(self):
211  None
def Utilities.TestModuleCommand.testConvertToSingleModuleEndPaths (   self)

Definition at line 374 of file Utilities.py.

References Utilities.convertToSingleModuleEndPaths().

375  import FWCore.ParameterSet.Config as cms
376  process = cms.Process("TEST")
377  process.a = cms.EDAnalyzer("A")
378  process.b = cms.EDAnalyzer("B")
379  process.c = cms.EDProducer("C")
380  process.ep = cms.EndPath(process.a+process.b,cms.Task(process.c))
381  self.assertEqual(process.ep.dumpPython(None),'cms.EndPath(process.a+process.b, cms.Task(process.c))\n')
383  self.assertEqual(False,hasattr(process,"ep"))
384  self.assertEqual(process.a_endpath.dumpPython(None),'cms.EndPath(process.a, cms.Task(process.c))\n')
385  self.assertEqual(process.b_endpath.dumpPython(None),'cms.EndPath(process.b, cms.Task(process.c))\n')
386 
387  unittest.main()
def convertToSingleModuleEndPaths(process)
Definition: Utilities.py:171
def testConvertToSingleModuleEndPaths(self)
Definition: Utilities.py:374
def Utilities.TestModuleCommand.testCreateTaskWithAllProducersAndFilters (   self)

Definition at line 349 of file Utilities.py.

References Utilities.createTaskWithAllProducersAndFilters().

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

Definition at line 212 of file Utilities.py.

213  import FWCore.ParameterSet.Config as cms
214  process = cms.Process("Test")
215 
216  process.f1 = cms.EDFilter("F1")
217  process.f2 = cms.EDFilter("F2")
218  process.f3 = cms.EDFilter("F3")
219  process.f4 = cms.EDFilter("F4")
220  process.f5 = cms.EDFilter("F5")
221  process.f6 = cms.EDFilter("F6")
222  process.t1 = cms.Task(process.f5)
223  process.t2 = cms.Task(process.f6)
224  process.s = cms.Sequence(process.f4, process.t1)
225 
226  process.p = cms.Path(process.f1+cms.ignore(process.f2)+process.f3+process.s, process.t2)
227  ignoreAllFiltersOnPath(process.p)
228  self.assertEqual(process.p.dumpPython(None),'cms.Path(cms.ignore(process.f1)+cms.ignore(process.f2)+cms.ignore(process.f3)+cms.ignore(process.f4), process.t1, process.t2)\n')
229 
def testIgnoreFiltersOnPath(self)
Definition: Utilities.py:212
def ignoreAllFiltersOnPath(path)
Definition: Utilities.py:1
def Utilities.TestModuleCommand.testNoSchedule (   self)

Definition at line 230 of file Utilities.py.

References Utilities.convertToUnscheduled().

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

Definition at line 291 of file Utilities.py.

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

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