ATLAS Offline Software
Loading...
Searching...
No Matches
python.ReaderAlg.ReaderAlg Class Reference

A class very similar to D3PDMakerCoreComps.MakerAlg, but it creates a configured version of the D3PD.ReaderAlg. More...

Inheritance diagram for python.ReaderAlg.ReaderAlg:
Collaboration diagram for python.ReaderAlg.ReaderAlg:

Public Member Functions

 __init__ (self, name, seq=topSequence, tuplename=None, preD3PDAlgSeqName=D3PDMakerFlags.PreD3PDAlgSeqName(), **kwargs)
 __iadd__ (self, configs)

Public Attributes

 filterSeq = AlgSequence( name + suffix )
 Prefix = configs.Prefix

Protected Member Functions

 _setRegistry (self, conf)

Protected Attributes

 _registry

Private Attributes

 __logger = logging.getLogger( "ReaderAlg" )

Detailed Description

A class very similar to D3PDMakerCoreComps.MakerAlg, but it creates a configured version of the D3PD.ReaderAlg.

Should not be used directly, users should only use the specialized functions from D3PDMakerReader.CodeGenerators.

Definition at line 18 of file ReaderAlg.py.

Constructor & Destructor Documentation

◆ __init__()

python.ReaderAlg.ReaderAlg.__init__ ( self,
name,
seq = topSequence,
tuplename = None,
preD3PDAlgSeqName = D3PDMakerFlags.PreD3PDAlgSeqName(),
** kwargs )

Definition at line 20 of file ReaderAlg.py.

25 **kwargs ):
26
27 self.__logger = logging.getLogger( "ReaderAlg" )
28
29 # Work around initialization order issue.
30 seq.__iadd__( D3PDMakerCoreComps.DummyInitAlg( name + 'DummyInit' ),
31 index = 0 )
32
33 # tuple name defaults to the algorithm name.
34 if tuplename is None:
35 tuplename = name
36
37 # Create the algorithm Configurable.
38 D3PD__ReaderAlg.__init__ ( self, name,
39 TupleName = tuplename,
40 **kwargs )
41
42 # Add to the supplied sequence.
43 if seq:
44 # But first, add a sequence for algorithms that should run
45 # before D3PD making, if it's not already there.
46 preseq = AlgSequence( preD3PDAlgSeqName )
47 if not hasattr( seq, preD3PDAlgSeqName ):
48 seq += [ preseq ]
49
50 # We don't want to do filtering in the presequence.
51 preseq.StopOverride = True
52 # Now set up another sequence for filtering.
53 # Unlike the presequence, there should be a unique one of these
54 # per algorithm. We also need to break out an additional
55 # sequence to which users can add, and to wrap the whole
56 # thing in a sequence to prevent a failed filter
57 # decision from stopping other algorithms.
58 # Like this:
59 #
60 # ALG_FilterAlgorithmsWrap (StopOverride = True)
61 # ALG_FilterAlgorithmsHolder
62 # ALG_FilterAlgorithms
63 # ALG
64 # Dummy alg, to reset filter flag
65 suffix = D3PDMakerFlags.FilterAlgSeqSuffix()
66 wrap = AlgSequence( name + suffix + 'Wrap',
67 StopOverride = True )
68 holder = AlgSequence( name + suffix + 'Holder' )
69 self.filterSeq = AlgSequence( name + suffix )
70 holder += self.filterSeq
71 holder += self
72 wrap += holder
73 wrap += PyAthena.Alg( name + 'Dummy' )
74
75 seq += wrap
76
77 # Create a unique collection getter registry tool for this tree.
78 from AthenaCommon.AppMgr import ToolSvc
79 self._registry = \
80 D3PDMakerCoreComps.CollectionGetterRegistryTool (self.name() +
81 '_CollectionGetterRegistry')
82 ToolSvc += self._registry
83
84 return
85

Member Function Documentation

◆ __iadd__()

python.ReaderAlg.ReaderAlg.__iadd__ ( self,
configs )
Add a new IObjFillerTool to a tree.

Definition at line 86 of file ReaderAlg.py.

86 def __iadd__( self, configs ):
87 """Add a new IObjFillerTool to a tree."""
88
89 # FIXME: should make sure name is unique within alg.
90 if not isinstance( configs, list ):
91 self.Prefix = configs.Prefix
92 configs = [ configs ]
93 else:
94 self.__logger.warning( "Should only add single D3PDObject-s to algorithm!" )
95 self.Tools += configs
96 super( ReaderAlg, self ).__iadd__( configs )
97
98 # Rescan all children to set the proper collection getter registry.
99 self._setRegistry( self )
100# for c in self.getChildren()[ nchild: ]:
101# D3PDObject.runHooks( c )
102
103 return self
104

◆ _setRegistry()

python.ReaderAlg.ReaderAlg._setRegistry ( self,
conf )
protected
Scan CONF and all children to set the proper
collection getter registry for this tree.

Definition at line 105 of file ReaderAlg.py.

105 def _setRegistry( self, conf ):
106 """Scan CONF and all children to set the proper
107 collection getter registry for this tree.
108 """
109
110 if 'CollectionGetterRegistry' in conf.properties():
111 conf.CollectionGetterRegistry = self._registry
112 for c in conf.getAllChildren():
113 self._setRegistry( c )
114
115 return

Member Data Documentation

◆ __logger

python.ReaderAlg.ReaderAlg.__logger = logging.getLogger( "ReaderAlg" )
private

Definition at line 27 of file ReaderAlg.py.

◆ _registry

python.ReaderAlg.ReaderAlg._registry
protected
Initial value:
= \
D3PDMakerCoreComps.CollectionGetterRegistryTool (self.name() +
'_CollectionGetterRegistry')

Definition at line 79 of file ReaderAlg.py.

◆ filterSeq

python.ReaderAlg.ReaderAlg.filterSeq = AlgSequence( name + suffix )

Definition at line 69 of file ReaderAlg.py.

◆ Prefix

python.ReaderAlg.ReaderAlg.Prefix = configs.Prefix

Definition at line 91 of file ReaderAlg.py.


The documentation for this class was generated from the following file: