ATLAS Offline Software
Classes | Functions
python.ComponentAccumulator Namespace Reference

Classes

class  ComponentAccumulator
 
class  ConfigurationError
 

Functions

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

Function Documentation

◆ __exit()

def python.ComponentAccumulator.__exit ( )
private

Definition at line 33 of file ComponentAccumulator.py.

33 def __exit():
34  ComponentAccumulator._checkUnmerged = False
35 atexit.register(__exit)
36 

◆ appendCAtoAthena()

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

Definition at line 1264 of file ComponentAccumulator.py.

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

◆ CAtoGlobalWrapper()

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

Definition at line 1262 of file ComponentAccumulator.py.

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

◆ conf2toConfigurable()

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

Definition at line 1260 of file ComponentAccumulator.py.

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

◆ filterComponents()

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

Definition at line 79 of file ComponentAccumulator.py.

79 def filterComponents (comps, onlyComponents = []):
80  ret = []
81  for c in comps:
82  if not onlyComponents or c.getName() in onlyComponents:
83  ret.append((c, True))
84  elif c.getName()+'-' in onlyComponents:
85  ret.append((c, False))
86  return ret
87 
88 

◆ printInteractiveMsg_init()

def python.ComponentAccumulator.printInteractiveMsg_init ( )

Definition at line 1235 of file ComponentAccumulator.py.

1236  print("Interactive mode")
1237  print("\tThe ComponentAccumulator is known as 'self', you can inspect it but changes are not taken into account.")
1238  print("\tThe application is known as 'app' but not yet initialized.")
1239  print("\t^D will exit the interactive mode and athena will continue.")
1240  print("\texit() will terminate the program now.")
1241  return
1242 
1243 

◆ printInteractiveMsg_run()

def python.ComponentAccumulator.printInteractiveMsg_run ( )

Definition at line 1244 of file ComponentAccumulator.py.

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

◆ printProperties()

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

Definition at line 37 of file ComponentAccumulator.py.

37 def printProperties(msg, c, nestLevel = 0, printDefaults=False, onlyComponentsOnly=False):
38  # Iterate in sorted order.
39  propnames= sorted(c._descriptors.keys())
40  for propname in propnames:
41 
42  if not printDefaults and not c.is_property_set(propname):
43  continue
44 
45  propval=getattr(c,propname)
46  # Ignore empty lists
47 
48  if isinstance(propval,(GaudiConfig2.semantics._ListHelper,
49  GaudiConfig2.semantics._DictHelper,
50  GaudiConfig2.semantics._SetHelper)) and propval.data is None:
51  continue
52  # Printing EvtStore could be relevant for Views?
53  if not c.is_property_set(propname) and propname in ["DetStore","EvtStore", "AuditFinalize", "AuditInitialize", "AuditReinitialize", "AuditRestart", "AuditStart", "AuditStop", "AuditTools", "ExtraInputs", "ExtraOutputs"]:
54  continue
55 
56  if isinstance(propval, GaudiConfig2.Configurable):
57  msg.info("%s * %s: %s/%s", " "*nestLevel, propname, propval.__cpp_type__, propval.getName())
58  printProperties(msg, propval, nestLevel+3)
59  continue
60 
61  propstr = ""
62  if isinstance(propval, GaudiHandles.PublicToolHandleArray):
63  ths = [th.getName() for th in propval]
64  propstr = "PublicToolHandleArray([ {0} ])".format(', '.join(ths))
65  elif isinstance(propval, GaudiHandles.PrivateToolHandleArray):
66  msg.info( "%s * %s: PrivateToolHandleArray of size %s", " "*nestLevel, propname, len(propval))
67  for el in propval:
68  msg.info( "%s * %s/%s", " "*(nestLevel+3), el.__cpp_type__, el.getName())
69  printProperties(msg, el, nestLevel+6)
70  elif isinstance(propval, GaudiHandles.GaudiHandle): # Any other handle
71  propstr = "Handle( {0} )".format(propval.typeAndName)
72  elif not onlyComponentsOnly:
73  propstr = str(propval)
74  if propstr:
75  msg.info("%s * %s: %s", " "*nestLevel, propname, propstr)
76  return
77 
78 

◆ startInteractive()

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

Definition at line 1218 of file ComponentAccumulator.py.

1218 def startInteractive(localVarDic):
1219  """Setup and start a useful interactive session including auto-completion and history"""
1220  import code
1221 
1222  # collect all global and local variables
1223  vars = sys.modules['__main__'].__dict__
1224  vars.update(globals())
1225  vars.update(localVarDic)
1226 
1227  # configure the prompt
1228  from AthenaCommon.Interactive import configureInteractivePrompt
1230 
1231  # start the interpreter
1232  code.interact(local=vars)
1233 
1234 
vtune_athena.format
format
Definition: vtune_athena.py:14
python.ComponentAccumulator.appendCAtoAthena
def appendCAtoAthena(*args, **kwargs)
Definition: ComponentAccumulator.py:1264
python.ComponentAccumulator.CAtoGlobalWrapper
def CAtoGlobalWrapper(*args, **kwargs)
Definition: ComponentAccumulator.py:1262
python.ComponentAccumulator.conf2toConfigurable
def conf2toConfigurable(*args, **kwargs)
Definition: ComponentAccumulator.py:1260
python.ComponentAccumulator.__exit
def __exit()
Definition: ComponentAccumulator.py:33
python.Interactive.configureInteractivePrompt
def configureInteractivePrompt(completionDict=None)
Definition: Interactive.py:80
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.ComponentAccumulator.startInteractive
def startInteractive(localVarDic)
Definition: ComponentAccumulator.py:1218
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.ComponentAccumulator.printInteractiveMsg_run
def printInteractiveMsg_run()
Definition: ComponentAccumulator.py:1244
str
Definition: BTagTrackIpAccessor.cxx:11
python.ComponentAccumulator.printInteractiveMsg_init
def printInteractiveMsg_init()
Definition: ComponentAccumulator.py:1235
python.ComponentAccumulator.printProperties
def printProperties(msg, c, nestLevel=0, printDefaults=False, onlyComponentsOnly=False)
Definition: ComponentAccumulator.py:37
python.ComponentAccumulator.filterComponents
def filterComponents(comps, onlyComponents=[])
Definition: ComponentAccumulator.py:79