ATLAS Offline Software
Loading...
Searching...
No Matches
python.ComponentAccumulator Namespace Reference

Classes

class  ComponentAccumulator
class  ConfigurationError

Functions

 __exit ()
 printProperties (msg, c, nestLevel=0, printDefaults=False)
 filterComponents (comps, onlyComponents=[])
 startInteractive (localVarDic)
 printInteractiveMsg_init ()
 printInteractiveMsg_run ()
 conf2toConfigurable (*args, **kwargs)
 CAtoGlobalWrapper (*args, **kwargs)
 appendCAtoAthena (*args, **kwargs)

Function Documentation

◆ __exit()

python.ComponentAccumulator.__exit ( )
private

Definition at line 33 of file ComponentAccumulator.py.

33def __exit():
34 ComponentAccumulator._checkUnmerged = False

◆ appendCAtoAthena()

python.ComponentAccumulator.appendCAtoAthena ( * args,
** kwargs )

Definition at line 1257 of file ComponentAccumulator.py.

1257 def appendCAtoAthena(*args, **kwargs):
1258 raise RuntimeError("appendCAtoAthena cannot be called in a CA job")

◆ CAtoGlobalWrapper()

python.ComponentAccumulator.CAtoGlobalWrapper ( * args,
** kwargs )

Definition at line 1255 of file ComponentAccumulator.py.

1255 def CAtoGlobalWrapper(*args, **kwargs):
1256 raise RuntimeError("CAtoGlobalWrapper cannot be called in a CA job")

◆ conf2toConfigurable()

python.ComponentAccumulator.conf2toConfigurable ( * args,
** kwargs )

Definition at line 1253 of file ComponentAccumulator.py.

1253 def conf2toConfigurable(*args, **kwargs):
1254 raise RuntimeError("conf2toConfigurable cannot be called in a CA job")

◆ filterComponents()

python.ComponentAccumulator.filterComponents ( comps,
onlyComponents = [] )

Definition at line 63 of file ComponentAccumulator.py.

63def filterComponents (comps, onlyComponents = []):
64 ret = []
65 for c in comps:
66 if not onlyComponents or c.getName() in onlyComponents:
67 ret.append((c, True))
68 elif c.getName()+'-' in onlyComponents:
69 ret.append((c, False))
70 return ret
71
72

◆ printInteractiveMsg_init()

python.ComponentAccumulator.printInteractiveMsg_init ( )

Definition at line 1228 of file ComponentAccumulator.py.

1228def printInteractiveMsg_init():
1229 print("Interactive mode")
1230 print("\tThe ComponentAccumulator is known as 'self', you can inspect it but changes are not taken into account.")
1231 print("\tThe application is known as 'app' but not yet initialized.")
1232 print("\t^D will exit the interactive mode and athena will continue.")
1233 print("\texit() will terminate the program now.")
1234 return
1235
1236
void print(char *figname, TCanvas *c1)

◆ printInteractiveMsg_run()

python.ComponentAccumulator.printInteractiveMsg_run ( )

Definition at line 1237 of file ComponentAccumulator.py.

1237def printInteractiveMsg_run():
1238 print("Interactive mode")
1239 print("\tThe application is known as 'app' and initialized.")
1240 print("\tYou can process N events with 'app.run(N)'.")
1241 print("\tStoreGate is accessible as 'sg'.")
1242 print("\t^D will exit the interactive mode and athena will finalize.")
1243 return
1244
1245
1246# Make legacy support available in legacy jobs

◆ printProperties()

python.ComponentAccumulator.printProperties ( msg,
c,
nestLevel = 0,
printDefaults = False )

Definition at line 38 of file ComponentAccumulator.py.

38def printProperties(msg, c, nestLevel = 0, printDefaults=False):
39
40 # Dictionary of (default and) explicitly set values with latter taking precedence
41 props = {**c.getDefaultProperties(), **c._properties} if printDefaults else c._properties
42
43 for propname, propval in sorted(props.items()):
44
45 # Recursively expand these types:
46 if isinstance(propval, GaudiConfig2.Configurable):
47 msg.info("%s * %s: %s", " "*nestLevel, propname, propval.getFullJobOptName())
48 printProperties(msg, propval, nestLevel+3, printDefaults)
49
50 elif isinstance(propval, GaudiHandles.PrivateToolHandleArray):
51 msg.info( "%s * %s: PrivateToolHandleArray of size %s", " "*nestLevel, propname, len(propval))
52 for el in propval:
53 msg.info( "%s * %s/%s", " "*(nestLevel+3), el.__cpp_type__, el.getName())
54 printProperties(msg, el, nestLevel+6, printDefaults)
55
56 # Only print handle keys:
57 elif isinstance(propval, DataHandle):
58 propval = propval.Path
59
60 msg.info("%s * %s: %r", " "*nestLevel, propname, propval)
61
62

◆ startInteractive()

python.ComponentAccumulator.startInteractive ( localVarDic)
Setup and start a useful interactive session including auto-completion and history

Definition at line 1211 of file ComponentAccumulator.py.

1211def startInteractive(localVarDic):
1212 """Setup and start a useful interactive session including auto-completion and history"""
1213 import code
1214
1215 # collect all global and local variables
1216 vars = sys.modules['__main__'].__dict__
1217 vars.update(globals())
1218 vars.update(localVarDic)
1219
1220 # configure the prompt
1221 from AthenaCommon.Interactive import configureInteractivePrompt
1222 configureInteractivePrompt(vars)
1223
1224 # start the interpreter
1225 code.interact(local=vars)
1226
1227