예제 #1
0
def prepareTrigSerialize(log):

    from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
    from TrigSerializeCnvSvc.TrigSerializeCnvSvcConf import TrigSerializeConvHelper

    trigCnv = TrigSerializeConvHelper(doTP=True)
    trigSer = TrigSerTPTool('TrigSerTPTool')

    from TrigEDMConfig.TriggerEDM import getL2BSTypeList, getEFBSTypeList, getTPList

    trigSer.TPMap = getTPList()
    trigSer.ActiveClasses = getL2BSTypeList() + getEFBSTypeList()

    from AthenaCommon.AppMgr import ToolSvc

    if not hasattr(ToolSvc, trigSer.name()):
        ToolSvc += trigSer
        log.info('Added TrigSerTPTool to ToolSvc')
    else:
        log.info('TrigSerTPTool already exists')

    if not hasattr(ToolSvc, trigCnv.name()):
        ToolSvc += trigCnv
        log.info('Added TrigSerializeConvHelper to ToolSvc')
    else:
        log.info('TrigSerializeConvHelper already exists')
예제 #2
0
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
TrigSerToolTP.ActiveClasses = getL2BSTypeList() + getEFBSTypeList()
TrigSerToolTP.TPMap = getTPList()

if edmCheck:
    from TrigValAlgs.TrigValAlgsConfig import TrigEDMChecker
    edmch = TrigEDMChecker()

    job += edmch
예제 #3
0
    def configure(self):

        log = logging.getLogger("HLTTriggergetter.py")

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        # If no xAOD::EventInfo is found in a POOL file, schedule conversion from old EventInfo
        from AthenaCommon.GlobalFlags import globalflags
        if globalflags.InputFormat.is_pool():
            from RecExConfig.ObjKeyStore import objKeyStore
            from PyUtils.MetaReaderPeeker import convert_itemList
            objKeyStore.addManyTypesInputFile(convert_itemList(layout='#join'))
            from AthenaCommon.AlgSequence import AthSequencer
            condSeq = AthSequencer("AthCondSeq")
            if (not objKeyStore.isInInput("xAOD::EventInfo")) and (not hasattr(
                    condSeq, "xAODMaker::EventInfoCnvAlg")):
                from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
                xAODEventInfoCnvAlgDefault(sequence=condSeq)

        if jobproperties.Global.InputFormat() == 'bytestream':
            # Decode ROIB::RoIBResult from ByteStream
            from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup
            L1ByteStreamDecodersRecExSetup()

        log.info("Loading RegionSelector")
        from AthenaCommon.AppMgr import ServiceMgr
        from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
        ServiceMgr += RegSelSvcDefault()

        # Configure the Data Preparation for Calo
        if TriggerFlags.doCalo():
            try:
                from TrigT2CaloCommon.TrigT2CaloCommonConfig import TrigDataAccess
                ServiceMgr.ToolSvc += TrigDataAccess()
            except ImportError:
                include('TrigT2CaloCommon/TrigDataAccessConfigured.py')

        if TriggerFlags.doFTK():
            # FTK algorithm inclusions
            # TrigFTK_DataProviderSvc moved to TrigFTK_RecExample
            pass

        if TriggerFlags.doHLT():
            log.info("configuring HLT Steering")

            from TrigSteering.TrigSteeringConfig import TrigSteer_HLT, ReruningTrigSteer_HLT
            if TriggerFlags.doFEX():

                # schedule the conversion of the L1Calo ROIB data to topo simulation input

                # this ROIB converter should only be scheduled if
                # - we run on data
                # - L1Calo simulation has not been scheduled
                # - and ROIB converter has not been scheduled yet before
                if globalflags.DataSource()=='data' \
                       and not hasattr( topSequence, 'CPCMX' ) \
                       and not hasattr( topSequence, 'RoiB2TopoInputDataCnv' ):
                    log.info("Setting up RoiB2TopoInputDataCnv")
                    from L1TopoSimulation.L1TopoSimulationConfig import RoiB2TopoInputDataCnv
                    roib2Topo = RoiB2TopoInputDataCnv()
                    topSequence += roib2Topo

                log.info(
                    "configuring HLT merged system, for normal running (FEX + Hypo)"
                )
                TrigSteer_HLT = TrigSteer_HLT(
                    'TrigSteer_HLT',
                    hltFile=TriggerFlags.inputHLTconfigFile(),
                    lvl1File=TriggerFlags.inputLVL1configFile())
                TrigSteer_HLT.doHypo = TriggerFlags.doHypo()

            if not TriggerFlags.doFEX() and TriggerFlags.doHypo():
                log.info("configuring merged HLT for re-running (Hypo only)")
                TrigSteer_HLT = ReruningTrigSteer_HLT(
                    'TrigSteer_HLT',
                    hltFile=TriggerFlags.inputHLTconfigFile(),
                    lvl1File=TriggerFlags.inputLVL1configFile())

            # TrigSteer_HLT.doL1TopoSimulation = TriggerFlags.doL1Topo() # this later needs to be extented to also run when we take data with L1Topo
            TrigSteer_HLT.doL1TopoSimulation = True  # always needs to run if the HLT is simulated
            if hasattr(TrigSteer_HLT.LvlTopoConverter, 'MuonInputProvider'):

                try:  # this is temporary until TrigT1Muctpi-00-06-29 is in the release
                    from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool
                    from AthenaCommon.AppMgr import ToolSvc
                    ToolSvc += L1MuctpiTool()
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuctpiSimTool = L1MuctpiTool(
                    )
                except ImportError:
                    pass

                from AthenaCommon.GlobalFlags import globalflags
                if globalflags.DataSource() != 'data':
                    log.info(
                        "Muon eta/phi encoding with reduced granularity for MC (L1Topo emulation for HLT seeding)"
                    )
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 1  # reduced granularity muon input
                else:
                    log.info(
                        "Muon eta/phi encoding with full granularity for data (L1Topo emulation for HLT seeding) - should be faced out"
                    )
                    TrigSteer_HLT.LvlTopoConverter.MuonInputProvider.MuonEncoding = 0  # full granularity muon input - should be faced out

            from TrigEDMConfig.TriggerEDM import getHLTPreregistrationList, getEDMLibraries
            TrigSteer_HLT.Navigation.ClassesToPreregister = getHLTPreregistrationList(
            )

            TrigSteer_HLT.Navigation.Dlls = getEDMLibraries()

            monitoringTools(TrigSteer_HLT)
            topSequence += TrigSteer_HLT

        if TriggerFlags.writeBS():
            # declare objects to go to BS (from the lists above)
            ## if TriggerFlags.doLVL2():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSList
            ##     TrigSteer_L2.Navigation.ClassesToPayload = getL2BSList()
            ##     TrigSteer_L2.Navigation.ClassesToPreregister = []
            ##
            ## if TriggerFlags.doEF():
            ##     from TrigEDMConfig.TriggerEDM import getEFBSList
            ##     TrigSteer_EF.Navigation.ClassesToPayload = getEFBSList()
            ##     TrigSteer_EF.Navigation.ClassesToPreregister = []
            ##     try:
            ##         from TrigEDMConfig.TriggerEDM import getEFDSList
            ##         TrigSteer_EF.Navigation.ClassesToPayload_DSonly = getEFDSList()
            ##     except ImportError:
            ##         log.warning("DataScouting not available in this release")

            if TriggerFlags.doHLT():
                from TrigEDMConfig.TriggerEDM import getHLTBSList
                TrigSteer_HLT.Navigation.ClassesToPayload = getHLTBSList()
                TrigSteer_HLT.Navigation.ClassesToPreregister = []
                try:
                    from TrigEDMConfig.TriggerEDM import getHLTDSList
                    TrigSteer_HLT.Navigation.ClassesToPayload_DSonly = getHLTDSList(
                    )
                except ImportError:
                    log.warning("DataScouting not available in this release")

            #configure tools for serialization
            from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
            TrigSerToolTP = TrigSerTPTool('TrigSerTPTool')
            from TrigEDMConfig.TriggerEDM import getTPList
            TrigSerToolTP.TPMap = getTPList(TriggerFlags.doHLT())
            from AthenaCommon.AppMgr import ToolSvc
            ToolSvc += TrigSerToolTP

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

            #do not activate T/P of EF classes at L2
            ## if TriggerFlags.doLVL2():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSTypeList
            ##     TrigSerToolTP.ActiveClasses = getL2BSTypeList()
            ## if TriggerFlags.doEF():
            ##     from TrigEDMConfig.TriggerEDM import getL2BSTypeList, getEFBSTypeList
            ##     TrigSerToolTP.ActiveClasses = getL2BSTypeList() + getEFBSTypeList()

            if TriggerFlags.doHLT():
                from TrigEDMConfig.TriggerEDM import getHLTBSTypeList
                TrigSerToolTP.ActiveClasses = getHLTBSTypeList()

        from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
        result = HLTTriggerResultGetter()  # noqa: F841
        return True
예제 #4
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
예제 #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