Esempio n. 1
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)
Esempio n. 2
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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
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)
Esempio n. 6
0
def muFastAlgSequence(ConfigFlags):

    ### set the EVCreator ###
    l2MuViewsMaker = EventViewCreatorAlgorithm("IMl2Mu")
    #
    l2MuViewsMaker.RoIsLink = "initialRoI"  # ROI is from L1
    l2MuViewsMaker.RoITool = ViewCreatorInitialROITool()  # ROI is from L1
    #
    l2MuViewsMaker.Views = "MUViewRoIs"
    l2MuViewsMaker.InViewRoIs = "MURoIs"
    #
    l2MuViewsMaker.ViewFallThrough = True

    ### get muFast reco sequence ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muFastRecoSequence, makeMuonPrepDataAlgs
    viewAlgs_MuonPRD = makeMuonPrepDataAlgs(RoIs=l2MuViewsMaker.InViewRoIs)
    muFastRecoSequence, sequenceOut = muFastRecoSequence(
        l2MuViewsMaker.InViewRoIs, doFullScanID=False)
    muFastSequence = parOR("muFastRecoSequence",
                           [viewAlgs_MuonPRD, muFastRecoSequence])
    l2MuViewsMaker.ViewNodeName = muFastSequence.name()

    l2muFastSequence = seqAND("l2muFastSequence",
                              [l2MuViewsMaker, muFastSequence])
    return (l2muFastSequence, l2MuViewsMaker, sequenceOut)
Esempio n. 7
0
def tauCaloMVASequence(ConfigFlags):
    """ Creates L2 Fast Calo sequence for Taus"""
    # EV creator
    InViewRoIs = "TAUCaloRoIs"
    RecoSequenceName = "tauCaloMVAInViewSequence"

    tauCaloMVAViewsMaker = EventViewCreatorAlgorithm("IMtauCaloMVA")
    tauCaloMVAViewsMaker.ViewFallThrough = True
    tauCaloMVAViewsMaker.RoIsLink = "initialRoI"
    tauCaloMVAViewsMaker.RoITool = ViewCreatorInitialROITool()
    tauCaloMVAViewsMaker.InViewRoIs = InViewRoIs
    tauCaloMVAViewsMaker.Views = "TAUCaloMVAViews"
    tauCaloMVAViewsMaker.ViewNodeName = RecoSequenceName
    (tauCaloMVAInViewSequence,
     sequenceOut) = tauCaloMVARecoSequence(InViewRoIs, RecoSequenceName)

    tauCaloMVARecoVDV = CfgMgr.AthViews__ViewDataVerifier("tauCaloMVARecoVDV")
    tauCaloMVARecoVDV.DataObjects = [
        ('TrigRoiDescriptorCollection', 'StoreGateSvc+TAUCaloRoIs'),
        ('CaloBCIDAverage', 'StoreGateSvc+CaloBCIDAverage'),
        ('ILArHVScaleCorr', 'ConditionStore+LArHVScaleCorrRecomputed'),
        ('xAOD::EventInfo', 'StoreGateSvc+EventInfo'),
        ('SG::AuxElement', 'StoreGateSvc+EventInfo.ActIntPerXDecor'),
        ('SG::AuxElement', 'StoreGateSvc+EventInfo.AveIntPerXDecor')
    ]
    tauCaloMVAInViewSequence += tauCaloMVARecoVDV

    tauCaloMVASequence = seqAND(
        "tauCaloMVASequence", [tauCaloMVAViewsMaker, tauCaloMVAInViewSequence])
    return (tauCaloMVASequence, tauCaloMVAViewsMaker, sequenceOut)
Esempio n. 8
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)
Esempio n. 9
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)
Esempio n. 10
0
def efLateMuAlgSequence(ConfigFlags):

    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muEFInsideOutRecoSequence, makeMuonPrepDataAlgs, muonIDFastTrackingSequence
    eflateViewsMaker = EventViewCreatorAlgorithm("IMeflatemu")
    roiTool = ViewCreatorNamedROITool(
    )  # Use an existing ROI which is linked to the navigation with a custom name.
    roiTool.ROILinkName = "feature"  # The ROI is actually linked as Step 1's feature. So the custom name is "feature".
    #
    eflateViewsMaker.mergeUsingFeature = True  # Expect to have efLateMuRoIAlgSequence produce one Decision Object per lateROI, keep these distinct in the merging
    eflateViewsMaker.RoITool = roiTool
    #
    eflateViewsMaker.Views = "MUEFLATEViewRoIs"
    eflateViewsMaker.InViewRoIs = "MUEFLATERoIs"
    #
    eflateViewsMaker.ViewFallThrough = True

    #decode data in these RoIs
    viewAlgs_MuonPRD = makeMuonPrepDataAlgs(RoIs=eflateViewsMaker.InViewRoIs)
    #ID fast tracking
    muFastIDRecoSequence = muonIDFastTrackingSequence(
        eflateViewsMaker.InViewRoIs, "Late")
    #inside-out reco sequence
    muonEFInsideOutRecoSequence, sequenceOut = muEFInsideOutRecoSequence(
        eflateViewsMaker.InViewRoIs, "LateMu")

    lateMuRecoSequence = parOR(
        "lateMuonRecoSequence",
        [viewAlgs_MuonPRD, muFastIDRecoSequence, muonEFInsideOutRecoSequence])

    #Final sequence running in view
    eflateViewsMaker.ViewNodeName = lateMuRecoSequence.name()
    muonSequence = seqAND("lateMuonOutSequence",
                          [eflateViewsMaker, lateMuRecoSequence])

    return (muonSequence, eflateViewsMaker, sequenceOut)
Esempio n. 11
0
def muEFSAFSAlgSequence(ConfigFlags):

    efsafsInputMaker = EventViewCreatorAlgorithm("IMMuonFS")
    fsRoiTool = ViewCreatorFSROITool()
    fsRoiTool.RoisWriteHandleKey = "MuonFS_RoIs"
    #
    efsafsInputMaker.RoIsLink = "initialRoI"  # Only expect to get in one FS RI
    efsafsInputMaker.RoITool = fsRoiTool  # Use new FS roi (note: the ViewCreatorInitialROITool should work excactly the same here)
    #
    efsafsInputMaker.Views = "MUFSViewRoI"
    efsafsInputMaker.InViewRoIs = "MUFSRoIs"
    #
    efsafsInputMaker.ViewFallThrough = True

    ### get EF reco sequence ###
    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import muEFSARecoSequence, makeMuonPrepDataAlgs
    viewAlgs_MuonPRD = makeMuonPrepDataAlgs(RoIs=efsafsInputMaker.InViewRoIs,
                                            forFullScan=True)
    muEFSAFSRecoSequence, sequenceOut = muEFSARecoSequence(
        efsafsInputMaker.InViewRoIs, 'FS')

    muEFFSRecoSequence = parOR("muEFSAFSRecoSequence",
                               [viewAlgs_MuonPRD, muEFSAFSRecoSequence])
    efsafsInputMaker.ViewNodeName = muEFFSRecoSequence.name()

    muonEFSAFSSequence = seqAND("muonEFSAFSSequence",
                                [efsafsInputMaker, muEFFSRecoSequence])

    return (muonEFSAFSSequence, efsafsInputMaker, sequenceOut)
Esempio n. 12
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)
Esempio n. 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)
Esempio n. 14
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)
Esempio n. 15
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)
Esempio n. 16
0
def allTE_trkfast( signature="FS" ):
        inputMakerAlg = EventViewCreatorAlgorithm("IM_beamspot_"+signature)
        inputMakerAlg.ViewFallThrough = True
        inputMakerAlg.RoIsLink = "initialRoI"
        inputMakerAlg.RoITool = ViewCreatorInitialROITool()
        inputMakerAlg.InViewRoIs = "beamspotViewRoI_"+signature
        inputMakerAlg.Views      = "beamspotViewRoI_"+signature

        from TrigInDetConfig.InDetSetup import makeInDetAlgs
        from TrigT2BeamSpot.T2VertexBeamSpotConfig import T2VertexBeamSpot_activeAllTE

        viewAlgs, viewVerify  = makeInDetAlgs( whichSignature=signature, rois=inputMakerAlg.InViewRoIs )

        vertexAlg = T2VertexBeamSpot_activeAllTE( "vertex_"+signature )
        vertexAlg.TrackCollection = "TrigFastTrackFinder_Tracks_"+signature

        viewVerify.DataObjects += [( 'TrigRoiDescriptorCollection' , 'StoreGateSvc+beamspotViewRoI_'+signature ),
                                   ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),
                                   ( 'TagInfo' , 'DetectorStore+ProcessingTags' )]

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

        beamspotSequence = seqAND( "beamspotSequence_"+signature, viewAlgs+[vertexAlg] )
        inputMakerAlg.ViewNodeName = beamspotSequence.name()
        beamspotViewsSequence = seqAND( "beamspotViewsSequence"+signature, [ inputMakerAlg, beamspotSequence ])


        #hypo
        beamspotHypoAlg = TrigStreamerHypoAlgMT("BeamspotHypoAlg_"+signature)
        beamspotHypoAlg.RuntimeValidation = False #Needed to avoid the ERROR ! Decision has no 'feature' ElementLink
        beamspotHypoToolGen= StreamerHypoToolMTgenerator


        return  MenuSequence( Sequence    = beamspotViewsSequence,
                              Maker       = inputMakerAlg,
                              Hypo        = beamspotHypoAlg,
                              HypoToolGen = beamspotHypoToolGen )
Esempio n. 17
0
def efLateMuRoIAlgSequence(ConfigFlags):

    from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup import efLateMuRoISequence

    eflateViewsMaker = EventViewCreatorAlgorithm("IMeflatemuroi")
    #
    eflateViewsMaker.RoIsLink = "initialRoI"
    eflateViewsMaker.RoITool = ViewCreatorInitialROITool()
    #
    eflateViewsMaker.Views = "MULATEViewRoIs"
    eflateViewsMaker.InViewRoIs = "MULATERoIs"
    #
    eflateViewsMaker.ViewFallThrough = True

    #Get Late Muon RoIs
    efLateMuRoISequence, sequenceOut = efLateMuRoISequence()

    #Final sequence running in view
    eflateViewsMaker.ViewNodeName = efLateMuRoISequence.name()
    muonSequence = seqAND("lateMuonRoISequence",
                          [eflateViewsMaker, efLateMuRoISequence])

    return (muonSequence, eflateViewsMaker, sequenceOut)
Esempio n. 18
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)
Esempio n. 19
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
Esempio n. 20
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
Esempio n. 21
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)
Esempio n. 22
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)