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:FullSimTP (intended for 2016 data) 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:FullSimTP (intended for 2016 data) will unpack all L1T inputs, re-emulate Trigger Primitives, re-emulate L1T (Stage-2), and pack uGT, uGMT, and Calo Stage-2 output."))
0013 
0014 # First, Unpack all inputs to L1:
0015 import EventFilter.L1TRawToDigi.bmtfDigis_cfi
0016 unpackBmtf = EventFilter.L1TRawToDigi.bmtfDigis_cfi.bmtfDigis.clone(
0017     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0018 
0019 import EventFilter.DTTFRawToDigi.dttfunpacker_cfi
0020 unpackDttf = EventFilter.DTTFRawToDigi.dttfunpacker_cfi.dttfunpacker.clone(
0021     DTTF_FED_Source = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0022         
0023 import EventFilter.L1TRawToDigi.emtfStage2Digis_cfi
0024 unpackEmtf = EventFilter.L1TRawToDigi.emtfStage2Digis_cfi.emtfStage2Digis.clone(
0025     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0026         
0027 
0028 import EventFilter.CSCTFRawToDigi.csctfunpacker_cfi
0029 unpackCsctf = EventFilter.CSCTFRawToDigi.csctfunpacker_cfi.csctfunpacker.clone(
0030     producer = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0031 
0032 import EventFilter.CSCRawToDigi.cscUnpacker_cfi
0033 unpackCSC = EventFilter.CSCRawToDigi.cscUnpacker_cfi.muonCSCDigis.clone(
0034     InputObjects = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0035 
0036 import EventFilter.DTRawToDigi.dtunpacker_cfi
0037 unpackDT = EventFilter.DTRawToDigi.dtunpacker_cfi.muonDTDigis.clone(
0038     inputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0039 
0040 import EventFilter.RPCRawToDigi.rpcUnpacker_cfi
0041 unpackRPC = EventFilter.RPCRawToDigi.rpcUnpacker_cfi.rpcunpacker.clone(
0042     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0043 
0044 import EventFilter.EcalRawToDigi.EcalUnpackerData_cfi
0045 unpackEcal = EventFilter.EcalRawToDigi.EcalUnpackerData_cfi.ecalEBunpacker.clone(
0046     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0047 
0048 import EventFilter.HcalRawToDigi.HcalRawToDigi_cfi
0049 unpackHcal = EventFilter.HcalRawToDigi.HcalRawToDigi_cfi.hcalDigis.clone(
0050     InputLabel = cms.InputTag( 'rawDataCollector', processName=cms.InputTag.skipCurrentProcess()))
0051 
0052 # Second, Re-Emulate the entire L1T
0053 
0054 from SimCalorimetry.EcalTrigPrimProducers.ecalTriggerPrimitiveDigis_cfi import *
0055 #from L1Trigger.Configuration.CaloTriggerPrimitives_cff import *
0056 simEcalTriggerPrimitiveDigis.InstanceEB = 'ebDigis'
0057 simEcalTriggerPrimitiveDigis.InstanceEE = 'eeDigis'
0058 simEcalTriggerPrimitiveDigis.Label = 'unpackEcal'
0059 from SimCalorimetry.HcalTrigPrimProducers.hcaltpdigi_cff import *
0060 simHcalTriggerPrimitiveDigis.inputLabel = [
0061     'unpackHcal',
0062     'unpackHcal'
0063 ]
0064 simHcalTriggerPrimitiveDigis.inputUpgradeLabel = [
0065     'unpackHcal',     # upgrade HBHE
0066     'unpackHcal'      # upgrade HF
0067 ]
0068 
0069 from L1Trigger.Configuration.SimL1Emulator_cff import *
0070     
0071 simDtTriggerPrimitiveDigis.digiTag = 'unpackDT'
0072 simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = 'unpackCSC:MuonCSCComparatorDigi'
0073 simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = 'unpackCSC:MuonCSCWireDigi'
0074 
0075 simTwinMuxDigis.RPC_Source         = 'unpackRPC'
0076 # simTwinMuxDigis.DTDigi_Source      = "simDtTriggerPrimitiveDigis"  # DEFAULT
0077 # simTwinMuxDigis.DTThetaDigi_Source = "simDtTriggerPrimitiveDigis"  # DEFAULT
0078 
0079 # BMTF
0080 # simBmtfDigis.DTDigi_Source       = "simTwinMuxDigis"               # DEFAULT
0081 # simBmtfDigis.DTDigi_Theta_Source = "simDtTriggerPrimitiveDigis"    # DEFAULT
0082 
0083 # OMTF
0084 simOmtfDigis.srcRPC              = 'unpackRPC'
0085 # simOmtfDigis.srcDTPh             = "simDtTriggerPrimitiveDigis"    # DEFAULT
0086 # simOmtfDigis.srcDTTh             = "simDtTriggerPrimitiveDigis"    # DEFAULT
0087 simOmtfDigis.srcCSC              = "unpackCsctf"
0088 # simOmtfDigis.srcCSC              = "simCscTriggerPrimitiveDigis"   # DEFAULT
0089 
0090 # EMTF
0091 simEmtfDigis.CSCInput            = "unpackEmtf"
0092 # simEmtfDigis.CSCInput            = "simCscTriggerPrimitiveDigis"     # DEFAULT
0093 simEmtfDigis.RPCInput            = 'unpackRPC'
0094 
0095 # simCaloStage2Layer1Digis.ecalToken = 'simEcalTriggerPrimitiveDigis'  # DEFAULT
0096 # simCaloStage2Layer1Digis.hcalToken = 'simHcalTriggerPrimitiveDigis'  # DEFAULT
0097 
0098 # Finally, pack the new L1T output back into RAW
0099     
0100 from EventFilter.L1TRawToDigi.caloStage2Raw_cfi import caloStage2Raw as packCaloStage2
0101 from EventFilter.L1TRawToDigi.gmtStage2Raw_cfi import gmtStage2Raw as packGmtStage2
0102 from EventFilter.L1TRawToDigi.gtStage2Raw_cfi import gtStage2Raw as packGtStage2
0103 
0104 # combine the new L1 RAW with existing RAW for other FEDs
0105 import EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi
0106 rawDataCollector = EventFilter.RawDataCollector.rawDataCollectorByLabel_cfi.rawDataCollector.clone(
0107     verbose = 0,
0108     RawCollectionList = [
0109         'packCaloStage2',
0110         'packGmtStage2',
0111         'packGtStage2',
0112         cms.InputTag('rawDataCollector', processName=cms.InputTag.skipCurrentProcess()),
0113         ]
0114     )
0115 
0116 
0117 SimL1EmulatorTask = cms.Task()
0118 stage2L1Trigger.toReplaceWith(SimL1EmulatorTask, cms.Task(unpackEcal,unpackHcal,unpackCSC,unpackDT,unpackRPC,unpackEmtf,unpackCsctf,unpackBmtf
0119                                  ,simEcalTriggerPrimitiveDigis
0120                                  ,simHcalTriggerPrimitiveDigis
0121                                  ,SimL1EmulatorCoreTask,packCaloStage2
0122                                  ,packGmtStage2,packGtStage2,rawDataCollector))
0123 SimL1Emulator = cms.Sequence(SimL1EmulatorTask)