The Gaudi Framework
v41r0 (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
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
# -----------------------------------------------------------------
53
ApplicationMgr
(
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"
))
ApplicationMgr
The Application Manager class.
Definition
ApplicationMgr.h:54
AuditorSvc
This service manages Auditors.
Definition
AuditorSvc.h:22
EventLoopMgr
Class definition of EventLoopMgr.
Definition
EventLoopMgr.h:43
HelloWorld
Trivial Algorithm for tutotial purposes.
Definition
HelloWorld.h:23
ParentAlg
Trivial Algorithm for tutotial purposes.
Definition
ParentAlg.h:21
Gaudi.Configuration
Definition
Configuration.py:1
AlgTimingAuditor
Definition
AlgTimingAuditor.cpp:22
StopperAlg
Definition
StopperAlg.cpp:14
GaudiTestSuite
options
ControlFlow
SuperAlgorithm.py
Generated on
for The Gaudi Framework by
1.17.0