CMS 3D CMS Logo

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