Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:38:34

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