Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-23 23:24:08

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 ## L1REPACK FULL:  Re-Emulate all of L1 and repack into RAW
0005 
0006 
0007 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
0008 def _print(ignored):
0009     print("# L1T WARN:  L1REPACK:Full2015Data only supports Stage 2 eras for now.")
0010     print("# L1T WARN:  Use a legacy version of L1REPACK for now.")
0011 stage2L1Trigger.toModify(None, _print)
0012 (~stage2L1Trigger).toModify(None, lambda x: print("# L1T INFO:  L1REPACK:Full2015Data will unpack all L1T inputs, re-emulated (Stage-2), and pack uGT, uGMT, and Calo Stage-2 output."))
0013 
0014 # First, Unpack all inputs to L1:
0015 import EventFilter.DTTFRawToDigi.dttfunpacker_cfi
0016 unpackDttf = EventFilter.DTTFRawToDigi.dttfunpacker_cfi.dttfunpacker.clone(
0017     DTTF_FED_Source = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0018 
0019 import EventFilter.CSCTFRawToDigi.csctfunpacker_cfi
0020 unpackCsctf = EventFilter.CSCTFRawToDigi.csctfunpacker_cfi.csctfunpacker.clone(
0021     producer = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0022 
0023 import EventFilter.CSCRawToDigi.cscUnpacker_cfi
0024 unpackCSC = EventFilter.CSCRawToDigi.cscUnpacker_cfi.muonCSCDigis.clone(
0025     InputObjects = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0026 
0027 import EventFilter.DTRawToDigi.dtunpacker_cfi
0028 unpackDT = EventFilter.DTRawToDigi.dtunpacker_cfi.muonDTDigis.clone(
0029     inputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0030 
0031 import EventFilter.RPCRawToDigi.rpcUnpacker_cfi
0032 unpackRPC = EventFilter.RPCRawToDigi.rpcUnpacker_cfi.rpcunpacker.clone(
0033     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0034 
0035 import EventFilter.EcalRawToDigi.EcalUnpackerData_cfi
0036 unpackEcal = EventFilter.EcalRawToDigi.EcalUnpackerData_cfi.ecalEBunpacker.clone(
0037     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0038 
0039 import EventFilter.HcalRawToDigi.HcalRawToDigi_cfi
0040 unpackHcal = EventFilter.HcalRawToDigi.HcalRawToDigi_cfi.hcalDigis.clone(
0041     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0042 
0043 # Second, Re-Emulate the entire L1T
0044 
0045 # NOTE:  2016 HCAL HF TPs require a new emulation
0046 from SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff import *
0047 simHcalTriggerPrimitiveDigis.inputLabel = [
0048     'unpackHcal',
0049     'unpackHcal'
0050 ]
0051 
0052 from L1Trigger.Configuration.SimL1Emulator_cff import *
0053 simDtTriggerPrimitiveDigis.digiTag = 'unpackDT'
0054 simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = 'unpackCSC:MuonCSCComparatorDigi'
0055 simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = 'unpackCSC:MuonCSCWireDigi'
0056 
0057 simTwinMuxDigis.RPC_Source = 'unpackRPC'
0058 simTwinMuxDigis.DTDigi_Source = "unpackDttf"
0059 simTwinMuxDigis.DTThetaDigi_Source = "unpackDttf"
0060 
0061 # BMTF
0062 simBmtfDigis.DTDigi_Source       = "simTwinMuxDigis"
0063 simBmtfDigis.DTDigi_Theta_Source = "unpackDttf"
0064 
0065 # OMTF
0066 simOmtfDigis.srcRPC                = 'unpackRPC'
0067 simOmtfDigis.srcDTPh               = "unpackDttf"
0068 simOmtfDigis.srcDTTh               = "unpackDttf"
0069 simOmtfDigis.srcCSC                = "unpackCsctf"
0070 
0071 # EMTF
0072 simEmtfDigis.CSCInput              = "unpackCsctf"
0073 simEmtfDigis.RPCInput              = 'unpackRPC'
0074 
0075 simCaloStage2Layer1Digis.ecalToken = 'unpackEcal:EcalTriggerPrimitives'
0076 simCaloStage2Layer1Digis.hcalToken = 'simHcalTriggerPrimitiveDigis'
0077 
0078 
0079 # Finally, pack the new L1T output back into RAW
0080     
0081 from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2
0082 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2
0083 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2
0084 
0085 # combine the new L1 RAW with existing RAW for other FEDs
0086 import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
0087 rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
0088     verbose = 0,
0089     RawCollectionList = [
0090         'packCaloStage2',
0091         'packGmtStage2',
0092         'packGtStage2',
0093         cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()),
0094         ]
0095     )
0096 
0097 
0098 SimL1EmulatorTask = cms.Task()
0099 stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackEcal,unpackHcal,unpackCSC,unpackDT,unpackRPC,unpackDttf,unpackCsctf
0100                                  ,simHcalTriggerPrimitiveDigis,SimL1EmulatorCoreTask,packCaloStage2
0101                                  ,packGmtStage2,packGtStage2,rawDataCollector))
0102 SimL1Emulator = cms.Sequence(SimL1EmulatorTask)