예제 #1
0
def getInput_GenericFiles(name="ISF_Input_GenericFiles", **kwargs):
    # Takes input file from athenaCommonFlags.PoolEvgenInput
    import AthenaPoolCnvSvc.ReadAthenaPool
    from AthenaCommon.AppMgr import ServiceMgr
    ServiceMgr.EventPersistencySvc.CnvServices += [ 'AthenaPoolCnvSvc' ]
    ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.PoolEvgenInput.get_Value()
    from AthenaPython import PyAthena
    return PyAthena.Alg(name)
예제 #2
0
    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
예제 #3
0
    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