コード例 #1
0
def createCaloRoIUnpackers():
    #from L1Decoder.L1DecoderConf import EMRoIsUnpackingTool, METRoIsUnpackingTool, JRoIsUnpackingTool, RerunRoIsUnpackingTool, TAURoIsUnpackingTool
    from L1Decoder.L1DecoderMonitoring import RoIsUnpackingMonitoring
    from TrigEDMConfig.TriggerEDMRun3 import recordable
    emUnpacker = CompFactory.EMRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("EM"),
                                                 OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("EM")),
                                                 MonTool = RoIsUnpackingMonitoring( prefix="EM", maxCount=30 ))

    #            emUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="EM", maxCount=30 )

    emRerunUnpacker = CompFactory.RerunRoIsUnpackingTool("EMRerunRoIsUnpackingTool",
                                                         SourceDecisions=mapThresholdToL1DecisionCollection("EM"),
                                                         Decisions="HLTNav_RerunL1EM" )

    metUnpacker = CompFactory.METRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("XE"))


    tauUnpacker = CompFactory.TAURoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("TAU"),
                                                   OutputTrigRoIs = recordable("HLT_TAURoI"))

    tauUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="TAU", maxCount=30 )

    jUnpacker = CompFactory.JRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("J"),
                                               OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("J")) )

    jUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="J", maxCount=30 )

    return [emUnpacker, metUnpacker, tauUnpacker, jUnpacker ],[emRerunUnpacker]
コード例 #2
0
def _algoTauPrecisionMVA(inputRoIs, tracks, step):
    from TrigTauRec.TrigTauRecConfigMT import TrigTauRecMerged_TauPrecisionMVA
    algo = TrigTauRecMerged_TauPrecisionMVA(
        name="TrigTauRecMerged_TauPrecisionMVA",
        doMVATES=True,
        doTrackBDT=False,
        doRNN=True)
    if "EF" in step:
        algo = TrigTauRecMerged_TauPrecisionMVA(
            name="TrigTauRecMerged_TauPrecisionMVA" + step,
            doMVATES=False,
            doTrackBDT=False,
            doRNN=True)
    algo.RoIInputKey = inputRoIs
    algo.L1RoIKey = "TAUCaloRoIs"
    algo.clustersKey = ""
    algo.Key_vertexInputContainer = ""
    algo.Key_trigTauJetInputContainer = "HLT_TrigTauRecMerged_CaloOnlyMVA"
    if "EF" in step:
        algo.Key_trigTauJetInputContainer = "HLT_TrigTauRecMerged_CaloOnly"
    algo.Key_trackPartInputContainer = tracks
    algo.Key_trigTauTrackInputContainer = "HLT_tautrack_dummy"
    algo.Key_trigTauJetOutputContainer = recordable("HLT_TrigTauRecMerged_MVA")
    algo.Key_trigTauTrackOutputContainer = recordable("HLT_tautrack_MVA")
    return algo
コード例 #3
0
def vertexFinder_builder( signature, inputTracks, outputVertices ) :

    from AthenaCommon.Logging import logging
    log = logging.getLogger("InDetVtx")

    from TrigEDMConfig.TriggerEDMRun3 import recordable

    # create the three subtools for use by the vertexFinder itself ...
    
    # the actual tool which finde the vertices ... 
    vertexFinderTool = vertexFinderTool_builder( signature ) 

    # which are then sorted ...
    vertexSortingTool = vertexSortingTool_builder( signature )

    # and finally some monitoring ...
    vertexMonitoringTool = vertexMonitoringTool_builder( signature )

    # no create the vertex finder ...

    from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetPriVxFinder

    vertexFinder = InDet__InDetPriVxFinder( name                        = "InDetTrigPriVxFinder" + signature,
                                            VertexFinderTool            = vertexFinderTool,
                                            TracksName                  = recordable(inputTracks), 
                                            VxCandidatesOutputName      = recordable(outputVertices), 
                                            VertexCollectionSortingTool = vertexSortingTool,
                                            doVertexSorting             = True,
                                            PriVxMonTool                = vertexMonitoringTool )
    
    log.debug(vertexFinder)
    
    return  [ vertexFinder ]
コード例 #4
0
def JetTrackingSequence(dummyFlags, trkopt, RoIs):
    jetTrkSeq = parOR("JetTrackingSeq_" + trkopt, [])
    tracksname = ""
    verticesname = ""

    if trkopt == "ftf":
        from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView
        # Guess FS rather than making it jet-specific?
        viewAlgs = makeInDetAlgsNoView("JetFS", "FS", rois=recordable(RoIs))
        jetTrkSeq += viewAlgs
        tracksname = recordable("HLT_IDTrack_FS_FTF")
        verticesname = recordable("HLT_IDVertex_FS")

    from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices
    vtxAlgs = makeVertices("jet", tracksname, verticesname)
    prmVtx = vtxAlgs[-1]
    jetTrkSeq += prmVtx

    tvaname = "JetTrackVtxAssoc_" + trkopt
    trkcolls = {
        "Tracks": tracksname,
        "Vertices": verticesname,
        "TVA": tvaname,
    }

    from JetRecTools.JetRecToolsConfig import trackcollectionmap
    if trkopt not in trackcollectionmap.keys():
        trackcollectionmap[trkopt] = trkcolls

    # Jet track selection
    jettrackselloose = getTrackSelTool(trkopt, doWriteTracks=True)
    jettracksname = jettrackselloose.OutputContainer
    jettvassoc = getTrackVertexAssocTool(trkopt)

    trackcollectionmap[trkopt]["JetTracks"] = jettracksname
    trackcollectionmap[trkopt]["TVA"] = tvaname

    jettrkprepalg = CompFactory.JetAlgorithm("jetalg_TrackPrep")
    jettrkprepalg.Tools = [jettrackselloose, jettvassoc]
    jetTrkSeq += conf2toConfigurable(jettrkprepalg)

    label = "GhostTrack_{}".format(trkopt)
    ghosttracksname = "PseudoJet{}".format(label)

    trackcollectionmap[trkopt]["GhostTracks"] = ghosttracksname
    trackcollectionmap[trkopt]["GhostTracksLabel"] = label

    pjgalg = CompFactory.PseudoJetAlgorithm("pjgalg_" + label,
                                            InputContainer=tracksname,
                                            OutputContainer=ghosttracksname,
                                            Label=label,
                                            SkipNegativeEnergy=True)
    jetTrkSeq += conf2toConfigurable(pjgalg)

    return jetTrkSeq, trkcolls
コード例 #5
0
def l2PhotonAlgCfg(flags):
    acc = ComponentAccumulator()
    #from TrigEgammaHypo.TrigL2PhotonFexMTConfig import L2PhotonFex_1
    from AthenaConfiguration.ComponentFactory import CompFactory

    photonFex = CompFactory.TrigEgammaFastPhotonFexMT("EgammaFastPhotonFex_1")
    #photonFex= L2PhotonFex_1()
    photonFex.TrigEMClusterName = recordable("HLT_FastCaloEMClusters")
    photonFex.PhotonsName = recordable("HLT_FastPhotons")
    photonFex.RoIs = "L2PhotonRecoRoIs"

    return acc, photonFex
コード例 #6
0
class TrigEgammaKeys(object):
    """Static class to collect all string manipulation in Electron sequences """
    from TrigEDMConfig.TriggerEDMRun3 import recordable
    SuperElectronRecCollectionName = 'HLT_ElectronSuperRecCollection'
    outputElectronKey = recordable('HLT_egamma_Electrons')
    SuperPhotonRecCollectionName = 'HLT_PhotonSuperRecCollection'
    EgammaRecKey = 'HLT_egammaRecCollection'
    outputPhotonKey = recordable('HLT_egamma_Photons')
    outputClusterKey = 'HLT_egammaClusters'
    outputTopoSeededClusterKey = 'HLT_egammaTopoSeededClusters'
    TrigEMClusterToolOutputContainer = 'HLT_TrigEMClusterOutput'
    TrigElectronTracksCollectionName = 'HLT_IDTrack_Electron_IDTrig'
    pidVersion = 'rel21_20180312'
コード例 #7
0
def _algoTauPreselection(inputRoIs, tracks, step):
    from TrigTauRec.TrigTauRecConfigMT import TrigTauRecMerged_TauPreselection
    algo = TrigTauRecMerged_TauPreselection(
        name="TrigTauRecMerged_TauPreselection_" + step)
    algo.RoIInputKey = inputRoIs
    algo.L1RoIKey = "TAUCaloRoIs"
    algo.clustersKey = ""
    algo.Key_vertexInputContainer = ""
    algo.Key_trigTauJetInputContainer = "HLT_TrigTauRecMerged_CaloOnly"
    algo.Key_trackPartInputContainer = tracks
    algo.Key_trigTauTrackInputContainer = "HLT_tautrack_dummy"
    algo.Key_trigTauJetOutputContainer = recordable(
        "HLT_TrigTauRecMerged_Presel")
    algo.Key_trigTauTrackOutputContainer = recordable("HLT_tautrack_Presel")
    return algo
コード例 #8
0
def tauEFSequence(ConfigFlags):

    RecoSequenceName = "tauEFInViewSequence"

    newRoITool = ViewCreatorFetchFromViewROITool()
    newRoITool.RoisWriteHandleKey = recordable(
        "HLT_Roi_TauID")  #RoI collection recorded to EDM
    newRoITool.InViewRoIs = "UpdatedTrackRoI"  #input RoIs from calo only step

    efViewsMaker = EventViewCreatorAlgorithm("IMTauEF")
    efViewsMaker.RoIsLink = "roi"
    efViewsMaker.RoITool = newRoITool
    efViewsMaker.InViewRoIs = "RoiForTauCore"
    efViewsMaker.Views = "TAUEFViews"
    efViewsMaker.ViewFallThrough = True
    efViewsMaker.RequireParentView = True
    efViewsMaker.ViewNodeName = RecoSequenceName

    (tauEFInViewSequence,
     sequenceOut) = tauIdTrackSequence(efViewsMaker.InViewRoIs,
                                       RecoSequenceName)

    tauEFSequence = seqAND("tauEFSequence",
                           [efViewsMaker, tauEFInViewSequence])
    return (tauEFSequence, efViewsMaker, sequenceOut)
コード例 #9
0
def muEFSAAlgSequence(ConfigFlags):

    efsaViewsMaker = EventViewCreatorAlgorithm("IMefsa")
    #
    efsaViewsMaker.RoIsLink = "initialRoI"  # Merge based on initial RoI

    newRoITool = ViewCreatorFetchFromViewROITool()
    newRoITool.RoisWriteHandleKey = recordable(
        "HLT_Roi_L2SAMuonForEF")  #RoI collection recorded to EDM
    newRoITool.InViewRoIs = "forMS"  #input RoIs from L2 SA views
    newRoITool.ViewToFetchFrom = "MUViewRoIs"
    efsaViewsMaker.RoITool = newRoITool  # Create a new ROI centred on the L2 SA muon from Step 1
    #
    efsaViewsMaker.Views = "MUEFSAViewRoIs"
    efsaViewsMaker.InViewRoIs = "MUEFSARoIs"
    #
    efsaViewsMaker.RequireParentView = True
    efsaViewsMaker.ViewFallThrough = True

    ### get EF reco sequence ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muEFSARecoSequence
    muEFSARecoSequence, sequenceOut = muEFSARecoSequence(
        efsaViewsMaker.InViewRoIs, 'RoI')

    efsaViewsMaker.ViewNodeName = muEFSARecoSequence.name()

    muonEFSAonlySequence = seqAND("muonEFSAonlySequence",
                                  [efsaViewsMaker, muEFSARecoSequence])

    return (muonEFSAonlySequence, efsaViewsMaker, sequenceOut)
コード例 #10
0
def muEFIsoAlgSequence(ConfigFlags):
    efmuIsoViewsMaker = EventViewCreatorAlgorithm("IMefmuIso")
    newRoITool = ViewCreatorCentredOnIParticleROITool()
    newRoITool.RoIEtaWidth = 0.15
    newRoITool.RoIPhiWidth = 0.15
    newRoITool.RoisWriteHandleKey = recordable("HLT_Roi_MuonIso")
    #
    efmuIsoViewsMaker.mergeUsingFeature = True
    efmuIsoViewsMaker.RoITool = newRoITool
    #
    efmuIsoViewsMaker.Views = "MUEFIsoViewRoIs"
    efmuIsoViewsMaker.InViewRoIs = "MUEFIsoRoIs"
    #
    efmuIsoViewsMaker.ViewFallThrough = True
    # Muon specific
    # TODO - this should be deprecated here and removed in the future, now that we mergeUsingFeature, each parent View should only have one muon.
    # therefore the xAOD::Muon should be got via ViewFallThrough, rather than being copied in here as "IsoViewMuons"
    efmuIsoViewsMaker.PlaceMuonInView = True
    efmuIsoViewsMaker.InViewMuonCandidates = "IsoMuonCandidates"
    efmuIsoViewsMaker.InViewMuons = "IsoViewMuons"

    ### get EF reco sequence ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import efmuisoRecoSequence
    efmuisoRecoSequence, sequenceOut = efmuisoRecoSequence(
        efmuIsoViewsMaker.InViewRoIs, efmuIsoViewsMaker.InViewMuons)

    efmuIsoViewsMaker.ViewNodeName = efmuisoRecoSequence.name()

    ### Define a Sequence to run for muIso ###
    efmuIsoSequence = seqAND("efmuIsoSequence",
                             [efmuIsoViewsMaker, efmuisoRecoSequence])

    return (efmuIsoSequence, efmuIsoViewsMaker, sequenceOut)
コード例 #11
0
    def __init__(self, name='L1Decoder', *args, **kwargs):
        super(L1Decoder, self).__init__(name, *args, **kwargs)

        from TriggerJobOpts.TriggerFlags import TriggerFlags

        # CTP unpacker
        ctpUnpacker = CompFactory.CTPUnpackingTool()

        self.ctpUnpacker = ctpUnpacker
        from TrigEDMConfig.TriggerEDMRun3 import recordable
        self.roiUnpackers += [ CompFactory.FSRoIsUnpackingTool("FSRoIsUnpackingTool",
                                                               Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"),
                                                               OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED") )) ]
        # EM unpacker
        if TriggerFlags.doID() or TriggerFlags.doCalo():
            unpackers, rerunUnpackers = createCaloRoIUnpackers()
            self.roiUnpackers += unpackers
            self.rerunRoiUnpackers += rerunUnpackers

        # MU unpacker
        if TriggerFlags.doMuon():
            unpackers, rerunUnpackers = createMuonRoIUnpackers()
            self.roiUnpackers += unpackers
            self.rerunRoiUnpackers += rerunUnpackers

        self.prescaler = createPrescalingTool()

        from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
        self.DoCostMonitoring = flags.Trigger.CostMonitoring.doCostMonitoring
        self.CostMonitoringChain = flags.Trigger.CostMonitoring.chain

        self.L1DecoderSummaryKey = "L1DecoderSummary"
コード例 #12
0
def tauFTFCoreSequence(ConfigFlags):

    RecoSequenceName = "tauFTFCoreInViewSequence"

    newRoITool = ViewCreatorFetchFromViewROITool()
    newRoITool.RoisWriteHandleKey = recordable(
        "HLT_Roi_TauCore")  #RoI collection recorded to EDM
    newRoITool.InViewRoIs = "UpdatedCaloRoI"  #input RoIs from calo only step

    ftfCoreViewsMaker = EventViewCreatorAlgorithm("IMFTFCore")
    ftfCoreViewsMaker.RoIsLink = "roi"
    ftfCoreViewsMaker.RoITool = newRoITool
    ftfCoreViewsMaker.InViewRoIs = "RoiForTauCore"
    ftfCoreViewsMaker.Views = "TAUFTFCoreViews"
    ftfCoreViewsMaker.ViewFallThrough = True
    ftfCoreViewsMaker.RequireParentView = True
    ftfCoreViewsMaker.ViewNodeName = RecoSequenceName

    (tauFTFCoreInViewSequence,
     sequenceOut) = tauCoreTrackSequence(ftfCoreViewsMaker.InViewRoIs,
                                         RecoSequenceName)

    tauFastTrackCoreSequence = seqAND(
        "tauFastTrackCoreSequence",
        [ftfCoreViewsMaker, tauFTFCoreInViewSequence])
    return (tauFastTrackCoreSequence, ftfCoreViewsMaker, sequenceOut)
コード例 #13
0
def fastElectronSequence(ConfigFlags):
    """ second step:  tracking....."""

    from TrigInDetConfig.InDetSetup import makeInDetAlgs
    RoIs = "EMIDRoIs"  # contract with the fastCalo
    viewAlgs, viewVerify = makeInDetAlgs(
        whichSignature="Electron",
        separateTrackParticleCreator="Electron",
        rois=RoIs)

    # A simple algorithm to confirm that data has been inherited from parent view
    # Required to satisfy data dependencies
    from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import CaloMenuDefs
    viewVerify.DataObjects += [('xAOD::TrigEMClusterContainer',
                                'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters),
                               ('TrigRoiDescriptorCollection',
                                'StoreGateSvc+' + RoIs)]

    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"):
        viewVerify.DataObjects += [('CondAttrListCollection',
                                    'ConditionStore+/PIXEL/DCS/FSMSTATUS')]
    if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"):
        viewVerify.DataObjects += [('CondAttrListCollection',
                                    'ConditionStore+/PIXEL/DCS/FSMSTATE')]

    TrackParticlesName = ""
    for viewAlg in viewAlgs:
        if "InDetTrigTrackParticleCreatorAlg" in viewAlg.name():
            TrackParticlesName = viewAlg.TrackParticlesName

    from TrigEgammaHypo.TrigEgammaFastElectronFexMTConfig import EgammaFastElectronFex_1
    theElectronFex = EgammaFastElectronFex_1()
    theElectronFex.TrigEMClusterName = CaloMenuDefs.L2CaloClusters
    theElectronFex.TrackParticlesName = TrackParticlesName
    theElectronFex.ElectronsName = recordable("HLT_FastElectrons")

    # EVCreator:
    l2ElectronViewsMaker = EventViewCreatorAlgorithm("IMl2Electron")
    l2ElectronViewsMaker.RoIsLink = "initialRoI"
    l2ElectronViewsMaker.RoITool = ViewCreatorInitialROITool()
    l2ElectronViewsMaker.InViewRoIs = RoIs
    l2ElectronViewsMaker.Views = "EMElectronViews"
    l2ElectronViewsMaker.ViewFallThrough = True
    l2ElectronViewsMaker.RequireParentView = True

    theElectronFex.RoIs = l2ElectronViewsMaker.InViewRoIs
    # ATR-20453
    # Until such time as FS and RoI collections do not interfere, a hacky fix
    #electronInViewAlgs = parOR("electronInViewAlgs", viewAlgs + [ theElectronFex ])
    electronInViewAlgs = seqAND("electronInViewAlgs",
                                viewAlgs + [theElectronFex])
    l2ElectronViewsMaker.ViewNodeName = "electronInViewAlgs"

    electronAthSequence = seqAND("electronAthSequence",
                                 [l2ElectronViewsMaker, electronInViewAlgs])
    return (electronAthSequence, l2ElectronViewsMaker,
            theElectronFex.ElectronsName)
コード例 #14
0
def _algoHLTTopoClusterLC(inputEDM="CellsClusters",
                          OutputLevel=ERROR,
                          algSuffix=""):
    from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo
    algo = TrigCaloClusterMakerMT_topo(name="TrigCaloClusterMakerMT_topo" +
                                       algSuffix,
                                       doMoments=True,
                                       doLC=True,
                                       cells=inputEDM)
    from TrigEDMConfig.TriggerEDMRun3 import recordable
    algo.CaloClusters = recordable("HLT_TopoCaloClusters" + algSuffix)
    algo.OutputLevel = OutputLevel
    return algo
コード例 #15
0
def caloClusterRecoSequence(
        flags, name="HLTCaloClusterMakerFS", RoIs="HLT_FSJETRoI",
        outputName="HLT_TopoCaloClustersFS"):
    """ Create the EM-level fullscan clusters """
    cell_sequence, cells_name = RecoFragmentsPool.retrieve(cellRecoSequence, flags=None, RoIs=RoIs)
    from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterMakerMT_topo
    alg = TrigCaloClusterMakerMT_topo(
            name,
            doMoments=True,
            doLC=False,
            cells=cells_name)
    alg.CaloClusters = recordable(outputName)
    return parOR(name+"RecoSequence", [cell_sequence, alg]), alg.CaloClusters
コード例 #16
0
def createMuonRoIUnpackers():
    #from L1Decoder.L1DecoderConf import MURoIsUnpackingTool, RerunRoIsUnpackingTool
    from L1Decoder.L1DecoderMonitoring import RoIsUnpackingMonitoring

    from TrigEDMConfig.TriggerEDMRun3 import recordable
    muUnpacker = CompFactory.MURoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("MU"),
                                     OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("MU")))

    muUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="MU", maxCount=20 )

    muRerunUnpacker =  CompFactory.RerunRoIsUnpackingTool("MURerunRoIsUnpackingTool",
                                                          SourceDecisions=mapThresholdToL1DecisionCollection("MU"),
                                                          Decisions="HLTNav_RerunL1MU" )
    return [muUnpacker],[muRerunUnpacker]
コード例 #17
0
def _algoTauCaloOnlyMVA(L1RoIs, inputRoIs, clusters):
    from TrigTauRec.TrigTauRecConfigMT import TrigTauRecMerged_TauCaloOnlyMVA
    algo = TrigTauRecMerged_TauCaloOnlyMVA()
    algo.RoIInputKey = inputRoIs
    algo.L1RoIKey = L1RoIs
    algo.clustersKey = clusters
    algo.Key_vertexInputContainer = ""
    algo.Key_trackPartInputContainer = ""
    algo.Key_trigTauJetInputContainer = ""
    algo.Key_trigTauTrackInputContainer = ""
    algo.Key_trigTauJetOutputContainer = recordable(
        "HLT_TrigTauRecMerged_CaloOnlyMVA")
    algo.Key_trigTauTrackOutputContainer = "HLT_tautrack_dummy"
    return algo
コード例 #18
0
def fastPhotonMenuSequence():
    """Creates secpond step photon sequence"""

    from TriggerMenuMT.HLTMenuConfig.CommonSequences.CaloSequenceSetup import CaloMenuDefs
    ViewVerify = CfgMgr.AthViews__ViewDataVerifier(
        "FastPhotonViewDataVerifier")
    ViewVerify.DataObjects = [('xAOD::TrigEMClusterContainer',
                               'StoreGateSvc+' + CaloMenuDefs.L2CaloClusters),
                              ('TrigRoiDescriptorCollection',
                               'StoreGateSvc+EMIDRoIs')]

    from TrigEgammaHypo.TrigEgammaFastPhotonFexMTConfig import EgammaFastPhotonFex_1
    thePhotonFex = EgammaFastPhotonFex_1()
    thePhotonFex.TrigEMClusterName = CaloMenuDefs.L2CaloClusters
    thePhotonFex.PhotonsName = recordable("HLT_FastPhotons")
    #thePhotonFex.RoIs="EMIDRoIs"

    l2PhotonViewsMaker = EventViewCreatorAlgorithm("IMl2Photon")
    l2PhotonViewsMaker.RoIsLink = "initialRoI"
    l2PhotonViewsMaker.InViewRoIs = "EMIDRoIs"
    #l2PhotonViewsMaker.InViewRoIs = "EMCaloRoIs"
    l2PhotonViewsMaker.RoITool = ViewCreatorInitialROITool()
    l2PhotonViewsMaker.Views = "EMPhotonViews"
    l2PhotonViewsMaker.ViewFallThrough = True
    l2PhotonViewsMaker.RequireParentView = True

    thePhotonFex.RoIs = l2PhotonViewsMaker.InViewRoIs

    photonInViewAlgs = parOR("photonInViewAlgs", [ViewVerify, thePhotonFex])

    l2PhotonViewsMaker.ViewNodeName = "photonInViewAlgs"

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlgMT
    thePhotonHypo = TrigEgammaFastPhotonHypoAlgMT()
    thePhotonHypo.Photons = thePhotonFex.PhotonsName
    thePhotonHypo.RunInView = True

    # this needs to be added:
    #electronDecisionsDumper = DumpDecisions("electronDecisionsDumper", Decisions = theElectronHypo.Output )

    photonAthSequence = seqAND("photonAthSequence",
                               [l2PhotonViewsMaker, photonInViewAlgs])
    from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict

    return MenuSequence(Maker=l2PhotonViewsMaker,
                        Sequence=photonAthSequence,
                        Hypo=thePhotonHypo,
                        HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict)
コード例 #19
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
コード例 #20
0
def triggerSummaryCfg(flags, hypos):
    """
    Configures an algorithm(s) that should be run after the selection process
    Returns: ca, algorithm
    """
    acc = ComponentAccumulator()
    DecisionSummaryMakerAlg=CompFactory.DecisionSummaryMakerAlg
    from TrigEDMConfig.TriggerEDMRun3 import recordable
    decisionSummaryAlg = DecisionSummaryMakerAlg()
    allChains = OrderedDict()

    
    for stepName, stepHypos in sorted( hypos.items() ):
        # order hypos so that ComboHypos are last ones
        orderedStepHypos = sorted(stepHypos, key=lambda hypo: __isCombo(hypo))  
        for hypo in orderedStepHypos:
            hypoChains,hypoOutputKey = __decisionsFromHypo( hypo )
            allChains.update( OrderedDict.fromkeys( hypoChains, hypoOutputKey ) )

    from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
    from L1Decoder.L1DecoderConfig import mapThresholdToL1DecisionCollection
    if len(TriggerConfigHLT.dicts()) == 0:
        __log.warning("No HLT menu, chains w/o algorithms are not handled")
    else:
        for chainName, chainDict in six.iteritems (TriggerConfigHLT.dicts()):
            if chainName not in allChains:
                __log.debug("The chain %s is not mentioned in any step", chainName)
                # TODO once sequences available in the menu we need to crosscheck it here
                assert len(chainDict['chainParts'])  == 1, "Chains w/o the steps can not have mutiple parts in chainDict, it makes no sense: %s"%chainName
                allChains[chainName] = mapThresholdToL1DecisionCollection( chainDict['chainParts'][0]['L1threshold'] )
                __log.debug("The chain %s final decisions will be taken from %s", chainName, allChains[chainName] )


    for c, cont in six.iteritems (allChains):
        __log.debug("Final decision of chain  " + c + " will be read from " + cont )
    decisionSummaryAlg.FinalDecisionKeys = list(OrderedDict.fromkeys(allChains.values()))
    decisionSummaryAlg.FinalStepDecisions = dict(allChains)
    decisionSummaryAlg.DecisionsSummaryKey = "HLTNav_Summary" # Output
    decisionSummaryAlg.DoCostMonitoring = flags.Trigger.CostMonitoring.doCostMonitoring
    decisionSummaryAlg.CostWriteHandleKey = recordable(flags.Trigger.CostMonitoring.outputCollection)
    return acc, decisionSummaryAlg
コード例 #21
0
def L1DecoderCfg(flags, seqName = None):
    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior += 1

    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator

    #from L1Decoder.L1DecoderConf import L1Decoder, CTPUnpackingTool
    from L1Decoder.L1DecoderMonitoring import CTPUnpackingMonitoring

    acc = ComponentAccumulator(sequenceName = seqName)

    decoderAlg = CompFactory.L1Decoder()
    decoderAlg.RoIBResult = "RoIBResult" if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1 else ""
    decoderAlg.L1TriggerResult = "L1TriggerResult" if flags.Trigger.enableL1Phase1 else ""
    decoderAlg.L1DecoderSummaryKey = "L1DecoderSummary" # Transient, consumed by DecisionSummaryMakerAlg
    decoderAlg.ctpUnpacker = CompFactory.CTPUnpackingTool( ForceEnableAllChains = flags.Trigger.L1Decoder.forceEnableAllChains,
                                                           MonTool = CTPUnpackingMonitoring(512, 200),
                                                           UseNewConfig = flags.Trigger.readLVL1FromJSON )
    #Transient bytestream
    if flags.Input.Format == "POOL":
        transTypeKey = ("TransientBSOutType","StoreGateSvc+TransientBSOutKey")
        decoderAlg.ExtraInputs += [transTypeKey]


    from TrigEDMConfig.TriggerEDMRun3 import recordable
    decoderAlg.roiUnpackers += [ CompFactory.FSRoIsUnpackingTool("FSRoIsUnpackingTool", Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"),
                                  OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED")) ) ]

    if flags.Trigger.doCalo:
        unpackers, rerunUnpackers = createCaloRoIUnpackers()
        decoderAlg.roiUnpackers += unpackers
        decoderAlg.rerunRoiUnpackers += rerunUnpackers

    if flags.Trigger.doMuon:
        unpackers, rerunUnpackers = createMuonRoIUnpackers()
        decoderAlg.roiUnpackers += unpackers
        decoderAlg.rerunRoiUnpackers += rerunUnpackers

    decoderAlg.prescaler = createPrescalingTool()
    decoderAlg.DoCostMonitoring = flags.Trigger.CostMonitoring.doCostMonitoring
    decoderAlg.CostMonitoringChain = flags.Trigger.CostMonitoring.chain

    acc.addEventAlgo( decoderAlg, sequenceName = seqName )

    if flags.Input.Format == "BS":
        # Add the algorithm decoding ByteStream into xAOD (Run-3 L1) and/or RoIBResult (legacy L1)
        from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
        acc.merge( L1TriggerByteStreamDecoderCfg(flags), sequenceName = seqName )

    # Add the algorithm creating L1TriggerResult which is the input to L1Decoder (Run-3 L1)
    if flags.Trigger.enableL1Phase1:
        acc.addEventAlgo( getL1TriggerResultMaker(), sequenceName = seqName )

    from TrigConfigSvc.TrigConfigSvcCfg import TrigConfigSvcCfg, HLTPrescaleCondAlgCfg
    acc.merge( TrigConfigSvcCfg( flags ) )
    acc.merge( HLTPrescaleCondAlgCfg( flags ) )


    Configurable.configurableRun3Behavior -= 1

    return acc
コード例 #22
0
 def outputKey(self):
     """ The MET container object produced by this algorithm """
     from TrigEDMConfig.TriggerEDMRun3 import recordable
     return recordable("HLT_MET_{}".format(self._suffix) )
コード例 #23
0
def generateChains(flags, chainDict):
    import pprint
    pprint.pprint(chainDict)

    firstStepName = getChainStepName('Electron', 1)
    stepReco, stepView = createStepView(firstStepName)

    accCalo = ComponentAccumulator()
    accCalo.addSequence(stepView)

    l2CaloReco = l2CaloRecoCfg(flags)
    accCalo.merge(l2CaloReco, sequenceName=stepReco.getName())

    # this alg needs EventInfo decorated with the  pileup info
    from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
    accCalo.merge(LumiBlockMuWriterCfg(flags))

    l2CaloHypo = l2CaloHypoCfg(
        flags,
        name='L2ElectronCaloHypo',
        CaloClusters=recordable('HLT_FastCaloEMClusters'))

    accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())

    fastCaloSequence = CAMenuSequence(
        Sequence=l2CaloReco.sequence(),
        Maker=l2CaloReco.inputMaker(),
        Hypo=l2CaloHypo,
        HypoToolGen=TrigEgammaFastCaloHypoToolFromDict,
        CA=accCalo)

    accCalo.printConfig()

    fastCaloStep = ChainStep(name=firstStepName,
                             Sequences=[fastCaloSequence],
                             chainDicts=[chainDict])

    secondStepName = getChainStepName('Electron', 2)
    stepReco, stepView = createStepView(secondStepName)

    accTrk = ComponentAccumulator()
    accTrk.addSequence(stepView)

    # # # fast ID
    from TrigInDetConfig.TrigInDetConfig import indetInViewRecoCfg
    fastInDetReco = indetInViewRecoCfg(flags,
                                       viewMakerName='ElectronInDet',
                                       signature='Electron')
    accTrk.merge(fastInDetReco, sequenceName=stepReco.getName())
    # TODO once tracking fully works remove fake hypos

    # TODO remove once full tracking is in place
    fakeHypoAlg = fakeHypoAlgCfg(flags, name='FakeHypoForElectron')

    def makeFakeHypoTool(chainDict, cfg=None):
        return CompFactory.getComp("HLTTest::TestHypoTool")(
            chainDict['chainName'])

    accTrk.addEventAlgo(fakeHypoAlg, sequenceName=stepView.getName())

    fastInDetSequence = CAMenuSequence(Sequence=fastInDetReco.sequence(),
                                       Maker=fastInDetReco.inputMaker(),
                                       Hypo=fakeHypoAlg,
                                       HypoToolGen=makeFakeHypoTool,
                                       CA=accTrk)

    fastInDetStep = ChainStep(name=secondStepName,
                              Sequences=[fastInDetSequence],
                              chainDicts=[chainDict])

    l1Thresholds = []
    for part in chainDict['chainParts']:
        l1Thresholds.append(part['L1threshold'])

    # # # EF calo

    # # # EF ID

    # # # offline egamma

    chain = Chain(chainDict['chainName'],
                  L1Thresholds=l1Thresholds,
                  ChainSteps=[fastCaloStep, fastInDetStep])

    return chain
コード例 #24
0
def makeInDetAlgs(whichSignature='',
                  separateTrackParticleCreator='',
                  rois='EMViewRoIs',
                  doFTF=True,
                  viewVerifier='IDViewDataVerifier'):
    #If signature specified add suffix to the algorithms
    signature = whichSignature if whichSignature else ''
    if signature != "" and separateTrackParticleCreator == "":
        separateTrackParticleCreator = signature

    if signature == "":
        raise ValueError('makeInDetAlgs() No signature specified')

    #Global keys/names for Trigger collections
    from .InDetTrigCollectionKeys import TrigPixelKeys, TrigSCTKeys
    from InDetRecExample.InDetKeys import InDetKeys
    from TrigInDetConfig.TrigInDetConfig import InDetCacheNames
    from AthenaCommon.GlobalFlags import globalflags

    viewAlgs = []

    ViewDataVerifier = None
    if viewVerifier:
        import AthenaCommon.CfgMgr as CfgMgr
        ViewDataVerifier = CfgMgr.AthViews__ViewDataVerifier(viewVerifier +
                                                             signature)
        ViewDataVerifier.DataObjects = [
            ('InDet::PixelClusterContainerCache',
             InDetCacheNames.Pixel_ClusterKey),
            ('PixelRDO_Cache', InDetCacheNames.PixRDOCacheKey),
            ('InDet::SCT_ClusterContainerCache',
             InDetCacheNames.SCT_ClusterKey),
            ('SCT_RDO_Cache', InDetCacheNames.SCTRDOCacheKey),
            ('SpacePointCache', InDetCacheNames.SpacePointCachePix),
            ('SpacePointCache', InDetCacheNames.SpacePointCacheSCT),
            ('IDCInDetBSErrContainer_Cache', InDetCacheNames.SCTBSErrCacheKey),
            ('IDCInDetBSErrContainer_Cache',
             InDetCacheNames.SCTFlaggedCondCacheKey),
            ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
            ('TagInfo', 'DetectorStore+ProcessingTags')
        ]

        viewAlgs.append(ViewDataVerifier)

        # Load RDOs if we aren't loading bytestream
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        topSequence.SGInputLoader.Load += [('TagInfo',
                                            'DetectorStore+ProcessingTags')]

        if not globalflags.InputFormat.is_bytestream():
            ViewDataVerifier.DataObjects += [
                ('PixelRDO_Container', InDetKeys.PixelRDOs()),
                ('SCT_RDO_Container', InDetKeys.SCT_RDOs()),
                ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs())
            ]
            topSequence.SGInputLoader.Load += [
                ('PixelRDO_Container', InDetKeys.PixelRDOs()),
                ('SCT_RDO_Container', InDetKeys.SCT_RDOs()),
                ('IDCInDetBSErrContainer', InDetKeys.SCT_ByteStreamErrs())
            ]

    from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
    from AthenaCommon.AppMgr import ToolSvc

    #Only add raw data decoders if we're running over raw data
    if globalflags.InputFormat.is_bytestream():
        #Pixel

        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder
        InDetPixelRodDecoder = PixelRodDecoder(name="InDetPixelRodDecoder_" +
                                               signature)
        # Disable duplcated pixel check for data15 because duplication mechanism was used.
        from RecExConfig.RecFlags import rec
        if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15":
            InDetPixelRodDecoder.CheckDuplicatedPixel = False
        ToolSvc += InDetPixelRodDecoder

        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool
        InDetPixelRawDataProviderTool = PixelRawDataProviderTool(
            name="InDetPixelRawDataProviderTool_" + signature,
            Decoder=InDetPixelRodDecoder,
            checkLVL1ID=False)
        ToolSvc += InDetPixelRawDataProviderTool

        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetPixelRawDataProviderTool)  # noqa: ATL901

        # load the PixelRawDataProvider
        from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider
        InDetPixelRawDataProvider = PixelRawDataProvider(
            name="InDetPixelRawDataProvider_" + signature,
            RDOKey=InDetKeys.PixelRDOs(),
            ProviderTool=InDetPixelRawDataProviderTool,
        )
        InDetPixelRawDataProvider.isRoI_Seeded = True
        InDetPixelRawDataProvider.RoIs = rois
        InDetPixelRawDataProvider.RDOCacheKey = InDetCacheNames.PixRDOCacheKey

        viewAlgs.append(InDetPixelRawDataProvider)

        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetPixelRawDataProvider)  # noqa: ATL901

        #SCT
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder
        InDetSCTRodDecoder = SCT_RodDecoder(name="InDetSCTRodDecoder_" +
                                            signature)
        ToolSvc += InDetSCTRodDecoder

        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool
        InDetSCTRawDataProviderTool = SCTRawDataProviderTool(
            name="InDetSCTRawDataProviderTool_" + signature,
            Decoder=InDetSCTRodDecoder)
        ToolSvc += InDetSCTRawDataProviderTool
        if (InDetTrigFlags.doPrintConfigurables()):
            print(InDetSCTRawDataProviderTool)  # noqa: ATL901

        # load the SCTRawDataProvider
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider
        InDetSCTRawDataProvider = SCTRawDataProvider(
            name="InDetSCTRawDataProvider_" + signature,
            RDOKey=InDetKeys.SCT_RDOs(),
            ProviderTool=InDetSCTRawDataProviderTool)
        InDetSCTRawDataProvider.isRoI_Seeded = True
        InDetSCTRawDataProvider.RoIs = rois
        InDetSCTRawDataProvider.RDOCacheKey = InDetCacheNames.SCTRDOCacheKey
        InDetSCTRawDataProvider.BSErrCacheKey = InDetCacheNames.SCTBSErrCacheKey

        from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT
        InDetSCTRawDataProvider.RegSelTool = makeRegSelTool_SCT()

        viewAlgs.append(InDetSCTRawDataProvider)

        # load the SCTEventFlagWriter
        from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTEventFlagWriter
        InDetSCTEventFlagWriter = SCTEventFlagWriter(
            name="InDetSCTEventFlagWriter_" + signature)

        viewAlgs.append(InDetSCTEventFlagWriter)

    #Pixel clusterisation
    from InDetTrigRecExample.InDetTrigConfigRecLoadTools import TrigPixelLorentzAngleTool, TrigSCTLorentzAngleTool

    from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg
    PixelConfigCondAlg.UseCalibConditions = False

    from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool
    InDetClusterMakerTool = InDet__ClusterMakerTool(
        name="InDetClusterMakerTool_" + signature,
        SCTLorentzAngleTool=TrigSCTLorentzAngleTool,
        PixelLorentzAngleTool=TrigPixelLorentzAngleTool)

    ToolSvc += InDetClusterMakerTool

    from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool
    InDetMergedPixelsTool = InDet__MergedPixelsTool(
        name="InDetMergedPixelsTool_" + signature,
        globalPosAlg=InDetClusterMakerTool,
        MinimalSplitSize=0,
        MaximalSplitSize=49,
        MinimalSplitProbability=0,
        DoIBLSplitting=True,
    )
    # Enable duplcated RDO check for data15 because duplication mechanism was used.
    from RecExConfig.RecFlags import rec
    if len(rec.projectName()) >= 6 and rec.projectName()[:6] == "data15":
        InDetMergedPixelsTool.CheckDuplicatedRDO = True
    ToolSvc += InDetMergedPixelsTool

    from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder
    InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(
        name="InDetPixelGangedAmbiguitiesFinder_" + signature)
    ToolSvc += InDetPixelGangedAmbiguitiesFinder

    from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization
    InDetPixelClusterization = InDet__PixelClusterization(
        name="InDetPixelClusterization_" + signature,
        clusteringTool=InDetMergedPixelsTool,
        gangedAmbiguitiesFinder=InDetPixelGangedAmbiguitiesFinder,
        DataObjectName=InDetKeys.PixelRDOs(),
        AmbiguitiesMap=TrigPixelKeys.PixelClusterAmbiguitiesMap,
        ClustersName=TrigPixelKeys.Clusters)

    InDetPixelClusterization.isRoI_Seeded = True
    InDetPixelClusterization.RoIs = rois
    InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheNames.Pixel_ClusterKey

    viewAlgs.append(InDetPixelClusterization)

    # Create SCT_ConditionsSummaryTool
    from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup
    sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup(
        "InDetSCT_ConditionsSummaryTool_" + signature)
    sct_ConditionsSummaryToolSetup.setup()
    InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool(
    )  # noqa: F841
    sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup(
        "InDetSCT_ConditionsSummaryToolWithoutFlagged_" + signature)
    sct_ConditionsSummaryToolSetupWithoutFlagged.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool(
    )

    # Add conditions tools to SCT_ConditionsSummaryTool
    from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup
    sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup(
    )
    sct_ConfigurationConditionsToolSetup.setToolName(
        "InDetSCT_ConfigurationConditionsTool_" + signature)
    sct_ConfigurationConditionsToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ConfigurationConditionsToolSetup.getTool().getFullName())

    from SCT_ConditionsTools.SCT_ReadCalibDataToolSetup import SCT_ReadCalibDataToolSetup
    sct_ReadCalibDataToolSetup = SCT_ReadCalibDataToolSetup()
    sct_ReadCalibDataToolSetup.setToolName("InDetSCT_ReadCalibDataTool_" +
                                           signature)
    sct_ReadCalibDataToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ReadCalibDataToolSetup.getTool().getFullName())

    from SCT_ConditionsTools.SCT_ByteStreamErrorsToolSetup import SCT_ByteStreamErrorsToolSetup
    sct_ByteStreamErrorsToolSetup = SCT_ByteStreamErrorsToolSetup()
    sct_ByteStreamErrorsToolSetup.setToolName("InDetSCT_BSErrorTool_" +
                                              signature)
    sct_ByteStreamErrorsToolSetup.setConfigTool(
        sct_ConfigurationConditionsToolSetup.getTool())
    sct_ByteStreamErrorsToolSetup.setup()
    InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools.append(
        sct_ByteStreamErrorsToolSetup.getTool().getFullName())

    if (InDetTrigFlags.doPrintConfigurables()):
        print(InDetSCT_ConditionsSummaryToolWithoutFlagged)

    #
    # --- SCT_ClusteringTool
    #
    from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool
    InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(
        name="InDetSCT_ClusteringTool_" + signature,
        globalPosAlg=InDetClusterMakerTool,
        conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged)
    if InDetTrigFlags.doSCTIntimeHits():
        if InDetTrigFlags.InDet25nsec():
            InDetSCT_ClusteringTool.timeBins = "01X"
        else:
            InDetSCT_ClusteringTool.timeBins = "X1X"

    #
    # --- SCT_Clusterization algorithm
    #

    from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization
    InDetSCT_Clusterization = InDet__SCT_Clusterization(
        name="InDetSCT_Clusterization_" + signature,
        clusteringTool=InDetSCT_ClusteringTool,
        # ChannelStatus         = InDetSCT_ChannelStatusAlg,
        DataObjectName=InDetKeys.SCT_RDOs(),
        ClustersName=TrigSCTKeys.Clusters,
        #Adding the suffix to flagged conditions
        SCT_FlaggedCondData="SCT_FlaggedCondData_TRIG",
        conditionsTool=InDetSCT_ConditionsSummaryToolWithoutFlagged)
    InDetSCT_Clusterization.isRoI_Seeded = True
    InDetSCT_Clusterization.RoIs = rois
    InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheNames.SCT_ClusterKey
    InDetSCT_Clusterization.FlaggedCondCacheKey = InDetCacheNames.SCTFlaggedCondCacheKey

    from RegionSelector.RegSelToolConfig import makeRegSelTool_SCT
    InDetSCT_Clusterization.RegSelTool = makeRegSelTool_SCT()

    viewAlgs.append(InDetSCT_Clusterization)

    #Space points and FTF

    from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool
    InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(
        name="InDetSiSpacePointMakerTool_" + signature)

    from AthenaCommon.DetFlags import DetFlags
    from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder
    from SiSpacePointFormation.InDetOnlineMonitor import InDetMonitoringTool
    InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(
        name="InDetSiTrackerSpacePointFinder_" + signature,
        SiSpacePointMakerTool=InDetSiSpacePointMakerTool,
        PixelsClustersName=TrigPixelKeys.Clusters,
        SpacePointsPixelName=TrigPixelKeys.SpacePoints,
        SCT_ClustersName=TrigSCTKeys.Clusters,
        SpacePointsSCTName=TrigSCTKeys.SpacePoints,
        SpacePointsOverlapName=InDetKeys.OverlapSpacePoints(),
        ProcessPixels=DetFlags.haveRIO.pixel_on(),
        ProcessSCTs=DetFlags.haveRIO.SCT_on(),
        ProcessOverlaps=DetFlags.haveRIO.SCT_on(),
        SpacePointCacheSCT=InDetCacheNames.SpacePointCacheSCT,
        SpacePointCachePix=InDetCacheNames.SpacePointCachePix,
        monTool=InDetMonitoringTool())

    viewAlgs.append(InDetSiTrackerSpacePointFinder)

    # Condition algorithm for SiTrackerSpacePointFinder
    if InDetSiTrackerSpacePointFinder.ProcessSCTs:
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")
        if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"):
            # Setup alignment folders and conditions algorithms
            from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg
            condSeq += InDet__SiElementPropertiesTableCondAlg(
                name="InDetSiElementPropertiesTableCondAlg")

    #FIXME have a flag for now set for True( as most cases call FTF) but potentially separate
    if doFTF:
        from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinderBase
        theFTF = TrigFastTrackFinderBase(
            "TrigFastTrackFinder_" + whichSignature, whichSignature)
        theFTF.RoIs = rois
        theFTF.TracksName = "TrigFastTrackFinder_Tracks_" + separateTrackParticleCreator

        #the following doCloneRemoval modification should be set up in the InDetTrigSliceSettings once legacy trigger not needed
        if whichSignature == "Electron":
            theFTF.doCloneRemoval = True

        viewAlgs.append(theFTF)

        from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF
        from TrigEDMConfig.TriggerEDMRun3 import recordable
        from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT

        trackCollection = "HLT_IDTrack_" + separateTrackParticleCreator + "_FTF"

        theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(
            name="InDetTrigTrackParticleCreatorAlg" + whichSignature,
            TrackName="TrigFastTrackFinder_Tracks_" +
            separateTrackParticleCreator,
            ParticleCreatorTool=InDetTrigParticleCreatorToolFTF)

        if separateTrackParticleCreator == "BeamSpot":
            theTrackParticleCreatorAlg.TrackParticlesName = trackCollection
        else:
            theTrackParticleCreatorAlg.TrackParticlesName = recordable(
                trackCollection)
        viewAlgs.append(theTrackParticleCreatorAlg)

    return viewAlgs, ViewDataVerifier
コード例 #25
0
class CaloMenuDefs(object):
      """Static Class to collect all string manipulations in Calo sequences """
      from TrigEDMConfig.TriggerEDMRun3 import recordable
      L2CaloClusters= recordable("HLT_FastCaloEMClusters")
コード例 #26
0
def generateChains(flags, chainDict):

    firstStepName = getChainStepName('Photon', 1)
    stepReco, stepView = createStepView(firstStepName)

    accCalo = ComponentAccumulator()
    accCalo.addSequence(stepView)

    l2CaloReco = l2CaloRecoCfg(flags)
    accCalo.merge(l2CaloReco, sequenceName=stepReco.getName())

    # this alg needs EventInfo decorated with the  pileup info
    from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
    accCalo.merge(LumiBlockMuWriterCfg(flags))

    l2CaloHypo = l2CaloHypoCfg(
        flags,
        name='L2PhotonCaloHypo',
        CaloClusters=recordable('HLT_FastCaloEMClusters'))

    accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName())

    fastCaloSequence = CAMenuSequence(
        Sequence=l2CaloReco.sequence(),
        Maker=l2CaloReco.inputMaker(),
        Hypo=l2CaloHypo,
        HypoToolGen=TrigEgammaFastCaloHypoToolFromDict,
        CA=accCalo)

    fastCaloStep = ChainStep(firstStepName, [fastCaloSequence])

    secondStepName = getChainStepName('Photon', 2)
    stepReco, stepView = createStepView(secondStepName)

    accPhoton = ComponentAccumulator()
    accPhoton.addSequence(stepView)

    l2PhotonReco = l2PhotonRecoCfg(flags)
    accPhoton.merge(l2PhotonReco, sequenceName=stepReco.getName())

    l2PhotonHypo = l2PhotonHypoCfg(flags,
                                   Photons='HLT_FastPhotons',
                                   RunInView=True)

    accPhoton.addEventAlgo(l2PhotonHypo, sequenceName=stepView.getName())

    l2PhotonSequence = CAMenuSequence(
        Sequence=l2PhotonReco.sequence(),
        Maker=l2PhotonReco.inputMaker(),
        Hypo=l2PhotonHypo,
        HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict,
        CA=accPhoton)

    l2PhotonStep = ChainStep(secondStepName, [l2PhotonSequence])

    l1Thresholds = []
    for part in chainDict['chainParts']:
        l1Thresholds.append(part['L1threshold'])

    log.debug('dictionary is: %s\n', pprint.pformat(chainDict))

    chain = Chain(chainDict['chainName'],
                  L1Thresholds=l1Thresholds,
                  ChainSteps=[fastCaloStep, l2PhotonStep])
    return chain
コード例 #27
0
def muCombAlgSequence(ConfigFlags):
    ### set the EVCreator ###
    l2muCombViewsMaker = EventViewCreatorAlgorithm("IMl2muComb")
    newRoITool = ViewCreatorFetchFromViewROITool()
    newRoITool.RoisWriteHandleKey = recordable(
        "HLT_Roi_L2SAMuon")  #RoI collection recorded to EDM
    newRoITool.InViewRoIs = muNames.L2forIDName  #input RoIs from L2 SA views

    #
    l2muCombViewsMaker.RoIsLink = "initialRoI"  # ROI for merging is still from L1, we get exactly one L2 SA muon per L1 ROI
    l2muCombViewsMaker.RoITool = newRoITool  # Create a new ROI centred on the L2 SA muon from Step 1
    #
    l2muCombViewsMaker.Views = "MUCombViewRoIs"  #output of the views maker (key in "storegate")
    l2muCombViewsMaker.InViewRoIs = "MUIDRoIs"  # Name of the RoI collection inside of the view, holds the single ROI used to seed the View.
    #
    l2muCombViewsMaker.RequireParentView = True
    l2muCombViewsMaker.ViewFallThrough = True  #if this needs to access anything from the previous step, from within the view

    ### get ID tracking and muComb reco sequences ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muCombRecoSequence, muonIDFastTrackingSequence
    muCombRecoSequence, sequenceOut = muCombRecoSequence(
        l2muCombViewsMaker.InViewRoIs, "FTF")

    #Filter algorithm to run muComb only if non-Bphysics muon chains are active
    from TrigMuonEF.TrigMuonEFConf import MuonChainFilterAlg
    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming
    muonChainFilter = MuonChainFilterAlg("FilterBphysChains")
    bphysChains = getBphysChainNames()
    muonChainFilter.ChainsToFilter = bphysChains
    muonChainFilter.InputDecisions = [
        CFNaming.inputMakerOutName(l2muCombViewsMaker.name())
    ]
    muonChainFilter.L2MuCombContainer = sequenceOut

    muCombFilterSequence = seqAND("l2muCombFilterSequence",
                                  [muonChainFilter, muCombRecoSequence])

    extraLoads = []
    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'):
        extraLoads += [('CondAttrListCollection',
                        'ConditionStore+/PIXEL/DCS/FSMSTATUS')]
    if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'):
        extraLoads += [('CondAttrListCollection',
                        'ConditionStore+/PIXEL/DCS/FSMSTATE')]

    for decision in muonChainFilter.InputDecisions:
        extraLoads += [('xAOD::TrigCompositeContainer',
                        'StoreGateSvc+' + decision)]

    muFastIDRecoSequence = muonIDFastTrackingSequence(
        l2muCombViewsMaker.InViewRoIs, "", extraLoads)
    muCombIDSequence = parOR("l2muCombIDSequence",
                             [muFastIDRecoSequence, muCombFilterSequence])

    l2muCombViewsMaker.ViewNodeName = muCombIDSequence.name()

    l2muCombSequence = seqAND("l2muCombSequence",
                              [l2muCombViewsMaker, muCombIDSequence])

    return (l2muCombSequence, l2muCombViewsMaker, sequenceOut)
コード例 #28
0
    def getMinBiasTrkStep(self):
        """ Use the reco-dict to construct a single MinBias step """
        def generateTrackCountHypo(chainDict):
            hypo = TrackCountHypoTool(chainDict["chainName"])
            if "hmt" in chainDict["chainName"]:
                hypo.required_ntrks = int(
                    chainDict["chainParts"][0]["hypoEFInfo"].strip("trk"))
            if "mb_sptrk" in chainDict["chainName"]:
                hypo.min_pt = 0.2
                hypo.max_z0 = 401

            # will set here cuts
            return hypo

        from TrigMinBias.TrigMinBiasConf import TrackCountHypoAlgMT, TrackCountHypoTool

        TrkInputMakerAlg = EventViewCreatorAlgorithm("IM_TrkEventViewCreator")
        TrkInputMakerAlg.ViewFallThrough = True
        TrkInputMakerAlg.RoITool = ViewCreatorInitialROITool()
        TrkInputMakerAlg.InViewRoIs = "InputRoI"  # contract with the consumer
        TrkInputMakerAlg.Views = "TrkView"
        TrkInputMakerAlg.RequireParentView = True
        TrkInputMakerAlg.ViewNodeName = "TrkCountHypoAlgMTNode"

        # prepare algorithms to run in views, first, inform scheduler that input data is available in parent view (has to be done by hand)
        idAlgs, verifier = makeInDetAlgs(whichSignature='MinBias',
                                         separateTrackParticleCreator='',
                                         rois=TrkInputMakerAlg.InViewRoIs,
                                         viewVerifier='TrkrecoSeqDataVerifier')
        verifier.DataObjects += [
            ('TrigRoiDescriptorCollection', 'StoreGateSvc+InputRoI'),
            ('IDCInDetBSErrContainer',
             'StoreGateSvc+SCT_FlaggedCondData_TRIG'),
            ('InDet::SCT_ClusterContainer', 'StoreGateSvc+SCT_TrigClusters'),
            ('SpacePointContainer', 'StoreGateSvc+SCT_TrigSpacePoints'),
            ('InDet::PixelClusterContainer', 'StoreGateSvc+PixelTrigClusters'),
            ('SpacePointContainer', 'StoreGateSvc+PixelTrigSpacePoints')
        ]

        if globalflags.InputFormat.is_bytestream():
            verifier.DataObjects += [
                ('InDetBSErrContainer', 'StoreGateSvc+PixelByteStreamErrs'),
                ('IDCInDetBSErrContainer', 'StoreGateSvc+SCT_ByteStreamErrs')
            ]

        TrkList = idAlgs[
            -2:]  # FTF and Track to xAOD::TrackParticle conversion alg
        TrackCountHypo = TrackCountHypoAlgMT()
        TrackCountHypo.trackCountKey = recordable("HLT_TrackCount")
        TrackCountHypo.tracksKey = recordable("HLT_IDTrack_MinBias_FTF")

        from TrigMinBias.TrackCountMonitoringMT import TrackCountMonitoring
        TrackCountHypo.MonTool = TrackCountMonitoring()

        TrkrecoSeq = parOR("TrkrecoSeq", [verifier] + TrkList)
        TrkSequence = seqAND("TrkSequence", [TrkInputMakerAlg, TrkrecoSeq])
        TrkInputMakerAlg.ViewNodeName = TrkrecoSeq.name()

        Step2_TrkCount = ChainStep("Step2_TrkCount", [
            MenuSequence(Sequence=TrkSequence,
                         Maker=TrkInputMakerAlg,
                         Hypo=TrackCountHypo,
                         HypoToolGen=generateTrackCountHypo)
        ])
        return Step2_TrkCount
コード例 #29
0
def getFlavourTagging(inputJets, inputVertex, inputTracks):

    acc = ComponentAccumulator()

    #Output container names as defined in TriggerEDMRun3
    BTagName = recordable("HLT_BTagging")

    #Particle to Jet Association
    TrackToJetAssociators = ['BTagTrackToJetAssociator']
    kwargs = {}
    kwargs['Release'] = '22'
    acc.merge(
        JetParticleAssociationAlgCfg(ConfigFlags,
                                     inputJets.replace("Jets",
                                                       ""), inputTracks,
                                     TrackToJetAssociators[0], **kwargs))

    #Secondary Vertexing
    SecVertexingAndAssociators = {
        'JetFitter': 'BTagTrackToJetAssociator',
        'SV1': 'BTagTrackToJetAssociator'
    }
    for k, v in SecVertexingAndAssociators.items():
        if v not in TrackToJetAssociators:
            raise RuntimeError(v + ' is not configured')
        acc.merge(
            JetSecVtxFindingAlgCfg(ConfigFlags, inputJets.replace("Jets", ""),
                                   inputVertex, k, v))
        acc.merge(
            JetSecVertexingAlgCfg(ConfigFlags, BTagName,
                                  inputJets.replace("Jets", ""), inputVertex,
                                  k, v))

    #Run Run2 taggers, i.e. IP2D, IP3D, SV1, JetFitter, MV2c10
    acc.merge(
        JetBTaggingAlgCfg(ConfigFlags,
                          BTaggingCollection=BTagName,
                          JetCollection=inputJets.replace("Jets", ""),
                          PrimaryVertexCollectionName=inputVertex,
                          TaggerList=ConfigFlags.BTagging.Run2TrigTaggers,
                          SetupScheme="Trig",
                          SVandAssoc=SecVertexingAndAssociators))

    #Track Augmenter
    acc.merge(
        BTagTrackAugmenterAlgCfg(ConfigFlags,
                                 TrackCollection=inputTracks,
                                 PrimaryVertexCollectionName=inputVertex))

    #Jet Augmenter
    acc.merge(
        BTagHighLevelAugmenterAlgCfg(ConfigFlags,
                                     JetCollection=inputJets.replace(
                                         "Jets", ""),
                                     BTagCollection=BTagName,
                                     Associator=TrackToJetAssociators[0]))

    #Run new Run3 taggers, i.e. DL1, RNNIP, DL1r
    postTagDL2JetToTrainingMap = {
        'AntiKt4EMPFlow': [
            #'BTagging/201903/smt/antikt4empflow/network.json',
            'BTagging/201903/rnnip/antikt4empflow/network.json',
            'BTagging/201903/dl1r/antikt4empflow/network.json',
            'BTagging/201903/dl1/antikt4empflow/network.json',
            #'BTagging/201903/dl1rmu/antikt4empflow/network.json',
        ]
    }
    for jsonFile in postTagDL2JetToTrainingMap['AntiKt4EMPFlow']:
        acc.merge(
            HighLevelBTagAlgCfg(ConfigFlags,
                                BTaggingCollection=BTagName,
                                TrackCollection=inputTracks,
                                NNFile=jsonFile))

    return [acc, BTagName]
コード例 #30
0
    def getMinBiasSpStep(self):
        """ Use the reco-dict to construct a single MinBias step """
        def generateSPCountHypo(chainDict):
            hypo = SPCountHypoTool(chainDict["chainName"])
            if "hmt" in chainDict["chainName"]:
                hypo.totNumSctSP = int(
                    chainDict["chainParts"][0]["hypoL2Info"].strip("sp"))
            if "mb_sptrk" in chainDict["chainName"]:
                hypo.totNumPixSP = 2
                hypo.totNumSctSP = 3
            # will set here thresholds
            return hypo

        SpList = []
        from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePointsMT, SPCountHypoAlgMT, SPCountHypoTool

        SPInputMakerAlg = EventViewCreatorAlgorithm("IM_SPEventViewCreator")
        SPInputMakerAlg.ViewFallThrough = True
        SPInputMakerAlg.RoITool = ViewCreatorInitialROITool()
        SPInputMakerAlg.InViewRoIs = "InputRoI"
        SPInputMakerAlg.Views = "SPView"
        idAlgs, verifier = makeInDetAlgs(whichSignature='MinBias',
                                         separateTrackParticleCreator='',
                                         rois=SPInputMakerAlg.InViewRoIs,
                                         viewVerifier='SPViewDataVerifier')
        verifier.DataObjects += [('TrigRoiDescriptorCollection',
                                  'StoreGateSvc+InputRoI'),
                                 ('SCT_ID', 'DetectorStore+SCT_ID'),
                                 ('PixelID', 'DetectorStore+PixelID'),
                                 ('TagInfo', 'DetectorStore+ProcessingTags')]

        # Make sure required objects are still available at whole-event level
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()
        topSequence.SGInputLoader.Load += [
            ('SCT_ID', 'DetectorStore+SCT_ID'),
            ('PixelID', 'DetectorStore+PixelID'),
            ('TagInfo', 'DetectorStore+ProcessingTags')
        ]

        from IOVDbSvc.CondDB import conddb
        if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'):
            verifier.DataObjects += [('CondAttrListCollection',
                                      'ConditionStore+/PIXEL/DCS/FSMSTATE')]
        if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'):
            verifier.DataObjects += [('CondAttrListCollection',
                                      'ConditionStore+/PIXEL/DCS/FSMSTATUS')]

        SpList = idAlgs[:-2]

        SpCount = TrigCountSpacePointsMT()
        SpCount.SpacePointsKey = recordable("HLT_SpacePointCounts")

        from TrigT2MinBias.TrigT2MinBiasMonitoringMT import SpCountMonitoring
        SpCount.MonTool = SpCountMonitoring()

        SPrecoSeq = parOR("SPrecoSeq", SpList + [SpCount])
        SPSequence = seqAND("SPSequence", [SPInputMakerAlg, SPrecoSeq])
        SPInputMakerAlg.ViewNodeName = SPrecoSeq.name()

        SpCountHypo = SPCountHypoAlgMT()
        SpCountHypo.SpacePointsKey = recordable("HLT_SpacePointCounts")

        Step1_SPCount = ChainStep("Step1_SPCount", [
            MenuSequence(Sequence=SPSequence,
                         Maker=SPInputMakerAlg,
                         Hypo=SpCountHypo,
                         HypoToolGen=generateSPCountHypo)
        ])

        return Step1_SPCount