Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:27

0001 
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 
0005 # customize to use upgrade L1 emulation
0006 
0007 from L1Trigger.Configuration.L1Trigger_custom import customiseL1Menu
0008 
0009 # customization of run L1 emulator for 2015 Stage 1 configuration
0010 def customiseSimL1EmulatorForStage1(process):
0011 
0012     process.load("L1Trigger.L1TCommon.l1tDigiToRaw_cfi")
0013     process.load("EventFilter.L1TRawToDigi.caloStage1Digis_cfi") 
0014 
0015     process.load("L1Trigger.L1TCommon.caloStage1LegacyFormatDigis_cfi")
0016 
0017     #process.load('L1Trigger.L1TCalorimeter.caloStage1Params_cfi')
0018     process.load('L1Trigger.L1TCalorimeter.caloConfigStage1PP_cfi')
0019     process.load('L1Trigger.L1TCalorimeter.L1TCaloStage1_cff')
0020 
0021     if hasattr(process, 'simGtDigis'):
0022         process.simGtDigis.GmtInputTag = 'simGmtDigis'
0023         process.simGtDigis.GctInputTag = 'simCaloStage1LegacyFormatDigis'
0024         process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag( )
0025     if hasattr(process, 'gctDigiToRaw'):
0026         process.gctDigiToRaw.gctInputLabel = 'simCaloStage1LegacyFormatDigis'
0027 
0028     if hasattr(process, 'simGctDigis'):
0029         for sequence in process.sequences:
0030             getattr(process,sequence).replace(process.simGctDigis,process.L1TCaloStage1)
0031         for path in process.paths:
0032             getattr(process,path).replace(process.simGctDigis,process.L1TCaloStage1)
0033 
0034     if hasattr(process, 'DigiToRaw'):
0035         process.l1tDigiToRaw.InputLabel = cms.InputTag("simCaloStage1FinalDigis", "")
0036         process.l1tDigiToRaw.TauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "rlxTaus")
0037         process.l1tDigiToRaw.IsoTauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "isoTaus")
0038         process.l1tDigiToRaw.HFBitCountsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFBitCounts")
0039         process.l1tDigiToRaw.HFRingSumsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFRingSums")
0040         process.l1tDigiToRawSeq = cms.Sequence(process.gctDigiToRaw + process.l1tDigiToRaw);
0041         process.DigiToRaw.replace(process.gctDigiToRaw, process.l1tDigiToRawSeq)
0042         if hasattr(process, 'rawDataCollector'):
0043             process.rawDataCollector.RawCollectionList.append(cms.InputTag("l1tDigiToRaw"))
0044     if hasattr(process, 'RawToDigi'):
0045         process.L1RawToDigiSeq = cms.Sequence(process.gctDigis+process.caloStage1Digis+process.caloStage1LegacyFormatDigis)
0046         process.RawToDigi.replace(process.gctDigis, process.L1RawToDigiSeq)
0047 
0048     blist=['l1extraParticles','recoL1extraParticles','dqmL1ExtraParticles']
0049     for b in blist:
0050         if hasattr(process,b):
0051             if (getattr(process, b).centralJetSource == cms.InputTag("simGctDigis","cenJets")):
0052                 getattr(process, b).etTotalSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0053                 getattr(process, b).nonIsolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","nonIsoEm")
0054                 getattr(process, b).etMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0055                 getattr(process, b).htMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0056                 getattr(process, b).forwardJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","forJets")
0057                 getattr(process, b).centralJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","cenJets")
0058                 getattr(process, b).tauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","tauJets")
0059                 getattr(process, b).isoTauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoTauJets")
0060                 getattr(process, b).isolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoEm")
0061                 getattr(process, b).etHadSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0062                 getattr(process, b).hfRingEtSumsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0063                 getattr(process, b).hfRingBitCountsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0064             else:
0065                 getattr(process, b).etTotalSource = cms.InputTag("caloStage1LegacyFormatDigis")
0066                 getattr(process, b).nonIsolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","nonIsoEm")
0067                 getattr(process, b).etMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
0068                 getattr(process, b).htMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
0069                 getattr(process, b).forwardJetSource = cms.InputTag("caloStage1LegacyFormatDigis","forJets")
0070                 getattr(process, b).centralJetSource = cms.InputTag("caloStage1LegacyFormatDigis","cenJets")
0071                 getattr(process, b).tauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","tauJets")
0072                 getattr(process, b).isoTauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","isoTauJets")
0073                 getattr(process, b).isolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","isoEm")
0074                 getattr(process, b).etHadSource = cms.InputTag("caloStage1LegacyFormatDigis")
0075                 getattr(process, b).hfRingEtSumsSource = cms.InputTag("caloStage1LegacyFormatDigis")
0076                 getattr(process, b).hfRingBitCountsSource = cms.InputTag("caloStage1LegacyFormatDigis")
0077 
0078     return process
0079 
0080 
0081 # customization of run L1 emulator for 2015 Stage 1 configuration
0082 def customiseL1RecoForStage1(process):
0083 
0084     process.load("L1Trigger.L1TCommon.l1tRawToDigi_cfi")
0085     process.load("L1Trigger.L1TCommon.caloStage1LegacyFormatDigis_cfi")
0086 
0087     if hasattr(process, 'RawToDigi'):
0088         process.L1RawToDigiSeq = cms.Sequence(process.gctDigis+process.caloStage1Digis+process.caloStage1LegacyFormatDigis)
0089         process.RawToDigi.replace(process.gctDigis, process.L1RawToDigiSeq)
0090 
0091     blist=['l1extraParticles','recoL1extraParticles','dqmL1ExtraParticles']
0092     for b in blist:
0093         if hasattr(process,b):
0094             if (getattr(process, b).centralJetSource == cms.InputTag("simGctDigis","cenJets")):
0095                 getattr(process, b).etTotalSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0096                 getattr(process, b).nonIsolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","nonIsoEm")
0097                 getattr(process, b).etMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0098                 getattr(process, b).htMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0099                 getattr(process, b).forwardJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","forJets")
0100                 getattr(process, b).centralJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","cenJets")
0101                 getattr(process, b).tauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","tauJets")
0102                 getattr(process, b).isoTauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoTauJets")
0103                 getattr(process, b).isolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoEm")
0104                 getattr(process, b).etHadSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0105                 getattr(process, b).hfRingEtSumsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0106                 getattr(process, b).hfRingBitCountsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
0107             else:
0108                 getattr(process, b).etTotalSource = cms.InputTag("caloStage1LegacyFormatDigis")
0109                 getattr(process, b).nonIsolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","nonIsoEm")
0110                 getattr(process, b).etMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
0111                 getattr(process, b).htMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
0112                 getattr(process, b).forwardJetSource = cms.InputTag("caloStage1LegacyFormatDigis","forJets")
0113                 getattr(process, b).centralJetSource = cms.InputTag("caloStage1LegacyFormatDigis","cenJets")
0114                 getattr(process, b).tauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","tauJets")
0115                 getattr(process, b).isoTauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","isoTauJets")
0116                 getattr(process, b).isolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","isoEm")
0117                 getattr(process, b).etHadSource = cms.InputTag("caloStage1LegacyFormatDigis")
0118                 getattr(process, b).hfRingEtSumsSource = cms.InputTag("caloStage1LegacyFormatDigis")
0119                 getattr(process, b).hfRingBitCountsSource = cms.InputTag("caloStage1LegacyFormatDigis")
0120 
0121     return process
0122 
0123 
0124 from L1Trigger.Configuration.customise_overwriteL1Menu import *
0125 
0126 def customiseSimL1EmulatorForPostLS1_lowPU(process):
0127     # load the Stage 1 configuration
0128     process = customiseSimL1EmulatorForStage1(process)
0129     # move to the lowPU v3 L1 menu once the HLT has been updated accordingly
0130     process = L1Menu_Collisions2015_lowPU_v3(process)
0131     return process
0132 
0133 def customiseSimL1EmulatorForPostLS1_50ns(process):
0134     # load the Stage 1 configuration
0135     process = customiseSimL1EmulatorForStage1(process)
0136     # move to the 50ns v2 L1 menu once the HLT has been updated accordingly
0137     process = L1Menu_Collisions2015_50ns_v2(process)
0138     return process
0139 
0140 def customiseSimL1EmulatorForPostLS1_25ns(process):
0141     # load the Stage 1 configuration
0142     process = customiseSimL1EmulatorForStage1(process)
0143     # load the 25ns v2 L1 menu
0144     process = L1Menu_Collisions2015_25ns_v2(process)
0145     return process
0146 
0147 # additional customizations needed for HI:
0148 # -> no L1 Menu added here
0149 # -> common post LS1 customizations not called here
0150 def customiseSimL1EmulatorForPostLS1_Additional_HI(process):
0151     if hasattr(process,'caloConfig'):
0152         process.caloConfig.fwVersionLayer2 = cms.uint32(1)
0153     return process
0154 
0155 # This (UNTESTED/UNUSED) should allow for unpacking RAW data created with legacy 74X MC.
0156 def customiseL1RawToDigiFor74XMC(process):
0157     if hasattr(process,'caloStage1Digis'):     
0158         process.caloStage1Digis.FWId = cms.uint32(0xff000000)
0159     if hasattr(process,'hltCaloStage1Digis'):     
0160         process.hltCaloStage1Digis.FWId = cms.uint32(0xff000000)
0161     return process