ATLAS Offline Software
Functions | Variables
HelloWorldConfig Namespace Reference

Functions

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

Variables

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

Function Documentation

◆ HelloWorldCfg()

def HelloWorldConfig.HelloWorldCfg (   flags)

Definition at line 28 of file HelloWorldConfig.py.

28 def 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(
56  )
57 
58  # add the algorithm to the result
59  result.addEventAlgo(alg)
60  return result
61 
62 

◆ HelloWorldPublicToolCfg()

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

Definition at line 17 of file HelloWorldConfig.py.

17 def 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()

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

Definition at line 8 of file HelloWorldConfig.py.

8 def 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.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
HelloWorldConfig.HelloWorldPublicToolCfg
def HelloWorldPublicToolCfg(flags, name="PublicHello", **kwargs)
Definition: HelloWorldConfig.py:17
HelloWorldConfig.HelloWorldToolCfg
def HelloWorldToolCfg(flags, name="HelloTool", **kwargs)
Definition: HelloWorldConfig.py:8
HelloWorldConfig.HelloWorldCfg
def HelloWorldCfg(flags)
Definition: HelloWorldConfig.py:28