Exemplo n.º 1
0
    def __init__(self, name='L1EmulationTest', *args, **kwargs):
        super(L1EmulationTest, self).__init__(name, *args, **kwargs)

        from TriggerJobOpts.TriggerFlags import TriggerFlags
        from L1Decoder.L1DecoderConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool

        self.RoIBResult = ""

        data = {}
        data['CTPEmulation'] = [
            'HLT_e3 HLT_g5 HLT_e7 HLT_2e3 HLT_mu6 HLT_2mu6 HLT_mu6idperf HLT_e15mu4',
            'HLT_e3 HLT_g5 HLT_mu6 HLT_2mu6 HLT_mu6idperf HLT_e15mu4',
            'HLT_e3 HLT_g5 HLT_e7 HLT_2e3 HLT_mu6 HLT_2mu6',
            'HLT_mu6 HLT_2mu6 HLT_mu6idperf HLT_e15mu4',
        ]  # just to see some change
        data['RoIEmulation'] = [
            '1.3,2.9,2704088841,EM3,EM7; 1.2,3.1,2972524297,EM3,EM7,EM10,EM15; -3.2,-2.0,3103727387,MU0,MU4,MU6,MU8',
            '1.2,1.9,2733969453,MU0,MU4,MU6,MU8,MU10;2.2,1.0,2733969453,MU0,MU4,MU6',
            '-3.2,3.0,2704088841,MU0,MU4,MU6,MU8;3.0,1.6,2972524297,MU0,MU4',
            '1.3,1.9,3103727387,MU0,MU10;1.2,2.6,2733969453,MU6;-1.1,2.6,2972524297,MU6; -1.2,2.6,2704088842,MU20'
        ]

        writeEmulationFiles(data)
        ctpUnpacker = CTPUnpackingEmulationTool(
            OutputLevel=self.getDefaultProperty("OutputLevel"),
            ForceEnableAllChains=True)
        self.ctpUnpacker = ctpUnpacker
        self += ctpUnpacker

        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection

        # EM unpacker
        if TriggerFlags.doID() or TriggerFlags.doCalo():
            emUnpacker = RoIsUnpackingEmulationTool(
                "EMRoIsUnpackingTool",
                Decisions="EMRoIDecisions",
                OutputTrigRoIs=mapThresholdToL1RoICollection("EM"),
                OutputLevel=self.getDefaultProperty("OutputLevel"))
            self.roiUnpackers += [emUnpacker]
            print(emUnpacker)

        # MU unpacker
        if TriggerFlags.doMuon():
            muUnpacker = RoIsUnpackingEmulationTool(
                "MURoIsUnpackingTool",
                Decisions="MURoIDecisions",
                OutputTrigRoIs=mapThresholdToL1RoICollection("MU"),
                OutputLevel=self.getDefaultProperty("OutputLevel"))
            self.roiUnpackers += [muUnpacker]

        self.L1DecoderSummaryKey = "L1DecoderSummary"
Exemplo n.º 2
0
def TgcRDODecodeCfg(flags, forTrigger=False):
    acc = ComponentAccumulator()

    # We need the TGC cabling to be setup
    from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
    acc.merge(TGCCablingConfigCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Get the RDO -> PRD tool
    Muon__TgcRdoToPrepDataToolMT = CompFactory.Muon.TgcRdoToPrepDataToolMT
    TgcRdoToTgcPrepDataTool = Muon__TgcRdoToPrepDataToolMT(
        name="TgcRdoToTgcPrepDataTool")

    # Get the RDO -> PRD alorithm
    TgcRdoToTgcPrepData = CompFactory.TgcRdoToTgcPrepData
    TgcRdoToTgcPrepData = TgcRdoToTgcPrepData(
        name="TgcRdoToTgcPrepData",
        DecodingTool=TgcRdoToTgcPrepDataTool,
        PrintPrepData=False)
    # add RegSelTool
    from RegionSelector.RegSelToolConfig import regSelTool_TGC_Cfg
    TgcRdoToTgcPrepData.RegSel_TGC = acc.popToolsAndMerge(
        regSelTool_TGC_Cfg(flags))

    if forTrigger:
        # Set the algorithm to RoI mode
        TgcRdoToTgcPrepData.DoSeededDecoding = True
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        TgcRdoToTgcPrepData.RoIs = mapThresholdToL1RoICollection("MU")

    acc.addEventAlgo(TgcRdoToTgcPrepData)
    return acc
Exemplo n.º 3
0
def l2MuFastAlgCfg(flags, roisKey=""):

    acc = ComponentAccumulator()

    if not roisKey:
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        roisKey = mapThresholdToL1RoICollection("MU")

    # Get Reco alg of muFast step
    muFastAcc, muFastFex = muFastSteeringCfg(flags, roisKey)
    muFastFex.MuRoIs = roisKey
    muFastFex.RecMuonRoI = "HLT_RecMURoIs"
    muFastFex.MuonL2SAInfo = muFastInfo
    muFastFex.forID = "forID"
    muFastFex.forMS = "forMS"
    acc.merge(muFastAcc)

    # Get services of the Reco alg
    acc.merge(PtBarrelLUTSvcCfg(flags)[0])
    acc.merge(PtBarrelLUTSvcCfg_MC(flags)[0])
    acc.merge(PtEndcapLUTSvcCfg(flags)[0])
    acc.merge(PtEndcapLUTSvcCfg_MC(flags)[0])
    acc.merge(AlignmentBarrelLUTSvcCfg(flags)[0])

    return acc, muFastFex
Exemplo n.º 4
0
def cellRecoSequence(flags, name="HLTCaloCellMakerFS", RoIs="HLT_FSJETRoI", outputName="CaloCellsFS"):
    """ Produce the full scan cell collection """
    if not RoIs:
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        RoIs = mapThresholdToL1RoICollection("FSNOSEED")
    from TrigT2CaloCommon.CaloDef import setMinimalCaloSetup
    setMinimalCaloSetup()
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker
    alg = HLTCaloCellMaker(name)
    alg.RoIs=RoIs
    alg.TrigDataAccessMT=svcMgr.TrigCaloDataAccessSvc
    alg.CellsName=outputName
    return parOR(name+"RecoSequence", [alg]), alg.CellsName
Exemplo n.º 5
0
def RpcBytestreamDecodeCfg(flags, forTrigger=False):
    acc = ComponentAccumulator()

    # We need the RPC cabling to be setup
    from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
    acc.merge(RPCCablingConfigCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Setup the RPC ROD decoder
    Muon__RpcROD_Decoder = CompFactory.Muon.RpcROD_Decoder
    RPCRodDecoder = Muon__RpcROD_Decoder(name="RpcROD_Decoder")

    # RAW data provider tool needs ROB data provider service (should be another Config function?)
    ROBDataProviderSvc = CompFactory.ROBDataProviderSvc
    robDPSvc = ROBDataProviderSvc()
    acc.addService(robDPSvc)

    # Setup the RAW data provider tool
    keyName = flags.Overlay.BkgPrefix + "RPCPAD" if flags.Detector.OverlayRPC else "RPCPAD"
    Muon__RPC_RawDataProviderToolMT = CompFactory.Muon.RPC_RawDataProviderToolMT
    MuonRpcRawDataProviderTool = Muon__RPC_RawDataProviderToolMT(
        name="RPC_RawDataProviderToolMT",
        Decoder=RPCRodDecoder,
        RdoLocation=keyName)
    if forTrigger:
        MuonRpcRawDataProviderTool.RpcContainerCacheKey = MuonCacheNames.RpcCache
        MuonRpcRawDataProviderTool.WriteOutRpcSectorLogic = False

    acc.addPublicTool(
        MuonRpcRawDataProviderTool
    )  # This should be removed, but now defined as PublicTool at MuFastSteering

    # Setup the RAW data provider algorithm
    Muon__RpcRawDataProvider = CompFactory.Muon.RpcRawDataProvider
    RpcRawDataProvider = Muon__RpcRawDataProvider(
        name="RpcRawDataProvider", ProviderTool=MuonRpcRawDataProviderTool)

    if forTrigger:
        # Configure the RAW data provider for ROI access
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        RpcRawDataProvider.RoIs = mapThresholdToL1RoICollection("MU")

    acc.addEventAlgo(RpcRawDataProvider, primary=True)
    return acc
Exemplo n.º 6
0
def _algoL2Egamma(inputEDM="",
                  OutputLevel=ERROR,
                  doRinger=False,
                  ClustersName="HLT_FastCaloEMClusters",
                  RingerKey="HLT_FastCaloRinger"):
    if not inputEDM:
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        inputEDM = mapThresholdToL1RoICollection("EM")
    setMinimalCaloSetup()
    from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo
    algo = T2CaloEgamma_ReFastAlgo("FastCaloL2EgammaAlg",
                                   doRinger=doRinger,
                                   RingerKey=RingerKey)
    algo.RoIs = inputEDM
    from TrigEDMConfig.TriggerEDMRun3 import recordable
    algo.ClustersName = recordable("HLT_FastCaloEMClusters")
    algo.OutputLevel = OutputLevel
    return algo
Exemplo n.º 7
0
def _algoHLTCaloCell(name="HLTCaloCellMaker",
                     inputEDM='',
                     outputEDM='CellsClusters',
                     RoIMode=True,
                     OutputLevel=ERROR):
    if not inputEDM:
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        inputEDM = mapThresholdToL1RoICollection("FSNOSEED")
    setMinimalCaloSetup()
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker
    algo = HLTCaloCellMaker(name)
    #"HLTCaloCellMaker"
    algo.RoIs = inputEDM
    algo.TrigDataAccessMT = svcMgr.TrigCaloDataAccessSvc
    algo.OutputLevel = OutputLevel
    algo.CellsName = outputEDM
    return algo
Exemplo n.º 8
0
def RpcRDODecodeCfg(flags, forTrigger=False):
    from MuonConfig.MuonCondAlgConfig import RpcCondDbAlgCfg  # MT-safe conditions access
    acc = RpcCondDbAlgCfg(flags)

    # We need the RPC cabling to be setup
    from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
    acc.merge(RPCCablingConfigCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Get the RDO -> PRD tool
    Muon__RpcRdoToPrepDataToolMT = CompFactory.Muon.RpcRdoToPrepDataToolMT
    RpcRdoToRpcPrepDataTool = Muon__RpcRdoToPrepDataToolMT(
        name="RpcRdoToRpcPrepDataTool")
    if flags.Common.isOnline:
        RpcRdoToRpcPrepDataTool.ReadKey = ""  ## cond data not needed online

    if forTrigger:
        RpcRdoToRpcPrepDataTool.RpcPrdContainerCacheKey = MuonPrdCacheNames.RpcCache
        RpcRdoToRpcPrepDataTool.RpcCoinDataContainerCacheKey = MuonPrdCacheNames.RpcCoinCache

    # Get the RDO -> PRD alorithm
    RpcRdoToRpcPrepData = CompFactory.RpcRdoToRpcPrepData
    RpcRdoToRpcPrepData = RpcRdoToRpcPrepData(
        name="RpcRdoToRpcPrepData",
        DecodingTool=RpcRdoToRpcPrepDataTool,
        PrintPrepData=False)
    # add RegSelTool
    from RegionSelector.RegSelToolConfig import regSelTool_RPC_Cfg
    RpcRdoToRpcPrepData.RegSel_RPC = acc.popToolsAndMerge(
        regSelTool_RPC_Cfg(flags))

    if forTrigger:
        # Set the algorithm to RoI mode
        RpcRdoToRpcPrepData.DoSeededDecoding = True
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        RpcRdoToRpcPrepData.RoIs = mapThresholdToL1RoICollection("MU")

    acc.addEventAlgo(RpcRdoToRpcPrepData)
    return acc
Exemplo n.º 9
0
def CscRDODecodeCfg(flags, forTrigger=False):
    acc = ComponentAccumulator()

    # We need the CSC cabling to be setup
    from MuonConfig.MuonCablingConfig import CSCCablingConfigCfg  # Not yet been prepared
    acc.merge(CSCCablingConfigCfg(flags))

    from MuonConfig.MuonCondAlgConfig import CscCondDbAlgCfg
    acc.merge(CscCondDbAlgCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Get the RDO -> PRD tool
    Muon__CscRdoToCscPrepDataToolMT = CompFactory.Muon.CscRdoToCscPrepDataToolMT
    CscRdoToCscPrepDataTool = Muon__CscRdoToCscPrepDataToolMT(
        name="CscRdoToCscPrepDataTool")

    # Get the RDO -> PRD alorithm
    CscRdoToCscPrepData = CompFactory.CscRdoToCscPrepData
    CscRdoToCscPrepData = CscRdoToCscPrepData(
        name="CscRdoToCscPrepData",
        CscRdoToCscPrepDataTool=CscRdoToCscPrepDataTool,
        PrintPrepData=False)
    # add RegSelTool
    from RegionSelector.RegSelToolConfig import regSelTool_CSC_Cfg
    CscRdoToCscPrepData.RegSel_CSC = acc.popToolsAndMerge(
        regSelTool_CSC_Cfg(flags))

    if forTrigger:
        # Set the algorithm to RoI mode
        CscRdoToCscPrepData.DoSeededDecoding = True
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        CscRdoToCscPrepData.RoIs = mapThresholdToL1RoICollection("MU")

    acc.addEventAlgo(CscRdoToCscPrepData)
    return acc
Exemplo n.º 10
0
def MdtRDODecodeCfg(flags, forTrigger=False):
    acc = ComponentAccumulator()

    # We need the MDT cabling to be setup
    from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
    acc.merge(MDTCablingConfigCfg(flags))

    from MuonConfig.MuonCalibConfig import MdtCalibDbAlgCfg
    acc.merge(MdtCalibDbAlgCfg(flags))

    # Make sure muon geometry is configured
    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    acc.merge(MuonGeoModelCfg(flags))

    # Get the RDO -> PRD tool
    Muon__MdtRdoToPrepDataToolMT = CompFactory.Muon.MdtRdoToPrepDataToolMT
    MdtRdoToMdtPrepDataTool = Muon__MdtRdoToPrepDataToolMT(
        name="MdtRdoToMdtPrepDataTool")

    # Get the RDO -> PRD alorithm
    MdtRdoToMdtPrepData = CompFactory.MdtRdoToMdtPrepData
    MdtRdoToMdtPrepData = MdtRdoToMdtPrepData(
        name="MdtRdoToMdtPrepData",
        DecodingTool=MdtRdoToMdtPrepDataTool,
        PrintPrepData=False)
    # add RegSelTool
    from RegionSelector.RegSelToolConfig import regSelTool_MDT_Cfg
    MdtRdoToMdtPrepData.RegSel_MDT = acc.popToolsAndMerge(
        regSelTool_MDT_Cfg(flags))

    if forTrigger:
        # Set the algorithm to RoI mode
        MdtRdoToMdtPrepData.DoSeededDecoding = True
        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection
        MdtRdoToMdtPrepData.RoIs = mapThresholdToL1RoICollection("MU")

    acc.addEventAlgo(MdtRdoToMdtPrepData)
    return acc
Exemplo n.º 11
0
                            ybins=64,
                            ymin=-math.pi,
                            ymax=math.pi)
        ]

        if not hasattr(svcMgr, "TrigCaloDataAccessSvc"):
            svcMgr += TrigCaloDataAccessSvc()
        svcMgr.TrigCaloDataAccessSvc.OutputLevel = ERROR
        svcMgr.TrigCaloDataAccessSvc.MonTool = mon

        from L1Decoder.L1DecoderConfig import mapThresholdToL1RoICollection

        from TrigCaloRec.TrigCaloRecConfig import HLTCaloCellMaker
        from TrigCaloRec.TrigCaloRecConf import HLTCaloCellSumMaker
        algo1 = HLTCaloCellMaker("testFastAlgo1")
        algo1.RoIs = mapThresholdToL1RoICollection("EM")
        algo1.TrigDataAccessMT = svcMgr.TrigCaloDataAccessSvc
        #algo1.roiMode=False
        algo1.OutputLevel = VERBOSE
        topSequence += algo1
        algo2 = HLTCaloCellSumMaker("testSumFastAlgo")
        algo2.OutputLevel = VERBOSE
        #algo2.roiMode=False
        topSequence += algo2

    from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_ReFastAlgo
    algo = T2CaloEgamma_ReFastAlgo("testReFastAlgo")
    algo.OutputLevel = VERBOSE

    algo.RoIs = mapThresholdToL1RoICollection("EM")
    topSequence += algo