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

Classes

class  ConfigurationError
class  ComponentAccumulator

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

__exit ( )
private

Definition at line 34 of file ComponentAccumulator.py.

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

◆ appendCAtoAthena()

appendCAtoAthena ( * args,
** kwargs )

Definition at line 1267 of file ComponentAccumulator.py.

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

◆ CAtoGlobalWrapper()

CAtoGlobalWrapper ( * args,
** kwargs )

Definition at line 1265 of file ComponentAccumulator.py.

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

◆ conf2toConfigurable()

conf2toConfigurable ( * args,
** kwargs )

Definition at line 1263 of file ComponentAccumulator.py.

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

◆ filterComponents()

filterComponents ( comps,
onlyComponents = [] )

Definition at line 64 of file ComponentAccumulator.py.

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

◆ printInteractiveMsg_init()

printInteractiveMsg_init ( )

Definition at line 1238 of file ComponentAccumulator.py.

1238def printInteractiveMsg_init():
1239 print("Interactive mode")
1240 print("\tThe ComponentAccumulator is known as 'self', you can inspect it but changes are not taken into account.")
1241 print("\tThe application is known as 'app' but not yet initialized.")
1242 print("\t^D will exit the interactive mode and athena will continue.")
1243 print("\texit() will terminate the program now.")
1244 return
1245
1246
void print(char *figname, TCanvas *c1)

◆ printInteractiveMsg_run()

printInteractiveMsg_run ( )

Definition at line 1247 of file ComponentAccumulator.py.

1247def printInteractiveMsg_run():
1248 print("Interactive mode")
1249 print("\tThe application is known as 'app' and initialized.")
1250 print("\tYou can process N events with 'app.run(N)'.")
1251 print("\tStoreGate is accessible as 'sg'.")
1252 print("\t^D will exit the interactive mode and athena will finalize.")
1253 return
1254
1255
1256# Make legacy support available in legacy jobs

◆ printProperties()

printProperties ( msg,
c,
nestLevel = 0,
printDefaults = False )

Definition at line 39 of file ComponentAccumulator.py.

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

◆ startInteractive()

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

Definition at line 1221 of file ComponentAccumulator.py.

1221def startInteractive(localVarDic):
1222 """Setup and start a useful interactive session including auto-completion and history"""
1223 import code
1224
1225 # collect all global and local variables
1226 vars = sys.modules['__main__'].__dict__
1227 vars.update(globals())
1228 vars.update(localVarDic)
1229
1230 # configure the prompt
1231 from AthenaCommon.Interactive import configureInteractivePrompt
1232 configureInteractivePrompt(vars)
1233
1234 # start the interpreter
1235 code.interact(local=vars)
1236
1237