ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
python.MultiReaderAlg.MultiReaderAlg Class Reference

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

Inheritance diagram for python.MultiReaderAlg.MultiReaderAlg:
Collaboration diagram for python.MultiReaderAlg.MultiReaderAlg:

Public Member Functions

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

Public Attributes

 filterSeq
 

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::MultiReaderAlg.

Can be used directly as if it were a MakerAlg object.

Definition at line 19 of file MultiReaderAlg.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 21 of file MultiReaderAlg.py.

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

Member Function Documentation

◆ __iadd__()

def python.MultiReaderAlg.MultiReaderAlg.__iadd__ (   self,
  config 
)
Add a new IObjFillerTool to a tree.

Definition at line 87 of file MultiReaderAlg.py.

87  def __iadd__( self, config ):
88  """Add a new IObjFillerTool to a tree."""
89 
90  nchild = len( self )
91  if not isinstance( config, list ):
92  # Check if this is a duplicate:
93  if hasattr( self, config.getName() ):
94  self.__logger.warning( "Duplicate D3PDObject with name \"%s\" ignored", config.ObjectName )
95  return self
96  # If not then add it to the algorithm:
97  self.__logger.info( "Adding D3PDObject with name \"%s\" and prefix \"%s\"",
98  config.ObjectName, config.Prefix )
99  self.Tools += [ config ]
100  self.Prefixes += [ config.Prefix ]
101  self.ClassNames += [ config.ObjectName ]
102  config = [ config ]
103  else:
104  for c in config:
105  self.__iadd__( c )
106  pass
107  return self
108 
109  super( MultiReaderAlg, self ).__iadd__( config )
110 
111  # Rescan all children to set the proper collection getter registry.
112  self._setRegistry( self )
113 
114  # Execute the hooks as well. They are needed after all...
115  for c in self.getChildren()[ nchild : ]:
116  D3PDObject.runHooks( c )
117  pass
118 
119  return self
120 

◆ _setRegistry()

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

Definition at line 121 of file MultiReaderAlg.py.

121  def _setRegistry( self, conf ):
122  """Scan CONF and all children to set the proper
123  collection getter registry for this tree.
124  """
125 
126  if 'CollectionGetterRegistry' in conf.properties():
127  conf.CollectionGetterRegistry = self._registry
128  for c in conf.getAllChildren():
129  self._setRegistry( c )
130 
131  return

Member Data Documentation

◆ __logger

python.MultiReaderAlg.MultiReaderAlg.__logger
private

Definition at line 23 of file MultiReaderAlg.py.

◆ _registry

python.MultiReaderAlg.MultiReaderAlg._registry
private

Definition at line 75 of file MultiReaderAlg.py.

◆ filterSeq

python.MultiReaderAlg.MultiReaderAlg.filterSeq

Definition at line 65 of file MultiReaderAlg.py.


The documentation for this class was generated from the following file:
grepfile.info
info
Definition: grepfile.py:38
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