The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
AlgTools.py
Go to the documentation of this file.
14from Configurables import GaudiTestSuiteCommonConf, MyAlgorithm, MyTool
15from Gaudi.Configuration import *
16
17GaudiTestSuiteCommonConf()
18
19myalg = MyAlgorithm("MyAlg")
20
21myalg.addTool(MyTool(Int=101, Double=101.1e10, String="hundred one", Bool=False))
22
23gtool = MyTool(
24 "MyTool",
25 Int=201,
26 Double=201.1e10,
27 String="two hundred and one",
28 Bool=True,
29 OutputLevel=INFO,
30)
31
32tool_conf1 = MyTool(
33 "MyTool_conf1", Int=1, Double=2, String="three", Bool=True, OutputLevel=INFO
34)
35
36tool_conf2 = MyTool(
37 "MyTool_conf2", Int=10, Double=20, String="xyz", Bool=False, OutputLevel=INFO
38)
39
40myToolWithName = myalg.addTool(tool_conf2, "ToolWithName")
41
42myalg.ToolWithName.String = "xyz"
43
44assert myToolWithName.String == "xyz"
45assert myalg.ToolWithName == myToolWithName
46
47myToolWithName.String = "abc"
48
49myalg.PrivToolHandle.String = "Is a private tool"
50
51pubtool = MyTool("TestPubToolHandle", String="Is a public tool")
52myalg.PubToolHandle = pubtool
53
54# disable a ToolHandle
55myalg.InvalidToolHandle = ""
56
57ApplicationMgr(EvtMax=10, EvtSel="NONE", HistogramPersistency="NONE", TopAlg=[myalg])
58# --------------------------------------------------------------
59# Test circular tool dependencies (by Chris Jones)
60# --------------------------------------------------------------
61from Configurables import TestTool, TestToolAlg
62
63tA = TestTool("ToolA", Tools=["TestTool/ToolB"], OutputLevel=DEBUG)
64tB = TestTool("ToolB", Tools=["TestTool/ToolA"], OutputLevel=DEBUG)
65testalg = TestToolAlg(Tools=["TestTool/ToolA"])
66ApplicationMgr().TopAlg += [testalg]
The Application Manager class.
Trivial Algorithm for tutorial purposes.
Definition MyAlgorithm.h:21
This is an interface class for a example tool.
Definition MyTool.h:23