CMS 3D CMS Logo

customiseReEmul.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
3 
5  process.load("L1Trigger.L1TCalorimeter.caloStage2Params_HWConfig_cfi")
6  return process
7 
8 def L1TAddBitwiseLayer1(process):
9  from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis as simCaloStage2BitwiseLayer1Digis
10  from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis as simCaloStage2BitwiseDigis
11  process.simCaloStage2BitwiseLayer1Digis = simCaloStage2BitwiseLayer1Digis.clone()
12  process.simCaloStage2BitwiseLayer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
13  process.simCaloStage2BitwiseDigis = simCaloStage2BitwiseDigis.clone()
14  process.simCaloStage2BitwiseDigis.towerToken = cms.InputTag("simCaloStage2BitwiseLayer1Digis")
15  process.SimL1TCalorimeter = cms.Sequence( process.simCaloStage2Layer1Digis + process.simCaloStage2Digis + process.simCaloStage2BitwiseLayer1Digis + process.simCaloStage2BitwiseDigis)
16  from L1Trigger.L1TNtuples.l1UpgradeTree_cfi import l1UpgradeTree
17  process.l1UpgradeBitwiseTree = l1UpgradeTree.clone()
18  process.l1UpgradeBitwiseTree.egToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
19  process.l1UpgradeBitwiseTree.tauTokens = cms.untracked.VInputTag("simCaloStage2BitwiseDigis")
20  process.l1UpgradeBitwiseTree.jetToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
21  process.l1UpgradeBitwiseTree.muonToken = cms.untracked.InputTag("simGmtStage2Digis")
22  process.l1UpgradeBitwiseTree.sumToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
23  process.l1ntuplebitwise = cms.Path(
24  process.l1UpgradeBitwiseTree
25  )
26  process.schedule.append(process.l1ntuplebitwise)
27  print "modified L1TReEmul: "
28  print process.L1TReEmul
29  return process
30 
31 # As of 80X, this ES configuration is needed for *data* GTs (mc tags work w/o)
33  process.es_pool_hf1x1 = cms.ESSource(
34  "PoolDBESSource",
35  #process.CondDBSetup,
36  timetype = cms.string('runnumber'),
37  toGet = cms.VPSet(
38  cms.PSet(record = cms.string("HcalLutMetadataRcd"),
39  tag = cms.string("HcalLutMetadata_HFTP_1x1")
40  ),
41  cms.PSet(record = cms.string("HcalElectronicsMapRcd"),
42  tag = cms.string("HcalElectronicsMap_HFTP_1x1")
43  )
44  ),
45  connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
46  authenticationMethod = cms.untracked.uint32(0)
47  )
48  process.es_prefer_es_pool_hf1x1 = cms.ESPrefer("PoolDBESSource", "es_pool_hf1x1")
49  return process
50 
51 def L1TReEmulFromRAW2015(process):
52  process.load('L1Trigger.Configuration.SimL1Emulator_cff')
53  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
54  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
55  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
56  cms.InputTag('hcalDigis'),
57  cms.InputTag('hcalDigis')
58  )
59  process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
60  process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
61  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
62  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
63 
64  if hasattr(process, "stage2L1Trigger"):
65  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
66  # When available, this will switch to TwinMux input Digis:
67  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag("dttfDigis")
68  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag("dttfDigis")
69  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
70  process.simBmtfDigis.DTDigi_Source = cms.InputTag("simTwinMuxDigis")
71  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag("dttfDigis")
72  process.simEmtfDigis.CSCInput = cms.InputTag("csctfDigis")
73  process.simEmtfDigis.RPCInput = cms.InputTag('muonRPCDigis')
74  process.simOmtfDigis.srcCSC = cms.InputTag("csctfDigis")
75  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
76  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
77  process.schedule.append(process.L1TReEmulPath)
78  print "L1TReEmul sequence: "
79  print process.L1TReEmul
80  print process.schedule
81  # quiet warning abouts missing Stage-2 payloads, since they won't reliably exist in 2015 data.
82  if hasattr(process, "caloStage2Digis"):
83  process.caloStage2Digis.MinFeds = cms.uint32(0)
84  if hasattr(process, "gmtStage2Digis"):
85  process.gmtStage2Digis.MinFeds = cms.uint32(0)
86  if hasattr(process, "gtStage2Digis"):
87  process.gtStage2Digis.MinFeds = cms.uint32(0)
88  return process
89  else:
90  process.simRctDigis.ecalDigis = cms.VInputTag('simEcalTriggerPrimitiveDigis')
91  process.simRctDigis.hcalDigis = cms.VInputTag('simHcalTriggerPrimitiveDigis')
92  process.simRpcTriggerDigis.label = 'muonRPCDigis'
93  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
94  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
95  process.schedule.append(process.L1TReEmulPath)
96  print "L1TReEmul sequence: "
97  print process.L1TReEmul
98  print process.schedule
99  return process
100 
102  L1TReEmulFromRAW2015(process)
103  if hasattr(process, "stage2L1Trigger"):
104  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
105  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
106  return process
107 
109  L1TReEmulFromRAW2015(process)
110  if hasattr(process, "stage2L1Trigger"):
111  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
112  return process
113 
114 def L1TReEmulFromRAW(process):
115  process.load('L1Trigger.Configuration.SimL1Emulator_cff')
116  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
117  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
118  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
119  cms.InputTag('hcalDigis'),
120  cms.InputTag('hcalDigis')
121  )
122  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
123  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
124  process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
125  if hasattr(process, "stage2L1Trigger"):
126  #cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis']
127  #for b in cutlist:
128  # process.SimL1Emulator.remove(getattr(process,b))
129  # TwinMux
130  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
131  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
132  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
133  # BMTF
134  process.simBmtfDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
135  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('bmtfDigis')
136  # OMTF
137  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
138  process.simOmtfDigis.srcCSC = cms.InputTag('csctfDigis')
139  process.simOmtfDigis.srcDTPh = cms.InputTag('bmtfDigis')
140  process.simOmtfDigis.srcDTTh = cms.InputTag('bmtfDigis')
141  # EMTF
142  process.simEmtfDigis.CSCInput = cms.InputTag('emtfStage2Digis')
143  process.simEmtfDigis.RPCInput = cms.InputTag('muonRPCDigis')
144  # Calo Layer1
145  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
146  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
147  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
148  process.schedule.append(process.L1TReEmulPath)
149  print "L1TReEmulPath sequence: "
150  print process.L1TReEmulPath
151  print process.schedule
152  return process
153  else:
154  process.simRctDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
155  process.simRctDigis.hcalDigis = cms.VInputTag('hcalDigis:')
156  process.simRpcTriggerDigis.label = 'muonRPCDigis'
157  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
158  process.schedule.append(process.L1TReEmulPath)
159  print "L1TReEmul sequence: "
160  print process.L1TReEmul
161  print process.schedule
162  return process
163 
164 def L1TReEmulMCFromRAW(process):
165  L1TReEmulFromRAW(process)
166  if hasattr(process, "stage2L1Trigger"):
167  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
168  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
169  return process
170 
172  L1TReEmulMCFromRAW(process)
173  if hasattr(process, "stage2L1Trigger"):
174  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
175  return process
176 
178  L1TReEmulMCFromRAW(process)
179  if hasattr(process, "stage2L1Trigger"):
180  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
181  return process
182 
184  L1TReEmulMCFromRAW(process)
185  if hasattr(process, "stage2L1Trigger"):
186  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
187  cms.InputTag('simHcalUnsuppressedDigis'),
188  cms.InputTag('simHcalUnsuppressedDigis')
189  )
190  process.simHcalTriggerPrimitiveDigis.inputUpgradeLabel = cms.VInputTag(
191  cms.InputTag('simHcalUnsuppressedDigis:HBHEQIE11DigiCollection'),
192  cms.InputTag('simHcalUnsuppressedDigis:HFQIE10DigiCollection')
193  )
194  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
195  return process
196  #inputUpgradeLabel = cms.VInputTag(
197  # cms.InputTag('simHcalUnsuppressedDigis:HBHEQIE11DigiCollection'),
198  # cms.InputTag('simHcalUnsuppressedDigis:HFQIE10DigiCollection')),
199 
201  L1TReEmulMCFromRAW(process)
202  if hasattr(process, "stage2L1Trigger"):
203  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
204  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
205  return process
206 
208  L1TReEmulFromRAW(process)
209  if hasattr(process, "stage2L1Trigger"):
210  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
211  return process
212 
214  L1TReEmulFromRAW(process)
215  if hasattr(process, "stage2L1Trigger"):
216  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
217  return process
218 
220  L1TReEmulFromRAW(process)
221  if hasattr(process, "stage2L1Trigger"):
222  # TwinMux
223  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
224  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
225  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
226  # BMTF
227  process.simBmtfDigis.DTDigi_Source = cms.InputTag('simTwinMuxDigis')
228  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
229  # OMTF
230  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
231  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis')
232  process.simOmtfDigis.srcDTPh = cms.InputTag('simDtTriggerPrimitiveDigis')
233  process.simOmtfDigis.srcDTTh = cms.InputTag('simDtTriggerPrimitiveDigis')
234  # EMTF
235  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis')
236  process.simEmtfDigis.RPCInput = cms.InputTag('muonRPCDigis')
237  # Layer1
238  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
239  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
240  return process
241 
243  process.load('L1Trigger.Configuration.SimL1Emulator_cff')
244  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
245  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
246  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
247  cms.InputTag('hcalDigis'),
248  cms.InputTag('hcalDigis')
249  )
250 
251 ## - Legacy to upgrade format muon converter
252  process.load('L1Trigger.L1TCommon.muonLegacyInStage2FormatDigis_cfi')
253  process.muonLegacyInStage2FormatDigis.muonSource = cms.InputTag('simGmtDigis')
254 
255 ## - DT TP emulator
256  from L1Trigger.DTTrigger.dtTriggerPrimitiveDigis_cfi import dtTriggerPrimitiveDigis
257  process.simDtTriggerPrimitiveDigis = dtTriggerPrimitiveDigis.clone()
258  process.simDtTriggerPrimitiveDigis.digiTag = cms.InputTag('muonDTDigis')
259 
260 ## - TwinMux
261  from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import simTwinMuxDigis
262  process.simTwinMuxDigisForDttf = simTwinMuxDigis.clone()
263  process.simTwinMuxDigisForDttf.RPC_Source = cms.InputTag('muonRPCDigis')
264  process.simTwinMuxDigisForDttf.DTDigi_Source = cms.InputTag('bmtfDigis')
265  process.simTwinMuxDigisForDttf.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
266 
267 ## - CSC TP emulator
268  from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi import cscTriggerPrimitiveDigis
269  process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigis.clone()
270  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
271  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
272 #
273 # - CSC Track Finder emulator
274 #
275  from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
276  process.simCsctfTrackDigis = csctfTrackDigis.clone()
277  process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag( 'csctfDigis' )
278  process.simCsctfTrackDigis.DTproducer = 'simDtTriggerPrimitiveDigis'
279  from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis
280  process.simCsctfDigis = csctfDigis.clone()
281  process.simCsctfDigis.CSCTrackProducer = 'simCsctfTrackDigis'
282 
285  from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
286  process.simDttfDigis = dttfDigis.clone()
287  process.simDttfDigis.DTDigi_Source = 'simTwinMuxDigisForDttf'
288  process.simDttfDigis.CSCStub_Source = 'simCsctfTrackDigis'
289 
292  from L1Trigger.RPCTrigger.rpcTriggerDigis_cff import rpcTriggerDigis
293  process.load('L1Trigger.RPCTrigger.RPCConeConfig_cff')
294  process.simRpcTriggerDigis = rpcTriggerDigis.clone()
295  process.simRpcTriggerDigis.label = 'muonRPCDigis'
296  process.simRpcTriggerDigis.RPCTriggerDebug = cms.untracked.int32(1)
297 
298 ##
299 ## - Legacy Global Muon Trigger emulator
300 
301  from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
302  process.simGmtDigis = gmtDigis.clone()
303  process.simGmtDigis.DTCandidates = cms.InputTag( 'simDttfDigis', 'DT' )
304  process.simGmtDigis.CSCCandidates = cms.InputTag( 'simCsctfDigis', 'CSC' )
305  process.simGmtDigis.RPCbCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCb' )
306  process.simGmtDigis.RPCfCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCf' )
307 
308 
309  # This is for the upgrade
310 
311  # BMTF
312  process.simBmtfDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
313  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('bmtfDigis')
314  # TwinMux
315  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
316  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
317  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
318  # OMTF
319  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
320  process.simOmtfDigis.srcCSC = cms.InputTag('csctfDigis')
321  process.simOmtfDigis.srcDTPh = cms.InputTag('bmtfDigis')
322  process.simOmtfDigis.srcDTTh = cms.InputTag('bmtfDigis')
323  # EMTF
324  process.simEmtfDigis.CSCInput = cms.InputTag('emtfStage2Digis')
325  process.simEmtfDigis.RPCInput = cms.InputTag('muonRPCDigis')
326  # Calo Layer1
327  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
328  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
329 
330 
331 # - Sequences
332  process.L1TMuonTriggerPrimitives = cms.Sequence(process.simCscTriggerPrimitiveDigis + process.simDtTriggerPrimitiveDigis + process.simTwinMuxDigisForDttf)
333 
334  process.L1TReEmul = cms.Sequence(process.L1TMuonTriggerPrimitives + process.simCsctfTrackDigis + process.simCsctfDigis + process.simDttfDigis + process.simRpcTriggerDigis + process.simGmtDigis + process.muonLegacyInStage2FormatDigis)
335 
336  process.load('L1Trigger.L1TMuon.simMuonQualityAdjusterDigis_cfi')
337 
338  process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.simTwinMuxDigis + process.simBmtfDigis + process.simEmtfDigis + process.simOmtfDigis + process.simGmtCaloSumDigis + process.simMuonQualityAdjusterDigis + process.simGmtStage2Digis)
339 
340  process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.SimL1TechnicalTriggers + process.SimL1TGlobal )
341 
342  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
343  process.schedule.append(process.L1TReEmulPath)
344  print "L1TReEmul sequence: "
345  print process.L1TReEmul
346  print process.schedule
347  return process
348 
def L1TReEmulMCFromRAWSimCalTP(process)
def L1TReEmulMCFromRAW(process)
def L1TReEmulMCFromRAWSimHcalTP(process)
def L1TReEmulFromRAWsimEcalTP(process)
def L1TReEmulFromRAW2015simCaloTP(process)
def L1TReEmulMCFrom90xRAWSimHcalTP(process)
def L1TReEmulFromRAW2015(process)
def L1TReEmulFromRAWLegacyMuon(process)
def L1TCaloStage2ParamsForHW(process)
def L1TReEmulFromRAW(process)
def L1TReEmulFromRAWsimHcalTP(process)
def L1TEventSetupForHF1x1TPs(process)
def L1TReEmulMCFromRAW2015(process)
def L1TReEmulFromRAWsimTP(process)
def L1TReEmulMCFromRAWSimEcalTP(process)
def L1TAddBitwiseLayer1(process)