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

Classes

class  AlgSequence
class  AlgSequenceIterator
class  AthSequencer
 sequence of Gaudi algorithms, to replace the generated configurable More...
class  TestAlgSequenceWithAlgs
 Test case for a sequence with only algorithms in it. More...
class  TestAlgSequenceWithAlgsAndSeqs
 Test case for a sequence with algorithms and sub-sequences. More...

Functions

 AlgSequence (name="AthAlgSeq", **kwargs)
 default algorithm sequence
 iter_algseq (seq)
 helper functions -------------------------------------------------------—
 dumpSequence (seq, indent=0)
 dumpMasterSequence ()

Variables

str __version__ = '$Revision: 1.21 $'
str __author__
list __all__
 AthSequencer
 AlgSequence = CompFactory.AthSequencer

Function Documentation

◆ AlgSequence()

python.AlgSequence.AlgSequence ( name = "AthAlgSeq",
** kwargs )

default algorithm sequence

Convenience method to get the default sequence for algorithms

Definition at line 69 of file Control/AthenaCommon/python/AlgSequence.py.

69def AlgSequence( name="AthAlgSeq", **kwargs ):
70 """Convenience method to get the default sequence for algorithms"""
71 return AthSequencer( name, **kwargs )
72
73
ClassName: AthSequencer.

◆ dumpMasterSequence()

python.AlgSequence.dumpMasterSequence ( )
Helper function to display on screen the current master sequencer layout

Definition at line 113 of file Control/AthenaCommon/python/AlgSequence.py.

113def dumpMasterSequence():
114 """
115 Helper function to display on screen the current master sequencer layout
116 """
117 # if the application manager has already been setup()'d we just have to
118 # dump the AthMasterSeq as all the work has been done for us
119 from AthenaCommon.AppMgr import theApp, AthAppMgr
120 app_state = theApp.state()
121 if app_state != AthAppMgr.State.OFFLINE:
122 return dumpSequence( AthSequencer ("AthMasterSeq") )
123
124 # otherwise, manually do it...
125 dumpSequence( AthSequencer ("AthMasterSeq"), indent=0 )
126 dumpSequence( AthSequencer ("athAlgEvtSeq"), indent=1 )
127 dumpSequence( AthSequencer ("athBeginSeq"), indent=2 )
128 dumpSequence( AthSequencer ("athAllAlgSeq"), indent=2 )
129 dumpSequence( AthSequencer ("athCondSeq"), indent=3 )
130 dumpSequence( AthSequencer ("athAlgSeq"), indent=3 )
131 dumpSequence( AthSequencer ("athEndSeq"), indent=2 )
132 dumpSequence( AthSequencer ("athOutSeq"), indent=1 )
133 dumpSequence( AthSequencer ("athRegSeq"), indent=1 )

◆ dumpSequence()

python.AlgSequence.dumpSequence ( seq,
indent = 0 )

Definition at line 101 of file Control/AthenaCommon/python/AlgSequence.py.

101def dumpSequence (seq, indent=0):
102 def _dump (seq, indent):
103 o = list()
104 for c in seq.getChildren():
105 o.append( (c.getFullName(), indent) )
106 o.extend( _dump (c, indent+1) )
107 return o
108 out = [(seq.getFullName(),indent)]
109 out.extend( _dump( seq, indent=indent+1 ) )
110 for n,i in out:
111 print (" "*i,"+--",n)
112

◆ iter_algseq()

python.AlgSequence.iter_algseq ( seq)

helper functions -------------------------------------------------------—

iterate over a (possibly nested) ``seq`` AlgSequence.

if the sequence contains nested sub-sequences, everything will be flatten
out in-order.

example:
>>> import AthenaCommon.AlgSequence as acas
>>> aaa = CfgMgr.AthSequencer('aaa')
>>> aaa += CfgMgr.AthSequencer('aaa1')
>>> aaa.aaa1 += CfgMgr.AthSequencer('aaa2')
>>> aaa.aaa1.aaa2 += CfgMgr.AthSequencer('aaa3')
>>> aaa.aaa1.aaa2.aaa3 += CfgMgr.AthSequencer('aaa4')
>>> aaa.aaa1.aaa2.aaa3.aaa4 += CfgMgr.AthSequencer('aaa5')
>>> aaa += CfgMgr.AthSequencer('aaa11')
>>> aaa.aaa11 += CfgMgr.AthSequencer('aaa21')
>>> print ([c.getName() for c in acas.iter_algseq(aaa)])
['aaa', 'aaa1', 'aaa2', 'aaa3', 'aaa4', 'aaa5', 'aaa11', 'aaa21']

Definition at line 75 of file Control/AthenaCommon/python/AlgSequence.py.

75def iter_algseq(seq):
76 """iterate over a (possibly nested) ``seq`` AlgSequence.
77
78 if the sequence contains nested sub-sequences, everything will be flatten
79 out in-order.
80
81 example:
82 >>> import AthenaCommon.AlgSequence as acas
83 >>> aaa = CfgMgr.AthSequencer('aaa')
84 >>> aaa += CfgMgr.AthSequencer('aaa1')
85 >>> aaa.aaa1 += CfgMgr.AthSequencer('aaa2')
86 >>> aaa.aaa1.aaa2 += CfgMgr.AthSequencer('aaa3')
87 >>> aaa.aaa1.aaa2.aaa3 += CfgMgr.AthSequencer('aaa4')
88 >>> aaa.aaa1.aaa2.aaa3.aaa4 += CfgMgr.AthSequencer('aaa5')
89 >>> aaa += CfgMgr.AthSequencer('aaa11')
90 >>> aaa.aaa11 += CfgMgr.AthSequencer('aaa21')
91 >>> print ([c.getName() for c in acas.iter_algseq(aaa)])
92 ['aaa', 'aaa1', 'aaa2', 'aaa3', 'aaa4', 'aaa5', 'aaa11', 'aaa21']
93 """
94 def _iter_algseq(seq):
95 yield seq
96 for c in seq.getChildren():
97 for sub in _iter_algseq(c):
98 yield sub
99 return _iter_algseq(seq)
100

Variable Documentation

◆ __all__

list python.AlgSequence.__all__
private
Initial value:
1= [ 'AlgSequence', 'AthSequencer',
2 'iter_algseq',
3 'dumpSequence',
4 'dumpMasterSequence']

Definition at line 12 of file Control/AthenaCommon/python/AlgSequence.py.

◆ __author__

str python.AlgSequence.__author__
private
Initial value:
1= """Wim Lavrijsen (WLavrijsen@lbl.gov)
2 Sebastien Binet <binet@cern.ch>
3 """

Definition at line 8 of file Control/AthenaCommon/python/AlgSequence.py.

◆ __version__

str python.AlgSequence.__version__ = '$Revision: 1.21 $'
private

Definition at line 7 of file Control/AthenaCommon/python/AlgSequence.py.

◆ AlgSequence

python.AlgSequence.AlgSequence = CompFactory.AthSequencer

◆ AthSequencer

python.AlgSequence.AthSequencer

Definition at line 64 of file Control/AthenaCommon/python/AlgSequence.py.