11 from __future__
import print_function
13 from Configurables
import AlgTimingAuditor, EventLoopMgr, GaudiExamplesCommonConf
22 GaudiExamplesCommonConf()
27 Example implementation of a SuperAlgorithm specialization with behaviour
28 depending on a property.
30 In this case the boolean option UseHelloWorld defines if the HelloWorld
31 instance has to be used or not.
36 self.__dict__[
"_hello_flag"] = kwargs.pop(
"UseHelloWorld",
True)
37 super(MySuperAlg, self).
__init__(*args, **kwargs)
52 Prepare the graph represented by the SuperAlgorithm.
54 from Configurables
import Gaudi__Examples__EventCounter
as EventCounter
55 from Configurables
import Gaudi__Examples__Prescaler
as Prescaler
56 from Configurables
import HelloWorld
58 p = self.
_makeAlg(Prescaler, name=
"Prescaler", PercentPass=50.0)
59 h = self.
_makeAlg(HelloWorld, name=
"HW")
60 c = self.
_makeAlg(EventCounter, name=
"Counter")
69 MySuperAlg(
"s2", PercentPass=75, OutputLevel=DEBUG, UseHelloWorld=
False)
71 print(
"# --- Configured Control Flow Expression:")
74 EventLoopMgr(PrintControlFlowExpression=
True)
81 ExtSvc=[
"ToolSvc",
"AuditorSvc",
"Gaudi::Monitoring::MessageSvcSink"],
85 AuditorSvc().Auditors.append(AlgTimingAuditor(
"TIMER"))