def __init__(self, name, seq=topSequence, tuplename=None, preD3PDAlgSeqName=D3PDMakerFlags.PreD3PDAlgSeqName(), **kwargs): self.__logger = logging.getLogger("ReaderAlg") # Work around initialization order issue. seq.__iadd__(D3PDMakerCoreComps.DummyInitAlg(name + 'DummyInit'), index=0) # tuple name defaults to the algorithm name. if tuplename == None: tuplename = name # Create the algorithm Configurable. D3PD__ReaderAlg.__init__(self, name, TupleName=tuplename, **kwargs) # Add to the supplied sequence. if seq: # But first, add a sequence for algorithms that should run # before D3PD making, if it's not already there. preseq = AlgSequence(preD3PDAlgSeqName) if not hasattr(seq, preD3PDAlgSeqName): seq += [preseq] # We don't want to do filtering in the presequence. preseq.StopOverride = True # Now set up another sequence for filtering. # Unlike the presequence, there should be a unique one of these # per algorithm. We also need to break out an additional # sequence to which users can add, and to wrap the whole # thing in a sequence to prevent a failed filter # decision from stopping other algorithms. # Like this: # # ALG_FilterAlgorithmsWrap (StopOverride = True) # ALG_FilterAlgorithmsHolder # ALG_FilterAlgorithms # ALG # Dummy alg, to reset filter flag suffix = D3PDMakerFlags.FilterAlgSeqSuffix() wrap = AlgSequence(name + suffix + 'Wrap', StopOverride=True) holder = AlgSequence(name + suffix + 'Holder') self.filterSeq = AlgSequence(name + suffix) holder += self.filterSeq holder += self wrap += holder wrap += PyAthena.Alg(name + 'Dummy') seq += wrap # Create a unique collection getter registry tool for this tree. from AthenaCommon.AppMgr import ToolSvc self._registry = \ D3PDMakerCoreComps.CollectionGetterRegistryTool (self.name() + '_CollectionGetterRegistry') ToolSvc += self._registry return
PoolESDInput=['UserDataIncluded.pool.root'] # Get a handle to the ServiceManager from AthenaCommon.AppMgr import ServiceMgr as svcMgr # Get a handle to the ApplicationManager from AthenaCommon.AppMgr import theApp from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence.StopOverride = False #Pool input import AthenaPoolCnvSvc.ReadAthenaPool # EventInfo Converters include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) # Pool input (Change this to use a different file) from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, 'EventSelector'): import AthenaPoolCnvSvc.ReadAthenaPool ServiceMgr.EventSelector.InputCollections = PoolESDInput from RecExConfig.ObjKeyStore import objKeyStore objKeyStore.readInputFile('RecExPers/OKS_streamESD.py') #-------------------------------------------------------------- # Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) #------------------------------------------------------------- svcMgr.MessageSvc.OutputLevel = INFO #increase the number of letter reserved to the alg/tool name from 18 to 30
def __init__( self, name, seq = topSequence, tuplename = None, preD3PDAlgSeqName = D3PDMakerFlags.PreD3PDAlgSeqName(), orig_stream = None, **kwargs ): self.__orig_stream = orig_stream self.__logger = logging.getLogger( "A4DumpAlg" ) # Work around initialization order issue. seq.__iadd__( D3PDMakerCoreComps.DummyInitAlg( name + 'DummyInit' ), index = 0 ) # tuple name defaults to the algorithm name. if tuplename == None: tuplename = name # Create the algorithm Configurable. D3PD__A4DumpAlg.__init__ ( self, name, TupleName = tuplename, **kwargs ) # Add to the supplied sequence. if seq: # But first, add a sequence for algorithms that should run # before D3PD making, if it's not already there. preseq = AlgSequence( preD3PDAlgSeqName ) if not hasattr( seq, preD3PDAlgSeqName ): seq += [ preseq ] # We don't want to do filtering in the presequence. preseq.StopOverride = True # Now set up another sequence for filtering. # Unlike the presequence, there should be a unique one of these # per algorithm. We also need to break out an additional # sequence to which users can add, and to wrap the whole # thing in a sequence to prevent a failed filter # decision from stopping other algorithms. # Like this: # # ALG_FilterAlgorithmsWrap (StopOverride = True) # ALG_FilterAlgorithmsHolder # ALG_FilterAlgorithms # ALG # Dummy alg, to reset filter flag suffix = D3PDMakerFlags.FilterAlgSeqSuffix() wrap = AlgSequence( name + suffix + 'Wrap', StopOverride = True ) holder = AlgSequence( name + suffix + 'Holder' ) self.filterSeq = AlgSequence( name + suffix ) holder += self.filterSeq holder += self wrap += holder wrap += PyAthena.Alg( name + 'Dummy' ) seq += wrap # Create a unique collection getter registry tool for this tree. from AthenaCommon.AppMgr import ToolSvc self._registry = \ D3PDMakerCoreComps.CollectionGetterRegistryTool (self.name() + '_CollectionGetterRegistry') ToolSvc += self._registry return
def __init__(self, name, seq=topSequence, file=None, stream=None, tuplename=None, TuplePath=None, preD3PDAlgSeqName=D3PDMakerFlags.PreD3PDAlgSeqName(), streamNameRoot=None, clevel=D3PDMakerFlags.CompressionLevel(), **kwargs): """MakerAlg constructor. See the class documentation for a full description. """ if streamNameRoot == None: streamNameRoot = 'D3PD' # Work around initialization order issue. if seq: seq.__iadd__(D3PDMakerCoreComps.DummyInitAlg(name + 'DummyInit'), index=0) # If the tuple path wasn't supplied, build it from the other args. if TuplePath == None: # tuple name defaults to the algorithm name. if tuplename == None: tuplename = name if stream == None: # If no stream was given, infer it from the file. # This creates the stream if needed. if file == None: raise TypeError("Neither stream nor file specified " "for tuple %s" % tuplename) stream = _stream_from_file(file, seq, tuplename, streamNameRoot, clevel) TuplePath = '/%s/%s' % (stream, tuplename) # Create the algorithm Configurable. D3PDMakerCoreCompsConf.D3PD__MakerAlg.__init__(self, name, TuplePath=TuplePath, **kwargs) # Ensure configuration parameters are set. if (D3PDMakerFlags.AutoFlush() != -1 and self.D3PDSvc.getFullName() == 'D3PD::RootD3PDSvc'): from D3PDMakerRoot.D3PDMakerRootConf import D3PD__RootD3PDSvc rootsvc = D3PD__RootD3PDSvc() rootsvc.AutoFlush = D3PDMakerFlags.AutoFlush() from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += rootsvc # Add to the supplied sequence. if seq: # But first, add a sequence for algorithms that should run # before D3PD making, if it's not already there. preseq = AlgSequence(preD3PDAlgSeqName) if not hasattr(seq, preD3PDAlgSeqName): seq += [preseq] # We don't want to do filtering in the presequence. preseq.StopOverride = True # Now set up another sequence for filtering. # Unlike the presequence, there should be a unique one of these # per algorithm. We also need to break out an additional # sequence to which users can add, and to wrap the whole # thing in a sequence to prevent a failed filter # decision from stopping other algorithms. # Like this: # # ALG_FilterAlgorithmsWrap (StopOverride = True) # ALG_FilterAlgorithmsHolder # ALG_FilterAlgorithms # ALG # Dummy alg, to reset filter flag suffix = D3PDMakerFlags.FilterAlgSeqSuffix() wrap = AlgSequence(name + suffix + 'Wrap', StopOverride=True) holder = AlgSequence(name + suffix + 'Holder') self.filterSeq = AlgSequence(name + suffix) holder += self.filterSeq holder += self wrap += holder wrap += PyAthena.Alg(name + 'Dummy') seq += wrap # Create a unique collection getter registry tool for this tree. from AthenaCommon.AppMgr import ToolSvc self._registry = \ D3PDMakerCoreComps.CollectionGetterRegistryTool (self.name() + '_CollectionGetterRegistry') ToolSvc += self._registry return