-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Copy pathcustomiseReEmul.py
512 lines (446 loc) · 21.7 KB
/
customiseReEmul.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017
from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM
def L1TCaloStage2ParamsForHW(process):
process.load("L1Trigger.L1TCalorimeter.caloStage2Params_HWConfig_cfi")
return process
def L1TAddBitwiseLayer1(process):
from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis as simCaloStage2BitwiseLayer1Digis
from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis as simCaloStage2BitwiseDigis
process.simCaloStage2BitwiseLayer1Digis = simCaloStage2BitwiseLayer1Digis.clone()
process.simCaloStage2BitwiseLayer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
process.simCaloStage2BitwiseDigis = simCaloStage2BitwiseDigis.clone()
process.simCaloStage2BitwiseDigis.towerToken = cms.InputTag("simCaloStage2BitwiseLayer1Digis")
process.SimL1TCalorimeter = cms.Sequence( process.simCaloStage2Layer1Digis + process.simCaloStage2Digis + process.simCaloStage2BitwiseLayer1Digis + process.simCaloStage2BitwiseDigis)
from L1Trigger.L1TNtuples.l1UpgradeTree_cfi import l1UpgradeTree
process.l1UpgradeBitwiseTree = l1UpgradeTree.clone()
process.l1UpgradeBitwiseTree.egToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
process.l1UpgradeBitwiseTree.tauTokens = cms.untracked.VInputTag("simCaloStage2BitwiseDigis")
process.l1UpgradeBitwiseTree.jetToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
process.l1UpgradeBitwiseTree.muonToken = cms.untracked.InputTag("simGmtStage2Digis")
process.l1UpgradeBitwiseTree.sumToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
process.l1ntuplebitwise = cms.Path(
process.l1UpgradeBitwiseTree
)
process.schedule.append(process.l1ntuplebitwise)
print("# modified L1TReEmul: ")
print("# {0}".format(process.L1TReEmul))
return process
# As of 80X, this ES configuration is needed for *data* GTs (mc tags work w/o)
def L1TEventSetupForHF1x1TPs(process):
process.es_pool_hf1x1 = cms.ESSource(
"PoolDBESSource",
#process.CondDBSetup,
timetype = cms.string('runnumber'),
toGet = cms.VPSet(
cms.PSet(record = cms.string("HcalLutMetadataRcd"),
tag = cms.string("HcalLutMetadata_HFTP_1x1")
),
cms.PSet(record = cms.string("HcalElectronicsMapRcd"),
tag = cms.string("HcalElectronicsMap_HFTP_1x1")
)
),
connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
authenticationMethod = cms.untracked.uint32(0)
)
process.es_prefer_es_pool_hf1x1 = cms.ESPrefer("PoolDBESSource", "es_pool_hf1x1")
return process
def L1TReEmulFromRAW2015(process):
process.load('L1Trigger.Configuration.SimL1Emulator_cff')
process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
cms.InputTag('hcalDigis'),
cms.InputTag('hcalDigis')
)
process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
stage2L1Trigger.toModify(process.simTwinMuxDigis,
RPC_Source = 'muonRPCDigis',
# When available, this will switch to TwinMux input Digis:
DTDigi_Source = "dttfDigis",
DTThetaDigi_Source = "dttfDigis"
)
stage2L1Trigger.toModify(process.simOmtfDigis,
srcRPC = 'muonRPCDigis',
srcCSC = "csctfDigis"
)
stage2L1Trigger.toModify(process.simBmtfDigis,
DTDigi_Source = "simTwinMuxDigis",
DTDigi_Theta_Source = "dttfDigis"
)
stage2L1Trigger.toModify(process.simKBmtfStubs,
srcPhi = "simTwinMuxDigis",
srcTheta = "dttfDigis"
)
stage2L1Trigger.toModify(process.simEmtfDigis,
CSCInput = "csctfDigis",
RPCInput = 'muonRPCDigis'
)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "ecalDigis:EcalTriggerPrimitives")
# quiet warning abouts missing Stage-2 payloads, since they won't reliably exist in 2015 data.
stage2L1Trigger.toModify(process.caloStage2Digis, MinFeds = 0)
stage2L1Trigger.toModify(process.gmtStage2Digis, MinFeds = 0)
stage2L1Trigger.toModify(process.gtStage2Digis, MinFeds = 0)
(~stage2L1Trigger).toModify(process.simRctDigis,
ecalDigis = ['simEcalTriggerPrimitiveDigis'],
hcalDigis = ['simHcalTriggerPrimitiveDigis']
)
(~stage2L1Trigger).toModify(process.simRpcTriggerDigis, label = 'muonRPCDigis')
(~stage2L1Trigger).toModify(process.simRpcTechTrigDigis, RPCDigiLabel = 'muonRPCDigis')
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
print("# L1TReEmul sequence: ")
print("# {0}".format(process.L1TReEmul))
print("# {0}".format(process.schedule))
return process
def L1TReEmulMCFromRAW2015(process):
L1TReEmulFromRAW2015(process)
stage2L1Trigger.toModify(process.simEmtfDigis, CSCInput = 'simCscTriggerPrimitiveDigis:MPCSORTED')
stage2L1Trigger.toModify(process.simOmtfDigis, srcCSC = 'simCscTriggerPrimitiveDigis:MPCSORTED')
return process
def L1TReEmulFromRAW2015simCaloTP(process):
L1TReEmulFromRAW2015(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
return process
def L1TReEmulFromRAW2016(process):
process.load('L1Trigger.Configuration.SimL1Emulator_cff')
process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
cms.InputTag('hcalDigis'),
cms.InputTag('hcalDigis')
)
process.simHcalTriggerPrimitiveDigis.inputUpgradeLabel = cms.VInputTag(
cms.InputTag('hcalDigis'),
cms.InputTag('hcalDigis')
)
process.simDtTriggerPrimitiveDigis.digiTag = cms.InputTag("muonDTDigis")
process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
#cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis']
#for b in cutlist:
# process.SimL1Emulator.remove(getattr(process,b))
# TwinMux
stage2L1Trigger.toModify(process.simTwinMuxDigis,
RPC_Source = 'rpcTwinMuxRawToDigi',
DTDigi_Source = 'twinMuxStage2Digis:PhIn',
DTThetaDigi_Source = 'twinMuxStage2Digis:ThIn'
)
# BMTF
stage2L1Trigger.toModify(process.simBmtfDigis,
DTDigi_Source = "simTwinMuxDigis",
DTDigi_Theta_Source = "bmtfDigis"
)
# KBMTF
stage2L1Trigger.toModify(process.simKBmtfStubs,
srcPhi = 'simTwinMuxDigis',
srcTheta = 'bmtfDigis'
)
# OMTF
stage2L1Trigger.toModify(process.simOmtfDigis,
srcRPC = 'muonRPCDigis',
srcCSC = 'csctfDigis',
srcDTPh = 'bmtfDigis',
srcDTTh = 'bmtfDigis'
)
# EMTF
stage2L1Trigger.toModify(process.simEmtfDigis,
CSCInput = 'emtfStage2Digis',
RPCInput = 'muonRPCDigis'
)
# Calo Layer1
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
ecalToken = 'ecalDigis:EcalTriggerPrimitives',
hcalToken = 'hcalDigis:'
)
(~stage2L1Trigger).toModify(process.simRctDigis,
ecalDigis = ['ecalDigis:EcalTriggerPrimitives'],
hcalDigis = ['hcalDigis:']
)
(~stage2L1Trigger).toModify(process.simRpcTriggerDigis, label = 'muonRPCDigis')
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
return process
def L1TReEmulFromRAW(process):
L1TReEmulFromRAW2016(process)
stage2L1Trigger_2017.toModify(process.simOmtfDigis,
srcRPC = 'omtfStage2Digis',
srcCSC = 'omtfStage2Digis',
srcDTPh = 'omtfStage2Digis',
srcDTTh = 'omtfStage2Digis'
)
stage2L1Trigger.toModify(process.simEmtfDigis,
CSCInput = cms.InputTag('emtfStage2Digis'),
RPCInput = cms.InputTag('muonRPCDigis'),
CPPFInput = cms.InputTag('emtfStage2Digis'),
GEMEnable = cms.bool(False),
GEMInput = cms.InputTag('muonGEMPadDigis'),
CPPFEnable = cms.bool(True), # Use CPPF-emulated clustered RPC hits from CPPF as the RPC hits
)
run3_GEM.toModify(process.simMuonGEMPadDigis,
InputCollection = 'muonGEMDigis',
)
run3_GEM.toModify(process.simTwinMuxDigis,
RPC_Source = 'rpcTwinMuxRawToDigi',
DTDigi_Source = 'simDtTriggerPrimitiveDigis',
DTThetaDigi_Source = 'simDtTriggerPrimitiveDigis'
)
run3_GEM.toModify(process.simKBmtfStubs,
srcPhi = 'bmtfDigis',
srcTheta = 'bmtfDigis'
)
run3_GEM.toModify(process.simBmtfDigis,
DTDigi_Source = 'bmtfDigis',
DTDigi_Theta_Source = 'bmtfDigis'
)
print("# L1TReEmul sequence: ")
print("# {0}".format(process.L1TReEmul))
print("# {0}".format(process.schedule))
return process
def L1TReEmulFromRAWCalouGT(process):
L1TReEmulFromRAW(process)
process.simGtStage2Digis.MuonInputTag = cms.InputTag("gtStage2Digis","Muon")
return process
def L1TReEmulFromNANO(process):
process.load('L1Trigger.Configuration.SimL1Emulator_cff')
process.L1TReEmul = cms.Sequence(process.SimL1TGlobal)
stage2L1Trigger_2017.toModify(process.simGtStage2Digis,
ExtInputTag = "hltGtStage2Digis",
MuonInputTag = "hltGtStage2Digis:Muon",
EtSumInputTag = "hltGtStage2Digis:EtSum",
EGammaInputTag = "hltGtStage2Digis:EGamma",
TauInputTag = "hltGtStage2Digis:Tau",
JetInputTag = "hltGtStage2Digis:Jet"
)
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
print ("# L1TReEmul sequence: ")
print ("# {0}".format(process.L1TReEmul))
print ("# {0}".format(process.schedule))
return process
def L1TReEmulFromRAWCalo(process):
process.load('L1Trigger.Configuration.SimL1CaloEmulator_cff')
process.L1TReEmul = cms.Sequence(process.SimL1CaloEmulator)
process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
print ("# L1TReEmul sequence: ")
print ("# {0}".format(process.L1TReEmul))
print ("# {0}".format(process.schedule))
return process
def L1TReEmulFromRAWCaloSimTP(process):
process.load('L1Trigger.Configuration.SimL1CaloEmulator_cff')
process.L1TReEmul = cms.Sequence(process.SimL1CaloEmulator)
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
print ("# L1TReEmul sequence: ")
print ("# {0}".format(process.L1TReEmul))
print ("# {0}".format(process.schedule))
return process
def L1TReEmulMCFromRAW(process):
L1TReEmulFromRAW(process)
stage2L1Trigger.toModify(process.simEmtfDigis, CSCInput = 'simCscTriggerPrimitiveDigis:MPCSORTED')
stage2L1Trigger.toModify(process.simOmtfDigis, srcCSC = 'simCscTriggerPrimitiveDigis:MPCSORTED')
# Correct input collections for MC re-emulation
run3_GEM.toModify(process.simBmtfDigis,
DTDigi_Source = 'simTwinMuxDigis',
DTDigi_Theta_Source = 'simDtTriggerPrimitiveDigis'
)
run3_GEM.toModify(process.simKBmtfStubs,
srcPhi = "simTwinMuxDigis",
srcTheta = "simDtTriggerPrimitiveDigis"
)
run3_GEM.toModify(process.simOmtfDigis,
srcRPC = 'muonRPCDigis',
srcDTPh = 'simDtTriggerPrimitiveDigis',
srcDTTh = 'simDtTriggerPrimitiveDigis'
)
run3_GEM.toModify(process.simEmtfDigis,
RPCInput = 'muonRPCDigis',
GEMEnable = False, # Will be enabled when GEM is in use.
GEMInput = 'simMuonGEMPadDigiClusters',
CPPFEnable = False, # Use CPPF-emulated clustered RPC hits from CPPF as the RPC hits. Set to "False" for MC
UseRun3CCLUT_OTMB = False, # TODO: Enable UseRun3CCLUT_OTMB once it's ready.
)
return process
def L1TReEmulMCFromRAWSimEcalTP(process):
L1TReEmulMCFromRAW(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
return process
def L1TReEmulMCFromRAWSimHcalTP(process):
L1TReEmulMCFromRAW(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
return process
def L1TReEmulMCFrom90xRAWSimHcalTP(process):
L1TReEmulMCFromRAW(process)
stage2L1Trigger.toModify(process.simHcalTriggerPrimitiveDigis,
inputLabel = [
'simHcalUnsuppressedDigis',
'simHcalUnsuppressedDigis'
],
inputUpgradeLabel = [
'simHcalUnsuppressedDigis:HBHEQIE11DigiCollection',
'simHcalUnsuppressedDigis:HFQIE10DigiCollection'
]
)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
return process
#inputUpgradeLabel = cms.VInputTag(
# cms.InputTag('simHcalUnsuppressedDigis:HBHEQIE11DigiCollection'),
# cms.InputTag('simHcalUnsuppressedDigis:HFQIE10DigiCollection')),
def L1TReEmulMCFromRAWSimCalTP(process):
L1TReEmulMCFromRAW(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
ecalToken = "simEcalTriggerPrimitiveDigis",
hcalToken = 'simHcalTriggerPrimitiveDigis'
)
return process
def L1TReEmulFromRAWsimEcalTP(process):
L1TReEmulFromRAW(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, ecalToken = "simEcalTriggerPrimitiveDigis")
return process
def L1TReEmulFromRAWsimHcalTP(process):
L1TReEmulFromRAW(process)
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis, hcalToken = 'simHcalTriggerPrimitiveDigis')
return process
def L1TReEmulFromRAWsimTP(process):
L1TReEmulFromRAW(process)
# TwinMux
stage2L1Trigger.toModify(process.simTwinMuxDigis,
RPC_Source = 'muonRPCDigis',
DTDigi_Source = 'simDtTriggerPrimitiveDigis',
DTThetaDigi_Source = 'simDtTriggerPrimitiveDigis'
)
# BMTF
stage2L1Trigger.toModify(process.simBmtfDigis,
DTDigi_Source = 'simTwinMuxDigis',
DTDigi_Theta_Source = 'simDtTriggerPrimitiveDigis'
)
# KBMTF
stage2L1Trigger.toModify(process.simKBmtfStubs,
srcPhi = "simTwinMuxDigis",
srcTheta = "simDtTriggerPrimitiveDigis"
)
# OMTF
stage2L1Trigger.toModify(process.simOmtfDigis,
srcRPC = 'muonRPCDigis',
srcCSC = 'simCscTriggerPrimitiveDigis',
srcDTPh = 'simDtTriggerPrimitiveDigis',
srcDTTh = 'simDtTriggerPrimitiveDigis'
)
# EMTF
stage2L1Trigger.toModify(process.simEmtfDigis,
CSCInput = 'simCscTriggerPrimitiveDigis',
RPCInput = 'muonRPCDigis'
)
# Layer1
stage2L1Trigger.toModify(process.simCaloStage2Layer1Digis,
ecalToken = "simEcalTriggerPrimitiveDigis",
hcalToken = 'simHcalTriggerPrimitiveDigis'
)
return process
def L1TReEmulFromRAWLegacyMuon(process):
process.load('L1Trigger.Configuration.SimL1Emulator_cff')
process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
cms.InputTag('hcalDigis'),
cms.InputTag('hcalDigis')
)
## - Legacy to upgrade format muon converter
process.load('L1Trigger.L1TCommon.muonLegacyInStage2FormatDigis_cfi')
process.muonLegacyInStage2FormatDigis.muonSource = cms.InputTag('simGmtDigis')
## - DT TP emulator
from L1Trigger.DTTrigger.dtTriggerPrimitiveDigis_cfi import dtTriggerPrimitiveDigis
process.simDtTriggerPrimitiveDigis = dtTriggerPrimitiveDigis.clone()
process.simDtTriggerPrimitiveDigis.digiTag = cms.InputTag('muonDTDigis')
## - TwinMux
from L1Trigger.L1TTwinMux.simTwinMuxDigis_cfi import simTwinMuxDigis
process.simTwinMuxDigisForDttf = simTwinMuxDigis.clone()
process.simTwinMuxDigisForDttf.RPC_Source = cms.InputTag('muonRPCDigis')
process.simTwinMuxDigisForDttf.DTDigi_Source = cms.InputTag('bmtfDigis')
process.simTwinMuxDigisForDttf.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
# Lookup tables for the CSC TP emulator
process.load("CalibMuon.CSCCalibration.CSCL1TPLookupTableEP_cff")
## - CSC TP emulator
from L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi import cscTriggerPrimitiveDigis
process.simCscTriggerPrimitiveDigis = cscTriggerPrimitiveDigis.clone()
process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
#
# - CSC Track Finder emulator
#
from L1Trigger.CSCTrackFinder.csctfTrackDigis_cfi import csctfTrackDigis
process.simCsctfTrackDigis = csctfTrackDigis.clone()
process.simCsctfTrackDigis.SectorReceiverInput = cms.untracked.InputTag( 'csctfDigis' )
process.simCsctfTrackDigis.DTproducer = 'simDtTriggerPrimitiveDigis'
from L1Trigger.CSCTrackFinder.csctfDigis_cfi import csctfDigis
process.simCsctfDigis = csctfDigis.clone()
process.simCsctfDigis.CSCTrackProducer = 'simCsctfTrackDigis'
##
## - DT Track Finder emulator
##
from L1Trigger.DTTrackFinder.dttfDigis_cfi import dttfDigis
process.simDttfDigis = dttfDigis.clone()
process.simDttfDigis.DTDigi_Source = 'simTwinMuxDigisForDttf'
process.simDttfDigis.CSCStub_Source = 'simCsctfTrackDigis'
##
## - RPC PAC Trigger emulator
##
from L1Trigger.RPCTrigger.rpcTriggerDigis_cff import rpcTriggerDigis
process.load('L1Trigger.RPCTrigger.RPCConeConfig_cff')
process.simRpcTriggerDigis = rpcTriggerDigis.clone()
process.simRpcTriggerDigis.label = 'muonRPCDigis'
process.simRpcTriggerDigis.RPCTriggerDebug = cms.untracked.int32(1)
##
## - Legacy Global Muon Trigger emulator
##
from L1Trigger.GlobalMuonTrigger.gmtDigis_cfi import gmtDigis
process.simGmtDigis = gmtDigis.clone()
process.simGmtDigis.DTCandidates = cms.InputTag( 'simDttfDigis', 'DT' )
process.simGmtDigis.CSCCandidates = cms.InputTag( 'simCsctfDigis', 'CSC' )
process.simGmtDigis.RPCbCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCb' )
process.simGmtDigis.RPCfCandidates = cms.InputTag( 'simRpcTriggerDigis', 'RPCf' )
# This is for the upgrade
# BMTF
process.simBmtfDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('bmtfDigis')
# TwinMux
process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
# OMTF
process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
process.simOmtfDigis.srcCSC = cms.InputTag('csctfDigis')
process.simOmtfDigis.srcDTPh = cms.InputTag('bmtfDigis')
process.simOmtfDigis.srcDTTh = cms.InputTag('bmtfDigis')
# EMTF
process.simEmtfDigis.CSCInput = cms.InputTag('emtfStage2Digis')
process.simEmtfDigis.RPCInput = cms.InputTag('muonRPCDigis')
# Calo Layer1
process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
# - Sequences
process.L1TMuonTriggerPrimitives = cms.Sequence(process.simCscTriggerPrimitiveDigis + process.simDtTriggerPrimitiveDigis + process.simTwinMuxDigisForDttf)
process.L1TReEmul = cms.Sequence(process.L1TMuonTriggerPrimitives + process.simCsctfTrackDigis + process.simCsctfDigis + process.simDttfDigis + process.simRpcTriggerDigis + process.simGmtDigis + process.muonLegacyInStage2FormatDigis)
process.load('L1Trigger.L1TMuon.simMuonQualityAdjusterDigis_cfi')
process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.simTwinMuxDigis + process.simBmtfDigis + process.simEmtfDigis + process.simOmtfDigis + process.simGmtCaloSumDigis + process.simMuonQualityAdjusterDigis + process.simGmtStage2Digis)
process.L1TReEmul = cms.Sequence( process.L1TReEmul + process.SimL1TechnicalTriggers + process.SimL1TGlobal )
if not hasattr(process, 'L1TReEmulPath'):
process.L1TReEmulPath = cms.Path(process.L1TReEmul)
process.schedule.append(process.L1TReEmulPath)
print("# L1TReEmul sequence: ")
print("# {0}".format(process.L1TReEmul))
print("# {0}".format(process.schedule))
return process