Exemplo n.º 1
0
    def configure(self):
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #schedule xAOD conversions here
        from TrigBSExtraction.TrigBSExtractionConf import TrigHLTtoxAODConversion
        xaodconverter = TrigHLTtoxAODConversion()

        from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline
        xaodconverter.Navigation = HLTNavigationOffline()

        from TrigEDMConfig.TriggerEDM import getPreregistrationList
        from TrigEDMConfig.TriggerEDM import getEFRun1BSList, getEFRun2EquivalentList, getL2Run1BSList, getL2Run2EquivalentList
        xaodconverter.Navigation.ClassesToPreregister = getPreregistrationList(
            TriggerFlags.EDMDecodingVersion())
        ## if TriggerFlags.EDMDecodingVersion() == 2:
        ##     #        if TriggerFlags.doMergedHLTResult():
        ##     #if EDMDecodingVersion() =='Run2': #FPP
        ##     xaodconverter.Navigation.ClassesToPreregister = getHLTPreregistrationList()
        ## else:
        ##     xaodconverter.Navigation.ClassesToPreregister = list(set(getL2PreregistrationList()+getEFPreregistrationList()+getHLTPreregistrationList()))

        #we attempt to convert the entire old navigation (L2+EF)
        #xaodconverter.BStoxAOD.ContainersToConvert = list(set(getL2PreregistrationList()+getEFPreregistrationList()))
        # we want only containers from Run 1 with the BS tag
        xaodconverter.BStoxAOD.ContainersToConvert = getL2Run1BSList(
        ) + getEFRun1BSList()
        xaodconverter.BStoxAOD.NewContainers = getL2Run2EquivalentList(
        ) + getEFRun2EquivalentList()

        xaodconverter.HLTResultKey = "HLTResult_EF"
        topSequence += xaodconverter

        # define list of HLT xAOD containers to be written to the output root file
        # (previously this was defined in HLTTriggerResultGetter def configure)
        from TrigEDMConfig.TriggerEDM import getTriggerEDMList
        self.xaodlist = {}
        self.xaodlist.update(getTriggerEDMList(TriggerFlags.ESDEDMSet(), 2))

        return True
Exemplo n.º 2
0
#ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/DataScouting_05" ]

# proxy provider
from SGComps.SGCompsConf import ProxyProviderSvc
svcMgr += ProxyProviderSvc()
ProxyProviderSvc = svcMgr.ProxyProviderSvc
ProxyProviderSvc.ProviderNames += ["ByteStreamAddressProviderSvc"]

from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
print job

from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction
extr = TrigBSExtraction()
from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline
extr.Navigation = HLTNavigationOffline()
# example for adding DataScouting results to decode
#extr.DSResultKeys += [ "DataScouting_03" ]
#extr.DSResultKeys += [ "DataScouting_05" ]

from TrigSerializeResult.TrigSerializeResultConf import TrigTSerializer

job += extr

svcMgr.StoreGateSvc.Dump = True

from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
TrigSerToolTP = TrigSerTPTool('TrigSerTPTool')
ToolSvc += TrigSerToolTP

from TrigEDMConfig.TriggerEDM import getL2BSTypeList, getEFBSTypeList, getTPList
Exemplo n.º 3
0
    def configure(self):

        log = logging.getLogger("ByteStreamUnpackGetterRun2")
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        #if TriggerFlags.readBS():
        log.info("TriggerFlags.dataTakingConditions: %s",
                 TriggerFlags.dataTakingConditions())
        # in MC this is always FullTrigger
        hasHLT = TriggerFlags.dataTakingConditions(
        ) == 'HltOnly' or TriggerFlags.dataTakingConditions() == 'FullTrigger'

        if hasHLT:
            # Decide based on the run number whether to assume a merged, or a
            # split HLT:
            if not TriggerFlags.doMergedHLTResult():
                ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                    "HLT::HLTResult/HLTResult_L2",
                    "HLT::HLTResult/HLTResult_EF"
                ]
            else:
                ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                    "HLT::HLTResult/HLTResult_HLT"
                ]
                pass
            pass

        # BS unpacking
        from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction
        extr = TrigBSExtraction()

        # Add fictional output to ensure data dependency in AthenaMT
        extr.ExtraOutputs += [("TrigBSExtractionOutput",
                               "StoreGateSvc+TrigBSExtractionOutput")]

        if hasHLT:
            from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline
            extr.Navigation = HLTNavigationOffline()

            from TrigEDMConfig.TriggerEDM import getEDMLibraries
            extr.Navigation.Dlls = getEDMLibraries()

            from TrigEDMConfig.TriggerEDM import getPreregistrationList
            extr.Navigation.ClassesToPreregister = getPreregistrationList(
                TriggerFlags.EDMDecodingVersion())

            if TriggerFlags.doMergedHLTResult():
                extr.L2ResultKey = ""
                extr.EFResultKey = ""
            else:
                extr.HLTResultKey = ""

            #
            # Configure DataScouting
            #
            from PyUtils.MetaReaderPeeker import metadata
            if 'stream' in metadata:
                stream_local = metadata['stream']
                if stream_local.startswith(
                        'calibration_DataScouting_'
                ) or TriggerFlags.doAlwaysUnpackDSResult():
                    if 'calibration' in stream_local and 'DataScouting_' in stream_local:
                        ds_tag = stream_local[12:27]
                        ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                            "HLT::HLTResult/" + ds_tag
                        ]
                        extr.DSResultKeys += [ds_tag]

        else:
            #if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings
            # but the extr alg must run
            extr.L2ResultKey = ""
            extr.EFResultKey = ""
            extr.HLTResultKey = ""
            extr.DSResultKeys = []

        topSequence += extr

        from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
        TrigSerToolTP = TrigSerTPTool('TrigSerTPTool')

        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += TrigSerToolTP
        from TrigEDMConfig.TriggerEDM import getTPList
        TrigSerToolTP.TPMap = getTPList((TriggerFlags.EDMDecodingVersion()))

        from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper
        TrigSerializeConvHelper = TrigSerializeConvHelper(doTP=True)
        ToolSvc += TrigSerializeConvHelper

        #
        # Configure L1Topo validation data algorithm
        #
        if hasHLT and TriggerFlags.doMergedHLTResult(
        ) and TriggerFlags.writeL1TopoValData():
            # make sure that CTP_RDO is known (see also ATR-14683)
            ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                "CTP_RDO/CTP_RDO"
            ]
            from L1TopoValDataCnv.L1TopoValDataCnvConf import xAODMaker__L1TopoValDataCnvAlg
            L1TopoValDataCvnAlg = xAODMaker__L1TopoValDataCnvAlg()
            topSequence += L1TopoValDataCvnAlg

        return True
Exemplo n.º 4
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

from TriggerMenuAnalysis.TriggerMenuAnalysisConf import *
from TrigDecisionTool.TrigDecisionToolConf import *

from AthenaCommon.AppMgr import ServiceMgr, ToolSvc

if not hasattr(ToolSvc, 'TrigDecisionTool'):
    ToolSvc += Trig__TrigDecisionTool('TrigDecisionTool')

from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline
if not hasattr(ToolSvc, 'Navigation'):
    ToolSvc += HLTNavigationOffline()


class TrigAccessTool_default(TrigAccessTool):
    def __init__(self, name='TrigAccessTool'):
        TrigAccessTool.__init__(self, name)
        self.TrigDecisionTool = ToolSvc.TrigDecisionTool


ToolSvc += TrigAccessTool_default()

from TriggerJobOpts.TriggerEDM import TriggerL2List, TriggerEFList, EDMDetails

## class RoILinksCnvTool_default(RoILinksCnvTool):
##     def __init__(self, name='RoILinksCnvTool'):
##         RoILinksCnvTool.__init__(self, name)
##         self.TrigAccessTool = ToolSvc.TrigAccessTool
##         self.TrigDecisionTool = ToolSvc.TrigDecisionTool
##         self.OutputLevel = 2
Exemplo n.º 5
0
    def configure(self):

        log = logging.getLogger("ByteStreamUnpackGetter.py")
        from AthenaCommon.AlgSequence import AlgSequence 
        topSequence = AlgSequence()
        
        #if TriggerFlags.readBS():
        log.info( "TriggerFlags.dataTakingConditions: %s" % TriggerFlags.dataTakingConditions() )
        # in MC this is always FullTrigger
        hasHLT = TriggerFlags.dataTakingConditions()=='HltOnly' or TriggerFlags.dataTakingConditions()=='FullTrigger'
        
        if hasHLT:
            from AthenaCommon.AppMgr import ServiceMgr
            # Decide based on the run number whether to assume a merged, or a
            # split HLT:
            if not TriggerFlags.doMergedHLTResult():
                ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                    "HLT::HLTResult/HLTResult_L2",
                    "HLT::HLTResult/HLTResult_EF" ]
            else:
                ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                    "HLT::HLTResult/HLTResult_HLT" ]
                pass
            pass

        # BS unpacking
        from TrigBSExtraction.TrigBSExtractionConf import TrigBSExtraction
        extr = TrigBSExtraction()
        
        if hasHLT:
            from TrigNavigation.TrigNavigationConfig import HLTNavigationOffline
            extr.Navigation = HLTNavigationOffline()

            from TrigEDMConfig.TriggerEDM import getEDMLibraries
            extr.Navigation.Dlls = getEDMLibraries()            

            from TrigEDMConfig.TriggerEDM import getPreregistrationList
            extr.Navigation.ClassesToPreregister = getPreregistrationList(TriggerFlags.EDMDecodingVersion())
            
            if TriggerFlags.doMergedHLTResult():
                extr.L2ResultKey=""
                extr.EFResultKey=""
            else:
                extr.HLTResultKey=""

            #
            # Configure DataScouting
            #
            from RecExConfig.InputFilePeeker import inputFileSummary
            if inputFileSummary['bs_metadata']['Stream'].startswith('calibration_DataScouting_') or TriggerFlags.doAlwaysUnpackDSResult():
                for stag in inputFileSummary['stream_tags']:
                    if (stag['stream_type'] == 'calibration') and (stag['stream_name'].startswith('DataScouting_')):
                        ds_tag = stag['stream_name'][0:15]
                        ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/"+ds_tag ]
                        extr.DSResultKeys += [ ds_tag ]

        else:            
            #if data doesn't have HLT info set HLTResult keys as empty strings to avoid warnings
            # but the extr alg must run
            extr.L2ResultKey=""
            extr.EFResultKey=""
            extr.HLTResultKey=""
            extr.DSResultKeys=[]

        topSequence += extr
        
        from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
        TrigSerToolTP = TrigSerTPTool('TrigSerTPTool')

        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += TrigSerToolTP
        from TrigEDMConfig.TriggerEDM import getTPList
        TrigSerToolTP.TPMap = getTPList((TriggerFlags.EDMDecodingVersion()))
        
        from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper
        TrigSerializeConvHelper = TrigSerializeConvHelper(doTP = True)
        ToolSvc += TrigSerializeConvHelper

        #
        # Configure L1Topo validation data algorithm
        #
        if hasHLT and TriggerFlags.doMergedHLTResult() and TriggerFlags.writeL1TopoValData() :
            # make sure that CTP_RDO is known (see also ATR-14683)
            ServiceMgr.ByteStreamAddressProviderSvc.TypeNames += [
                "CTP_RDO/CTP_RDO"
                ]
            from L1TopoValDataCnv.L1TopoValDataCnvConf import xAODMaker__L1TopoValDataCnvAlg
            L1TopoValDataCvnAlg = xAODMaker__L1TopoValDataCnvAlg()
            topSequence += L1TopoValDataCvnAlg

        return True