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 testIgnoreFiltersOnPath (self)
 
def testNoSchedule (self)
 
def testWithSchedule (self)
 

Detailed Description

Definition at line 168 of file Utilities.py.

Member Function Documentation

def Utilities.TestModuleCommand.setup (   self)

Definition at line 169 of file Utilities.py.

169  def setup(self):
170  None
def Utilities.TestModuleCommand.testIgnoreFiltersOnPath (   self)

Definition at line 171 of file Utilities.py.

172  import FWCore.ParameterSet.Config as cms
173  process = cms.Process("Test")
174 
175  process.f1 = cms.EDFilter("F1")
176  process.f2 = cms.EDFilter("F2")
177  process.f3 = cms.EDFilter("F3")
178  process.f4 = cms.EDFilter("F4")
179  process.f5 = cms.EDFilter("F5")
180  process.f6 = cms.EDFilter("F6")
181  process.t1 = cms.Task(process.f5)
182  process.t2 = cms.Task(process.f6)
183  process.s = cms.Sequence(process.f4, process.t1)
184 
185  process.p = cms.Path(process.f1+cms.ignore(process.f2)+process.f3+process.s, process.t2)
186  ignoreAllFiltersOnPath(process.p)
187  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')
188 
def testIgnoreFiltersOnPath(self)
Definition: Utilities.py:171
def ignoreAllFiltersOnPath(path)
Definition: Utilities.py:1
def Utilities.TestModuleCommand.testNoSchedule (   self)

Definition at line 189 of file Utilities.py.

References Utilities.convertToUnscheduled().

189  def testNoSchedule(self):
190  import FWCore.ParameterSet.Config as cms
191  process = cms.Process("TEST")
192 
193  process.a = cms.EDProducer("AProd")
194  process.b = cms.EDProducer("BProd")
195  process.c = cms.EDProducer("CProd")
196  process.d = cms.EDProducer("DProd")
197  process.m = cms.EDProducer("MProd")
198  process.n = cms.EDProducer("NProd")
199  process.r = cms.EDProducer("RProd")
200  process.s = cms.EDProducer("SProd")
201 
202  process.t1 = cms.Task(process.m)
203  t2 = cms.Task(process.n)
204 
205  process.f1 = cms.EDFilter("Filter")
206  process.f2 = cms.EDFilter("Filter2")
207  process.f3 = cms.EDFilter("Filter3")
208  process.f4 = cms.EDFilter("FIlter4")
209 
210  process.out1 = cms.OutputModule("Output1")
211  process.out2 = cms.OutputModule("Output2")
212 
213  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
214  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
215 
216  process.p1 = cms.Path(process.a+process.b+process.f1+process.analyzer1+cms.ignore(process.d)+cms.ignore(process.f2))
217  process.p4 = cms.Path(process.a+process.f2+process.b+~process.f1+cms.ignore(process.f4))
218  process.p2 = cms.Path(process.a+process.b)
219  process.p3 = cms.Path(process.f1, process.t1, t2)
220 
221  process.t3 = cms.Task(process.r)
222  process.t4 = cms.Task(process.s)
223  process.s1 = cms.Sequence(~process.a, process.t3)
224  process.p5 = cms.Path(process.b + process.s1, process.t4)
225  process.end1 = cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2+process.a+process.b+cms.ignore(process.f1))
226  process.end2 = cms.EndPath()
227  convertToUnscheduled(process)
228  self.assert_(hasattr(process,'p2'))
229  self.assert_(hasattr(process,'a'))
230  self.assert_(hasattr(process,'b'))
231  self.assert_(hasattr(process,'c'))
232  self.assert_(hasattr(process,'d'))
233  self.assert_(hasattr(process,'f1'))
234  self.assert_(hasattr(process,'f2'))
235  self.assert_(hasattr(process,'f3'))
236  self.assert_(hasattr(process,'f4'))
237  self.assert_(hasattr(process,'out1'))
238  self.assert_(hasattr(process,'out2'))
239  self.assert_(hasattr(process,'analyzer1'))
240  self.assert_(hasattr(process,'analyzer2'))
241 
242  self.assertEqual(process.p1.dumpPython(None),'cms.Path(process.f1+process.analyzer1, cms.Task(process.a, process.b, process.d, process.f2))\n')
243  self.assertEqual(process.p2.dumpPython(None),'cms.Path(cms.Task(process.a, process.b))\n')
244  self.assertEqual(process.p3.dumpPython(None),'cms.Path(process.f1, cms.Task(process.m, process.n))\n')
245  self.assertEqual(process.p4.dumpPython(None),'cms.Path(process.f2+~process.f1, cms.Task(process.a, process.b, process.f4))\n')
246  self.assertEqual(process.p5.dumpPython(None),'cms.Path(cms.Task(process.a, process.b), cms.Task(process.r, process.s))\n')
247  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')
248  self.assertEqual(process.end2.dumpPython(None),'cms.EndPath()\n')
249 
def convertToUnscheduled(proc)
Definition: Utilities.py:45
def Utilities.TestModuleCommand.testWithSchedule (   self)

Definition at line 250 of file Utilities.py.

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

250  def testWithSchedule(self):
251  import FWCore.ParameterSet.Config as cms
252  process = cms.Process("TEST")
253 
254  process.a = cms.EDProducer("AProd")
255  process.b = cms.EDProducer("BProd")
256  process.c = cms.EDProducer("CProd")
257  process.d = cms.EDProducer("DProd")
258  process.m = cms.EDProducer("MProd")
259  process.n = cms.EDProducer("NProd")
260 
261  process.t1 = cms.Task(process.m)
262  t2 = cms.Task(process.n)
263 
264  process.f1 = cms.EDFilter("Filter")
265  process.f2 = cms.EDFilter("Filter2")
266  process.f3 = cms.EDFilter("Filter3")
267  process.f4 = cms.EDFilter("Filter4")
268 
269  process.out1 = cms.OutputModule("Output1")
270  process.out2 = cms.OutputModule("Output2")
271 
272  process.analyzer1 = cms.EDAnalyzer("analyzerType1")
273  process.analyzer2 = cms.EDAnalyzer("analyzerType2")
274 
275  process.p1 = cms.Path(process.a+process.b+cms.ignore(process.f1)+process.d+process.f2)
276  process.p4 = cms.Path(process.a+process.f2+process.b+~process.f1)
277  process.p2 = cms.Path(process.a+process.b)
278  process.p3 = cms.Path(process.f1)
279  process.p5 = cms.Path(process.a+process.f4) #not used on schedule
280  process.end1 = cms.EndPath(process.out1+process.out2+process.analyzer1+process.analyzer2+process.a+process.b+cms.ignore(process.f1))
281  process.end2 = cms.EndPath()
282 
283  process.schedule = cms.Schedule(process.p1,process.p4,process.p2,process.p3,process.end1,process.end2,tasks=[process.t1,t2])
284  convertToUnscheduled(process)
285  self.assert_(hasattr(process,'p2'))
286  self.assert_(hasattr(process,'a'))
287  self.assert_(hasattr(process,'b'))
288  self.assert_(hasattr(process,'c'))
289  self.assert_(hasattr(process,'d'))
290  self.assert_(hasattr(process,'f1'))
291  self.assert_(hasattr(process,'f2'))
292  self.assert_(hasattr(process,'f3'))
293  self.assert_(hasattr(process,"f4"))
294  self.assert_(hasattr(process,"p5"))
295 
296  self.assertEqual(process.p1.dumpPython(None),'cms.Path(process.f2, cms.Task(process.a, process.b, process.d, process.f1))\n')
297  self.assertEqual(process.p2.dumpPython(None),'cms.Path(cms.Task(process.a, process.b))\n')
298  self.assertEqual(process.p3.dumpPython(None),'cms.Path(process.f1)\n')
299  self.assertEqual(process.p4.dumpPython(None),'cms.Path(process.f2+~process.f1, cms.Task(process.a, process.b))\n')
300  self.assertEqual(process.p5.dumpPython(None),'cms.Path(process.f4, cms.Task(process.a))\n')
301  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')
302  self.assertEqual(process.end2.dumpPython(None),'cms.EndPath()\n')
303 
304  self.assertEqual([p for p in process.schedule],[process.p1,process.p4,process.p2,process.p3,process.end1,process.end2])
305  listOfTasks = list(process.schedule._tasks)
306  self.assertEqual(listOfTasks, [process.t1,t2])
307 
308  unittest.main()
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