2004 testTask1 =
Task(edproducer, edfilter)
2005 self.assertRaises(RuntimeError, testTask1.add, edanalyzer)
2006 testTask1.add(essource, service)
2007 testTask1.add(essource, esproducer)
2008 testTask1.add(testTask2)
2009 coll = testTask1._collection
2010 self.assertTrue(edproducer
in coll)
2011 self.assertTrue(edfilter
in coll)
2012 self.assertTrue(service
in coll)
2013 self.assertTrue(essource
in coll)
2014 self.assertTrue(esproducer
in coll)
2015 self.assertTrue(testTask2
in coll)
2016 self.assertTrue(len(coll) == 6)
2017 self.assertTrue(len(testTask2._collection) == 0)
2021 taskContents.append(i)
2022 self.assertTrue(taskContents == [edproducer, edfilter, essource, service, esproducer, testTask2])
2027 process.mproducer = edproducer
2028 process.mproducer2 = edproducer2
2029 process.mfilter = edfilter
2030 process.messource = essource
2031 process.mesproducer = esproducer
2034 testTask3 =
Task(edproducer, edproducer2)
2035 testTask1.add(testTask3)
2036 process.myTask1 = testTask1
2043 testTask1.visit(visitor)
2044 self.assertTrue(l == set([
'mesproducer',
'mproducer',
'mproducer2',
'mfilter',
'd',
'messource']))
2045 l2 = testTask1.moduleNames
2046 self.assertTrue(l == set([
'mesproducer',
'mproducer',
'mproducer2',
'mfilter',
'd',
'messource']))
2048 testTask4 =
Task(edproducer3)
2050 self.assertRaises(RuntimeError, testTask4.visit, visitor)
2052 process.myTask4 = testTask4
2053 self.assertTrue(
False)
2054 except RuntimeError:
2057 testTask5 =
Task(service3)
2059 self.assertRaises(RuntimeError, testTask5.visit, visitor)
2061 process.myTask5 = testTask5
2062 self.assertTrue(
False)
2063 except RuntimeError:
2066 process.d = service3
2067 process.myTask5 = testTask5
2070 expectedDict = {
'myTask1' : testTask1,
'myTask5' : testTask5 }
2072 self.assertTrue(process.tasks == expectedFixedDict)
2073 self.assertTrue(process.tasks[
'myTask1'] == testTask1)
2074 self.assertTrue(process.myTask1 == testTask1)
2078 process.mproducer2 = edproducer4
2082 testTask1.visit(visitor1)
2084 expectedList = [edproducer,essource,esproducer,service,edfilter,edproducer,edproducer4]
2086 self.assertTrue(expectedList == l)
2088 process.myTask6 =
Task()
2089 process.myTask7 =
Task()
2090 process.mproducer8 = edproducer8
2091 process.myTask8 =
Task(process.mproducer8)
2092 process.myTask6.add(process.myTask7)
2093 process.myTask7.add(process.myTask8)
2094 process.myTask1.add(process.myTask6)
2095 process.myTask8.add(process.myTask5)
2097 testDict = process._itemsInDependencyOrder(process.tasks)
2098 expectedLabels = [
"myTask5",
"myTask8",
"myTask7",
"myTask6",
"myTask1"]
2099 expectedTasks = [process.myTask5, process.myTask8, process.myTask7, process.myTask6, process.myTask1]
2101 for testLabel, testTask
in testDict.items():
2102 self.assertTrue(testLabel == expectedLabels[index])
2103 self.assertTrue(testTask == expectedTasks[index])
2109 expectedPythonDump =
'cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer, process.mproducer2, process.myTask6)\n' 2110 self.assertTrue(pythonDump == expectedPythonDump)
2112 process.myTask5 =
Task()
2113 process.myTask100 =
Task()
2114 process.mproducer9 = edproducer9
2115 sequence1 =
Sequence(process.mproducer8, process.myTask1, process.myTask5, testTask2, testTask3)
2116 sequence2 =
Sequence(process.mproducer8 + process.mproducer9)
2117 process.sequence3 =
Sequence((process.mproducer8 + process.mfilter))
2119 process.path1 =
Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+sequence4)
2120 process.path1.associate(process.myTask1, process.myTask5, testTask2, testTask3)
2121 process.path11 =
Path(process.mproducer+process.mproducer8+sequence1+sequence2+process.sequence3+ sequence4,process.myTask1, process.myTask5, testTask2, testTask3, process.myTask100)
2122 process.path2 =
Path(process.mproducer)
2123 process.path3 =
Path(process.mproducer9+process.mproducer8,testTask2)
2125 self.assertTrue(process.path1.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)\n')
2127 self.assertTrue(process.path11.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
2132 process.path1.visit(nameVisitor)
2133 self.assertTrue(l == set([
'mproducer',
'd',
'mesproducer',
None,
'mproducer9',
'mproducer8',
'messource',
'mproducer2',
'mfilter']))
2134 self.assertTrue(process.path1.moduleNames() == set([
'mproducer',
'd',
'mesproducer',
None,
'mproducer9',
'mproducer8',
'messource',
'mproducer2',
'mfilter']))
2138 process.path21 = process.path11.copy()
2139 process.path21.replace(process.mproducer, process.mproducer10)
2141 self.assertTrue(process.path11.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer+process.mproducer8+cms.Sequence(process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask5)+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer), process.myTask1, process.myTask100, process.myTask5)\n')
2150 self.assertTrue(process.path21.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.sequence3, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.d, process.mesproducer, process.messource, process.mfilter, process.mproducer10, process.mproducer2, process.myTask6), process.myTask100, process.myTask5)\n')
2152 process.path22 = process.path21.copyAndExclude([process.d, process.mesproducer, process.mfilter])
2153 self.assertTrue(process.path22.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer10+process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None, process.mproducer10), cms.Task(process.messource, process.mproducer10, process.mproducer2, process.myTask6), process.myTask100, process.myTask5)\n')
2155 process.path23 = process.path22.copyAndExclude([process.messource, process.mproducer10])
2156 self.assertTrue(process.path23.dumpPython(
PrintOptions()) ==
'cms.Path(process.mproducer8+process.mproducer8+(process.mproducer8+process.mproducer9)+process.mproducer8, cms.Task(), cms.Task(process.None), cms.Task(process.mproducer2, process.myTask6), process.myTask100, process.myTask5)\n')
2165 process.path24 =
Path(process.a+process.b+process.c+process.d)
2166 process.path25 = process.path24.copyAndExclude([process.a,process.b,process.c])
2167 self.assertTrue(process.path25.dumpPython(
None) ==
'cms.Path(process.d)\n')
2172 process.path200.replace(process.c,process.b)
2173 process.path200.replace(process.e,process.f)
2174 self.assertEqual(process.path200.dumpPython(
None),
"cms.EndPath(process.b, cms.Task(process.f))\n")
2175 process.path200.replace(process.b,process.c)
2176 process.path200.replace(process.f,process.e)
2177 self.assertEqual(process.path200.dumpPython(
None),
"cms.EndPath(process.c, cms.Task(process.e))\n")
2178 process.path200.replace(process.c,process.a)
2179 process.path200.replace(process.e,process.g)
2180 self.assertEqual(process.path200.dumpPython(
None),
"cms.EndPath(process.a, cms.Task(process.g))\n")
2181 process.path200.replace(process.a,process.c)
2182 process.path200.replace(process.g,process.e)
2183 self.assertEqual(process.path200.dumpPython(
None),
"cms.EndPath(process.c, cms.Task(process.e))\n")
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