ATLAS Offline Software
Loading...
Searching...
No Matches
HelloWorldConfig Namespace Reference

Functions

 HelloWorldToolCfg (flags, name="HelloTool", **kwargs)
 HelloWorldPublicToolCfg (flags, name="PublicHello", **kwargs)
 HelloWorldCfg (flags)

Variables

 flags = initConfigFlags()
 MaxEvents
 cfg = MainServicesCfg(flags)

Function Documentation

◆ HelloWorldCfg()

HelloWorldConfig.HelloWorldCfg ( flags)

Definition at line 28 of file HelloWorldConfig.py.

28def HelloWorldCfg(flags):
29 result = ComponentAccumulator()
30
31 alg = CompFactory.HelloAlg("HelloWorld",
32 # Set an int from a flag
33 MyInt=flags.Input.JobNumber,
34 # Set a boolean property (False, True, 0, 1)
35 MyBool=True,
36 # Set a double property
37 MyDouble=3.14159,
38 # Set a vector of strings property
39 MyStringVec=["Welcome", "to",
40 "Athena", "Framework", "Tutorial"],
41 # Set a map of strings to strings property
42 MyDict={"Bonjour": "Guten Tag",
43 "Good Morning": "Bonjour",
44 "one": "uno"},
45 # Set a table (a vector of pairs of doubles)
46 MyTable=[(1, 1), (2, 4), (3, 9)],
47 # Set a matrix (a vector of vectors) ...
48 MyMatrix=[[1, 2, 3],
49 [4, 5, 6]],
50 # set a private tool
51 MyPrivateHelloTool=result.popToolsAndMerge(
52 HelloWorldToolCfg(flags)),
53 # set a public tool
54 MyPublicHelloTool=result.getPrimaryAndMerge(
55 HelloWorldPublicToolCfg(flags)),
56 )
57
58 # add the algorithm to the result
59 result.addEventAlgo(alg)
60 return result
61
62

◆ HelloWorldPublicToolCfg()

HelloWorldConfig.HelloWorldPublicToolCfg ( flags,
name = "PublicHello",
** kwargs )

Definition at line 17 of file HelloWorldConfig.py.

17def HelloWorldPublicToolCfg(flags, name="PublicHello", **kwargs):
18 result = ComponentAccumulator()
19 # one can also set properties directly with creation
20 tool = CompFactory.HelloTool(name, MyMessage="Hello!", **kwargs)
21 # ...or after creation
22 tool.MyMessage = "A public Message!"
23 # add the tool to the result
24 result.addPublicTool(tool, primary=True)
25 return result
26
27

◆ HelloWorldToolCfg()

HelloWorldConfig.HelloWorldToolCfg ( flags,
name = "HelloTool",
** kwargs )

Definition at line 8 of file HelloWorldConfig.py.

8def HelloWorldToolCfg(flags, name="HelloTool", **kwargs):
9 result = ComponentAccumulator()
10 # one can use kwargs to set properties
11 kwargs.setdefault("MyMessage", "Hello World!")
12 # create and add the tool to the result (and pass arguments)
13 result.setPrivateTools(CompFactory.HelloTool(name, **kwargs))
14 return result
15
16

Variable Documentation

◆ cfg

HelloWorldConfig.cfg = MainServicesCfg(flags)

Definition at line 71 of file HelloWorldConfig.py.

◆ flags

HelloWorldConfig.flags = initConfigFlags()

Definition at line 66 of file HelloWorldConfig.py.

◆ MaxEvents

HelloWorldConfig.MaxEvents

Definition at line 67 of file HelloWorldConfig.py.