The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
SuperAlgorithm.py
Go to the documentation of this file.
11
12# see implementation of Gaudi_Test_MySuperAlg in GaudiTestSuite/Configuration.py
13from Configurables import AlgTimingAuditor, EventLoopMgr
14from Configurables import Gaudi__TestSuite__EventCounter as GE_EventCounter
15from Configurables import Gaudi_Test_MySuperAlg as MySuperAlg
16from Configurables import GaudiTestSuiteCommonConf, HelloWorld, ParentAlg, StopperAlg
17from Gaudi.Configuration import *
18from GaudiConfig.ControlFlow import seq
19
20
23
24
25GaudiTestSuiteCommonConf()
26
27s1 = MySuperAlg("s1", OutputLevel=INFO)
28s2 = MySuperAlg("s2", OutputLevel=WARNING)
29top = s1 >> s2
30
31MySuperAlg("s2", PercentPass=75, OutputLevel=DEBUG)
32
33# -----------------------------------------------------------------
34# Testing the new GaudiSequencer
35# -----------------------------------------------------------------
36sand = HelloWorld("AND") & GE_EventCounter("ANDCounter")
37sor = HelloWorld("OR") | GE_EventCounter("ORCounter")
38
39try:
40 MySuperAlg("AND")
41 raise RuntimeError("we should not be able to retype to SuperAlgorithm")
42except AssertionError:
43 pass # it's expected
44
45all = ParentAlg() >> StopperAlg(StopCount=20) >> top >> sand >> sor
46
47print("# --- Configured Control Flow Expression:")
48print("#", all)
49print("# ---")
50EventLoopMgr(PrintControlFlowExpression=True)
51
52# -----------------------------------------------------------------
54 TopAlg=[all],
55 EvtMax=10, # events to be processed (default is 10)
56 EvtSel="NONE", # do not use any event input
57 ExtSvc=["ToolSvc", "AuditorSvc", "Gaudi::Monitoring::MessageSvcSink"],
58 AuditAlgorithms=True,
59)
60
61AuditorSvc().Auditors.append(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