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