ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
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

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

Public Attributes

 filterSeq
 
 Prefix
 

Private Member Functions

def _setRegistry (self, conf)
 

Private Attributes

 __logger
 
 _registry
 

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

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

Definition at line 20 of file ReaderAlg.py.

20  def __init__( self,
21  name,
22  seq = topSequence,
23  tuplename = None,
24  preD3PDAlgSeqName = D3PDMakerFlags.PreD3PDAlgSeqName(), # noqa: B008 (constant string)
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__()

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

def python.ReaderAlg.ReaderAlg._setRegistry (   self,
  conf 
)
private
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
private

Definition at line 22 of file ReaderAlg.py.

◆ _registry

python.ReaderAlg.ReaderAlg._registry
private

Definition at line 74 of file ReaderAlg.py.

◆ filterSeq

python.ReaderAlg.ReaderAlg.filterSeq

Definition at line 64 of file ReaderAlg.py.

◆ Prefix

python.ReaderAlg.ReaderAlg.Prefix

Definition at line 91 of file ReaderAlg.py.


The documentation for this class was generated from the following file:
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
PyAthena::Alg
Definition: PyAthenaAlg.h:33