Esempio n. 1
0
def generatePhotonsCfg(flags):

    acc = ComponentAccumulator()
    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, ChainStep, Chain, RecoFragmentsPool

    from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict
    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastCaloHypoAlgMT
    l2CaloHypo = TrigEgammaFastCaloHypoAlgMT("EgammaFastPhotonCaloHypo")
    l2CaloHypo.CaloClusters = 'L2CaloEMClusters'

    from TriggerMenuMT.HLTMenuConfig.Electron.ElectronRecoSequences import l2CaloRecoCfg

    l2CaloReco = RecoFragmentsPool.retrieve(l2CaloRecoCfg, flags)
    acc.merge(l2CaloReco)

    fastCaloSequence = MenuSequence(
        Sequence=l2CaloReco.sequence(),
        Maker=l2CaloReco.inputMaker(),
        Hypo=l2CaloHypo,
        HypoToolGen=TrigEgammaFastCaloHypoToolFromDict)

    fastCaloStep = ChainStep("Photon_step1", [fastCaloSequence])

    l2PhotonReco = RecoFragmentsPool.retrieve(l2PhotonRecoCfg, flags)
    acc.merge(l2PhotonReco)

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastPhotonHypoAlgMT
    l2PhotonHypo = TrigEgammaFastPhotonHypoAlgMT()
    l2PhotonHypo.Photons = "L2Photons"
    l2PhotonHypo.RunInView = True

    from TrigEgammaHypo.TrigEgammaFastPhotonHypoTool import TrigEgammaFastPhotonHypoToolFromDict

    l2PhotonSequence = MenuSequence(
        Sequence=l2PhotonReco.sequence(),
        Maker=l2PhotonReco.inputMaker(),
        Hypo=l2PhotonHypo,
        HypoToolGen=TrigEgammaFastPhotonHypoToolFromDict)

    l2PhotonStep = ChainStep("Photon_step2", [l2PhotonSequence])

    chains = [
        Chain(c.split()[0],
              c.split()[1], [fastCaloStep, l2PhotonStep])
        for c in flags.Trigger.menu.photons
    ]

    return acc, chains
Esempio n. 2
0
def serial_zip(allSteps, chainName):
    n_chains = len(allSteps)
    newsteps = []
    for chain_index, chainsteps in enumerate(allSteps):
        for step_index, step in enumerate(chainsteps):
            log.debug('chain_index: ' + str(chain_index) + " step_index: " +
                      str(step_index))
            # create list of correct length
            stepList = [None] * n_chains

            # put the step from the current sub-chain into the right place
            stepList[chain_index] = step
            log.debug('Put step: ' + str(step.name))

            # all other steps should contain an empty sequence
            for step_index2, emptyStep in enumerate(stepList):
                if emptyStep is None:
                    seqName = getEmptySeqName(step.name, chain_index,
                                              step_index + 1)
                    emptySeq = RecoFragmentsPool.retrieve(getEmptyMenuSequence,
                                                          flags=None,
                                                          name=seqName)
                    stepList[step_index2] = ChainStep(
                        seqName,
                        Sequences=[emptySeq],
                        chainDicts=step.chainDicts)

            newsteps.append(stepList)
    log.debug('After serial_zip')
    for s in newsteps:
        log.debug(', '.join(map(str, [step.name for step in s])))
    return newsteps
Esempio n. 3
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
Esempio n. 4
0
    def getJetChainStep(self):
        from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import jetMenuSequence
        from TriggerMenuMT.HLTMenuConfig.Jet.JetRecoSequences import jetRecoDictToString

        jetDefStr = jetRecoDictToString(self.recoDict)

        stepName = "Step1_jet_" + jetDefStr
        jetSeq1 = RecoFragmentsPool.retrieve(
            jetMenuSequence, None,
            **self.recoDict)  # the None will be used for flags in future

        return ChainStep(stepName, [jetSeq1],
                         multiplicity=[1],
                         chainDicts=[self.dict])
Esempio n. 5
0
def tauTwoStepTrackSeqIso():

    (sequence, ftfIsoViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(tauFTFIsoSequence, ConfigFlags)

    from TrigTauHypo.TrigTauHypoConf import TrigEFTauMVHypoAlgMT
    precisionHypo = TrigEFTauMVHypoAlgMT("EFTauMVHypoAlgFinal")
    precisionHypo.taujetcontainer = sequenceOut

    from TrigTauHypo.TrigTauHypoTool import TrigEFTauMVHypoToolFromDict

    return MenuSequence(Sequence=sequence,
                        Maker=ftfIsoViewsMaker,
                        Hypo=precisionHypo,
                        HypoToolGen=TrigEFTauMVHypoToolFromDict)
Esempio n. 6
0
def tauCaloRecoSequence(InViewRoIs, SeqName):
    global TauCaloJetContainer
    # lc sequence
    (lcTopoInViewSequence,
     lcCaloSequenceOut) = RecoFragmentsPool.retrieve(HLTLCTopoRecoSequence,
                                                     InViewRoIs)
    tauCaloRoiUpdaterAlg = _algoTauRoiUpdater(inputRoIs=InViewRoIs,
                                              clusters=lcCaloSequenceOut)
    updatedRoIs = tauCaloRoiUpdaterAlg.RoIOutputKey
    tauCaloOnlyAlg = _algoTauCaloOnly(L1RoIs=InViewRoIs,
                                      inputRoIs=updatedRoIs,
                                      clusters=lcCaloSequenceOut)
    RecoSequence = parOR(
        SeqName, [lcTopoInViewSequence, tauCaloRoiUpdaterAlg, tauCaloOnlyAlg])
    return (RecoSequence, tauCaloOnlyAlg.Key_trigTauJetOutputContainer)
Esempio n. 7
0
def LCCaloClusterRecoSequence(
        flags, name="HLTCaloClusterCalibratorLCFS", RoIs="HLT_FSJETRoI",
        outputName="HLT_TopoCaloClustersLCFS"):
    """ Create the LC calibrated fullscan clusters

    The clusters will be created as a shallow copy of the EM level clusters
    """
    em_sequence, em_clusters = RecoFragmentsPool.retrieve(caloClusterRecoSequence, flags=None, RoIs=RoIs)
    from TrigCaloRec.TrigCaloRecConfig import TrigCaloClusterCalibratorMT_LC
    alg = TrigCaloClusterCalibratorMT_LC(
            name,
            InputClusters = em_clusters,
            OutputClusters = outputName,
            OutputCellLinks = outputName+"_cellLinks")
    return parOR(name+"RecoSequence", [em_sequence, alg]), alg.OutputClusters
Esempio n. 8
0
def tauCaloMVAMenuSequence(name):
    (sequence, tauCaloMVAViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(tauCaloMVASequence, ConfigFlags)

    # hypo
    from TrigTauHypo.TrigTauHypoConf import TrigTauCaloHypoAlgMT
    theTauCaloMVAHypo = TrigTauCaloHypoAlgMT(name + "L2CaloMVAHypo")
    theTauCaloMVAHypo.taujets = sequenceOut

    from TrigTauHypo.TrigTauHypoTool import TrigL2TauHypoToolFromDict

    return MenuSequence(Sequence=sequence,
                        Maker=tauCaloMVAViewsMaker,
                        Hypo=theTauCaloMVAHypo,
                        HypoToolGen=TrigL2TauHypoToolFromDict)
Esempio n. 9
0
def tauTrackTwoEFSeq():

    (sequence, efViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(tauEFSequence, ConfigFlags)

    from TrigTauHypo.TrigTauHypoConf import TrigEFTauMVHypoAlgMT
    precisionHypo = TrigEFTauMVHypoAlgMT("EFTauMVHypoAlg")
    precisionHypo.taujetcontainer = sequenceOut

    from TrigTauHypo.TrigTauHypoTool import TrigEFTauMVHypoToolFromDict

    return MenuSequence(Sequence=sequence,
                        Maker=efViewsMaker,
                        Hypo=precisionHypo,
                        HypoToolGen=TrigEFTauMVHypoToolFromDict)
Esempio n. 10
0
def tauTwoStepTrackSeqCore():

    (sequence, ftfCoreViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(tauFTFCoreSequence, ConfigFlags)

    from TrigTauHypo.TrigTauHypoConf import TrigTrackPreSelHypoAlgMT
    fastTrkHypo = TrigTrackPreSelHypoAlgMT("TrackPreSelHypoAlg_RejectEmpty")
    fastTrkHypo.trackcollection = sequenceOut

    from TrigTauHypo.TrigTauHypoTool import TrigTauTrackHypoToolFromDict

    return MenuSequence(Sequence=sequence,
                        Maker=ftfCoreViewsMaker,
                        Hypo=fastTrkHypo,
                        HypoToolGen=TrigTauTrackHypoToolFromDict)
Esempio n. 11
0
def muCombOvlpRmSequence():

    (l2muCombSequence, l2muCombViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muCombAlgSequence, ConfigFlags)

    ### set up muCombHypo algorithm ###
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoAlg
    trigmuCombHypo = TrigmuCombHypoAlg("TrigL2MuCBHypoAlg")
    trigmuCombHypo.MuonL2CBInfoFromMuCombAlg = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoToolwORFromDict

    return MenuSequence(Sequence=l2muCombSequence,
                        Maker=l2muCombViewsMaker,
                        Hypo=trigmuCombHypo,
                        HypoToolGen=TrigmuCombHypoToolwORFromDict)
Esempio n. 12
0
def muEFSASequence():

    (muonEFSAonlySequence, efsaViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muEFSAAlgSequence, ConfigFlags)

    # setup EFSA hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg
    trigMuonEFSAHypo = TrigMuonEFHypoAlg("TrigMuonEFSAHypoAlg")
    trigMuonEFSAHypo.MuonDecisions = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFMSonlyHypoToolFromDict

    return MenuSequence(Sequence=muonEFSAonlySequence,
                        Maker=efsaViewsMaker,
                        Hypo=trigMuonEFSAHypo,
                        HypoToolGen=TrigMuonEFMSonlyHypoToolFromDict)
Esempio n. 13
0
def muIsoSequence():

    (l2muIsoSequence, l2muIsoViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muIsoAlgSequence, ConfigFlags)

    # set up hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuisoHypoAlg
    trigmuIsoHypo = TrigMuisoHypoAlg("L2MuisoHypoAlg")
    trigmuIsoHypo.MuonL2ISInfoName = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuisoHypoToolFromDict

    return MenuSequence(Sequence=l2muIsoSequence,
                        Maker=l2muIsoViewsMaker,
                        Hypo=trigmuIsoHypo,
                        HypoToolGen=TrigMuisoHypoToolFromDict)
Esempio n. 14
0
def muEFIsoSequence():

    (efmuIsoSequence, efmuIsoViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muEFIsoAlgSequence, ConfigFlags)

    # set up hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoAlg
    trigmuefIsoHypo = TrigMuonEFTrackIsolationHypoAlg("EFMuisoHypoAlg")
    trigmuefIsoHypo.EFMuonsName = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFTrackIsolationHypoToolFromDict

    return MenuSequence(Sequence=efmuIsoSequence,
                        Maker=efmuIsoViewsMaker,
                        Hypo=trigmuefIsoHypo,
                        HypoToolGen=TrigMuonEFTrackIsolationHypoToolFromDict)
Esempio n. 15
0
def muFastOvlpRmSequence():

    (l2muFastSequence, l2MuViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muFastAlgSequence, ConfigFlags)

    ### set up MuFastHypo ###
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoAlg
    trigMufastHypo = TrigMufastHypoAlg("TrigL2MufastHypoAlg")
    trigMufastHypo.MuonL2SAInfoFromMuFastAlg = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMufastHypoToolwORFromDict

    return MenuSequence(Sequence=l2muFastSequence,
                        Maker=l2MuViewsMaker,
                        Hypo=trigMufastHypo,
                        HypoToolGen=TrigMufastHypoToolwORFromDict)
Esempio n. 16
0
def minbiasTrackMenuSequence():
    # menu components
    # retrieve the reco seuqnece
    from TriggerMenuMT.HLTMenuConfig.MinBias.MinBiasTrkRecoSequences import minbiasTrackAthSequence
    (minbiasTrackSequence, InputMakerAlg,
     sequenceOut) = RecoFragmentsPool.retrieve(minbiasTrackAthSequence,
                                               ConfigFlags)

    #hypo
    mbHypoAlg = MbCountHypoAlgMT("MinBiasHypoAlg_trk")
    mbHypoAlg.MinBiasContainerKey = sequenceOut

    return MenuSequence(Sequence=minbiasTrackSequence,
                        Maker=InputMakerAlg,
                        Hypo=mbHypoAlg,
                        HypoToolGen=TrigMinBiasHypoToolFromDict)
Esempio n. 17
0
def muCombSequence():

    (l2muCombSequence, l2muCombViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muCombAlgSequence, ConfigFlags)

    ### set up muCombHypo algorithm ###
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoAlg
    #trigmuCombHypo = TrigmuCombHypoAlg("L2muCombHypoAlg") # avoid to have "Comb" string in the name due to HLTCFConfig.py.
    trigmuCombHypo = TrigmuCombHypoAlg("TrigL2MuCBHypoAlg")
    trigmuCombHypo.MuonL2CBInfoFromMuCombAlg = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigmuCombHypoToolFromDict

    return MenuSequence(Sequence=l2muCombSequence,
                        Maker=l2muCombViewsMaker,
                        Hypo=trigmuCombHypo,
                        HypoToolGen=TrigmuCombHypoToolFromDict)
Esempio n. 18
0
 def getStep(self,
             stepID,
             stepPartName,
             sequenceCfgArray,
             comboHypoCfg=ComboHypoCfg,
             comboTools=[]):
     stepName = 'Step%d' % stepID + '_%d' % self.mult + stepPartName
     if self.mult > 1:
         stepName = 'Step%d' % stepID + '_N' + stepPartName
     log.debug("Configuring step " + stepName)
     seqArray = []
     for sequenceCfg in sequenceCfgArray:
         seqArray.append(RecoFragmentsPool.retrieve(sequenceCfg, None))
     return ChainStep(stepName,
                      seqArray, [self.mult], [self.dict],
                      comboHypoCfg=comboHypoCfg,
                      comboToolConfs=comboTools)
Esempio n. 19
0
def efLateMuSequence():

    (muonEFLateSequence, eflateViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(efLateMuAlgSequence,
                                               ConfigFlags)

    # setup EFCB hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg
    trigMuonEFLateHypo = TrigMuonEFHypoAlg("TrigMuonEFCombinerLateMuHypoAlg")
    trigMuonEFLateHypo.MuonDecisions = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromDict

    return MenuSequence(Sequence=muonEFLateSequence,
                        Maker=eflateViewsMaker,
                        Hypo=trigMuonEFLateHypo,
                        HypoToolGen=TrigMuonEFCombinerHypoToolFromDict)
Esempio n. 20
0
def muEFCBFSSequence():

    (muonEFCBFSSequence, efcbfsInputMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muEFCBFSAlgSequence,
                                               ConfigFlags)

    # setup EFCB hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg
    trigMuonEFCBFSHypo = TrigMuonEFHypoAlg("TrigMuonEFFSCombinerHypoAlg")
    trigMuonEFCBFSHypo.MuonDecisions = sequenceOut

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromName

    return MenuSequence(Sequence=muonEFCBFSSequence,
                        Maker=efcbfsInputMaker,
                        Hypo=trigMuonEFCBFSHypo,
                        HypoToolGen=TrigMuonEFCombinerHypoToolFromName)
Esempio n. 21
0
def muEFCBSequence():

    (muonEFCBSequence, efcbViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(muEFCBAlgSequence, ConfigFlags)

    # setup EFCB hypo
    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFHypoAlg
    trigMuonEFCBHypo = TrigMuonEFHypoAlg("TrigMuonEFCombinerHypoAlg")
    trigMuonEFCBHypo.MuonDecisions = sequenceOut
    trigMuonEFCBHypo.MapToPreviousDecisions = True

    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromDict

    return MenuSequence(Sequence=muonEFCBSequence,
                        Maker=efcbViewsMaker,
                        Hypo=trigMuonEFCBHypo,
                        HypoToolGen=TrigMuonEFCombinerHypoToolFromDict)
Esempio n. 22
0
def precisionCaloMenuSequence(name):
    """ Creates precisionCalo MENU sequence """
    (sequence, precisionCaloViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(precisionCaloSequence,
                                               ConfigFlags)

    #Hypo
    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionCaloHypoAlgMT
    from TrigEgammaHypo.TrigEgammaPrecisionCaloHypoTool import TrigEgammaPrecisionCaloHypoToolFromDict

    thePrecisionCaloHypo = TrigEgammaPrecisionCaloHypoAlgMT(
        name + "precisionCaloHypo")
    thePrecisionCaloHypo.CaloClusters = sequenceOut

    return MenuSequence(Sequence=sequence,
                        Maker=precisionCaloViewsMaker,
                        Hypo=thePrecisionCaloHypo,
                        HypoToolGen=TrigEgammaPrecisionCaloHypoToolFromDict)
Esempio n. 23
0
def fastCaloMenuSequence(name, doRinger):
    """ Creates Egamma Fast Calo  MENU sequence
    The Hypo name changes depending on name, so for different implementations (Electron, Gamma,....)
    The doRinger flag is to use or not the Ringer hypo
    """
    (sequence, fastCaloViewsMaker, sequenceOut) = RecoFragmentsPool.retrieve(fastCaloSequence, {'doRinger' : doRinger})
    # check if use Ringer and are electron because there aren't ringer for photons yet:
    # hypo
    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastCaloHypoAlgMT
    theFastCaloHypo = TrigEgammaFastCaloHypoAlgMT(name+"EgammaFastCaloHypo")
    theFastCaloHypo.CaloClusters = sequenceOut
    CaloMenuDefs.L2CaloClusters = sequenceOut

    from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict
    return MenuSequence( Sequence    = sequence,
                         Maker       = fastCaloViewsMaker,
                         Hypo        = theFastCaloHypo,
                         HypoToolGen = TrigEgammaFastCaloHypoToolFromDict )
Esempio n. 24
0
def precisionElectronMenuSequence():
    # retrieve the reco seuqence+EVC
    (electronPrecisionAthSequence, precisionElectronViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(precisionElectronSequence,
                                               ConfigFlags)

    # make the Hypo
    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionElectronHypoAlgMT
    thePrecisionElectronHypo = TrigEgammaPrecisionElectronHypoAlgMT(
        "TrigEgammaPrecisionElectronHypoAlgMT")
    thePrecisionElectronHypo.Electrons = sequenceOut
    thePrecisionElectronHypo.RunInView = True

    from TrigEgammaHypo.TrigEgammaPrecisionElectronHypoTool import TrigEgammaPrecisionElectronHypoToolFromDict

    return MenuSequence(
        Maker=precisionElectronViewsMaker,
        Sequence=electronPrecisionAthSequence,
        Hypo=thePrecisionElectronHypo,
        HypoToolGen=TrigEgammaPrecisionElectronHypoToolFromDict)
Esempio n. 25
0
def fastElectronMenuSequence():
    """ Creates 2nd step Electron  MENU sequence"""
    # retrievee the reco seuqence+IM
    (electronAthSequence, l2ElectronViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(fastElectronSequence,
                                               ConfigFlags)

    # make the Hypo
    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaFastElectronHypoAlgMT
    theElectronHypo = TrigEgammaFastElectronHypoAlgMT()
    theElectronHypo.Electrons = sequenceOut

    theElectronHypo.RunInView = True

    from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict

    return MenuSequence(Maker=l2ElectronViewsMaker,
                        Sequence=electronAthSequence,
                        Hypo=theElectronHypo,
                        HypoToolGen=TrigEgammaFastElectronHypoToolFromDict)
Esempio n. 26
0
def precisionPhotonMenuSequence(name):

    # This will be executed after pricisionCalo, so we need to pickup indeed the topoClusters by precisionCalo and add them here as requirements

    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    """Creates precisionPhoton  sequence"""
    (sequence, precisionPhotonViewsMaker,
     sequenceOut) = RecoFragmentsPool.retrieve(precisionPhotonSequence,
                                               ConfigFlags)

    # Hypo

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionPhotonHypoAlgMT
    from TrigEgammaHypo.TrigEgammaPrecisionPhotonHypoTool import TrigEgammaPrecisionPhotonHypoToolFromDict

    thePrecisionPhotonHypo = TrigEgammaPrecisionPhotonHypoAlgMT(
        name + "precisionPhotonHypo")
    thePrecisionPhotonHypo.Photons = sequenceOut

    return MenuSequence(Sequence=sequence,
                        Maker=precisionPhotonViewsMaker,
                        Hypo=thePrecisionPhotonHypo,
                        HypoToolGen=TrigEgammaPrecisionPhotonHypoToolFromDict)
Esempio n. 27
0
def precisionCaloRecoSequence(DummyFlag, RoIs):
    log.debug('DummyFlag = %s', str(DummyFlag))
    log.debug('RoIs = %s', RoIs)

    egammaTopoClusterCopier = AlgFactory(
        egammaAlgsConf.egammaTopoClusterCopier,
        name='TrigEgammaTopoClusterCopier' + RoIs,
        InputTopoCollection="caloclusters",
        OutputTopoCollection=precisionCaloMenuDefs.precisionCaloClusters,
        OutputTopoCollectionShallow="tmp_" +
        precisionCaloMenuDefs.precisionCaloClusters,
        doAdd=False)

    from TrigT2CaloCommon.CaloDef import HLTRoITopoRecoSequence
    (precisionRecoSequence,
     caloclusters) = RecoFragmentsPool.retrieve(HLTRoITopoRecoSequence, RoIs)

    algo = egammaTopoClusterCopier()
    algo.InputTopoCollection = caloclusters
    precisionRecoSequence += algo
    sequenceOut = algo.OutputTopoCollection

    return (precisionRecoSequence, sequenceOut)
Esempio n. 28
0
def generateChains():
    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
    from DecisionHandling.TestUtils import makeChain

    testChains = []
    ##################################################################
    # egamma chains
    ##################################################################
    if opt.doEgammaSlice == True:
        from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg, fastElectronSequenceCfg, precisionCaloSequenceCfg
        fastCaloSeq = RecoFragmentsPool.retrieve(electronFastCaloCfg, None)
        electronSeq = RecoFragmentsPool.retrieve(fastElectronSequenceCfg, None)
        precisionCaloSeq = RecoFragmentsPool.retrieve(precisionCaloSequenceCfg,
                                                      None)

        FastCaloStep = ChainStep("ElectronFastCaloStep", [fastCaloSeq])
        FastElectronStep = ChainStep("ElectronFastTrackStep", [electronSeq])
        PrecisionCaloStep = ChainStep("ElectronPrecisionCaloStep",
                                      [precisionCaloSeq])

        electronChains = [
            makeChain(name='HLT_e3_etcut1step_L1EM3',
                      L1Thresholds=["EM3"],
                      ChainSteps=[FastCaloStep]),
            makeChain(
                name='HLT_e3_etcut_L1EM3',
                L1Thresholds=["EM3"],
                ChainSteps=[FastCaloStep, FastElectronStep,
                            PrecisionCaloStep]),
            makeChain(
                name='HLT_e5_etcut_L1EM3',
                L1Thresholds=["EM3"],
                ChainSteps=[FastCaloStep, FastElectronStep,
                            PrecisionCaloStep]),
            makeChain(
                name='HLT_e7_etcut_L1EM3',
                L1Thresholds=["EM3"],
                ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep])
        ]
        testChains += electronChains

        from TriggerMenuMT.HLTMenuConfig.Egamma.PhotonDef import fastPhotonCaloSequenceCfg, fastPhotonSequenceCfg, precisionPhotonCaloSequenceCfg
        fastCaloSeq = RecoFragmentsPool.retrieve(fastPhotonCaloSequenceCfg,
                                                 None)
        fastPhotonSeq = RecoFragmentsPool.retrieve(fastPhotonSequenceCfg, None)
        precisionCaloPhotonSeq = RecoFragmentsPool.retrieve(
            precisionPhotonCaloSequenceCfg, None)

        FastCaloStep = ChainStep("PhotonFastCaloStep", [fastCaloSeq])
        fastPhotonStep = ChainStep("PhotonStep2", [fastPhotonSeq])
        precisionCaloPhotonStep = ChainStep("precisionCaloPhotonStep",
                                            [precisionCaloPhotonSeq])

        photonChains = [
            makeChain(name='HLT_g5_etcut_L1EM3',
                      L1Thresholds=["EM3"],
                      ChainSteps=[
                          FastCaloStep, fastPhotonStep, precisionCaloPhotonStep
                      ])
        ]

        testChains += photonChains

    ##################################################################
    # muon chains
    ##################################################################
    if opt.doMuonSlice == True:
        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muIsoSequence, muEFCBSequence, muEFSAFSSequence, muEFCBFSSequence

        MuonChains = []
        # step1
        mufastS = muFastSequence()
        step1mufast = ChainStep("Step1_muFast", [mufastS])
        # step2
        mucombS = muCombSequence()
        step2muComb = ChainStep("Step2_muComb", [mucombS])
        # step3
        muEFSAS = muEFSASequence()
        step3muEFSA = ChainStep("Step3_muEFSA", [muEFSAS])
        step3muIso = ChainStep("Step3_muIso", [muIsoSequence()])
        # step4
        muEFCBS = muEFCBSequence()
        step4muEFCB = ChainStep("Step4_muEFCB", [muEFCBS])

        emptyStep = ChainStep("Step2_empty", multiplicity=[])

        ## single muon trigger
        MuonChains += [
            makeChain(name='HLT_mu6fast_L1MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[step1mufast])
        ]
        MuonChains += [
            makeChain(name='HLT_mu6Comb_L1MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[step1mufast, step2muComb])
        ]
        MuonChains += [
            makeChain(name='HLT_mu6_L1MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[
                          step1mufast, step2muComb, step3muEFSA, step4muEFCB
                      ])
        ]
        MuonChains += [
            makeChain(name='HLT_mu6msonly_L1MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[step1mufast, emptyStep, step3muEFSA])
        ]  # removed due to muEFSA isuue(?)
        MuonChains += [
            makeChain(name='HLT_mu20_ivar_L1MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[step1mufast, step2muComb, step3muIso])
        ]

        # multi muon trigger
        # 2muons symmetric
        step1_2mufast_sym = ChainStep("Step1_2muFast_sym", [mufastS],
                                      multiplicity=[2])
        step2_2muComb_sym = ChainStep("Step2_2muComb_sym", [mucombS],
                                      multiplicity=[2])

        step3_2muEFSA_sym = ChainStep("Step3_2muEFSA_sym", [muEFSAS],
                                      multiplicity=[2])
        step4_2muEFCB_sym = ChainStep("Step4_2muEFCB_sym", [muEFCBS],
                                      multiplicity=[2])

        MuonChains += [
            makeChain(name='HLT_2mu6Comb_L12MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=[step1_2mufast_sym, step2_2muComb_sym])
        ]

        # 2muons asymmetric (this will change): 2 sequences, 2 seeds
        step1_2mufast_asym = ChainStep("Step1_2muFast_asym",
                                       [mufastS, mufastS],
                                       multiplicity=[1, 1])
        step2_2muComb_asym = ChainStep("Step1_2muComb_asym",
                                       [mucombS, mucombS],
                                       multiplicity=[1, 1])

        step3_2muEFSA_asym = ChainStep("Step3_2muEFSA_asym",
                                       [muEFSAS, muEFSAS],
                                       multiplicity=[1, 1])
        step4_2muEFCB_asym = ChainStep("Step4_2muEFCB_asym",
                                       [muEFCBS, muEFCBS],
                                       multiplicity=[1, 1])

        MuonChains += [
            makeChain(name='HLT_mu6_mu4_L12MU4',
                      L1Thresholds=["MU4", "MU6"],
                      ChainSteps=[step1_2mufast_asym, step2_2muComb_asym])
        ]

        #FS Muon trigger
        # Full scan MS tracking step
        stepFSmuEFSA = ChainStep("Step_FSmuEFSA", [muEFSAFSSequence()])
        stepFSmuEFCB = ChainStep("Step_FSmuEFCB", [muEFCBFSSequence()])
        MuonChains += [
            makeChain(name='HLT_mu6noL1_L1MU6',
                      L1Thresholds=["FSNOSEED"],
                      ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])
        ]

        testChains += MuonChains

    ##################################################################
    # jet chains
    ##################################################################
    if opt.doJetSlice == True:
        from DecisionHandling.jetMenuHelper import jetMenuSequenceFromString

        # small-R jets, different calibrations HLT_AntiKt4EMTopoJets_subjesIS
        jetSeq_a4_tc_em = jetMenuSequenceFromString("a4_tc_em_subjesIS")
        step_a4_tc_em = ChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em])

        jetSeq_a4_tc_em_subjes = jetMenuSequenceFromString("a4_tc_em_subjes")
        step_a4_tc_em_subjes = ChainStep("Step_jet_a4_subjes_tc_em",
                                         [jetSeq_a4_tc_em_subjes])

        jetSeq_a4_tc_em_nocalib = jetMenuSequenceFromString(
            "a4_tc_em_nojcalib")
        step_a4_tc_em_nocalib = ChainStep("Step_jet_a4_nojcalib_tc_em",
                                          [jetSeq_a4_tc_em_nocalib])

        #    jetSeq_a4_tc_lcw = jetMenuSequenceFromString("a10_tc_lcw_subjesIS")
        #    step_a4_tc_lcw=ChainStep("Step_jet_a10_tc_lcw", [jetSeq_a4_tc_lcw])

        # large-R jets
        jetSeq_a10_tc_lcw_subjes = jetMenuSequenceFromString(
            "a10_tc_lcw_subjes")
        step_a10_tc_lcw_subjes = ChainStep("Step_jet_a10_subjes_tc_lcw",
                                           [jetSeq_a10_tc_lcw_subjes])

        jetSeq_a10r = jetMenuSequenceFromString("a10r_tc_em_subjesIS")
        step_a10r = ChainStep("Step_jet_a10r", [jetSeq_a10r])

        jetChains = [
            makeChain(name='HLT_j45_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            makeChain(name='HLT_j85_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            makeChain(name='HLT_j420_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            makeChain(name='HLT_j260_320eta490_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            # makeChain(name='HLT_j225_gsc420_boffperf_split',   ChainSteps=[step_a4_tc_em]  ),
            makeChain(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            makeChain(name='HLT_j460_a10_lcw_subjes_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a10_tc_lcw_subjes]),
            makeChain(name='HLT_j460_a10r_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a10r]),
            makeChain(name='HLT_3j200_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step_a4_tc_em]),
            makeChain(
                name='HLT_5j70_0eta240_L1J20',
                L1Thresholds=["J20"],
                ChainSteps=[step_a4_tc_em]
            ),  # 5j70_0eta240_L14J15 (J20 until multi-object L1 seeds supported)
        ]

        testChains += jetChains

    ##################################################################
    # bjet chains
    ##################################################################
    if opt.doBjetSlice == True:
        from DecisionHandling.jetMenuHelper import jetMenuSequenceFromString
        from TriggerMenuMT.HLTMenuConfig.Bjet.BjetSequenceSetup import getBJetSequence

        jetSequence = jetMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf")

        step1 = ChainStep("Step1_bjet", [jetSequence])
        step2 = ChainStep("Step2_bjet", [getBJetSequence()])

        bjetChains = [
            makeChain(name='HLT_j45_ftf_subjesgscIS_boffperf_split_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step1, step2]),
            makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_split_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step1, step2]),
            makeChain(name='HLT_j45_ftf_subjesgscIS_bmv2c1070_L1J20',
                      L1Thresholds=["J20"],
                      ChainSteps=[step1, step2])
        ]
        testChains += bjetChains

        ##################################################################
    # tau chains
    ##################################################################
    if opt.doTauSlice == True and False:
        from TriggerMenuMT.HLTMenuConfig.Tau.TauMenuSequences import getTauSequence

        step1 = ChainStep("Step1_tau", [getTauSequence('calo')])
        step1MVA = ChainStep("Step1MVA_tau", [getTauSequence('calo_mva')])

        #This runs the tau-preselection(TP) step
        step2TP = ChainStep("Step2TP_tau", [getTauSequence('track_core')])

        #This runs the EFTauMV hypo on top of fast tracks
        step2PT = ChainStep("Step2PT_tau", [getTauSequence('precision')])

        tauChains = [
            makeChain(name='HLT_tau0_perf_ptonly_L1TAU12',
                      L1Thresholds=["TAU12"],
                      ChainSteps=[step1, step2]),
            makeChain(name='HLT_tau25_medium1_tracktwo_L1TAU12IM',
                      L1Thresholds=["TAU12IM"],
                      ChainSteps=[step1, step2TP]),
            makeChain(name='HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM',
                      L1Thresholds=["TAU20IM"],
                      ChainSteps=[step1MVA, step2PT])
        ]
        testChains += tauChains

    ##################################################################
    # MET chains
    ##################################################################
    if opt.doMETSlice == True:
        from TriggerMenuMT.HLTMenuConfig.MET.METMenuSequences import metMenuSequence
        from TriggerMenuMT.HLTMenuConfig.MET.ConfigHelpers import extractMETRecoDict

        cellRecoDict = extractMETRecoDict({'EFrecoAlg': "cell"})
        metCellSeq = metMenuSequence(None, **cellRecoDict)

        pufitRecoDict = extractMETRecoDict({'EFrecoAlg': "tcpufit"})
        metClusterPufitSeq = metMenuSequence(None, **pufitRecoDict)

        metCellStep = ChainStep("Step1_met_cell", [metCellSeq])
        metClusterPufitStep = ChainStep("Step1_met_clusterpufit",
                                        [metClusterPufitSeq])
        comboStep_cell_clusterpufit = ChainStep(
            "Step1_combo_cell_clusterpufit", [metCellSeq, metClusterPufitSeq],
            multiplicity=[1, 1])

        metChains = [
            makeChain(name="HLT_xe65_L1XE50",
                      L1Thresholds=["XE50"],
                      ChainSteps=[metCellStep]),
            makeChain(name="HLT_xe30_L1XE10",
                      L1Thresholds=["XE10"],
                      ChainSteps=[metCellStep]),
            makeChain(name="HLT_xe30_tcpufit_L1XE10",
                      L1Thresholds=["XE10"],
                      ChainSteps=[metClusterPufitStep]),
            makeChain(name='HLT_xe30_cell_xe30_tcpufit_L1XE10',
                      L1Thresholds=["XE10", "XE10"],
                      ChainSteps=[comboStep_cell_clusterpufit])
        ]

        testChains += metChains

    ##################################################################
    # B-physics and light states chains
    ##################################################################
    if opt.doBphysicsSlice == True:
        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence, muCombSequence, muEFSASequence, muEFCBSequence
        from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DimuL2ComboHypoCfg, DimuEFComboHypoCfg

        step1_dimufast = ChainStep("Step1_dimuFast", [muFastSequence()],
                                   multiplicity=[2])
        step2_dimuComb = ChainStep("Step2_dimuComb", [muCombSequence()],
                                   multiplicity=[2],
                                   comboHypoCfg=DimuL2ComboHypoCfg)
        step3_dimuEFSA = ChainStep("Step3_dimuEFSA", [muEFSASequence()],
                                   multiplicity=[2])
        step4_dimuEFCB = ChainStep("Step4_dimuEFCB", [muEFCBSequence()],
                                   multiplicity=[2],
                                   comboHypoCfg=DimuEFComboHypoCfg)
        steps = [
            step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB
        ]

        BphysChains = [
            makeChain(name='HLT_2mu4_bBmumu_L12MU4',
                      L1Thresholds=["MU4"],
                      ChainSteps=steps),
            makeChain(name='HLT_2mu4_bDimu_L12MU4',
                      L1Thresholds=["MU4"],
                      ChainSteps=steps),
            makeChain(name='HLT_2mu4_bJpsimumu_L12MU4',
                      L1Thresholds=["MU4"],
                      ChainSteps=steps),
            makeChain(name='HLT_2mu6_bJpsimumu_L12MU6',
                      L1Thresholds=["MU6"],
                      ChainSteps=steps),
            makeChain(name='HLT_2mu4_bUpsimumu_L12MU4',
                      L1Thresholds=["MU4"],
                      ChainSteps=steps)
        ]

        testChains += BphysChains

    ##################################################################
    # combined chains
    ##################################################################
    if opt.doCombinedSlice == True:
        from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import electronFastCaloCfg
        fastCaloSeq = RecoFragmentsPool.retrieve(electronFastCaloCfg, None)

        from TriggerMenuMT.HLTMenuConfig.Muon.MuonSequenceSetup import muFastSequence

        comboStep_et_mufast = ChainStep(
            "Step1_et_mufast", [fastCaloSeq, muFastSequence()],
            multiplicity=[1, 1])
        comboStep_mufast_etcut1_step1 = ChainStep(
            "Step1_mufast_etcut1", [muFastSequence(), fastCaloSeq],
            multiplicity=[1, 1])

        comboChains = [
            makeChain(name='HLT_e3_etcut_mu6_L1EM8I_MU10',
                      L1Thresholds=["EM8I", "MU10"],
                      ChainSteps=[comboStep_et_mufast])
        ]
        #   comboChains += [Chain(name='HLT_mu8fast_e8_etcut1step',   ChainSteps=[ comboStep_mufast_etcut1_step1 ])]
        testChains += comboChains
Esempio n. 29
0
def gamMenuSequence(step, reconame, hyponame):
    (Sequence, IM, seqOut) = RecoFragmentsPool.retrieve(makeElSequence,ConfigFlags,name=reconame, step=step)
    elHypo = ElGamHypo(hyponame+"Step"+step+"GamHypo")
    elHypo.Input = seqOut
    return MenuSequence( Maker=IM, Sequence=Sequence, Hypo=elHypo, HypoToolGen=ElTestHypoTool)
Esempio n. 30
0
def muMenuSequence(step, reconame, hyponame):
    (Sequence, IM, seqOut) = RecoFragmentsPool.retrieve(makeMuSequence,ConfigFlags,name=reconame, step=step)
    muHypo = MuHypo(hyponame+"Step"+step+"MuHypo")
    muHypo.Input = seqOut
    return MenuSequence( Maker=IM, Sequence=Sequence, Hypo=muHypo, HypoToolGen=MuTestHypoTool)