The Gaudi Framework  master (37c0b60a)
SuperAlgorithm.py
Go to the documentation of this file.
1 
11 
12 # see implementation of Gaudi_Test_MySuperAlg in GaudiTestSuite/Configuration.py
13 from Configurables import AlgTimingAuditor, EventLoopMgr
14 from Configurables import Gaudi__TestSuite__EventCounter as GE_EventCounter
15 from Configurables import Gaudi_Test_MySuperAlg as MySuperAlg
16 from Configurables import GaudiTestSuiteCommonConf, HelloWorld, ParentAlg, StopperAlg
17 from Gaudi.Configuration import *
18 from GaudiConfig.ControlFlow import seq
19 
20 
23 
24 
25 GaudiTestSuiteCommonConf()
26 
27 s1 = MySuperAlg("s1", OutputLevel=INFO)
28 s2 = MySuperAlg("s2", OutputLevel=WARNING)
29 top = s1 >> s2
30 
31 MySuperAlg("s2", PercentPass=75, OutputLevel=DEBUG)
32 
33 # -----------------------------------------------------------------
34 # Testing the new GaudiSequencer
35 # -----------------------------------------------------------------
36 sand = HelloWorld("AND") & GE_EventCounter("ANDCounter")
37 sor = HelloWorld("OR") | GE_EventCounter("ORCounter")
38 
39 try:
40  MySuperAlg("AND")
41  raise RuntimeError("we should not be able to retype to SuperAlgorithm")
42 except AssertionError:
43  pass # it's expected
44 
45 all = ParentAlg() >> StopperAlg(StopCount=20) >> top >> sand >> sor
46 
47 print("# --- Configured Control Flow Expression:")
48 print("#", all)
49 print("# ---")
50 EventLoopMgr(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 
61 AuditorSvc().Auditors.append(AlgTimingAuditor("TIMER"))
AuditorSvc
Definition: AuditorSvc.h:28
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57