def patchGct(process) :

    process.load("Configuration.StandardSequences.RawToDigi_Data_cff")

    process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
    process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")

    from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
    from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis    

    process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
    process.rctReEmulDigis  = rctDigis.clone()
    process.gctReEmulDigis  = gctDigis.clone()
    process.gtReEmulDigis   = gtDigis.clone()
    
    process.hcalReEmulDigis.inputLabel = cms.VInputTag(cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))

    process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
    process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalReEmulDigis' ) )
    
    process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")
    
    process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gtDigis")
    process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")

    process.patchGct = cms.Sequence(
        process.ecalDigis
        + process.hcalDigis
        + process.hcalReEmulDigis
        + process.rctReEmulDigis
        + process.gctReEmulDigis
        + process.gtReEmulDigis
        )
Esempio n. 2
0
def patchGct(process):

    process.load("Configuration.StandardSequences.RawToDigi_Data_cff")

    process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
    process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")

    from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
    from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis

    process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
    process.rctReEmulDigis = rctDigis.clone()
    process.gctReEmulDigis = gctDigis.clone()
    process.gtReEmulDigis = gtDigis.clone()

    process.hcalReEmulDigis.inputLabel = cms.VInputTag(
        cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))

    process.rctReEmulDigis.ecalDigis = cms.VInputTag(
        cms.InputTag('ecalDigis:EcalTriggerPrimitives'))
    process.rctReEmulDigis.hcalDigis = cms.VInputTag(
        cms.InputTag('hcalReEmulDigis'))

    process.gctReEmulDigis.inputLabel = cms.InputTag("rctReEmulDigis")

    process.gtReEmulDigis.GmtInputTag = cms.InputTag("gtDigis")
    process.gtReEmulDigis.GctInputTag = cms.InputTag("gctReEmulDigis")

    process.patchGct = cms.Sequence(process.ecalDigis + process.hcalDigis +
                                    process.hcalReEmulDigis +
                                    process.rctReEmulDigis +
                                    process.gctReEmulDigis +
                                    process.gtReEmulDigis)
Esempio n. 3
0
    isoEmLabel=cms.untracked.InputTag("l1extraParticles:Isolated"),
    tauJetLabel=cms.untracked.InputTag("l1extraParticles:Tau"),
    cenJetLabel=cms.untracked.InputTag("l1extraParticles:Central"),
    fwdJetLabel=cms.untracked.InputTag("l1extraParticles:Forward"),
    muonLabel=cms.untracked.InputTag("l1extraParticles"),
    metLabel=cms.untracked.InputTag("l1extraParticles:MET"),
    mhtLabel=cms.untracked.InputTag("l1extraParticles:MHT"),
    hfRingsLabel=cms.untracked.InputTag("l1extraParticles"),
    maxL1Extra=cms.uint32(20))

process.TFileService = cms.Service(
    "TFileService", fileName=cms.string('L1TreeReRunHTCUT5.root'))

from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis

process.gtReEmulDigis = gtDigis.clone()

process.gtReEmulDigis.GmtInputTag = cms.InputTag(
    "gtDigis"
)  # this is original GMT info from DATA (GMT is read out by GT FED)
process.gtReEmulDigis.GctInputTag = cms.InputTag("gctReEmulDigis")
process.gtReEmulDigis.EmulateBxInEvent = cms.int32(1)

process.gtReEmulDigisNOPU = gtDigis.clone()

process.gtReEmulDigisNOPU.GmtInputTag = cms.InputTag(
    "gtDigis"
)  # this is original GMT info from DATA (GMT is read out by GT FED)
process.gtReEmulDigisNOPU.GctInputTag = cms.InputTag("gctReEmulDigisNOPU")
process.gtReEmulDigisNOPU.EmulateBxInEvent = cms.int32(1)
Esempio n. 4
0
   fwdJetLabel = cms.untracked.InputTag("l1extraParticles:Forward"),
   muonLabel = cms.untracked.InputTag("l1extraParticles"),
   metLabel = cms.untracked.InputTag("l1extraParticles:MET"),
   mhtLabel = cms.untracked.InputTag("l1extraParticles:MHT"),
   hfRingsLabel = cms.untracked.InputTag("l1extraParticles"),
   maxL1Extra = cms.uint32(20)
)


process.TFileService = cms.Service("TFileService",
    fileName = cms.string('L1TreeReRun.root')
)

from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis

process.gtReEmulDigis   = gtDigis.clone()

process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gtDigis") # this is original GMT info from DATA (GMT is read out by GT FED)
process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")
process.gtReEmulDigis.EmulateBxInEvent = cms.int32(1)


process.p1 = cms.Path(
    process.emulationSequence 
    *process.gtEvmDigis
    *process.dttfDigis
    *process.csctfDigis
    *process.gctReEmulDigis
    *process.gtReEmulDigis
    *process.scalersRawToDigi*
    process.l1extraParticlesReEmul*    
Esempio n. 5
0
def reEmulation(process, reEmulMuons=True, reEmulCalos=True, patchNtuple=True, runOnPostLS1 = False):

    print "[L1Menu]: Setting up overall re-emulation"        

    if patchNtuple and hasattr(process,'l1NtupleProducer') and hasattr(process,'l1ExtraTreeProducer') :
        print "[L1Menu]:\tConfiguring Ntuple to use re-emulated information"        
        ntuple        = getattr(process,'l1NtupleProducer')
        l1ExtraNtuple = getattr(process,'l1ExtraTreeProducer')
    elif patchNtuple :
        print "[L1Menu]:\tERROR: FAILED to find ntuple! switching patchNtuple to False"        
        patchNtuple=False

    process.l1ExtraReEmul = cms.EDProducer(
        "L1ExtraParticlesProd",
        muonSource = cms.InputTag("gtDigis"),
        isolatedEmSource    = cms.InputTag("gctDigis","isoEm"),
        nonIsolatedEmSource = cms.InputTag("gctDigis","nonIsoEm"),
        
        forwardJetSource = cms.InputTag("gctDigis","forJets"),
        centralJetSource = cms.InputTag("gctDigis","cenJets"),
        tauJetSource     = cms.InputTag("gctDigis","tauJets"),
        
        etTotalSource = cms.InputTag("gctDigis"),
        etHadSource   = cms.InputTag("gctDigis"),
        etMissSource  = cms.InputTag("gctDigis"),
        htMissSource  = cms.InputTag("gctDigis"),
        
        hfRingEtSumsSource    = cms.InputTag("gctDigis"),
        hfRingBitCountsSource = cms.InputTag("gctDigis"),
        
        produceMuonParticles = cms.bool(True),
        produceCaloParticles = cms.bool(True),
        centralBxOnly = cms.bool(True),
        ignoreHtMiss = cms.bool(False)
        )
        
    if reEmulMuons :
        print "[L1Menu]:\tSetting up muon re-emulation"        
        
        from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
        process.dttfReEmulDigis       = dttfDigis.clone()
        process.dttfReEmulDigis.DTDigi_Source  = cms.InputTag("dttfDigis")
        process.dttfReEmulDigis.CSCStub_Source = cms.InputTag("csctfReEmulTrackDigis")

        from L1Trigger.RPCTrigger.rpcTriggerDigis_cfi import rpcTriggerDigis
        process.rpcTriggerReEmulDigis = rpcTriggerDigis.clone()

        if not runOnPostLS1 :
            from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

        
            process.csctfReEmulTrackDigis = csctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()
        
            process.csctfReEmulTrackDigis.readDtDirect        = True
            process.csctfReEmulTrackDigis.SectorReceiverInput = cms.untracked.InputTag("csctfDigis")
            process.csctfReEmulTrackDigis.DtDirectProd        = cms.untracked.InputTag("csctfDigis","DT")
            process.csctfReEmulDigis.CSCTrackProducer         = cms.untracked.InputTag("csctfReEmulTrackDigis")
            #process.csctfReEmulDigis.SectorProcessor.initializeFromPSet = True
            
            process.csctfReEmulSequence = cms.Sequence(
                process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )
        else :
            from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_L1Emulator
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

            customise_csc_L1Emulator(process) 

            process.csctfReEmulTrackDigis = process.simCsctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()

            process.csctfReEmulTrackDigis.DTproducer  = cms.untracked.InputTag("dttfDigis")
            process.csctfReEmulDigis.CSCTrackProducer = cms.untracked.InputTag("csctfReEmulTrackDigis")

            process.csctfReEmulTrackDigis.SectorProcessor.PTLUT.PtMethod = cms.untracked.uint32(33) # no triple ganging in ME11a
            process.csctfReEmulTrackDigis.SectorProcessor.gangedME1a = cms.untracked.bool(False)
            process.csctfReEmulTrackDigis.SectorProcessor.firmwareSP = cms.uint32(20120730) #core 20120730
            process.csctfReEmulTrackDigis.SectorProcessor.initializeFromPSet = cms.bool(True) 

            process.csctfReEmulSequence = cms.Sequence(
                process.simCscTriggerPrimitiveDigis
                * process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )

            process.load('L1TriggerConfig.GMTConfigProducers.L1MuGMTParameters_cfi')
            process.L1MuGMTParameters.MergeMethodPtBrl=cms.string("byCombi")
            process.L1MuGMTParameters.MergeMethodPtFwd=cms.string("byCombi")
            process.L1MuGMTParameters.VersionSortRankEtaQLUT = cms.uint32(1043)
            process.L1MuGMTParameters.VersionLUTs = cms.uint32(1)


        from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
        process.gmtReEmulDigis  = gmtDigis.clone()

        process.gmtReEmulDigis.DTCandidates   = cms.InputTag("dttfReEmulDigis","DT")
        process.gmtReEmulDigis.CSCCandidates  = cms.InputTag("csctfReEmulDigis","CSC")
        process.gmtReEmulDigis.RPCbCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCb")
        process.gmtReEmulDigis.RPCfCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCf")
        process.gmtReEmulDigis.MipIsoData     = cms.InputTag("none")
        
        process.l1ExtraReEmul.muonSource = cms.InputTag("gmtReEmulDigis")            

        if patchNtuple :
            ntuple.gmtSource          = cms.InputTag("gmtReEmulDigis")
            ntuple.dttfSource         = cms.InputTag("dttfReEmulDigis")
            ntuple.csctfTrkSource     = cms.InputTag("csctfReEmulTrackDigis")
            ntuple.csctfStatusSource  = cms.InputTag("csctfReEmulTrackDigis")

            l1ExtraNtuple.muonLabel = cms.untracked.InputTag("l1ExtraReEmul")

        process.reEmulMuonChain = cms.Sequence(
            process.rpcTriggerReEmulDigis
            *process.csctfReEmulSequence
            *process.dttfReEmulDigis
            *process.gmtReEmulDigis
            )

    if reEmulCalos :
        print "[L1Menu]:\tSetting up calo re-emulation"        

        print "[L1Menu]:\tWARNING! Just patching GCT sequence, RCT can't be re-emulated after UCT2015 SW patches"        

        # Need to have RCT emulator configurable and not UCT 2015 patches
        # in order to run 2012 RCT emulator correctly
        
        #	# In MC HCAL need to be re-run as there is no TPG information stored
        #	process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
        #	process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
        #	
        #	from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
        #	from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
        #	
        #	process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
        #	process.rctReEmulDigis  = rctDigis.clone()
        #	process.gctReEmulDigis  = gctDigis.clone()
        #	
        #	process.hcalReEmulDigis.inputLabel = cms.VInputTag(cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))
        #	#process.HcalTPGCoderULUT.LUTGenerationMode = cms.bool(False)
        #	
        #	process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
        #	process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalReEmulDigis' ) )
        #	
        #	process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")

        from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis

        process.gctReEmulDigis = gctDigis.clone()        
        process.gctReEmulDigis.inputLabel = cms.InputTag("gctDigis")

        process.l1ExtraReEmul.isolatedEmSource    = cms.InputTag("gctReEmulDigis","isoEm")
        process.l1ExtraReEmul.nonIsolatedEmSource = cms.InputTag("gctReEmulDigis","nonIsoEm")

        process.l1ExtraReEmul.forwardJetSource = cms.InputTag("gctReEmulDigis","forJets")
        process.l1ExtraReEmul.centralJetSource = cms.InputTag("gctReEmulDigis","cenJets")
        process.l1ExtraReEmul.tauJetSource     = cms.InputTag("gctReEmulDigis","tauJets")
            
        process.l1ExtraReEmul.etTotalSource = cms.InputTag("gctDigis")
        process.l1ExtraReEmul.etHadSource   = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etMissSource  = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.htMissSource  = cms.InputTag("gctReEmulDigis")

        process.l1ExtraReEmul.hfRingEtSumsSource    = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.hfRingBitCountsSource = cms.InputTag("gctReEmulDigis")

        if patchNtuple :
            ntuple.gctCentralJetsSource = cms.InputTag("gctReEmulDigis","cenJets")
            ntuple.gctNonIsoEmSource    = cms.InputTag("gctReEmulDigis","nonIsoEm")
            ntuple.gctForwardJetsSource = cms.InputTag("gctReEmulDigis","forJets")
            ntuple.gctIsoEmSource       = cms.InputTag("gctReEmulDigis","isoEm")
            ntuple.gctEnergySumsSource  = cms.InputTag("gctReEmulDigis","")
            ntuple.gctTauJetsSource     = cms.InputTag("gctReEmulDigis","tauJets")

            l1ExtraNtuple.nonIsoEmLabel = cms.untracked.InputTag("l1ExtraReEmul:NonIsolated")
            l1ExtraNtuple.isoEmLabel    = cms.untracked.InputTag("l1ExtraReEmul:Isolated")
            l1ExtraNtuple.tauJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Tau")
            l1ExtraNtuple.cenJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Central")
            l1ExtraNtuple.fwdJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Forward")
            l1ExtraNtuple.metLabel      = cms.untracked.InputTag("l1ExtraReEmul:MET")
            l1ExtraNtuple.mhtLabel      = cms.untracked.InputTag("l1ExtraReEmul:MHT")

            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly
            #    ntuple.rctSource            = cms.InputTag("rctReEmulDigis")

        process.reEmulCaloChain = cms.Sequence(
            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly
        
            #process.hcalReEmulDigis
            #+ process.rctReEmulDigis
            process.gctReEmulDigis
        )


    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis
    process.gtReEmulDigis   = gtDigis.clone()

    if reEmulMuons :
        process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gmtReEmulDigis")
    if reEmulCalos :
        process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")

    if patchNtuple :
        ntuple.gtSource = cms.InputTag("gtReEmulDigis")
        
    if reEmulMuons and reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulMuons :
        process.reEmul = cms.Sequence(process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    else :
        process.reEmul = cms.Sequence(process.gtReEmulDigis + process.l1ExtraReEmul)
Esempio n. 6
0
def reEmulation(process, reEmulMuons=True, reEmulCalos=True, patchNtuple=True, runOnPostLS1 = False, useStage1Layer2=False):

    print "[L1Menu]: Setting up overall re-emulation"        

    if patchNtuple and hasattr(process,'l1NtupleProducer') and hasattr(process,'l1ExtraTreeProducer') :
        print "[L1Menu]:\tConfiguring Ntuple to use re-emulated information"        
        ntuple        = getattr(process,'l1NtupleProducer')
        l1ExtraNtuple = getattr(process,'l1ExtraTreeProducer')
    elif patchNtuple :
        print "[L1Menu]:\tERROR: FAILED to find ntuple! switching patchNtuple to False"        
        patchNtuple=False

    process.l1ExtraReEmul = cms.EDProducer(
        "L1ExtraParticlesProd",
        muonSource = cms.InputTag("gtDigis"),
        isolatedEmSource    = cms.InputTag("gctDigis","isoEm"),
        nonIsolatedEmSource = cms.InputTag("gctDigis","nonIsoEm"),
        
        forwardJetSource = cms.InputTag("gctDigis","forJets"),
        centralJetSource = cms.InputTag("gctDigis","cenJets"),
        tauJetSource     = cms.InputTag("gctDigis","tauJets"),
        isoTauJetSource  = cms.InputTag("gctDigis","isoTauJets"),
        
        etTotalSource = cms.InputTag("gctDigis"),
        etHadSource   = cms.InputTag("gctDigis"),
        etMissSource  = cms.InputTag("gctDigis"),
        htMissSource  = cms.InputTag("gctDigis"),
        
        hfRingEtSumsSource    = cms.InputTag("gctDigis"),
        hfRingBitCountsSource = cms.InputTag("gctDigis"),
        
        produceMuonParticles = cms.bool(True),
        produceCaloParticles = cms.bool(True),
        centralBxOnly = cms.bool(True),
        ignoreHtMiss = cms.bool(False)
        )
        
    if reEmulMuons :
        print "[L1Menu]:\tSetting up muon re-emulation"        
        
        from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
        process.dttfReEmulDigis       = dttfDigis.clone()
        process.dttfReEmulDigis.DTDigi_Source  = cms.InputTag("dttfDigis")
        process.dttfReEmulDigis.CSCStub_Source = cms.InputTag("csctfReEmulTrackDigis")

        from L1Trigger.RPCTrigger.rpcTriggerDigis_cfi import rpcTriggerDigis
        process.rpcTriggerReEmulDigis = rpcTriggerDigis.clone()

        if not runOnPostLS1 :
            from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

        
            process.csctfReEmulTrackDigis = csctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()
        
            process.csctfReEmulTrackDigis.readDtDirect        = True
            process.csctfReEmulTrackDigis.SectorReceiverInput = cms.untracked.InputTag("csctfDigis")
            process.csctfReEmulTrackDigis.DtDirectProd        = cms.untracked.InputTag("csctfDigis","DT")
            process.csctfReEmulDigis.CSCTrackProducer         = cms.untracked.InputTag("csctfReEmulTrackDigis")
            #process.csctfReEmulDigis.SectorProcessor.initializeFromPSet = True
            
            process.csctfReEmulSequence = cms.Sequence(
                process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )
        else :
            from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_L1Emulator_sim
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

            customise_csc_L1Emulator_sim(process) 

            process.csctfReEmulTrackDigis = process.simCsctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()

            process.csctfReEmulTrackDigis.DTproducer  = cms.untracked.InputTag("dttfDigis")
            process.csctfReEmulDigis.CSCTrackProducer = cms.untracked.InputTag("csctfReEmulTrackDigis")

            process.csctfReEmulTrackDigis.SectorProcessor.PTLUT.PtMethod = cms.untracked.uint32(34) # no triple ganging in ME11a
            process.csctfReEmulTrackDigis.SectorProcessor.gangedME1a = cms.untracked.bool(False)
            process.csctfReEmulTrackDigis.SectorProcessor.firmwareSP = cms.uint32(20140515) #core 20120730
            process.csctfReEmulTrackDigis.SectorProcessor.initializeFromPSet = cms.bool(True) 

            process.csctfReEmulSequence = cms.Sequence(
                process.simCscTriggerPrimitiveDigis
                * process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )

            process.load('L1TriggerConfig.GMTConfigProducers.L1MuGMTParameters_cfi')
            process.L1MuGMTParameters.MergeMethodPtBrl=cms.string("byCombi")
            process.L1MuGMTParameters.MergeMethodPtFwd=cms.string("byCombi")
            process.L1MuGMTParameters.VersionSortRankEtaQLUT = cms.uint32(1043)
            process.L1MuGMTParameters.VersionLUTs = cms.uint32(1)


        from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
        process.gmtReEmulDigis  = gmtDigis.clone()

        process.gmtReEmulDigis.DTCandidates   = cms.InputTag("dttfReEmulDigis","DT")
        process.gmtReEmulDigis.CSCCandidates  = cms.InputTag("csctfReEmulDigis","CSC")
        process.gmtReEmulDigis.RPCbCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCb")
        process.gmtReEmulDigis.RPCfCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCf")
        process.gmtReEmulDigis.MipIsoData     = cms.InputTag("none")
        
        process.l1ExtraReEmul.muonSource = cms.InputTag("gmtReEmulDigis")            

        if patchNtuple :
            ntuple.gmtSource          = cms.InputTag("gmtReEmulDigis")
            ntuple.dttfSource         = cms.InputTag("dttfReEmulDigis")
            ntuple.csctfTrkSource     = cms.InputTag("csctfReEmulTrackDigis")
            ntuple.csctfStatusSource  = cms.InputTag("csctfReEmulTrackDigis")

            l1ExtraNtuple.muonLabel = cms.untracked.InputTag("l1ExtraReEmul")

        process.reEmulMuonChain = cms.Sequence(
            process.rpcTriggerReEmulDigis
            *process.csctfReEmulSequence
            *process.dttfReEmulDigis
            *process.gmtReEmulDigis
            )

    if reEmulCalos :
        print "[L1Menu]:\tSetting up calo re-emulation"        

        ## redo ECAL TP's
        ##
        #from SimCalorimetry.EcalTrigPrimProducers.ecalTriggerPrimitiveDigis_cff import simEcalTriggerPrimitiveDigis
        #process.ecalReEmulDigis = simEcalTriggerPrimitiveDigis.clone()
        #process.ecalReEmulDigis.InstanceEB = cms.string('ebDigis')
        #process.ecalReEmulDigis.InstanceEE = cms.string('eeDigis')
        #process.ecalReEmulDigis.Label = cms.string('ecalDigis')
        
        ###
        
        from L1Trigger.Configuration.SimL1Emulator_cff import simRctDigis
        process.rctReEmulDigis = process.simRctDigis.clone()
        process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
        #process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalReEmulDigis' ) )
        process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalDigis' ) )

        from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis

        process.gctReEmulDigis = gctDigis.clone()        
        process.gctReEmulDigis.inputLabel = cms.InputTag("gctDigis")

        process.l1ExtraReEmul.isolatedEmSource    = cms.InputTag("gctReEmulDigis","isoEm")
        process.l1ExtraReEmul.nonIsolatedEmSource = cms.InputTag("gctReEmulDigis","nonIsoEm")

        process.l1ExtraReEmul.forwardJetSource = cms.InputTag("gctReEmulDigis","forJets")
        process.l1ExtraReEmul.centralJetSource = cms.InputTag("gctReEmulDigis","cenJets")
        process.l1ExtraReEmul.tauJetSource     = cms.InputTag("gctReEmulDigis","tauJets")
        process.l1ExtraReEmul.isoTauJetSource  = cms.InputTag("gctReEmulDigis","isoTauJets")            

        process.l1ExtraReEmul.etTotalSource = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etHadSource   = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etMissSource  = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.htMissSource  = cms.InputTag("gctReEmulDigis")

        process.l1ExtraReEmul.hfRingEtSumsSource    = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.hfRingBitCountsSource = cms.InputTag("gctReEmulDigis")

        if patchNtuple :
            ntuple.gctCentralJetsSource = cms.InputTag("gctReEmulDigis","cenJets")
            ntuple.gctNonIsoEmSource    = cms.InputTag("gctReEmulDigis","nonIsoEm")
            ntuple.gctForwardJetsSource = cms.InputTag("gctReEmulDigis","forJets")
            ntuple.gctIsoEmSource       = cms.InputTag("gctReEmulDigis","isoEm")
            ntuple.gctEnergySumsSource  = cms.InputTag("gctReEmulDigis","")
            ntuple.gctTauJetsSource     = cms.InputTag("gctReEmulDigis","tauJets")
            if useStage1Layer2:
                ntuple.gctIsoTauJetsSource  = cms.InputTag("gctReEmulDigis","isoTauJets")
            else:
                ntuple.gctIsoTauJetsSource  = cms.InputTag("none","isoTauJets")

            l1ExtraNtuple.nonIsoEmLabel = cms.untracked.InputTag("l1ExtraReEmul:NonIsolated")
            l1ExtraNtuple.isoEmLabel    = cms.untracked.InputTag("l1ExtraReEmul:Isolated")
            l1ExtraNtuple.tauJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Tau")
            l1ExtraNtuple.isoTauJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:IsoTau")
            l1ExtraNtuple.cenJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Central")
            l1ExtraNtuple.fwdJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Forward")
            l1ExtraNtuple.metLabel      = cms.untracked.InputTag("l1ExtraReEmul:MET")
            l1ExtraNtuple.mhtLabel      = cms.untracked.InputTag("l1ExtraReEmul:MHT")

            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly
            #    ntuple.rctSource            = cms.InputTag("rctReEmulDigis")

        process.reEmulCaloChain = cms.Sequence(
            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly
        
            #process.hcalReEmulDigis
            #process.ecalReEmulDigis
            process.rctReEmulDigis
            +process.gctReEmulDigis
        )


    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis
    process.gtReEmulDigis   = gtDigis.clone()

    if reEmulMuons :
        process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gmtReEmulDigis")
    if reEmulCalos :
        process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")
        process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")

    if patchNtuple :
        ntuple.gtSource = cms.InputTag("gtReEmulDigis")
        
    if reEmulMuons and reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulMuons :
        process.reEmul = cms.Sequence(process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    else :
        process.reEmul = cms.Sequence(process.gtReEmulDigis + process.l1ExtraReEmul)
def patchGct(process) :

    process.GlobalTag.toGet = cms.VPSet(
        cms.PSet(record = cms.string("L1GtTriggerMenuRcd"),
                 tag = cms.string("L1GtTriggerMenu_L1Menu_Collisions2012_v2_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 ),
        cms.PSet(record = cms.string("L1GctChannelMaskRcd"),
                 tag = cms.string("L1GctChannelMask_AllEnergySumsMaskedFromHF_jetCentresToEta3Allowed_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 ),
        cms.PSet(record = cms.string("L1GctJetFinderParamsRcd"),
                 tag = cms.string("L1GctJetFinderParams_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 ),
        cms.PSet(record = cms.string("L1HfRingEtScaleRcd"),
                 tag = cms.string("L1HfRingEtScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 ),
        cms.PSet(record = cms.string("L1JetEtScaleRcd"),
                 tag = cms.string("L1JetEtScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 ),
        cms.PSet(record = cms.string("L1HtMissScaleRcd"),
                 tag = cms.string("L1HtMissScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
                 connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_L1T")
                 )
        )

    process.load("Configuration.StandardSequences.RawToDigi_Data_cff")

    process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
    process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
    
    from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
    from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis    

    process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
    process.rctReEmulDigis  = rctDigis.clone()
    process.gctReEmulDigis  = gctDigis.clone()
    process.gtReEmulDigis   = gtDigis.clone()

    # Starting from RAW (just suppressed digis)
    
#    process.hcalReEmulDigis.inputLabel = cms.VInputTag(cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))

#    process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
#    process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalReEmulDigis' ) )

# original from simulation ( if saved)
    
    process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'simEcalTriggerPrimitiveDigis' ) )
    process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'simHcalTriggerPrimitiveDigis' ) )

    process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")
    
    process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gtDigis")
    process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")

#     process.patchGct = cms.Sequence(
#         process.ecalDigis
#         + process.hcalDigis
#         + process.hcalReEmulDigis
#         + process.rctReEmulDigis
#         + process.gctReEmulDigis
#         + process.gtReEmulDigis
#         )

    process.patchGct = cms.Sequence(
        process.rctReEmulDigis
        + process.gctReEmulDigis
        + process.gtReEmulDigis
        )
Esempio n. 8
0
   fwdJetLabel = cms.untracked.InputTag("l1extraParticles:Forward"),
   muonLabel = cms.untracked.InputTag("l1extraParticles"),
   metLabel = cms.untracked.InputTag("l1extraParticles:MET"),
   mhtLabel = cms.untracked.InputTag("l1extraParticles:MHT"),
   hfRingsLabel = cms.untracked.InputTag("l1extraParticles"),
   maxL1Extra = cms.uint32(20)
)


process.TFileService = cms.Service("TFileService",
    fileName = cms.string('L1TreeReRun_recoveringElectrons_brokenTaus.root')
)

from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis

process.gtReEmulDigis   = gtDigis.clone()

process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gtDigis") # this is original GMT info from DATA (GMT is read out by GT FED)
process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")
process.gtReEmulDigis.EmulateBxInEvent = cms.int32(1)

process.gtReEmulDigisOldTaus   = gtDigis.clone()

process.gtReEmulDigisOldTaus.GmtInputTag  = cms.InputTag("gtDigis") # this is original GMT info from DATA (GMT is read out by GT FED)
process.gtReEmulDigisOldTaus.GctInputTag  = cms.InputTag("gctReEmulDigisOldTaus")
process.gtReEmulDigisOldTaus.EmulateBxInEvent = cms.int32(1)


process.testMET = cms.EDAnalyzer("TestEtHt",
        originalL1Extra=cms.InputTag("l1extraParticles","MET"),
        uctCands=cms.InputTag("UCT2015Producer","METUnpacked"),
Esempio n. 9
0
def reEmulation(process, reEmulMuons=True, reEmulCalos=True, patchNtuple=True, runOnPostLS1 = True, useStage1Layer2=True, reEmulRCT = True):

    print "[L1Menu]: Setting up overall re-emulation"        

    if patchNtuple and hasattr(process,'l1NtupleProducer') and hasattr(process,'l1ExtraTreeProducer') :
        print "[L1Menu]:\tConfiguring Ntuple to use re-emulated information"        
        ntuple        = getattr(process,'l1NtupleProducer')
        l1ExtraNtuple = getattr(process,'l1ExtraTreeProducer')
    elif patchNtuple :
        print "[L1Menu]:\tERROR: FAILED to find ntuple! switching patchNtuple to False"        
        patchNtuple=False

    process.l1ExtraReEmul = cms.EDProducer(
        "L1ExtraParticlesProd",
        muonSource = cms.InputTag("gtDigis"),
        isolatedEmSource    = cms.InputTag("gctDigis","isoEm"),
        nonIsolatedEmSource = cms.InputTag("gctDigis","nonIsoEm"),
        
        forwardJetSource = cms.InputTag("gctDigis","forJets"),
        centralJetSource = cms.InputTag("gctDigis","cenJets"),
        tauJetSource     = cms.InputTag("gctDigis","tauJets"),
        isoTauJetSource  = cms.InputTag("gctDigis","isoTauJets"),
        
        etTotalSource = cms.InputTag("gctDigis"),
        etHadSource   = cms.InputTag("gctDigis"),
        etMissSource  = cms.InputTag("gctDigis"),
        htMissSource  = cms.InputTag("gctDigis"),
        
        hfRingEtSumsSource    = cms.InputTag("gctDigis"),
        hfRingBitCountsSource = cms.InputTag("gctDigis"),
        
        produceMuonParticles = cms.bool(True),
        produceCaloParticles = cms.bool(True),
        centralBxOnly = cms.bool(True),
        ignoreHtMiss = cms.bool(False)
        )
        
    if reEmulMuons :
        print "[L1Menu]:\tSetting up muon re-emulation"        
        
        from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
        process.dttfReEmulDigis                = dttfDigis.clone()
        process.dttfReEmulDigis.DTDigi_Source  = cms.InputTag("dttfDigis")
        process.dttfReEmulDigis.CSCStub_Source = cms.InputTag("csctfReEmulTrackDigis")

        from L1Trigger.RPCTrigger.rpcTriggerDigis_cfi import rpcTriggerDigis
        process.rpcTriggerReEmulDigis = rpcTriggerDigis.clone()

        if not runOnPostLS1 :
            from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis
        
            process.csctfReEmulTrackDigis = csctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()
        
            process.csctfReEmulTrackDigis.readDtDirect        = True
            process.csctfReEmulTrackDigis.SectorReceiverInput = cms.untracked.InputTag("csctfDigis")
            process.csctfReEmulTrackDigis.DtDirectProd        = cms.untracked.InputTag("csctfDigis","DT")
            process.csctfReEmulDigis.CSCTrackProducer         = cms.untracked.InputTag("csctfReEmulTrackDigis")
            
            process.csctfReEmulSequence = cms.Sequence(
                process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )
        else :
            from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_L1Emulator_sim
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

            customise_csc_L1Emulator_sim(process) 

            process.csctfReEmulTrackDigis = process.simCsctfTrackDigis.clone()
            process.csctfReEmulDigis      = csctfDigis.clone()

            process.csctfReEmulTrackDigis.DTproducer  = cms.untracked.InputTag("dttfDigis")
            process.csctfReEmulDigis.CSCTrackProducer = cms.untracked.InputTag("csctfReEmulTrackDigis")

            process.csctfReEmulTrackDigis.SectorProcessor.PTLUT.PtMethod = cms.untracked.uint32(34) # no triple ganging in ME11a
            process.csctfReEmulTrackDigis.SectorProcessor.gangedME1a = cms.untracked.bool(False)
            process.csctfReEmulTrackDigis.SectorProcessor.firmwareSP = cms.uint32(20140515) #core 20120730
            process.csctfReEmulTrackDigis.SectorProcessor.initializeFromPSet = cms.bool(True) 

            process.csctfReEmulSequence = cms.Sequence(
                process.simCscTriggerPrimitiveDigis
                * process.csctfReEmulTrackDigis
                * process.csctfReEmulDigis
            )

            process.load('L1TriggerConfig.GMTConfigProducers.L1MuGMTParameters_cfi')
            process.L1MuGMTParameters.MergeMethodPtBrl=cms.string("byCombi")
            process.L1MuGMTParameters.MergeMethodPtFwd=cms.string("byCombi")
            process.L1MuGMTParameters.VersionSortRankEtaQLUT = cms.uint32(1043)
            process.L1MuGMTParameters.VersionLUTs = cms.uint32(1)


        from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
        process.gmtReEmulDigis  = gmtDigis.clone()

        process.gmtReEmulDigis.DTCandidates   = cms.InputTag("dttfReEmulDigis","DT")
        process.gmtReEmulDigis.CSCCandidates  = cms.InputTag("csctfReEmulDigis","CSC")
        process.gmtReEmulDigis.RPCbCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCb")
        process.gmtReEmulDigis.RPCfCandidates = cms.InputTag("rpcTriggerReEmulDigis","RPCf")
        process.gmtReEmulDigis.MipIsoData     = cms.InputTag("none")
        
        process.l1ExtraReEmul.muonSource = cms.InputTag("gmtReEmulDigis")            

        if patchNtuple :
            ntuple.gmtSource          = cms.InputTag("gmtReEmulDigis")
            ntuple.dttfSource         = cms.InputTag("dttfReEmulDigis")
            ntuple.csctfTrkSource     = cms.InputTag("csctfReEmulTrackDigis")
            ntuple.csctfStatusSource  = cms.InputTag("csctfReEmulTrackDigis")

            l1ExtraNtuple.muonLabel = cms.untracked.InputTag("l1ExtraReEmul")

        process.reEmulMuonChain = cms.Sequence(
            process.rpcTriggerReEmulDigis
            *process.csctfReEmulSequence
            *process.dttfReEmulDigis
            *process.gmtReEmulDigis
            )

    if reEmulCalos :
        print "[L1Menu]:\tSetting up calo re-emulation"        

        ## redo ECAL TP's
        ##
        #from SimCalorimetry.EcalTrigPrimProducers.ecalTriggerPrimitiveDigis_cff import simEcalTriggerPrimitiveDigis
        #process.ecalReEmulDigis = simEcalTriggerPrimitiveDigis.clone()
        #process.ecalReEmulDigis.InstanceEB = cms.string('ebDigis')
        #process.ecalReEmulDigis.InstanceEE = cms.string('eeDigis')
        #process.ecalReEmulDigis.Label = cms.string('ecalDigis')
        
        if reEmulRCT :
            from L1Trigger.Configuration.SimL1Emulator_cff import simRctDigis
            process.rctReEmulDigis = process.simRctDigis.clone()
            process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
            ##process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalReEmulDigis' ) )
            process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalDigis' ) )

        from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis

        process.gctReEmulDigis = gctDigis.clone()        
        process.gctReEmulDigis.inputLabel = cms.InputTag("gctDigis")

        process.l1ExtraReEmul.isolatedEmSource    = cms.InputTag("gctReEmulDigis","isoEm")
        process.l1ExtraReEmul.nonIsolatedEmSource = cms.InputTag("gctReEmulDigis","nonIsoEm")

        process.l1ExtraReEmul.forwardJetSource = cms.InputTag("gctReEmulDigis","forJets")
        process.l1ExtraReEmul.centralJetSource = cms.InputTag("gctReEmulDigis","cenJets")
        process.l1ExtraReEmul.tauJetSource     = cms.InputTag("gctReEmulDigis","tauJets")
        process.l1ExtraReEmul.isoTauJetSource  = cms.InputTag("gctReEmulDigis","isoTauJets")            

        process.l1ExtraReEmul.etTotalSource = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etHadSource   = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etMissSource  = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.htMissSource  = cms.InputTag("gctReEmulDigis")

        process.l1ExtraReEmul.hfRingEtSumsSource    = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.hfRingBitCountsSource = cms.InputTag("gctReEmulDigis")

        if patchNtuple :
            ntuple.gctCentralJetsSource = cms.InputTag("gctReEmulDigis","cenJets")
            ntuple.gctNonIsoEmSource    = cms.InputTag("gctReEmulDigis","nonIsoEm")
            ntuple.gctForwardJetsSource = cms.InputTag("gctReEmulDigis","forJets")
            ntuple.gctIsoEmSource       = cms.InputTag("gctReEmulDigis","isoEm")
            ntuple.gctEnergySumsSource  = cms.InputTag("gctReEmulDigis","")
            ntuple.gctTauJetsSource     = cms.InputTag("gctReEmulDigis","tauJets")
            if useStage1Layer2:
                ntuple.gctIsoTauJetsSource  = cms.InputTag("gctReEmulDigis","isoTauJets")
            else:
                ntuple.gctIsoTauJetsSource  = cms.InputTag("none","isoTauJets")

            l1ExtraNtuple.nonIsoEmLabel = cms.untracked.InputTag("l1ExtraReEmul:NonIsolated")
            l1ExtraNtuple.isoEmLabel    = cms.untracked.InputTag("l1ExtraReEmul:Isolated")
            l1ExtraNtuple.tauJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Tau")
            l1ExtraNtuple.isoTauJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:IsoTau")
            l1ExtraNtuple.cenJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Central")
            l1ExtraNtuple.fwdJetLabel   = cms.untracked.InputTag("l1ExtraReEmul:Forward")
            l1ExtraNtuple.metLabel      = cms.untracked.InputTag("l1ExtraReEmul:MET")
            l1ExtraNtuple.mhtLabel      = cms.untracked.InputTag("l1ExtraReEmul:MHT")


        if reEmulRCT :
            process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")
            process.reEmulCaloChain = cms.Sequence(
                #process.hcalReEmulDigis
                #process.ecalReEmulDigis
                process.rctReEmulDigis
                *process.gctReEmulDigis
                )
        else :
            process.reEmulCaloChain = cms.Sequence(
            process.gctReEmulDigis
        )

    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis
    process.gtReEmulDigis   = gtDigis.clone()

    if reEmulMuons :
        process.gtReEmulDigis.GmtInputTag  = cms.InputTag("gmtReEmulDigis")

    if reEmulCalos :
        process.gtReEmulDigis.GctInputTag  = cms.InputTag("gctReEmulDigis")

    if patchNtuple :
        ntuple.gtSource = cms.InputTag("gtReEmulDigis")
        
    if reEmulMuons and reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulMuons :
        process.reEmul = cms.Sequence(process.reEmulMuonChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    elif reEmulCalos :
        process.reEmul = cms.Sequence(process.reEmulCaloChain + process.gtReEmulDigis + process.l1ExtraReEmul)
    else :
        process.reEmul = cms.Sequence(process.gtReEmulDigis + process.l1ExtraReEmul)
Esempio n. 10
0
def reEmulation(process,
                reEmulMuons=True,
                reEmulCalos=True,
                patchNtuple=True,
                runOnPostLS1=False):

    print "[L1Menu]: Setting up overall re-emulation"

    if patchNtuple and hasattr(process, 'l1NtupleProducer') and hasattr(
            process, 'l1ExtraTreeProducer'):
        print "[L1Menu]:\tConfiguring Ntuple to use re-emulated information"
        ntuple = getattr(process, 'l1NtupleProducer')
        l1ExtraNtuple = getattr(process, 'l1ExtraTreeProducer')
    elif patchNtuple:
        print "[L1Menu]:\tERROR: FAILED to find ntuple! switching patchNtuple to False"
        patchNtuple = False

    process.l1ExtraReEmul = cms.EDProducer(
        "L1ExtraParticlesProd",
        muonSource=cms.InputTag("gtDigis"),
        isolatedEmSource=cms.InputTag("gctDigis", "isoEm"),
        nonIsolatedEmSource=cms.InputTag("gctDigis", "nonIsoEm"),
        forwardJetSource=cms.InputTag("gctDigis", "forJets"),
        centralJetSource=cms.InputTag("gctDigis", "cenJets"),
        tauJetSource=cms.InputTag("gctDigis", "tauJets"),
        etTotalSource=cms.InputTag("gctDigis"),
        etHadSource=cms.InputTag("gctDigis"),
        etMissSource=cms.InputTag("gctDigis"),
        htMissSource=cms.InputTag("gctDigis"),
        hfRingEtSumsSource=cms.InputTag("gctDigis"),
        hfRingBitCountsSource=cms.InputTag("gctDigis"),
        produceMuonParticles=cms.bool(True),
        produceCaloParticles=cms.bool(True),
        centralBxOnly=cms.bool(True),
        ignoreHtMiss=cms.bool(False))

    if reEmulMuons:
        print "[L1Menu]:\tSetting up muon re-emulation"

        from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
        process.dttfReEmulDigis = dttfDigis.clone()
        process.dttfReEmulDigis.DTDigi_Source = cms.InputTag("dttfDigis")
        process.dttfReEmulDigis.CSCStub_Source = cms.InputTag(
            "csctfReEmulTrackDigis")

        from L1Trigger.RPCTrigger.rpcTriggerDigis_cfi import rpcTriggerDigis
        process.rpcTriggerReEmulDigis = rpcTriggerDigis.clone()

        if not runOnPostLS1:
            from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

            process.csctfReEmulTrackDigis = csctfTrackDigis.clone()
            process.csctfReEmulDigis = csctfDigis.clone()

            process.csctfReEmulTrackDigis.readDtDirect = True
            process.csctfReEmulTrackDigis.SectorReceiverInput = cms.untracked.InputTag(
                "csctfDigis")
            process.csctfReEmulTrackDigis.DtDirectProd = cms.untracked.InputTag(
                "csctfDigis", "DT")
            process.csctfReEmulDigis.CSCTrackProducer = cms.untracked.InputTag(
                "csctfReEmulTrackDigis")
            #process.csctfReEmulDigis.SectorProcessor.initializeFromPSet = True

            process.csctfReEmulSequence = cms.Sequence(
                process.csctfReEmulTrackDigis * process.csctfReEmulDigis)
        else:
            from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_L1Emulator
            from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis

            customise_csc_L1Emulator(process)

            process.csctfReEmulTrackDigis = process.simCsctfTrackDigis.clone()
            process.csctfReEmulDigis = csctfDigis.clone()

            process.csctfReEmulTrackDigis.DTproducer = cms.untracked.InputTag(
                "dttfDigis")
            process.csctfReEmulDigis.CSCTrackProducer = cms.untracked.InputTag(
                "csctfReEmulTrackDigis")

            process.csctfReEmulSequence = cms.Sequence(
                process.simCscTriggerPrimitiveDigis *
                process.csctfReEmulTrackDigis * process.csctfReEmulDigis)

        from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
        process.gmtReEmulDigis = gmtDigis.clone()

        process.gmtReEmulDigis.DTCandidates = cms.InputTag(
            "dttfReEmulDigis", "DT")
        process.gmtReEmulDigis.CSCCandidates = cms.InputTag(
            "csctfReEmulDigis", "CSC")
        process.gmtReEmulDigis.RPCbCandidates = cms.InputTag(
            "rpcTriggerReEmulDigis", "RPCb")
        process.gmtReEmulDigis.RPCfCandidates = cms.InputTag(
            "rpcTriggerReEmulDigis", "RPCf")
        process.gmtReEmulDigis.MipIsoData = cms.InputTag("none")

        process.l1ExtraReEmul.muonSource = cms.InputTag("gmtReEmulDigis")

        if patchNtuple:
            ntuple.gmtSource = cms.InputTag("gmtReEmulDigis")
            ntuple.dttfSource = cms.InputTag("dttfReEmulDigis")
            ntuple.csctfTrkSource = cms.InputTag("csctfReEmulTrackDigis")
            ntuple.csctfStatusSource = cms.InputTag("csctfReEmulTrackDigis")

            l1ExtraNtuple.muonLabel = cms.untracked.InputTag("l1ExtraReEmul")

        process.reEmulMuonChain = cms.Sequence(
            process.rpcTriggerReEmulDigis * process.csctfReEmulSequence *
            process.dttfReEmulDigis * process.gmtReEmulDigis)

    if reEmulCalos:
        print "[L1Menu]:\tSetting up calo re-emulation"

        print "[L1Menu]:\tWARNING! Just patching GCT sequence, RCT can't be re-emulated after UCT2015 SW patches"

        # Need to have RCT emulator configurable and not UCT 2015 patches
        # in order to run 2012 RCT emulator correctly

        #	# In MC HCAL need to be re-run as there is no TPG information stored
        #	process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
        #	process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")
        #
        #	from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
        #	from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
        #
        #	process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
        #	process.rctReEmulDigis  = rctDigis.clone()
        #	process.gctReEmulDigis  = gctDigis.clone()
        #
        #	process.hcalReEmulDigis.inputLabel = cms.VInputTag(cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))
        #	#process.HcalTPGCoderULUT.LUTGenerationMode = cms.bool(False)
        #
        #	process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
        #	process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalReEmulDigis' ) )
        #
        #	process.gctReEmulDigis.inputLabel  = cms.InputTag("rctReEmulDigis")

        from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis

        process.gctReEmulDigis = gctDigis.clone()
        process.gctReEmulDigis.inputLabel = cms.InputTag("gctDigis")

        process.l1ExtraReEmul.isolatedEmSource = cms.InputTag(
            "gctReEmulDigis", "isoEm")
        process.l1ExtraReEmul.nonIsolatedEmSource = cms.InputTag(
            "gctReEmulDigis", "nonIsoEm")

        process.l1ExtraReEmul.forwardJetSource = cms.InputTag(
            "gctReEmulDigis", "forJets")
        process.l1ExtraReEmul.centralJetSource = cms.InputTag(
            "gctReEmulDigis", "cenJets")
        process.l1ExtraReEmul.tauJetSource = cms.InputTag(
            "gctReEmulDigis", "tauJets")

        process.l1ExtraReEmul.etTotalSource = cms.InputTag("gctDigis")
        process.l1ExtraReEmul.etHadSource = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.etMissSource = cms.InputTag("gctReEmulDigis")
        process.l1ExtraReEmul.htMissSource = cms.InputTag("gctReEmulDigis")

        process.l1ExtraReEmul.hfRingEtSumsSource = cms.InputTag(
            "gctReEmulDigis")
        process.l1ExtraReEmul.hfRingBitCountsSource = cms.InputTag(
            "gctReEmulDigis")

        if patchNtuple:
            ntuple.gctCentralJetsSource = cms.InputTag("gctReEmulDigis",
                                                       "cenJets")
            ntuple.gctNonIsoEmSource = cms.InputTag("gctReEmulDigis",
                                                    "nonIsoEm")
            ntuple.gctForwardJetsSource = cms.InputTag("gctReEmulDigis",
                                                       "forJets")
            ntuple.gctIsoEmSource = cms.InputTag("gctReEmulDigis", "isoEm")
            ntuple.gctEnergySumsSource = cms.InputTag("gctReEmulDigis", "")
            ntuple.gctTauJetsSource = cms.InputTag("gctReEmulDigis", "tauJets")

            l1ExtraNtuple.nonIsoEmLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:NonIsolated")
            l1ExtraNtuple.isoEmLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:Isolated")
            l1ExtraNtuple.tauJetLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:Tau")
            l1ExtraNtuple.cenJetLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:Central")
            l1ExtraNtuple.fwdJetLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:Forward")
            l1ExtraNtuple.metLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:MET")
            l1ExtraNtuple.mhtLabel = cms.untracked.InputTag(
                "l1ExtraReEmul:MHT")

            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly
            #    ntuple.rctSource            = cms.InputTag("rctReEmulDigis")

        process.reEmulCaloChain = cms.Sequence(
            # Need to have RCT emulator configurable and not UCT 2015 patches
            # in order to run 2012 RCT emulator correctly

            #process.hcalReEmulDigis
            #+ process.rctReEmulDigis
            process.gctReEmulDigis)

    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis
    process.gtReEmulDigis = gtDigis.clone()

    if reEmulMuons:
        process.gtReEmulDigis.GmtInputTag = cms.InputTag("gmtReEmulDigis")
    if reEmulCalos:
        process.gtReEmulDigis.GctInputTag = cms.InputTag("gctReEmulDigis")

    if patchNtuple:
        ntuple.gtSource = cms.InputTag("gtReEmulDigis")

    if reEmulMuons and reEmulCalos:
        process.reEmul = cms.Sequence(process.reEmulCaloChain +
                                      process.reEmulMuonChain +
                                      process.gtReEmulDigis +
                                      process.l1ExtraReEmul)
    elif reEmulMuons:
        process.reEmul = cms.Sequence(process.reEmulMuonChain +
                                      process.gtReEmulDigis +
                                      process.l1ExtraReEmul)
    elif reEmulCalos:
        process.reEmul = cms.Sequence(process.reEmulCaloChain +
                                      process.gtReEmulDigis +
                                      process.l1ExtraReEmul)
    else:
        process.reEmul = cms.Sequence(process.gtReEmulDigis +
                                      process.l1ExtraReEmul)
Esempio n. 11
0
def patchGct(process):

    process.GlobalTag.toGet = cms.VPSet(
        cms.PSet(record=cms.string("L1GtTriggerMenuRcd"),
                 tag=cms.string("L1GtTriggerMenu_L1Menu_Collisions2012_v2_mc"),
                 connect=cms.untracked.string(
                     "frontier://FrontierProd/CMS_COND_31X_L1T")),
        cms.PSet(
            record=cms.string("L1GctChannelMaskRcd"),
            tag=cms.string(
                "L1GctChannelMask_AllEnergySumsMaskedFromHF_jetCentresToEta3Allowed_mc"
            ),
            connect=cms.untracked.string(
                "frontier://FrontierProd/CMS_COND_31X_L1T")),
        cms.PSet(
            record=cms.string("L1GctJetFinderParamsRcd"),
            tag=cms.string(
                "L1GctJetFinderParams_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"
            ),
            connect=cms.untracked.string(
                "frontier://FrontierProd/CMS_COND_31X_L1T")),
        cms.PSet(
            record=cms.string("L1HfRingEtScaleRcd"),
            tag=cms.string(
                "L1HfRingEtScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
            connect=cms.untracked.string(
                "frontier://FrontierProd/CMS_COND_31X_L1T")),
        cms.PSet(
            record=cms.string("L1JetEtScaleRcd"),
            tag=cms.string(
                "L1JetEtScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
            connect=cms.untracked.string(
                "frontier://FrontierProd/CMS_COND_31X_L1T")),
        cms.PSet(
            record=cms.string("L1HtMissScaleRcd"),
            tag=cms.string(
                "L1HtMissScale_GCTPhysics_2012_04_27_JetSeedThresh5GeV_mc"),
            connect=cms.untracked.string(
                "frontier://FrontierProd/CMS_COND_31X_L1T")))

    process.load("Configuration.StandardSequences.RawToDigi_Data_cff")

    process.load("SimCalorimetry.HcalSimProducers.hcalUnsuppressedDigis_cfi")
    process.load("SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff")

    from L1Trigger.RegionalCaloTrigger.rctDigis_cfi import rctDigis
    from L1Trigger.GlobalCaloTrigger.gctDigis_cfi import gctDigis
    from L1Trigger.GlobalTrigger.gtDigis_cfi import gtDigis

    process.hcalReEmulDigis = process.simHcalTriggerPrimitiveDigis.clone()
    process.rctReEmulDigis = rctDigis.clone()
    process.gctReEmulDigis = gctDigis.clone()
    process.gtReEmulDigis = gtDigis.clone()

    # Starting from RAW (just suppressed digis)

    #    process.hcalReEmulDigis.inputLabel = cms.VInputTag(cms.InputTag('hcalDigis'), cms.InputTag('hcalDigis'))

    #    process.rctReEmulDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
    #    process.rctReEmulDigis.hcalDigis = cms.VInputTag( cms.InputTag( 'hcalReEmulDigis' ) )

    # original from simulation ( if saved)

    process.rctReEmulDigis.ecalDigis = cms.VInputTag(
        cms.InputTag('simEcalTriggerPrimitiveDigis'))
    process.rctReEmulDigis.hcalDigis = cms.VInputTag(
        cms.InputTag('simHcalTriggerPrimitiveDigis'))

    process.gctReEmulDigis.inputLabel = cms.InputTag("rctReEmulDigis")

    process.gtReEmulDigis.GmtInputTag = cms.InputTag("gtDigis")
    process.gtReEmulDigis.GctInputTag = cms.InputTag("gctReEmulDigis")

    #     process.patchGct = cms.Sequence(
    #         process.ecalDigis
    #         + process.hcalDigis
    #         + process.hcalReEmulDigis
    #         + process.rctReEmulDigis
    #         + process.gctReEmulDigis
    #         + process.gtReEmulDigis
    #         )

    process.patchGct = cms.Sequence(process.rctReEmulDigis +
                                    process.gctReEmulDigis +
                                    process.gtReEmulDigis)