예제 #1
0
def precisionElectronSequence(ConfigFlags):
    """ fourth step:  precision electron....."""
    InViewRoIs = "precisionElectron"
    # EVCreator:
    precisionElectronViewsMaker = EventViewCreatorAlgorithm(
        "IMprecisionElectron")
    precisionElectronViewsMaker.RoIsLink = "initialRoI"
    precisionElectronViewsMaker.RoITool = ViewCreatorInitialROITool()
    precisionElectronViewsMaker.InViewRoIs = InViewRoIs
    precisionElectronViewsMaker.Views = "precisionElectronViews"  #precisionElectronViews
    precisionElectronViewsMaker.ViewFallThrough = True
    precisionElectronViewsMaker.RequireParentView = True

    # Configure the reconstruction algorithm sequence
    from TriggerMenuMT.HLTMenuConfig.Electron.PrecisionElectronRecoSequences import precisionElectronRecoSequence
    (electronPrecisionRec, electronPrecisionTrack,
     sequenceOut) = precisionElectronRecoSequence(InViewRoIs)

    electronPrecisionInViewAlgs = parOR(
        "electronPrecisionInViewAlgs",
        [electronPrecisionTrack, electronPrecisionRec])
    precisionElectronViewsMaker.ViewNodeName = "electronPrecisionInViewAlgs"

    electronPrecisionAthSequence = seqAND(
        "electronPrecisionAthSequence",
        [precisionElectronViewsMaker, electronPrecisionInViewAlgs])
    return (electronPrecisionAthSequence, precisionElectronViewsMaker,
            sequenceOut)
예제 #2
0
def muEFCBFSAlgSequence(ConfigFlags):
    efcbfsInputMaker = EventViewCreatorAlgorithm("IMEFCBFS")
    newRoITool = ViewCreatorCentredOnIParticleROITool()
    newRoITool.RoisWriteHandleKey = "MuonCandidates_FS_ROIs"
    #
    efcbfsInputMaker.mergeUsingFeature = True
    efcbfsInputMaker.RoITool = newRoITool
    #
    efcbfsInputMaker.Views = "MUCBFSViews"
    efcbfsInputMaker.InViewRoIs = "MUCBFSRoIs"
    #
    efcbfsInputMaker.RequireParentView = True
    efcbfsInputMaker.ViewFallThrough = True
    # Muon specific
    efcbfsInputMaker.PlaceMuonInView = True
    efcbfsInputMaker.InViewMuons = "InViewMuons"
    efcbfsInputMaker.InViewMuonCandidates = "MuonCandidates_FS"

    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muEFCBRecoSequence
    muEFCBFSRecoSequence, sequenceOut = muEFCBRecoSequence(
        efcbfsInputMaker.InViewRoIs, "FS")

    efcbfsInputMaker.ViewNodeName = muEFCBFSRecoSequence.name()

    muonEFCBFSSequence = seqAND("muonEFFSCBSequence",
                                [efcbfsInputMaker, muEFCBFSRecoSequence])

    return (muonEFCBFSSequence, efcbfsInputMaker, sequenceOut)
예제 #3
0
def muIsoAlgSequence(ConfigFlags):

    l2muIsoViewsMaker = EventViewCreatorAlgorithm("IMl2muIso")
    #
    l2muIsoViewsMaker.RoIsLink = "roi"  # Merge based on L2SA muon
    l2muIsoViewsMaker.RoITool = ViewCreatorPreviousROITool(
    )  # Spawn EventViews on L2SA muon ROI
    #
    l2muIsoViewsMaker.Views = "MUIsoViewRoIs"
    l2muIsoViewsMaker.InViewRoIs = "MUIsoRoIs"
    #
    l2muIsoViewsMaker.RequireParentView = True
    l2muIsoViewsMaker.ViewFallThrough = True

    ### get EF reco sequence ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import l2muisoRecoSequence
    l2muisoRecoSequence, sequenceOut = l2muisoRecoSequence(
        l2muIsoViewsMaker.InViewRoIs)

    l2muIsoViewsMaker.ViewNodeName = l2muisoRecoSequence.name()

    ### Define a Sequence to run for muIso ###
    l2muIsoSequence = seqAND("l2muIsoSequence",
                             [l2muIsoViewsMaker, l2muisoRecoSequence])

    return (l2muIsoSequence, l2muIsoViewsMaker, sequenceOut)
예제 #4
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)
예제 #5
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)
예제 #6
0
def precisionPhotonSequence(ConfigFlags):
    """ This function creates the PrecisionPhoton sequence"""

    # Prepare first the EventView
    InViewRoIs = "PrecisionPhotonRoIs"
    precisionPhotonViewsMaker = EventViewCreatorAlgorithm("IMprecisionPhoton")
    precisionPhotonViewsMaker.ViewFallThrough = True
    precisionPhotonViewsMaker.RequireParentView = True
    precisionPhotonViewsMaker.RoIsLink = "initialRoI"  # ROI link used to merge inputs
    precisionPhotonViewsMaker.RoITool = ViewCreatorInitialROITool(
    )  # Tool used to supply ROIs for EventViews
    precisionPhotonViewsMaker.InViewRoIs = InViewRoIs  # names to use for the collection of which the RoIs are picked up
    precisionPhotonViewsMaker.Views = "precisionPhotonViews"  # Output container which has the view objects

    # Configure the reconstruction algorithm sequence
    from TriggerMenuMT.HLTMenuConfig.Photon.PhotonRecoSequences import precisionPhotonRecoSequence
    (precisionPhotonInViewSequence,
     sequenceOut) = precisionPhotonRecoSequence(InViewRoIs)

    precisionPhotonViewsMaker.ViewNodeName = precisionPhotonInViewSequence.name(
    )

    theSequence = seqAND(
        "precisionPhotonSequence",
        [precisionPhotonViewsMaker, precisionPhotonInViewSequence])
    return (theSequence, precisionPhotonViewsMaker, sequenceOut)
예제 #7
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)
예제 #8
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)
예제 #9
0
def muEFCBAlgSequence(ConfigFlags):

    #By default the EFCB sequence will run both outside-in and
    #(if zero muons are found) inside-out reconstruction
    from TrigMuonEF.TrigMuonEFConf import MuonFilterAlg, MergeEFMuonsAlg
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muEFCBRecoSequence, muEFInsideOutRecoSequence

    efcbViewsMaker = EventViewCreatorAlgorithm("IMefcbtotal")
    #
    efcbViewsMaker.RoIsLink = "roi"  # Merge based on L2SA muon
    efcbViewsMaker.RoITool = ViewCreatorPreviousROITool(
    )  # Spawn EventViews on L2SA muon ROI
    #
    efcbViewsMaker.Views = "MUEFCBViewRoIs"
    efcbViewsMaker.InViewRoIs = "MUEFCBRoIs"
    #
    efcbViewsMaker.RequireParentView = True
    efcbViewsMaker.ViewFallThrough = True
    efcbViewsMaker.mergeUsingFeature = True

    #outside-in reco sequence
    muEFCBRecoSequence, sequenceOutCB = muEFCBRecoSequence(
        efcbViewsMaker.InViewRoIs, "RoI")

    #Algorithm to filter events with no muons
    muonFilter = MuonFilterAlg("FilterZeroMuons")
    muonFilter.MuonContainerLocation = sequenceOutCB

    #inside-out reco sequence - runs only if filter is passed
    muonEFInsideOutRecoSequence, sequenceOutInsideOut = muEFInsideOutRecoSequence(
        efcbViewsMaker.InViewRoIs, "RoI")
    muonInsideOutSequence = seqAND("muonEFInsideOutSequence",
                                   [muonFilter, muonEFInsideOutRecoSequence])

    #combine outside-in and inside-out sequences
    muonRecoSequence = parOR("muonEFCBandInsideOutRecoSequence",
                             [muEFCBRecoSequence, muonInsideOutSequence])

    #Merge muon containers from outside-in and inside-out reco
    muonMerger = MergeEFMuonsAlg("MergeEFMuons")
    muonMerger.MuonCBContainerLocation = sequenceOutCB
    muonMerger.MuonInsideOutContainerLocation = sequenceOutInsideOut
    muonMerger.MuonOutputLocation = muNames.EFCBName
    sequenceOut = muonMerger.MuonOutputLocation

    #Add merging alg in sequence with reco sequences
    mergeSequence = seqOR("muonCBInsideOutMergingSequence",
                          [muonRecoSequence, muonMerger])

    #Final sequence running in view
    efcbViewsMaker.ViewNodeName = mergeSequence.name()
    muonSequence = seqAND("muonEFCBandInsideOutSequence",
                          [efcbViewsMaker, mergeSequence])

    return (muonSequence, efcbViewsMaker, sequenceOut)
예제 #10
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)
예제 #11
0
def precisionCaloSequence(ConfigFlags):
    """ Creates PrecisionCalo sequence """
    # EV creator
    InViewRoIs = "PrecisionCaloRoIs"
    precisionCaloViewsMaker = EventViewCreatorAlgorithm("IMprecisionCalo")
    precisionCaloViewsMaker.ViewFallThrough = True
    precisionCaloViewsMaker.RoIsLink = "initialRoI"
    precisionCaloViewsMaker.RoITool = ViewCreatorInitialROITool()
    precisionCaloViewsMaker.InViewRoIs = InViewRoIs
    precisionCaloViewsMaker.Views = "precisionCaloViews"
    precisionCaloViewsMaker.RequireParentView = True

    # reco sequence
    from TriggerMenuMT.HLTMenuConfig.Egamma.PrecisionCaloRec import precisionCaloRecoSequence
    (precisionCaloInViewSequence,
     sequenceOut) = precisionCaloRecoSequence(None, InViewRoIs)

    precisionCaloViewsMaker.ViewNodeName = precisionCaloInViewSequence.name()

    # connect EVC and reco
    theSequence = seqAND(
        "precisionCaloSequence",
        [precisionCaloViewsMaker, precisionCaloInViewSequence])
    return (theSequence, precisionCaloViewsMaker, sequenceOut)
예제 #12
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)
예제 #13
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
예제 #14
0
def bJetStep2Sequence():
    prmVtxKey = "HLT_IDVertex_FS"
    outputRoIName = "HLT_Roi_Bjet"

    from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
    from DecisionHandling.DecisionHandlingConf import ViewCreatorCentredOnJetWithPVConstraintROITool
    InputMakerAlg = EventViewCreatorAlgorithm("IMBJet_step2")
    #
    newRoITool = ViewCreatorCentredOnJetWithPVConstraintROITool()
    newRoITool.RoisWriteHandleKey = recordable(outputRoIName)
    newRoITool.VertexReadHandleKey = prmVtxKey
    newRoITool.PrmVtxLink = prmVtxKey.replace("HLT_", "")
    #
    InputMakerAlg.mergeUsingFeature = True
    InputMakerAlg.RoITool = newRoITool
    #
    InputMakerAlg.Views = "BTagViews"
    InputMakerAlg.InViewRoIs = "InViewRoIs"
    #
    InputMakerAlg.RequireParentView = False
    InputMakerAlg.ViewFallThrough = True
    # BJet specific
    InputMakerAlg.PlaceJetInView = True
    InputMakerAlg.InViewJets = recordable("HLT_bJets")

    # Prepare data objects for view verifier
    viewDataObjects = [('TrigRoiDescriptorCollection',
                        'StoreGateSvc+' + InputMakerAlg.InViewRoIs),
                       ('xAOD::VertexContainer', 'StoreGateSvc+' + prmVtxKey),
                       ('xAOD::JetContainer',
                        'StoreGateSvc+' + InputMakerAlg.InViewJets)]

    # Second stage of Fast Tracking and Precision Tracking
    from TriggerMenuMT.HLTMenuConfig.Bjet.BjetTrackingConfiguration import getSecondStageBjetTracking
    secondStageAlgs, PTTrackParticles = getSecondStageBjetTracking(
        inputRoI=InputMakerAlg.InViewRoIs, dataObjects=viewDataObjects)

    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior = 1

    # Flavour Tagging
    from TriggerMenuMT.HLTMenuConfig.Bjet.BjetFlavourTaggingConfiguration import getFlavourTagging
    acc_flavourTaggingAlgs, bTaggingContainerName = getFlavourTagging(
        inputJets=InputMakerAlg.InViewJets,
        inputVertex=prmVtxKey,
        inputTracks=PTTrackParticles[0])

    Configurable.configurableRun3Behavior = 0

    #Conversion of flavour-tagging algorithms from new to old-style
    from AthenaCommon.CFElements import findAllAlgorithms
    from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
    AllFlavourTaggingAlgs = []
    for alg in findAllAlgorithms(
            acc_flavourTaggingAlgs.getSequence("AthAlgSeq")):
        AllFlavourTaggingAlgs.append(conf2toConfigurable(alg))

    acc_flavourTaggingAlgs.wasMerged(
    )  #Needed to remove error message; Next we add all algorithms to sequence so this is kind of an old-style merge
    bJetBtagSequence = seqAND("bJetBtagSequence",
                              secondStageAlgs + AllFlavourTaggingAlgs)
    InputMakerAlg.ViewNodeName = "bJetBtagSequence"

    # Sequence
    BjetAthSequence = seqAND("BjetAthSequence_step2",
                             [InputMakerAlg, bJetBtagSequence])

    from TrigBjetHypo.TrigBjetHypoConf import TrigBjetBtagHypoAlgMT
    hypo = TrigBjetBtagHypoAlgMT("TrigBjetBtagHypoAlg")
    # keys
    hypo.BTaggedJetKey = InputMakerAlg.InViewJets
    hypo.BTaggingKey = bTaggingContainerName
    hypo.TracksKey = PTTrackParticles[0]
    hypo.PrmVtxKey = newRoITool.VertexReadHandleKey
    # links for navigation
    hypo.BTaggingLink = bTaggingContainerName.replace("HLT_", "")
    hypo.PrmVtxLink = newRoITool.PrmVtxLink

    from TrigBjetHypo.TrigBjetOnlineMonitoringMTConfig import TrigBjetOnlineMonitoring
    hypo.MonTool = TrigBjetOnlineMonitoring()

    from TrigBjetHypo.TrigBjetBtagHypoTool import TrigBjetBtagHypoToolFromDict
    return MenuSequence(Sequence=BjetAthSequence,
                        Maker=InputMakerAlg,
                        Hypo=hypo,
                        HypoToolGen=TrigBjetBtagHypoToolFromDict)