Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r7 (7f57a304)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 EventLoopMgr
15 from Configurables import Gaudi_Test_MySuperAlg as MySuperAlg
16 from Configurables import (
17  GaudiExamplesCommonConf,
18  HelloWorld,
19  ParentAlg,
20  StopperAlg,
21  TimingAuditor,
22 )
23 from Gaudi.Configuration import *
24 from GaudiConfig.ControlFlow import seq
25 
26 
29 
30 
31 GaudiExamplesCommonConf()
32 
33 s1 = MySuperAlg("s1", OutputLevel=INFO)
34 s2 = MySuperAlg("s2", OutputLevel=WARNING)
35 top = s1 >> s2
36 
37 MySuperAlg("s2", PercentPass=75, OutputLevel=DEBUG)
38 
39 # -----------------------------------------------------------------
40 # Testing the new GaudiSequencer
41 # -----------------------------------------------------------------
42 sand = HelloWorld("AND") & EventCounter("ANDCounter")
43 sor = HelloWorld("OR") | EventCounter("ORCounter")
44 
45 try:
46  MySuperAlg("AND")
47  raise RuntimeError("we should not be able to retype to SuperAlgorithm")
48 except AssertionError:
49  pass # it's expected
50 
51 all = ParentAlg() >> StopperAlg(StopCount=20) >> top >> sand >> sor
52 
53 print("# --- Configured Control Flow Expression:")
54 print("#", all)
55 print("# ---")
56 EventLoopMgr(PrintControlFlowExpression=True)
57 
58 # -----------------------------------------------------------------
60  TopAlg=[all],
61  EvtMax=10, # events to be processed (default is 10)
62  EvtSel="NONE", # do not use any event input
63  ExtSvc=["ToolSvc", "AuditorSvc"],
64  AuditAlgorithms=True,
65 )
66 
67 AuditorSvc().Auditors.append(TimingAuditor("TIMER"))
GaudiConfig.ControlFlow
Definition: ControlFlow.py:1
EventCounter
Definition: EventCounter.h:14
AuditorSvc
Definition: AuditorSvc.h:28
Gaudi.Configuration
Definition: Configuration.py:1
ApplicationMgr
Definition: ApplicationMgr.h:57