Example #1
0
def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=1):

    useTRT = 'noTRT' not in chainDict['chainParts']['extra']

    log.debug("In myBjetConfig_split")    

    EFChainName = "EF_bjet_" + chainDict['chainName']

    chainParts = chainDict['chainParts']
    btagthresh = chainParts['threshold']
    gscthresh  = chainParts['gscThreshold'] if ('gscThreshold' in chainParts) else ''
    btagmult = chainParts['multiplicity']
    btagcut = chainParts['bTag']
    btagcut = btagcut[1:]

    ftk=""
    if 'FTKVtx' in chainParts['bTracking'] or 'FTK' in chainParts['bTracking']  or 'FTKRefit' in chainParts['bTracking']:
        ftk="FTKVtx"


    #-----------------------------------------------------------------------------------
    # Import of algs
    #-----------------------------------------------------------------------------------

    algoInstance = "EF"

    #--------------------
    
    # super ROI building
    theSuperRoi=getSuperRoiBuilderAllTEInstance()

    #--------------------

    # jet splitting
    theJetSplit=getJetSplitterAllTEInstance()
    theJetSplitFTK=getJetSplitterFTKAllTEInstance()

    #-------------------- 
    
    #find jets far away from a muon (for mu-jet chains with b-jet requirements only)
    if any('antimatchdr' in bM for bM in chainParts['bMatching'] ):

        # Extract the dR value from the chain name here.. the deltaR value has to consist of 2 numbers
       deltaR = -1
       for anti_match_part in chainParts['bMatching']:
           if 'dr' in anti_match_part:
               deltaR=anti_match_part.split('dr')[1][0:2]
       if deltaR == -1: log.error("No DeltaR cut could be extracted!")
        
       theFarawayJet=getFarawayJetFinderAllTEInstance(str(deltaR))

       algoInstance = "MuJetChain"

    #--------------------
    
    # Et hypo (for b-tagging)
    #from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
    theBjetEtHypo   = getBjetEtHypoInstance(algoInstance, "Btagging", btagthresh+"GeV" )
    #--------------------

    # tracking
    if 'FTKVtx' in chainParts['bTracking']:
        [trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig").getSequence() # new
        [ftkvtx, trkftk] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx"]).getSequence() # new
    elif 'FTKRefit' in chainParts['bTracking']:
        [ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","refit","PT"]).getSequence() # new
    elif 'FTK' in chainParts['bTracking']:
        [ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","PT"]).getSequence() # new
    elif useTRT :
        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence() # new
    else :
        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step","noTRT"]).getSequence() # new


    # for b-tagging
    theBjetTracks = trkftf+trkprec
    # for vertexing
##    theVertexTracks = trkvtx  
    #--------------------

    # primary vertexing
    # JK FTK vertex
#    from TrigFTK_RecAlgs.TrigFTK_RecAlgs_Config import TrigFTK_VxPrimary_EF
#    from InDetTrigRecExample.InDetTrigConfigRecPostProcessing import *

    #--------------------
    # GSC
    if ('gscThreshold' in chainParts) and chainParts['gscThreshold']:
        theGSCFex      = getGSCFexSplitInstance(algoInstance)
        #from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
        theGSCEtHypo   = getBjetEtHypoInstance("GSC", "Btagging", gscthresh.replace("gsc","")+"GeV" )
    #--------------------

    # secondary vertexing
    theVxSecondary = TrigVxSecondaryCombo_EF()
    theVxSecondaryFTK = TrigVxSecondaryCombo_EF("TrigVxSecondaryComboFTK_EF")
    theVxSecondaryFTK.PriVtxKey="PrimVertexFTK"
    #--------------------

    # bjet fex
#    if ('boffperf' in chainParts['bTag'] or 'bmv2c20' in chainParts['bTag']):
#        # Offline taggers
#        from TrigBjetHypo.TrigBtagFexConfig import getBtagFexSplitInstance 
#        theBjetFex = getBtagFexSplitInstance(algoInstance,"2012","EFID") 
#    else:
#        # Run 1 style taggers
#        from TrigBjetHypo.TrigBjetFexConfig  import getBjetFexSplitInstance
#        theBjetFex = getBjetFexSplitInstance(algoInstance,"2012","EFID")

    if ('boffperf' in chainParts['bTag'] or 'bmv2c20' in chainParts['bTag'] or 'bmv2c10' or 'bhmv2c10' in chainParts['bTag']):
        # Offline taggers
        if('FTKRefit' in chainParts['bTracking']):
            theBjetFex = getBtagFexFTKRefitInstance(algoInstance,"2012","EFID") 
        elif('FTKVtx' in chainParts['bTracking']):
            theBjetFex = getBtagFexFTKVtxInstance(algoInstance,"2012","EFID") 
        elif ('FTK' in chainParts['bTracking']):
            theBjetFex = getBtagFexFTKInstance(algoInstance,"2012","EFID") 
        else:
            theBjetFex = getBtagFexSplitInstance(algoInstance,"2012","EFID") 
    else:
        # Run 1 style taggers
        if('FTKRefit' in chainParts['bTracking']):
            theBjetFex = getBjetFexFTKRefitInstance(algoInstance,"2012","EFID")
        elif ('FTKVtx' in chainParts['bTracking'] ):
            theBjetFex = getBjetFexFTKVtxInstance(algoInstance,"2012","EFID")
        elif ('FTK' in chainParts['bTracking'] ):
            theBjetFex = getBjetFexFTKInstance(algoInstance,"2012","EFID")
        else:
            theBjetFex = getBjetFexSplitInstance(algoInstance,"2012","EFID")

    #--------------------

    # bjet hypo 
    if ('bperf' in chainParts['bTag'] or 'boffperf' in chainParts['bTag']):
        # Performance chains (run 1 and run 2 style)
        # Runs in NoCut mode
        theBtagReq = getBjetHypoSplitNoCutInstance(algoInstance)
    elif ('bmv2c20' in chainParts['bTag']  ):
        # MV2c20 tagger series
        theBtagReq = getBjetHypoSplitInstance(algoInstance,"2015", btagcut)
    elif ('bmv2c10' in chainParts['bTag']  ):
        # MV2c10 tagger series
        theBtagReq = getBjetHypoSplitInstance(algoInstance,"2017", btagcut)
    elif ('bhmv2c10' in chainParts['bTag']) :
        # MV2c10hybrid tagger series 
        theBtagReq = getBjetHypoSplitInstance(algoInstance,"2018", btagcut)
    else:
        # Run 1 style chains
        theBtagReq = getBjetHypoSplitInstance(algoInstance,"2012", btagcut)

    #-----------------------------------------------------------------------------------
    # TE naming
    #-----------------------------------------------------------------------------------
    

    tracking        = "IDTrig"
    if 'FTKVtx' in chainParts['bTracking']:
        tracking    = "IDtrig"
    elif 'FTKRefit' in chainParts['bTracking']:
        tracking    = "FTKRefit"
    elif 'FTK' in chainParts['bTracking']:
        tracking    = "FTK"
    elif 'noTRT' in chainParts['extra']:
        tracking    = "IDTrig_noTRT"

    jetEtHypoTE     = "HLT_j"+btagthresh+ftk
    jetHypoTE       = "HLT_j"+btagthresh+ftk+"_eta"
    jetSplitTE      = jetHypoTE+"_jsplit"
    jetTrackTE      = jetSplitTE+"_"+tracking

    if not useTRT: 
        jetEtHypoTE = jetEtHypoTE + "_noTRT"
        jetSplitTE = jetSplitTE + "_noTRT"

    jetFarawayTE    = jetSplitTE+"_faraway"


    gsc_jetTrackTEPreCut  = "HLT_precut_gsc"+btagthresh+ftk+"_eta"+"_jsplit"+"_"+tracking
    gsc_jetTrackTE        = "HLT_"+gscthresh+ftk+"_eta"+"_jsplit"+"_"+tracking


    if any('antimatch' in bM for bM in chainParts['bMatching'] ) and  any('mu' in bM for bM in chainParts['bMatching'] ):

        # extract muon threshold from chainname
        allChainParts = chainDict['chainName'].split('_')
        muonthr=-1
        for cp in allChainParts:
            if 'mu' in cp and not 'antimatch' in cp:
                muonthr = cp.split('mu')[-1] # assume the last bit is the threshold
                break
        #print 'muon thr for antimatch:' + str(muonthr) 
        muonTE      = "EF_SuperEF_mu{0}_MU{1}".format(muonthr,muonthr)
        jetEtHypoTE = jetEtHypoTE+'_antimatchmu{0}'.format(muonthr)
        #gscEtHypoTE = "HLT_"+gscthresh+ftk+"_eta"+"_jsplit"+"_"+tracking+'_antimatchmu{0}'.format(muonthr)
        jetHypoTE   = jetHypoTE+'_antimatchmu{0}'.format(muonthr)
        jetTrackTE  = jetTrackTE +'_antimatchmu{0}'.format(muonthr)

    superTE         = "HLT_super"
    superTrackingTE = superTE+tracking
    prmVertexTE     = superTrackingTE+"_prmVtx"
    comboPrmVtxTE   = prmVertexTE+"Combo"
    secVtxTE        = jetTrackTE+"__"+"secVtx"
    lastTEout       = "HLT_bjet_"+chainParts['chainPartName'] if numberOfSubChainDicts>1 else EFChainName

    if not useTRT:
        lastTEout = lastTEout + "_noTRT"


    if 'FTKVtx' in chainParts['bTracking'] or 'FTK' in chainParts['bTracking']  or 'FTKRefit' in chainParts['bTracking']:
        comboPrmVtxTE="HLT_FTKVtx_Combo"
    

    topoThresh = chainDict['topoThreshold']
    topoStartFrom = setupTopoStartFrom(topoThresh,theChainDef) if topoThresh else None

    if topoStartFrom:
        lastTEout = lastTEout+'_tsf'
    
    #-----------------------------------------------------------------------------------
    # sequence assembling
    #-----------------------------------------------------------------------------------

    # Vertexing part of the chain
    if 'FTKVtx' in chainParts['bTracking'] or 'FTK' in chainParts['bTracking'] or 'FTKRefit' in chainParts['bTracking'] :
        theChainDef.addSequence(ftkvtx , inputTEsEF, comboPrmVtxTE)
        # b-tagging part of the chain (requires PV)
        theChainDef.addSequence(theJetSplitFTK,    [inputTEsEF, comboPrmVtxTE], jetSplitTE)
    else:
        theChainDef.addSequence(theSuperRoi,      inputTEsEF,   superTE)
        theChainDef.addSequence(trkvtx,  superTE,      superTrackingTE) 
        theChainDef.addSequence([EFHistoPrmVtxAllTE_Jet()], superTrackingTE, prmVertexTE)
        theChainDef.addSequence([EFHistoPrmVtxCombo_Jet()], [superTrackingTE,prmVertexTE], comboPrmVtxTE)
        
        # b-tagging part of the chain (requires PV)
        theChainDef.addSequence(theJetSplit,    [inputTEsEF, comboPrmVtxTE], jetSplitTE)

    #theChainDef.addSequence(theFarawayJet,  [muonTE, jetSplitTE], jetFarawayTE)
    #theChainDef.addSequence(theBjetEtHypo,  jetFarawayTE,  jetEtHypoTE)
    #theChainDef.addSequence(theBjetEtHypo,  jetSplitTE,  jetEtHypoTE)
    if any('antimatch' in bM for bM in chainParts['bMatching'] ) and  any('mu' in bM for bM in chainParts['bMatching'] ):
        theChainDef.addSequence(theFarawayJet,  [muonTE, jetSplitTE], jetFarawayTE)
        jetForTrackingEtCut = jetFarawayTE        
        #theChainDef.addSequence(theBjetEtHypo,  jetFarawayTE,  jetEtHypoTE)
    else :
        jetForTrackingEtCut = jetSplitTE
        #theChainDef.addSequence(theBjetEtHypo,  jetSplitTE,  jetEtHypoTE)

    #Et cut before tracking
    theChainDef.addSequence(theBjetEtHypo,  jetForTrackingEtCut,       jetEtHypoTE )


    theChainDef.addSequence(theBjetTracks,  jetEtHypoTE, jetTrackTE)   
    if 'FTKVtx' in chainParts['bTracking'] or 'FTK' in chainParts['bTracking']  or 'FTKRefit' in chainParts['bTracking']:
        theChainDef.addSequence(theVxSecondaryFTK, [jetTrackTE, comboPrmVtxTE], secVtxTE)
    else:
        theChainDef.addSequence(theVxSecondary, [jetTrackTE, comboPrmVtxTE], secVtxTE)

    #GSC
    if ('gscThreshold' in chainParts) and chainParts['gscThreshold']:
        log.debug("Doing GSC Calculation:"+chainParts["gscThreshold"])
        theChainDef.addSequence(theGSCFex,      secVtxTE                ,       gsc_jetTrackTEPreCut )
        theChainDef.addSequence(theGSCEtHypo,   gsc_jetTrackTEPreCut,           gsc_jetTrackTE )
        jetsForBTagging = gsc_jetTrackTE
        #secVtxTE        = gsc_jetTrackTE+"__"+"superVtx"
    else:
        log.debug("No GSC Calculation")
        jetsForBTagging = secVtxTE
        #secVtxTE        = jetTrackTE+"__"+"superVtx"

    theChainDef.addSequence([theBjetFex, theBtagReq], jetsForBTagging, lastTEout, topo_start_from = topoStartFrom)
    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [lastTEout]*int(btagmult))
    return theChainDef
Example #2
0
def buildBjetChainsAllTE(theChainDef, bjetdict, numberOfSubChainDicts=1):
    log.debug("In buildBjetChainsAllTE")
    inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements'][0]

    useTRT = 'noTRT' not in bjetdict[0]['chainParts']['extra']

    #
    #  Initial Config
    #
    ###############################3

    #
    # Get the min threshold for tracking
    #   This cut is applied after the jet splitting
    #   So we only run precision tracking in ROIs above the minimum considered
    #
    minBTagThreshold = 1e9
    for bjetPart in bjetdict:
        thisBTagThresholdInt = int(bjetPart['chainParts']['threshold'])
        if thisBTagThresholdInt < minBTagThreshold: 
            minBTagThreshold = thisBTagThresholdInt
    log.debug("min jet Pt %s", minBTagThreshold)

    #
    # Configure the GSC calibration
    #   This cut is applied after the GSC calibration
    #   So we only btag ROIs above the minimum considered
    #
    doGSC = False
    minGSCThreshold = 1e9
    for bjetPart in bjetdict:
        if ('gscThreshold' in bjetPart['chainParts']) and (bjetPart['chainParts']['gscThreshold']): 
            doGSC = True
            thisGSCThresholdInt = int(bjetPart['chainParts']['gscThreshold'].replace("gsc",""))
            if thisGSCThresholdInt < minGSCThreshold:
                minGSCThreshold = thisGSCThresholdInt

    if doGSC: log.debug("Doing GSC Calculation:"+str(minGSCThreshold)+"GeV")

    #
    # Now build the chain
    #
    ###########################3

    #
    # super ROI building
    #
    theSuperRoi=getSuperRoiBuilderAllTEInstance()
    superTE = "HLT_super" 
    theChainDef.addSequence(theSuperRoi,      inputTEsEF,   superTE)

    #
    #  PV Tracking
    #
    if useTRT :
        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step"]).getSequence()
    else :
        [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", sequenceFlavour=["2step","noTRT"]).getSequence()
    tracking = "IDTrig"
    if not useTRT : tracking = tracking + "_noTRT"

    superTrackingTE = superTE+tracking
    theChainDef.addSequence(trkvtx,  superTE,      superTrackingTE) 

    #
    #  PV Finding
    #
    prmVertexTE     = superTrackingTE+"_prmVtx"
    theChainDef.addSequence([EFHistoPrmVtxAllTE_Jet()], superTrackingTE, prmVertexTE)
    comboPrmVtxTE   = prmVertexTE+"Combo"
    theChainDef.addSequence([EFHistoPrmVtxCombo_Jet()], [superTrackingTE,prmVertexTE], comboPrmVtxTE)

    #
    #  Jet splitting
    #
    # get the minimum et before gsc cut
    theJetSplit=getJetSplitterAllTEInstance()
    jetHypoTE       = "HLT_j"+str(minBTagThreshold)+"_eta"
    jetSplitTE      = jetHypoTE+"_jsplit"
    if not useTRT : jetSplitTE = jetSplitTE + "_noTRT"

    theChainDef.addSequence(theJetSplit,  [inputTEsEF, comboPrmVtxTE], jetSplitTE) 

    #
    # If do the btagging in away muons 
    #
    algoInstance = "EF"   

    #
    #  Et cut berfore running precision tracking
    #
    theBjetEtHypo   = getBjetEtHypoInstance(algoInstance, "Btagging", str(minBTagThreshold)+"GeV" )
    jetEtHypoTE     = "HLT_j"+str(minBTagThreshold)
    if not useTRT: jetEtHypoTE = jetEtHypoTE + "_noTRT" 
    theChainDef.addSequence(theBjetEtHypo,  jetSplitTE,       jetEtHypoTE )

    #
    #  Precision tracking
    #
    if not useTRT : jetSplitTE = jetSplitTE.replace("_noTRT","") # remove noTRT since we are adding tracking !!!!
    jetTrackTE      = jetSplitTE+"_"+tracking
    theBjetTracks = trkftf+trkprec
    theChainDef.addSequence(theBjetTracks,  jetEtHypoTE, jetTrackTE)       

    #
    #  Secondary Vertexing
    #
    theVxSecondary = TrigVxSecondaryCombo_EF()
    secVtxTE        = jetTrackTE+"__"+"secVtx"
    theChainDef.addSequence(theVxSecondary, [jetTrackTE, comboPrmVtxTE], secVtxTE)

    #
    #  GSC calculation
    #
    if doGSC:
        gsc_jetTrackTEPreCut  = "HLT_precut_gsc"+str(minBTagThreshold)+"_eta"+"_jsplit"+"_"+tracking
        theGSCFex      = getGSCFexSplitInstance(algoInstance)
        theChainDef.addSequence(theGSCFex,      secVtxTE                ,       gsc_jetTrackTEPreCut )

        algoInstance = "GSC"   
        gsc_jetTrackTE        = "HLT_gsc"+str(minGSCThreshold)+"_eta"+"_jsplit"+"_"+tracking
        theGSCEtHypo   = getBjetEtHypoInstance(algoInstance, "Btagging", str(minGSCThreshold) +"GeV" )
        theChainDef.addSequence(theGSCEtHypo,   gsc_jetTrackTEPreCut,           gsc_jetTrackTE )
        jetsForBTagging = gsc_jetTrackTE 
    else:
        log.debug("No GSC Calculation")
        jetsForBTagging = secVtxTE


    #
    #  the tagging fex
    #
    log.debug("Getting tagging fex")
    theBjetFex = getBtagFexSplitInstance(algoInstance, "2012", "EFID") 
    btaggingTE = jetsForBTagging+"_btagged"
    theChainDef.addSequence(theBjetFex, jetsForBTagging, btaggingTE)

    #
    #  The btagging hypo
    #
    log.debug("Getting tagging hypo")
    lastTEout = "HLT_"+bjetdict[0]['chainName']
    if not useTRT : lastTEout = lastTEout + "_noTRT" 

    topoThresh = bjetdict[0]['topoThreshold']
    topoStartFrom = setupTopoStartFrom(topoThresh,theChainDef) if topoThresh else None
    if topoStartFrom:         lastTEout = lastTEout+'_tsf'

    #
    #  Derive multiplicity requirements
    #
    log.debug("Derive multiplicity requirements")
    btagReqs = []
    for bjetchain in bjetdict:
        log.debug(bjetdict)
        btagCut = bjetchain['chainParts']['bTag']
        mult    = bjetchain['chainParts']['multiplicity']

        threshold = bjetchain['chainParts']['threshold']
        if 'gscThreshold' in bjetchain['chainParts']:
            threshold = bjetchain['chainParts']['gscThreshold'].replace("gsc","")

        btagReqs.append([threshold,btagCut,mult])
    
    log.debug("Config the ALLTE Hypo")
    name = bjetdict[0]['chainName']
    theBjetHypoAllTE = getBjetHypoAllTEInstance("EF","2017",name,btagReqs)

    #theChainDef.signatureList[-1]['listOfTriggerElements'][0]
    log.debug("Adding Sequence")
    theChainDef.addSequence(theBjetHypoAllTE, btaggingTE, lastTEout, topo_start_from = topoStartFrom)

    log.debug("Adding Signature")
    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [lastTEout])

    log.debug("Left buildBjetChainsAllTE")
    theChainDef.chain_name = 'HLT_'+bjetdict[0]['chainName']
    return theChainDef
Example #3
0
def generateCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoAlgs):
    HLTChainName = "HLT_" + chainDict['chainName']   

    # need to chang the inputTE for the first seq. If set to L1Topoo -> change to TAU30 (HA30 threshold)
    currentInput = theChainDef.sequenceList[0]['input']
    if "-" in currentInput:
        theChainDef.sequenceList[0]['input'] = "HA30"
    
    # jet splitting
    from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import getJetSplitterInstance
    if ('pufix' in topoAlgs):
        pufixLR=0.5
    else:
        pufixLR=1.2

    theJetSplit=getJetSplitterInstance("TrigJetSplitter",1.2, pufixLR)

    # tracking
    from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
    [trkcore, trkiso, trkprec] = TrigInDetSequence("Tau", "tau", "IDTrig", sequenceFlavour=["2step"]).getSequence()

    # calo-ratio
    from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import getCaloRatioHypoInstance
    fex_llp_jet_hypo = getCaloRatioHypoInstance("TrigCaloRatioHypo", 30, 1.2, True)


    # beam-halo removal
    from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import TrigNewLoFHypoConfig
    hypo_LoF = TrigNewLoFHypoConfig()

    from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import getBHremovalInstance
    theBHremoval=getBHremovalInstance()

    TE_SplitJets = HLTChainName+'_SplitJetTool'
    TE_TrackIsoB = HLTChainName+'_TrkIsoB'
    TE_LogRatioCut = HLTChainName+'_LogRatioCut'
    TE_LogRatioCut_Fcalo = HLTChainName+'_LogRatioCut_Fcalo'
    TE_BeamHaloRemoval = HLTChainName+'_BeamHaloRemoval'

    # split into several trigger elements
    theChainDef.addSequence(theJetSplit, inputTEsEF, TE_SplitJets)

    # adding tracking sequence
    theChainDef.addSequence(trkiso+trkprec,TE_SplitJets,TE_TrackIsoB)
    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TE_TrackIsoB])

    # adding calo-ratio sequence
    theChainDef.addSequence(fex_llp_jet_hypo,TE_TrackIsoB,TE_LogRatioCut)
    theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TE_LogRatioCut])

    # adding LoF sequence
    if ('noiso' not in topoAlgs):
        # create a dummy roi and get full calo
        fullScanSeqMap = getFullScanCaloSequences()
        
        theChainDef.addSequence(fullScanSeqMap['EF_full'][0],'', 'EF_full')
        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full'])

        theChainDef.addSequence(fullScanSeqMap['EF_full_cell'][0],'EF_full', 'EF_full_cell')
        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full'])

        # adding beam halo removal sequence
        theChainDef.addSequence(theBHremoval, ['EF_full_cell',TE_LogRatioCut],TE_LogRatioCut_Fcalo)
        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TE_LogRatioCut_Fcalo])

        theChainDef.addSequence([hypo_LoF], TE_LogRatioCut_Fcalo,TE_BeamHaloRemoval)
        theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TE_BeamHaloRemoval])

    return theChainDef
Example #4
0
    def __init__(self):
        '''
        Inits EgammaFexBuilder
        '''
        self._fast_track = []
        self._precise_track = []

        self._fast_calo_egamma = T2CaloEgamma_eGamma()
        self._fast_calo_ringer = T2CaloEgamma_Ringer()

        self._fast_electron = L2ElectronFex_1()
        self._fast_photon = L2PhotonFex_1()
        self._egamma_rec = TrigEgammaRec.copy(name="TrigEgammaRec_eGamma",
                                              doPrint=False)()
        self._egamma_rec_conv = TrigEgammaRec.copy(
            name="TrigEgammaRec_Conv_eGamma",
            doConversions=True,
            doPrint=False)()
        self._egamma_rec_noid = TrigEgammaRec.copy(
            name="TrigEgammaRec_NoIDEF_eGamma",
            doTrackMatching=False,
            doTrackIsolation=False,
            doPrint=False)()
        self._egamma_rec_ph_caloiso = TrigEgammaRec.copy(
            name="TrigEgammaRec_CaloIso_photon",
            PhotonContainerName="egamma_Iso_Photons",
            doTrackMatching=False,
            doTrackIsolation=False,
            doCaloTopoIsolation=True,
            doPrint=False)()
        self._egamma_rec_el_caloiso = TrigEgammaRec.copy(
            name="TrigEgammaRec_CaloIso_electron",
            ElectronContainerName="egamma_Iso_Electrons",
            PhotonContainerName="egamma_Iso_Photons",
            doCaloTopoIsolation=True,
            doPrint=False)()

        self._egamma_rec_sc = TrigTopoEgammaBuilder.copy(
            name="TrigTopoEgammaBuilder_eGamma", doPrint=False)()
        self._egamma_rec_sc_conv = TrigTopoEgammaBuilder.copy(
            name="TrigTopoEgammaBuilder_Conv_eGamma",
            doConversions=True,
            doPrint=False)()
        self._egamma_rec_sc_noid = TrigTopoEgammaBuilder.copy(
            name="TrigTopoEgammaBuilder_NoIDEF_eGamma",
            doTrackMatching=False,
            doTrackIsolation=False,
            doPrint=False)()
        self._egamma_rec_sc_ph_caloiso = TrigTopoEgammaBuilder.copy(
            name="TrigTopoEgammaBuilder_CaloIso_photon",
            PhotonContainerName="egamma_Iso_Photons",
            doTrackMatching=False,
            doTrackIsolation=False,
            doCaloTopoIsolation=True,
            doPrint=False)()
        self._egamma_rec_sc_el_caloiso = TrigTopoEgammaBuilder.copy(
            name="TrigTopoEgammaBuilder_CaloIso_electron",
            ElectronContainerName="egamma_Iso_Electrons",
            PhotonContainerName="egamma_Iso_Photons",
            doCaloTopoIsolation=True,
            doPrint=False)()

        self._cell_maker = TrigCaloCellMaker_eGamma()
        self._tower_maker = TrigCaloTowerMaker_eGamma()
        self._tower_maker_ion = TrigCaloTowerMaker_eGamma(
            "TrigCaloTowerMaker_eGamma_heavyIon")
        self._cluster_maker = TrigCaloClusterMaker_slw()
        self._electron_calib = TrigEFCaloCalibFex_Electron()
        self._photon_calib = TrigEFCaloCalibFex_Photon()

        ########### Sequences ###########
        [self._fast_track,
         self._precise_track] = TrigInDetSequence("Electron", "electron",
                                                  "IDTrig").getSequence()

        self._gensequence = {
            'fastcalo': self._get_fastcalo,
            'fastcalorec': self._get_fastringer,
            'fastcalohypo': self._get_fastcalohypo,
            'fastringer': self._get_fastringer,
            'fastringerhypo': self._get_fastringerhypo,
            'fastrec': self._get_fastrec,
            'fasttrack': self._get_fasttrack,
            'precisecalo': self._get_precisecalo,
            'precisecalocalib': self._get_precisecalocalib,
            'precisetrack': self._get_precisetrack,
            'trackrec': self._get_trackrec,
            'preciserec': self._get_preciserec
        }

        EgammaFexBuilder.inst_count += 1
        if (EgammaFexBuilder.inst_count > 1):
            log.error('EgammaFexBuilder multiple instances %s' %
                      EgammaFexBuilder.inst_count)

        log.debug('EgammaFexBuilder init complete')
Example #5
0
    def setup_xeXX(self):

        ##EF only chain, run FEB or topo_cluster
        ##NoAlg at L2
        ##if at a certain point different steps are used at EF, 
        ## we need a way to encode the information of the threshold at both the two steps
        ##could be a dict here, or adding something to the SignatureDictionary
        
        threshold   = int(self.chainPart['threshold'])
        calibration = self.chainPart['calib']
        jetCalib    = self.chainPart['jetCalib']
        L2recoAlg   = self.chainPart['L2recoAlg']
        EFrecoAlg   = self.chainPart['EFrecoAlg']
        EFmuon      = self.chainPart['EFmuonCorr']
        addInfo     = self.chainPart["addInfo"]

        # tcpufit is the run 3 name for pufit
        if EFrecoAlg == "tcpufit":
            EFrecoAlg = "pufit"

        #--------------------------------------
        #obtaining the muon sequences & signature:
        #--------------------------------------
        log.debug("Creating muon sequence")
        
        chain = ['mu8', 'L1_MU6',  [], ["Main"], ['RATE:SingleMuon', 'BW:Muon'], -1]

        theDictFromChainName = DictFromChainName.DictFromChainName()
        muonChainDict = theDictFromChainName.getChainDict(chain)
        listOfChainDicts = splitChainDict(muonChainDict)
        muDict = listOfChainDicts[0]
        muDict['chainCounter'] = 9150
        muonthing = L2EFChain_mu(muDict, False, ['8GeV']) 
        muonSeed = muonthing.EFsignatureList[-1][0][0]

        for seq in muonthing.L2sequenceList:
             self.L2sequenceList += [seq]
        for seq in muonthing.EFsequenceList:
             self.EFsequenceList += [seq]
 

        ########### Imports for hypos and fexes  ###########
        ##L1 MET 
        theL2Fex     = L2MissingET_Fex()
        theL2MuonFex = L2TrigMissingETMuon_Fex()

        mucorr=  '_wMu' if EFmuon else ''          
        ##MET with topo-cluster
        if EFrecoAlg=='tc' or EFrecoAlg=='pueta' or EFrecoAlg=='pufit' or EFrecoAlg=='mht' or EFrecoAlg=='trkmht' or EFrecoAlg=='pufittrack' or EFrecoAlg=='trktc':

            ##Topo-cluster
            if EFrecoAlg=='tc':
                #MET fex
                theEFMETFex     = EFMissingET_Fex_topoClusters()                         
                #Muon correction fex
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_topocl()        

                #TC hypo
                #mucorr=  '_wMu' if EFmuon else ''      

                if self.chainPart['trigType'] == "xs":
                    theEFMETHypo = EFMetHypoXS_2sided('EFMetHypo_xs_2sided_%i%s' % (threshold, mucorr),ef_thr=float(threshold)*0.1)
                elif  self.chainPart['trigType'] == "te":
                    theEFMETHypo = EFMetHypoTE('EFMetHypo_te%d' % threshold,ef_thr=float(threshold)*GeV)
                else:               
                    theEFMETHypo = EFMetHypoTCXE('EFMetHypo_TC_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV)  
                
            if EFrecoAlg=='pufit':

                doLArH11off=False
                doLArH12off=False
                LArTag=''
                if "LArH11off" in addInfo: 
                    doLArH11off = True
                    LArTag += '_LArH11off'
                if "LArH12off" in addInfo:
                    doLArH12off = True
                    LArTag += '_LArH12off'
                if "METphi" in addInfo: 
                    LArTag += '_METphi'

                jpt_thr = '-1'
                if len(addInfo.split('Jpt'))==2: jpt_thr = addInfo.split('Jpt')[1] 

                if "Jpt" in addInfo:
                    LArTag += '_Jpt'+jpt_thr

                #MET fex
                theEFMETFex = EFMissingET_Fex_topoClustersPUC("EFMissingET_Fex_topoClustersPUC%s"%(addInfo),doLArH11off,doLArH12off,float(jpt_thr)) 
                #Muon correction fex
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_topoclPUC()
                mucorr= '_wMu' if EFmuon else '' 

                theEFMETHypo = EFMetHypoTCPUCXE('EFMetHypo_TCPUC'+LArTag+'_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV,labelMET=addInfo)


            if EFrecoAlg=='pufittrack':
                calibCorr = ('_{0}'.format(calibration) if calibration != METChainParts_Default['calib'] else '') + ('_{0}'.format(jetCalib) if jetCalib != METChainParts_Default['jetCalib'] else '')
                #MET fex
                #print ("PUFITTRACK XXXXXXXXXX")
                #print (calibCorr)
                theEFMETFex = EFMissingET_Fex_topoClustersTracksPUC("EFMissingET_Fex_topoClustersTracksPUC{0}".format(calibCorr), extraCalib=calibCorr)
                #print ("PUFITTRACK XXXXXXXXXX")
                #print (theEFMETFex)
                #Muon correction fex
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_topoclPUC()
                #print (theEFMETMuonFex)
                mucorr= '_wMu' if EFmuon else ''
                #theEFMETHypo = EFMetHypoTCTrkPUCXE('EFMetHypo_TCTrkPUC_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV)
                theEFMETHypo = EFMetHypoTCTrkPUCXE('EFMetHypo_TCTrkPUC_xe%s_tc%s%s%s'%(threshold,jetCalib,calibration,mucorr),ef_thr=float(threshold)*GeV, extraCalib=calibCorr)

            ##MET based on trigger jets
            if EFrecoAlg=='mht':
                calibCorr = ('_{0}'.format(calibration) if calibration != METChainParts_Default['calib'] else '') + ('_{0}'.format(jetCalib) if jetCalib != METChainParts_Default['jetCalib'] else '')

                #MET fex
                theEFMETFex = EFMissingET_Fex_Jets("EFMissingET_Fex_Jets{0}".format(calibCorr), extraCalib=calibCorr )
                #Muon correction fex
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_Jets("EFTrigMissingETMuon_Fex_Jets{0}".format(calibCorr) )
                #mucorr= '_wMu' if EFmuon else ''
                theEFMETHypo = EFMetHypoJetsXE('EFMetHypo_Jets_xe%s_tc%s%s%s'%(threshold,jetCalib,calibration,mucorr),ef_thr=float(threshold)*GeV, extraCalib=calibCorr)


             ##MET based on trigger jets
            if EFrecoAlg=='trkmht':
                #MET fex                                                                                                                                                    
                theEFMETFex = EFMissingET_Fex_TrackAndJets()                                                                                                                
                #Muon correction fex                                                                                                                                        
                ## this will be added later                                                                                                                                 
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_Jets()                                                                                                            
                #mucorr= '_wMu' if EFmuon else ''                                                                                                                           
                theEFMETHypo = EFMetHypoTrackAndJetsXE('EFMetHypo_TrackAndJets_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV)

                
            if EFrecoAlg=='trktc':
                #MET fex                                                                                                                                                    
                theEFMETFex = EFMissingET_Fex_TrackAndClusters()                                                                                                                
                #Muon correction fex                                                                                                                                        
                ## this will never be used                                                                                                                                 
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_topocl()                                                                                                            
                #mucorr= '_wMu' if EFmuon else ''                                                                                                                           
                theEFMETHypo = EFMetHypoTrackAndClustersXE('EFMetHypo_TrackAndClusters_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV)

       
            ##Topo-cluster with Pile-up suppression
            if EFrecoAlg=='pueta':
                #MET fex
                theEFMETFex = EFMissingET_Fex_topoClustersPS() 
                #Muon correction fex
                theEFMETMuonFex = EFTrigMissingETMuon_Fex_topoclPS()        

                theEFMETHypo = EFMetHypoTCPSXE('EFMetHypo_TCPS_xe%s_tc%s%s'%(threshold,calibration,mucorr),ef_thr=float(threshold)*GeV)



        ##2-SidedNoise Cell
        elif EFrecoAlg=='cell':
            #MET fex
            theEFMETFex = EFMissingET_Fex_2sidednoiseSupp()

            #Muon correction fex
            theEFMETMuonFex = EFTrigMissingETMuon_Fex()        
            
            #Hypo
            if self.chainPart['trigType'] == "xs":
                theEFMETHypo = EFMetHypoXS_2sided('EFMetHypo_xs_2sided_%d%s' % (threshold, mucorr),ef_thr=float(threshold)*0.1)                    
            elif  self.chainPart['trigType'] == "te":
                theEFMETHypo = EFMetHypoTE('EFMetHypo_te%d'% threshold,ef_thr=threshold*GeV)
            else:               
                LArTag=''
                if "LArH11off" in addInfo: LArTag += '_LArH11off'
                if "LArH12off" in addInfo: LArTag += '_LArH12off'
                if "METphi" in addInfo: LArTag += '_METphi'
                theEFMETHypo = EFMetHypoXE('EFMetHypo'+LArTag+'_xe%s%s'%(threshold,mucorr),ef_thr=float(threshold)*GeV)  

        else:
            log.warning("MET EF algorithm not recognised")
        
        #----------------------------------------------------
        # Obtaining the needed jet TEs from the jet code and b-jet code 
        #----------------------------------------------------
        from TriggerJobOpts.TriggerFlags import TriggerFlags
        
        from TriggerMenu.bjet.generateBjetChainDefs import generateChainDefs as generateBjetChainDefs
    
        chain = ['j0_{0}_{1}'.format(calibration, jetCalib), '', [], ["Main"], ['RATE:SingleJet', 'BW:Jet'], -1]

        theDictFromChainName = DictFromChainName.DictFromChainName()
        jetChainDict = theDictFromChainName.getChainDict(chain)
        
        jetChainDict['chainCounter'] = 9151
        jetChainDef = generateHLTChainDef(jetChainDict)
        #This is a dummy b-jet chain, with a threshold at 20 GeV at the uncalibrated scale. It computes the tracks within each jet RoI. 
        #Change the calibration by changing 'nojcalib' to the desired calibration scale. 
        #For pufittrack, we found that the performance was superior using uncalibrated jets. 
        dummy_bjet_chain = ['j20_{0}_{1}_boffperf_split'.format(calibration, jetCalib),  '', [], ["Main"], ['RATE:SingleBJet', 'BW:BJet'], -1]
        bjet_chain_dict = theDictFromChainName.getChainDict(dummy_bjet_chain)
        bjet_chain_dict["chainCounter"] = 9152
        bjet_chain_dict['topoThreshold'] = None
        bjet_chain_def = generateBjetChainDefs(bjet_chain_dict)
       
        #for i in range(3):
        #    m_input[i] = jetChainDef.sequenceList[i]['input']
        #    m_output[i]= jetChainDef.sequenceList[i]['output']
        #    m_algo[i] =jetChainDef.sequenceList[i]['algorithm']

        #obtaining DummyUnseededAllTEAlgo/RoiCreator 
        input0=jetChainDef.sequenceList[0]['input']
        output0 =jetChainDef.sequenceList[0]['output']
        algo0 =jetChainDef.sequenceList[0]['algorithm']
        
        #obtaing TrigCaloCellMaker/FS 
        input1=jetChainDef.sequenceList[1]['input']
        output1 =jetChainDef.sequenceList[1]['output']
        algo1 =jetChainDef.sequenceList[1]['algorithm']
        
        #obtaining TrigCaloClusterMaker
        input2=jetChainDef.sequenceList[2]['input']
        output2 =jetChainDef.sequenceList[2]['output']
        algo2 =jetChainDef.sequenceList[2]['algorithm']

        #obtaining TrigHLTEnergyDensity
        input3=jetChainDef.sequenceList[3]['input']
        output3 =jetChainDef.sequenceList[3]['output']
        algo3 =jetChainDef.sequenceList[3]['algorithm']

        #obtaining TrigHLTJetRecFromCluster
        input4=jetChainDef.sequenceList[4]['input']
        output4 =jetChainDef.sequenceList[4]['output']
        algo4 =jetChainDef.sequenceList[4]['algorithm']

        #---End of obtaining jet TEs------------------------------
                   
        ########### Sequences ###########
        
        #Run L2-like algos only for l2fsperf and L2FS chains
        if L2recoAlg=="l2fsperf" or L2recoAlg=="L2FS":

            ##L1 MET
            self.L2sequenceList += [[ self.l2_input_tes,              [theL2Fex],                      'L2_xe_step1']]
            ##Moun Correction to L1 MET
            self.L2sequenceList += [[ ['L2_xe_step1', muonSeed],  [theL2MuonFex],                  'L2_xe_step2']]

        # --- EF ---                

        # cell preselection (v7 onwards only)
        # First check if we're in a multipart chain (for now assume that we don't apply the preselection for these)
        isMulitpartChain = self.chainPart['chainPartName'] != self.chainDict['chainName']
        if EFrecoAlg != 'cell' and 'v6' not in TriggerFlags.triggerMenuSetup() and 'v5' not in TriggerFlags.triggerMenuSetup() and not isMulitpartChain:
        # if EFrecoAlg != 'cell' and TriggerFlags.run2Config() != '2016' and not isMulitpartChain:
          # a few parameters
          cellPresel_minL1Threshold = 50
          cellPresel_threshold = 50
          # work out what the L1 threshold is
          import re
          match = re.match(r"L1_XE(\d+)", self.chainDict['L1item'])
          if match:
            if int(match.group(1) ) >= cellPresel_minL1Threshold:
              cellPreselectionFex = EFMissingET_Fex_2sidednoiseSupp()
              cellPreselectionMuonFex = EFTrigMissingETMuon_Fex()
              cellPreselectionHypo = EFMetHypoXE('EFMetHypo_xe{0}_presel'.format(cellPresel_threshold), ef_thr = float(cellPresel_threshold) * GeV)

              self.EFsequenceList += [[ [''], [cellPreselectionFex], 'EF_xe{0}_step1'.format(cellPresel_threshold) ]]
              self.EFsequenceList += [[ ['EF_xe{0}_step1'.format(cellPresel_threshold), muonSeed], [cellPreselectionMuonFex, cellPreselectionHypo], 'EF_xe{0}_step2'.format(cellPresel_threshold) ]]
              
              self.EFsignatureList += [ [['EF_xe{0}_step1'.format(cellPresel_threshold)]] ]
              self.EFsignatureList += [ [['EF_xe{0}_step2'.format(cellPresel_threshold)]] ]
          else:
            log.info("Pure MET chain doesn't have an L1_XE seed! Will not apply the cell preselection")


        #topocluster
        if EFrecoAlg=='tc' or EFrecoAlg=='pueta' or EFrecoAlg=='pufit':
            self.EFsequenceList +=[[ input0,algo0,  output0 ]]            
            self.EFsequenceList +=[[ input1,algo1,  output1 ]]            
            self.EFsequenceList +=[[ input2,algo2,  output2 ]]           
            self.EFsequenceList +=[[ input3,algo3,  output3 ]]            
            self.EFsequenceList +=[[ input4,algo4,  output4 ]]
            self.EFsequenceList +=[[ [output3,output4],          [theEFMETFex],  'EF_xe_step1' ]]            
            self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed],     [theEFMETMuonFex, theEFMETHypo],  'EF_xe_step2' ]]


        elif EFrecoAlg=='pufittrack':
            def makelist(x):
                return x if isinstance(x, list) else [x]
            self.EFsequenceList += [ [ x['input'], makelist(x['algorithm']), x['output'] ] for x in bjet_chain_def.sequenceList[:-2] ]
#            for x in bjet_chain_def.sequenceList[:-2]:
#                print (x)
#            print (self.EFsequenceList[4][2], "Clusters, output EF_FSTopoClusters")
#            print (self.EFsequenceList[6][2], "Jets, output EF_8389636500743033767_jetrec_a4tclcwnojcalibFS")
#            print (self.EFsequenceList[-1][2], "Tracks, output HLT_j20_eta_jsplit_IDTrig")
#            print (self.EFsequenceList[-5][2], "Vertex, output HLT_superIDTrig_prmVtx")
#            Fill the sequence with clusters, jets, tracks, vertices 
            self.EFsequenceList += [[ [self.EFsequenceList[4][2],self.EFsequenceList[6][2],self.EFsequenceList[-1][2],self.EFsequenceList[-5][2]], [theEFMETFex], 'EF_xe_step1' ]]  
            self.EFsequenceList += [[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]]

        #trigger-jet based MET
        elif EFrecoAlg=='mht': 
            self.EFsequenceList +=[[ input0,algo0,  output0 ]]            
            self.EFsequenceList +=[[ input1,algo1,  output1 ]]            
            self.EFsequenceList +=[[ input2,algo2,  output2 ]]           
            self.EFsequenceList +=[[ input3,algo3,  output3 ]]            
            self.EFsequenceList +=[[ input4,algo4,  output4 ]]            
            self.EFsequenceList +=[[ [output4], [theEFMETFex], 'EF_xe_step1' ]]
            self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]]
            if "FStracks" in addInfo:
                from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
                trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
                print (trk_algs[0])
                dummyAlg = PESA__DummyUnseededAllTEAlgo("EF_DummyFEX_xe")
                self.EFsequenceList +=[[ [''], [dummyAlg]+trk_algs[0], 'EF_xe_step3' ]]

        elif EFrecoAlg=='trkmht':
            self.EFsequenceList +=[[ input0,algo0,  output0 ]]
            self.EFsequenceList +=[[ input1,algo1,  output1 ]]
            self.EFsequenceList +=[[ input2,algo2,  output2 ]]
            self.EFsequenceList +=[[ input3,algo3,  output3 ]]
            self.EFsequenceList +=[[ input4,algo4,  output4 ]]

            #adding FullScan tracks
            from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
            trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
            dummyAlg = PESA__DummyUnseededAllTEAlgo("EF_DummyFEX_xe")
            self.EFsequenceList +=[[ [''], [dummyAlg]+trk_algs[0], 'EF_xe_step0' ]]

            self.EFsequenceList +=[[ [output4,'EF_xe_step0',muonSeed], [theEFMETFex], 'EF_xe_step1' ]]                                                                               
            self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]]   


        elif EFrecoAlg=='trktc':
            self.EFsequenceList +=[[ input0,algo0,  output0 ]]
            self.EFsequenceList +=[[ input1,algo1,  output1 ]]
            self.EFsequenceList +=[[ input2,algo2,  output2 ]]
            self.EFsequenceList +=[[ input3,algo3,  output3 ]]
            #self.EFsequenceList +=[[ input4,algo4,  output4 ]]

            ##adding FullScan tracks
            from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
            trk_algs = TrigInDetSequence("FullScan", "fullScan", "IDTrig", sequenceFlavour=["FTF"]).getSequence()
            dummyAlg = PESA__DummyUnseededAllTEAlgo("EF_DummyFEX_xe")
            self.EFsequenceList +=[[ [''], [dummyAlg]+trk_algs[0], 'EF_xe_step0' ]]

            self.EFsequenceList +=[[ [output3,'EF_xe_step0',muonSeed], [theEFMETFex], 'EF_xe_step1' ]]                                                                               
            self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]]   


        #cell based MET
        elif EFrecoAlg=='cell':
            self.EFsequenceList +=[[ [''],          [theEFMETFex],  'EF_xe_step1' ]]  
            self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed],     [theEFMETMuonFex, theEFMETHypo],  'EF_xe_step2' ]]
            
            
        ########### Signatures ###########
        if L2recoAlg=="l2fsperf" or  L2recoAlg=="L2FS" :
            self.L2signatureList += [ [['L2_xe_step1']] ]
            self.L2signatureList += [ [['L2_xe_step2']] ]

        if EFrecoAlg=="trkmht" or EFrecoAlg=="trktc" :
            self.EFsignatureList += [ [['EF_xe_step0']] ]   

        self.EFsignatureList += [ [['EF_xe_step1']] ]
        self.EFsignatureList += [ [['EF_xe_step2']] ]
        if "FStracks" in addInfo:
            self.EFsignatureList += [ [['EF_xe_step3']] ]
        

        ########### TE renaming ###########
        self.TErenamingDict = {}
            
        if L2recoAlg=="l2fsperf" or  L2recoAlg=="L2FS" :
            self.TErenamingDict['L2_xe_step1']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step1')
            self.TErenamingDict['L2_xe_step2']= mergeRemovingOverlap('L2_', self.sig_id_noMult+'_step2')

        if EFrecoAlg=='trkmht' or EFrecoAlg=='trktc':
            self.TErenamingDict['EF_xe_step0']= mergeRemovingOverlap('EF_', self.sig_id_noMult+"_step0")                                                                    
        #if EFrecoAlg=='pufittrack':
        #    self.TErenamingDict['EF_xe_step0']= mergeRemovingOverlap('EF_', self.sig_id_noMult+"_step0")
            
        self.TErenamingDict['EF_xe_step1']= mergeRemovingOverlap('EF_', self.sig_id_noMult+'_step1')
        if "FStracks" in addInfo:
            self.TErenamingDict['EF_xe_step2']= mergeRemovingOverlap('EF_', self.sig_id_noMult+"_step2")
            self.TErenamingDict['EF_xe_step3']= mergeRemovingOverlap('EF_', self.sig_id_noMult)
        else:
            self.TErenamingDict['EF_xe_step2']= mergeRemovingOverlap('EF_', self.sig_id_noMult)