Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-04 02:53:04

0001 from __future__ import print_function
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
0005 from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017
0006 from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM
0007 
0008 def L1TCaloStage2ParamsForHW(process):
0009     process.load("L1Trigger.L1TCalorimeter.caloStage2Params_HWConfig_cfi")
0010     return process
0011 
0012 def L1TAddBitwiseLayer1(process):
0013     from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis as simCaloStage2BitwiseLayer1Digis
0014     from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis as simCaloStage2BitwiseDigis        
0015     process.simCaloStage2BitwiseLayer1Digis = simCaloStage2BitwiseLayer1Digis.clone()
0016     process.simCaloStage2BitwiseLayer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
0017     process.simCaloStage2BitwiseDigis = simCaloStage2BitwiseDigis.clone()
0018     process.simCaloStage2BitwiseDigis.towerToken = cms.InputTag("simCaloStage2BitwiseLayer1Digis")
0019     process.SimL1TCalorimeter = cms.Sequence( process.simCaloStage2Layer1Digis + process.simCaloStage2Digis + process.simCaloStage2BitwiseLayer1Digis + process.simCaloStage2BitwiseDigis)    
0020     from L1Trigger.L1TNtuples.l1UpgradeTree_cfi import l1UpgradeTree
0021     process.l1UpgradeBitwiseTree = l1UpgradeTree.clone()
0022     process.l1UpgradeBitwiseTree.egToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
0023     process.l1UpgradeBitwiseTree.tauTokens = cms.untracked.VInputTag("simCaloStage2BitwiseDigis")
0024     process.l1UpgradeBitwiseTree.jetToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
0025     process.l1UpgradeBitwiseTree.muonToken = cms.untracked.InputTag("simGmtStage2Digis")
0026     process.l1UpgradeBitwiseTree.sumToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
0027     process.l1ntuplebitwise = cms.Path(
0028         process.l1UpgradeBitwiseTree
0029     )
0030     process.schedule.append(process.l1ntuplebitwise)
0031     print("# modified L1TReEmul:  ")
0032     print("# {0}".format(process.L1TReEmul))
0033     return process
0034 
0035 # As of 80X, this ES configuration is needed for *data* GTs (mc tags work w/o)
0036 def L1TEventSetupForHF1x1TPs(process):
0037     process.es_pool_hf1x1 = cms.ESSource(
0038         "PoolDBESSource",
0039         #process.CondDBSetup,
0040         timetype = cms.string('runnumber'),
0041         toGet = cms.VPSet(
0042             cms.PSet(record = cms.string("HcalLutMetadataRcd"),
0043                      tag = cms.string("HcalLutMetadata_HFTP_1x1")
0044                      ),
0045             cms.PSet(record = cms.string("HcalElectronicsMapRcd"),
0046                      tag = cms.string("HcalElectronicsMap_HFTP_1x1")
0047                      )
0048             ),
0049         connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
0050         authenticationMethod = cms.untracked.uint32(0)
0051         )
0052     process.es_prefer_es_pool_hf1x1 = cms.ESPrefer("PoolDBESSource", "es_pool_hf1x1")    
0053     return process
0054 
0055 def L1TReEmulFromRAW2015(process):
0056     process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0057     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
0058     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
0059     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
0060         cms.InputTag('hcalDigis'),
0061         cms.InputTag('hcalDigis')
0062     )
0063     process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
0064     process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
0065     process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
0066     process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )  
0067 
0068     stage2L1Trigger.toModify(process.simTwinMuxDigis,
0069         RPC_Source         = 'muonRPCDigis',
0070         # When available, this will switch to TwinMux input Digis:
0071         DTDigi_Source      = "dttfDigis",
0072         DTThetaDigi_Source = "dttfDigis"
0073     )
0074     stage2L1Trigger.toModify(process.simOmtfDigis,
0075         srcRPC = 'muonRPCDigis',
0076         srcCSC = "csctfDigis"
0077     )
0078     stage2L1Trigger.toModify(process.simBmtfDigis,
0079        DTDigi_Source         = "simTwinMuxDigis",
0080        DTDigi_Theta_Source   = "dttfDigis"
0081     )
0082     stage2L1Trigger.toModify(process.simKBmtfStubs,
0083         srcPhi     = "simTwinMuxDigis",
0084         srcTheta   = "dttfDigis"
0085     )
0086     stage2L1Trigger.toModify(process.simEmtfDigis,
0087         CSCInput = "csctfDigis",
0088         RPCInput = 'muonRPCDigis'
0089     )
0090     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "ecalDigis:EcalTriggerPrimitives")
0091     # quiet warning abouts missing Stage-2 payloads, since they won't reliably exist in 2015 data.
0092     stage2L1Trigger.toModify(process.caloStage2Digis, MinFeds = 0)
0093     stage2L1Trigger.toModify(process.gmtStage2Digis, MinFeds = 0)
0094     stage2L1Trigger.toModify(process.gtStage2Digis, MinFeds = 0)
0095 
0096     (~stage2L1Trigger).toModify(process.simRctDigis,
0097         ecalDigis = ['simEcalTriggerPrimitiveDigis'],
0098         hcalDigis = ['simHcalTriggerPrimitiveDigis']
0099     )
0100     (~stage2L1Trigger).toModify(process.simRpcTriggerDigis, label = 'muonRPCDigis')
0101     (~stage2L1Trigger).toModify(process.simRpcTechTrigDigis, RPCDigiLabel  = 'muonRPCDigis')
0102 
0103     process.L1TReEmulPath = cms.Path(process.L1TReEmul)
0104     process.schedule.append(process.L1TReEmulPath)
0105 
0106     print("# L1TReEmul sequence:  ")
0107     print("# {0}".format(process.L1TReEmul))
0108     print("# {0}".format(process.schedule))
0109     return process
0110 
0111 def L1TReEmulMCFromRAW2015(process):
0112     L1TReEmulFromRAW2015(process)
0113     stage2L1Trigger.toModify(process.simEmtfDigis, CSCInput = 'simCscTriggerPrimitiveDigis:MPCSORTED')
0114     stage2L1Trigger.toModify(process.simOmtfDigis, srcCSC   = 'simCscTriggerPrimitiveDigis:MPCSORTED')
0115     return process
0116 
0117 def L1TReEmulFromRAW2015simCaloTP(process):
0118     L1TReEmulFromRAW2015(process)
0119     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
0120     return process
0121 
0122 def L1TReEmulFromRAW2016(process):
0123     process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0124     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
0125     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
0126     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
0127         cms.InputTag('hcalDigis'),
0128         cms.InputTag('hcalDigis')
0129     )
0130     process.simHcalTriggerPrimitiveDigis.inputUpgradeLabel = cms.VInputTag(
0131                 cms.InputTag('hcalDigis'),
0132                 cms.InputTag('hcalDigis')
0133     )
0134     process.simDtTriggerPrimitiveDigis.digiTag = cms.InputTag("muonDTDigis")
0135     process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
0136     process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )  
0137     process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
0138 
0139 
0140     #cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis']
0141     #for b in cutlist:
0142     #    process.SimL1Emulator.remove(getattr(process,b))
0143     # TwinMux
0144     stage2L1Trigger.toModify(process.simTwinMuxDigis,
0145         RPC_Source         = 'rpcTwinMuxRawToDigi',
0146         DTDigi_Source      = 'twinMuxStage2Digis:PhIn',
0147         DTThetaDigi_Source = 'twinMuxStage2Digis:ThIn'
0148     )
0149     # BMTF
0150     stage2L1Trigger.toModify(process.simBmtfDigis,
0151        DTDigi_Source         = "simTwinMuxDigis",
0152        DTDigi_Theta_Source   = "bmtfDigis"
0153     )
0154     # KBMTF
0155     stage2L1Trigger.toModify(process.simKBmtfStubs,
0156        srcPhi       = 'simTwinMuxDigis',
0157        srcTheta     = 'bmtfDigis'
0158     )
0159     # OMTF
0160     stage2L1Trigger.toModify(process.simOmtfDigis,
0161         srcRPC  = 'muonRPCDigis',
0162         srcCSC  = 'csctfDigis',
0163         srcDTPh = 'bmtfDigis',
0164         srcDTTh = 'bmtfDigis'
0165     )
0166     # EMTF
0167     stage2L1Trigger.toModify(process.simEmtfDigis,
0168         CSCInput = 'emtfStage2Digis',
0169         RPCInput = 'muonRPCDigis'
0170     )
0171     # Calo Layer1
0172     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
0173         ecalToken = 'ecalDigis:EcalTriggerPrimitives',
0174         hcalToken = 'hcalDigis:'
0175     )
0176 
0177     (~stage2L1Trigger).toModify(process.simRctDigis,
0178         ecalDigis = ['ecalDigis:EcalTriggerPrimitives'],
0179         hcalDigis = ['hcalDigis:']
0180     )
0181     (~stage2L1Trigger).toModify(process.simRpcTriggerDigis, label = 'muonRPCDigis')
0182 
0183     process.L1TReEmulPath = cms.Path(process.L1TReEmul)    
0184     process.schedule.append(process.L1TReEmulPath)
0185     return process 
0186 
0187 def L1TReEmulFromRAW(process):
0188     L1TReEmulFromRAW2016(process)
0189     
0190 
0191     stage2L1Trigger_2017.toModify(process.simOmtfDigis,
0192         srcRPC   = 'omtfStage2Digis',
0193         srcCSC   = 'omtfStage2Digis',
0194         srcDTPh  = 'omtfStage2Digis',
0195         srcDTTh  = 'omtfStage2Digis'
0196     )
0197 
0198     stage2L1Trigger.toModify(process.simEmtfDigis,
0199       CSCInput  = cms.InputTag('emtfStage2Digis'),
0200       RPCInput  = cms.InputTag('muonRPCDigis'),
0201       CPPFInput = cms.InputTag('emtfStage2Digis'),
0202       GEMEnable = cms.bool(False),
0203       GEMInput  = cms.InputTag('muonGEMPadDigis'),
0204       CPPFEnable = cms.bool(True), # Use CPPF-emulated clustered RPC hits from CPPF as the RPC hits
0205     )
0206 
0207     run3_GEM.toModify(process.simMuonGEMPadDigis,
0208         InputCollection         = 'muonGEMDigis',
0209     )
0210 
0211     run3_GEM.toModify(process.simTwinMuxDigis,
0212         RPC_Source         = 'rpcTwinMuxRawToDigi',
0213         DTDigi_Source      = 'simDtTriggerPrimitiveDigis',
0214         DTThetaDigi_Source = 'simDtTriggerPrimitiveDigis'
0215     )
0216 
0217     run3_GEM.toModify(process.simKBmtfStubs,
0218         srcPhi   = 'bmtfDigis',
0219         srcTheta = 'bmtfDigis'
0220     )
0221 
0222     run3_GEM.toModify(process.simBmtfDigis,
0223         DTDigi_Source       = 'bmtfDigis',
0224         DTDigi_Theta_Source = 'bmtfDigis'
0225     )
0226 
0227     print("# L1TReEmul sequence:  ")
0228     print("# {0}".format(process.L1TReEmul))
0229     print("# {0}".format(process.schedule))
0230     return process
0231 
0232 def L1TReEmulFromRAWCalouGT(process):
0233     L1TReEmulFromRAW(process)
0234     process.simGtStage2Digis.MuonInputTag   = cms.InputTag("gtStage2Digis","Muon")
0235     return process 
0236 
0237 def L1TReEmulFromNANO(process):
0238 
0239     process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0240     process.L1TReEmul = cms.Sequence(process.SimL1TGlobal)
0241     stage2L1Trigger_2017.toModify(process.simGtStage2Digis,
0242         ExtInputTag = "hltGtStage2Digis",
0243         MuonInputTag = "hltGtStage2Digis:Muon",
0244         EtSumInputTag = "hltGtStage2Digis:EtSum",
0245         EGammaInputTag = "hltGtStage2Digis:EGamma",
0246         TauInputTag = "hltGtStage2Digis:Tau",
0247         JetInputTag = "hltGtStage2Digis:Jet"
0248     )
0249         
0250     process.L1TReEmulPath = cms.Path(process.L1TReEmul)    
0251     process.schedule.append(process.L1TReEmulPath)
0252 
0253     print ("# L1TReEmul sequence:  ")
0254     print ("# {0}".format(process.L1TReEmul))
0255     print ("# {0}".format(process.schedule))
0256     return process 
0257 
0258 def L1TReEmulFromRAWCalo(process):
0259     process.load('L1Trigger.Configuration.SimL1CaloEmulator_cff')
0260     process.L1TReEmul = cms.Sequence(process.SimL1CaloEmulator)
0261     process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
0262     process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
0263     process.L1TReEmulPath = cms.Path(process.L1TReEmul)
0264     process.schedule.append(process.L1TReEmulPath)
0265 
0266     print ("# L1TReEmul sequence:  ")
0267     print ("# {0}".format(process.L1TReEmul))
0268     print ("# {0}".format(process.schedule))
0269     return process
0270 
0271 def L1TReEmulFromRAWCaloSimTP(process):
0272     process.load('L1Trigger.Configuration.SimL1CaloEmulator_cff')
0273     process.L1TReEmul = cms.Sequence(process.SimL1CaloEmulator)
0274     process.L1TReEmulPath = cms.Path(process.L1TReEmul)
0275     process.schedule.append(process.L1TReEmulPath)
0276 
0277     print ("# L1TReEmul sequence:  ")
0278     print ("# {0}".format(process.L1TReEmul))
0279     print ("# {0}".format(process.schedule))
0280     return process
0281 
0282 def L1TReEmulMCFromRAW(process):
0283     L1TReEmulFromRAW(process)
0284     stage2L1Trigger.toModify(process.simEmtfDigis, CSCInput = 'simCscTriggerPrimitiveDigis:MPCSORTED')
0285     stage2L1Trigger.toModify(process.simOmtfDigis, srcCSC   = 'simCscTriggerPrimitiveDigis:MPCSORTED')
0286 
0287     # Correct input collections for MC re-emulation
0288     run3_GEM.toModify(process.simBmtfDigis,
0289         DTDigi_Source         = 'simTwinMuxDigis',
0290         DTDigi_Theta_Source   = 'simDtTriggerPrimitiveDigis'
0291     )
0292 
0293     run3_GEM.toModify(process.simKBmtfStubs,
0294         srcPhi     = "simTwinMuxDigis",
0295         srcTheta   = "simDtTriggerPrimitiveDigis"
0296     )
0297 
0298     run3_GEM.toModify(process.simOmtfDigis,
0299         srcRPC   = 'muonRPCDigis',
0300         srcDTPh  = 'simDtTriggerPrimitiveDigis',
0301         srcDTTh  = 'simDtTriggerPrimitiveDigis'
0302     )
0303 
0304     run3_GEM.toModify(process.simEmtfDigis,
0305       RPCInput  = 'muonRPCDigis',
0306       GEMEnable = False,  # Will be enabled when GEM is in use.
0307       GEMInput  = 'simMuonGEMPadDigiClusters',
0308       CPPFEnable = False,  # Use CPPF-emulated clustered RPC hits from CPPF as the RPC hits. Set to "False" for MC
0309       UseRun3CCLUT_OTMB = False,  # TODO: Enable UseRun3CCLUT_OTMB once it's ready.
0310     )
0311 
0312     return process
0313 
0314 def L1TReEmulMCFromRAWSimEcalTP(process):
0315     L1TReEmulMCFromRAW(process)
0316     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
0317     return process
0318 
0319 def L1TReEmulMCFromRAWSimHcalTP(process):
0320     L1TReEmulMCFromRAW(process)
0321     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
0322     return process
0323 
0324 def L1TReEmulMCFrom90xRAWSimHcalTP(process):
0325     L1TReEmulMCFromRAW(process)
0326     stage2L1Trigger.toModify(process.simHcalTriggerPrimitiveDigis,
0327         inputLabel = [
0328             'simHcalUnsuppressedDigis',
0329             'simHcalUnsuppressedDigis'
0330         ],
0331         inputUpgradeLabel = [
0332             'simHcalUnsuppressedDigis:HBHEQIE11DigiCollection',
0333             'simHcalUnsuppressedDigis:HFQIE10DigiCollection'
0334         ]
0335     )
0336     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
0337     return process
0338     #inputUpgradeLabel = cms.VInputTag(
0339     #    cms.InputTag('simHcalUnsuppressedDigis:HBHEQIE11DigiCollection'),
0340     #    cms.InputTag('simHcalUnsuppressedDigis:HFQIE10DigiCollection')),
0341 
0342 def L1TReEmulMCFromRAWSimCalTP(process):
0343     L1TReEmulMCFromRAW(process)
0344     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
0345         ecalToken = "simEcalTriggerPrimitiveDigis",
0346         hcalToken = 'simHcalTriggerPrimitiveDigis'
0347     ) 
0348     return process
0349 
0350 def L1TReEmulFromRAWsimEcalTP(process):
0351     L1TReEmulFromRAW(process)
0352     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
0353     return process
0354 
0355 def L1TReEmulFromRAWsimHcalTP(process):
0356     L1TReEmulFromRAW(process)
0357     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
0358     return process
0359 
0360 def L1TReEmulFromRAWsimTP(process):
0361     L1TReEmulFromRAW(process)
0362     # TwinMux
0363     stage2L1Trigger.toModify(process.simTwinMuxDigis,
0364         RPC_Source         = 'muonRPCDigis',
0365         DTDigi_Source      = 'simDtTriggerPrimitiveDigis',
0366         DTThetaDigi_Source = 'simDtTriggerPrimitiveDigis'
0367     )
0368     # BMTF
0369     stage2L1Trigger.toModify(process.simBmtfDigis,
0370         DTDigi_Source         = 'simTwinMuxDigis',
0371         DTDigi_Theta_Source   = 'simDtTriggerPrimitiveDigis'
0372     )
0373     # KBMTF
0374     stage2L1Trigger.toModify(process.simKBmtfStubs,
0375         srcPhi     = "simTwinMuxDigis",
0376         srcTheta   = "simDtTriggerPrimitiveDigis"
0377     )
0378     # OMTF
0379     stage2L1Trigger.toModify(process.simOmtfDigis,
0380         srcRPC  = 'muonRPCDigis',
0381         srcCSC  = 'simCscTriggerPrimitiveDigis',
0382         srcDTPh = 'simDtTriggerPrimitiveDigis',
0383         srcDTTh = 'simDtTriggerPrimitiveDigis'
0384     )
0385     # EMTF
0386     stage2L1Trigger.toModify(process.simEmtfDigis,
0387         CSCInput = 'simCscTriggerPrimitiveDigis',
0388         RPCInput = 'muonRPCDigis'
0389     )
0390     # Layer1
0391     stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
0392         ecalToken = "simEcalTriggerPrimitiveDigis",
0393         hcalToken = 'simHcalTriggerPrimitiveDigis'
0394     )
0395     return process
0396 
0397 def L1TReEmulFromRAWLegacyMuon(process):
0398     process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0399     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
0400     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
0401     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
0402         cms.InputTag('hcalDigis'),
0403         cms.InputTag('hcalDigis')
0404     )
0405 
0406 ## - Legacy to upgrade format muon converter
0407     process.load('L1Trigger.L1TCommon.muonLegacyInStage2FormatDigis_cfi')
0408     process.muonLegacyInStage2FormatDigis.muonSource = cms.InputTag('simGmtDigis')  
0409 
0410 ## - DT TP emulator
0411     from L1Trigger.DTTrigger.dtTriggerPrimitiveDigis_cfi import dtTriggerPrimitiveDigis
0412     process.simDtTriggerPrimitiveDigis = dtTriggerPrimitiveDigis.clone()
0413     process.simDtTriggerPrimitiveDigis.digiTag = cms.InputTag('muonDTDigis')
0414 
0415 ## - TwinMux
0416     from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import simTwinMuxDigis
0417     process.simTwinMuxDigisForDttf = simTwinMuxDigis.clone()
0418     process.simTwinMuxDigisForDttf.RPC_Source         = cms.InputTag('muonRPCDigis')
0419     process.simTwinMuxDigisForDttf.DTDigi_Source      = cms.InputTag('bmtfDigis')
0420     process.simTwinMuxDigisForDttf.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
0421 
0422     # Lookup tables for the CSC TP emulator
0423     process.load("CalibMuon.CSCCalibration.CSCL1TPLookupTableEP_cff")
0424     ## - CSC TP emulator
0425     from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi import cscTriggerPrimitiveDigis
0426     process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigis.clone()
0427     process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
0428     process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
0429 #
0430 # - CSC Track Finder emulator
0431 #
0432     from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
0433     process.simCsctfTrackDigis = csctfTrackDigis.clone()
0434     process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag( 'csctfDigis' ) 
0435     process.simCsctfTrackDigis.DTproducer = 'simDtTriggerPrimitiveDigis'
0436     from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis
0437     process.simCsctfDigis = csctfDigis.clone()
0438     process.simCsctfDigis.CSCTrackProducer = 'simCsctfTrackDigis'
0439 ##
0440 ## - DT Track Finder emulator
0441 ## 
0442     from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
0443     process.simDttfDigis = dttfDigis.clone()
0444     process.simDttfDigis.DTDigi_Source  = 'simTwinMuxDigisForDttf'
0445     process.simDttfDigis.CSCStub_Source = 'simCsctfTrackDigis'
0446 ##
0447 ## - RPC PAC Trigger emulator
0448 ##
0449     from L1Trigger.RPCTrigger.rpcTriggerDigis_cff import rpcTriggerDigis
0450     process.load('L1Trigger.RPCTrigger.RPCConeConfig_cff')
0451     process.simRpcTriggerDigis = rpcTriggerDigis.clone()
0452     process.simRpcTriggerDigis.label = 'muonRPCDigis'
0453     process.simRpcTriggerDigis.RPCTriggerDebug = cms.untracked.int32(1)
0454 
0455 ## 
0456 ## - Legacy Global Muon Trigger emulator
0457 ##
0458     from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
0459     process.simGmtDigis = gmtDigis.clone()
0460     process.simGmtDigis.DTCandidates   = cms.InputTag( 'simDttfDigis', 'DT' )
0461     process.simGmtDigis.CSCCandidates  = cms.InputTag( 'simCsctfDigis', 'CSC' )
0462     process.simGmtDigis.RPCbCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCb' )
0463     process.simGmtDigis.RPCfCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCf' )
0464 
0465 
0466     # This is for the upgrade
0467 
0468     # BMTF
0469     process.simBmtfDigis.DTDigi_Source         = cms.InputTag('bmtfDigis')
0470     process.simBmtfDigis.DTDigi_Theta_Source   = cms.InputTag('bmtfDigis')
0471     # TwinMux
0472     process.simTwinMuxDigis.RPC_Source         = cms.InputTag('muonRPCDigis')
0473     process.simTwinMuxDigis.DTDigi_Source      = cms.InputTag('bmtfDigis')
0474     process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
0475     # OMTF
0476     process.simOmtfDigis.srcRPC                = cms.InputTag('muonRPCDigis')
0477     process.simOmtfDigis.srcCSC                = cms.InputTag('csctfDigis')
0478     process.simOmtfDigis.srcDTPh               = cms.InputTag('bmtfDigis')
0479     process.simOmtfDigis.srcDTTh               = cms.InputTag('bmtfDigis')
0480     # EMTF
0481     process.simEmtfDigis.CSCInput              = cms.InputTag('emtfStage2Digis')
0482     process.simEmtfDigis.RPCInput              = cms.InputTag('muonRPCDigis')
0483     # Calo Layer1
0484     process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
0485     process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
0486    
0487 
0488 # - Sequences 
0489     process.L1TMuonTriggerPrimitives = cms.Sequence(process.simCscTriggerPrimitiveDigis + process.simDtTriggerPrimitiveDigis + process.simTwinMuxDigisForDttf)
0490 
0491     process.L1TReEmul = cms.Sequence(process.L1TMuonTriggerPrimitives + process.simCsctfTrackDigis + process.simCsctfDigis + process.simDttfDigis + process.simRpcTriggerDigis + process.simGmtDigis + process.muonLegacyInStage2FormatDigis)
0492     
0493     process.load('L1Trigger.L1TMuon.simMuonQualityAdjusterDigis_cfi')
0494 
0495     process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.simTwinMuxDigis + process.simBmtfDigis + process.simEmtfDigis + process.simOmtfDigis + process.simGmtCaloSumDigis + process.simMuonQualityAdjusterDigis + process.simGmtStage2Digis)
0496 
0497     process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.SimL1TechnicalTriggers + process.SimL1TGlobal )
0498 
0499     process.L1TReEmulPath = cms.Path(process.L1TReEmul)    
0500     process.schedule.append(process.L1TReEmulPath)
0501     print("# L1TReEmul sequence:  ")
0502     print("# {0}".format(process.L1TReEmul))
0503     print("# {0}".format(process.schedule))
0504     return process
0505