The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
AlgSequencer.py
Go to the documentation of this file.
11
12from Configurables import AlgTimingAuditor, ApplicationMgr, AuditorSvc, EventLoopMgr
13from Configurables import Gaudi__TestSuite__EventCounter as EventCounter
14from Configurables import Gaudi__TestSuite__Prescaler as Prescaler
15from Configurables import GaudiTestSuiteCommonConf, HelloWorld, ParentAlg, StopperAlg
16from Gaudi.Configuration import DEBUG
17from GaudiConfig.ControlFlow import seq
18
19
22
23
24GaudiTestSuiteCommonConf()
25
26# --------------------------------------------------------------
27# Testing Sequencers
28# --------------------------------------------------------------
29p1 = Prescaler("Prescaler1", PercentPass=50.0)
30p2 = Prescaler("Prescaler2", PercentPass=10.0)
31h = HelloWorld(OutputLevel=DEBUG)
32c1 = EventCounter("Counter1")
33c2 = EventCounter("Counter2")
34
35s1 = seq(p1 & h & c1)
36s2 = seq(p2 & h & c2)
37top = s1 >> s2
38# s1 = Sequencer('Sequence1', Members = [p1, h, c1] )
39# s2 = Sequencer('Sequence2', Members = [p2, h, c2] )
40# top = Sequencer('TopSequence', Members = [s1, s2], ShortCircuit = False )
41
42# -----------------------------------------------------------------
43# Testing the new GaudiSequencer
44# -----------------------------------------------------------------
45sand = HelloWorld("AND") & EventCounter("ANDCounter")
46sor = HelloWorld("OR") | EventCounter("ORCounter")
47# sand = GaudiSequencer( 'ANDSequence',
48# Members = [ HelloWorld('AND'), EventCounter('ANDCounter') ],
49# MeasureTime = 1 )
50# sor = GaudiSequencer( 'ORSequence',
51# Members = [ HelloWorld('OR'), EventCounter('ORCounter') ],
52# MeasureTime = 1,
53# ModeOR = 1 )
54
55all = ParentAlg() >> StopperAlg(StopCount=20) >> top >> sand >> sor
56
57print("# --- Configured Control Flow Expression:")
58print("#", all)
59print("# ---")
60EventLoopMgr(PrintControlFlowExpression=True)
61# -----------------------------------------------------------------
63 TopAlg=[all],
64 EvtMax=10, # events to be processed (default is 10)
65 EvtSel="NONE", # do not use any event input
66 ExtSvc=["ToolSvc", "AuditorSvc", "Gaudi::Monitoring::MessageSvcSink"],
67 AuditAlgorithms=True,
68)
69
70AuditorSvc().Auditors += [AlgTimingAuditor("TIMER")]
The Application Manager class.
This service manages Auditors.
Definition AuditorSvc.h:22
Class definition of EventLoopMgr.
Trivial Algorithm for tutotial purposes.
Definition HelloWorld.h:23
Trivial Algorithm for tutotial purposes.
Definition ParentAlg.h:21