/
customizeHGCalPandora_cff.py
479 lines (438 loc) · 29.7 KB
/
customizeHGCalPandora_cff.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
import FWCore.ParameterSet.Config as cms
from SLHCUpgradeSimulations.Configuration.postLS1Customs import customisePostLS1
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE import customise as customiseBE
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5D import customise as customiseBE5D
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5DPixel10D import customise as customiseBE5DPixel10D
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5DPixel10DLHCC import customise as customiseBE5DPixel10DLHCC
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5DPixel10Ddev import customise as customiseBE5DPixel10Ddev
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE import l1EventContent as customise_ev_BE
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5D import l1EventContent as customise_ev_BE5D
from SLHCUpgradeSimulations.Configuration.phase2TkCustomsBE5DPixel10D import l1EventContent as customise_ev_BE5DPixel10D
from SLHCUpgradeSimulations.Configuration.phase1TkCustomsPixel10D import customise as customisePhase1TkPixel10D
from SLHCUpgradeSimulations.Configuration.combinedCustoms_TTI import customise as customiseTTI
from SLHCUpgradeSimulations.Configuration.combinedCustoms_TTI import l1EventContent_TTI as customise_ev_l1tracker
from SLHCUpgradeSimulations.Configuration.combinedCustoms_TTI import l1EventContent_TTI_forHLT
from SLHCUpgradeSimulations.Configuration.customise_mixing import customise_NoCrossing
from SLHCUpgradeSimulations.Configuration.phase1TkCustoms import customise as customisePhase1Tk
from SLHCUpgradeSimulations.Configuration.phase1TkCustomsdev import customise as customisePhase1Tkdev
from SLHCUpgradeSimulations.Configuration.HCalCustoms import customise_HcalPhase1, customise_HcalPhase0, customise_HcalPhase2
from SLHCUpgradeSimulations.Configuration.gemCustoms import customise2019 as customise_gem2019
from SLHCUpgradeSimulations.Configuration.gemCustoms import customise2023 as customise_gem2023
from SLHCUpgradeSimulations.Configuration.me0Customs import customise as customise_me0
from SLHCUpgradeSimulations.Configuration.rpcCustoms import customise as customise_rpc
from SLHCUpgradeSimulations.Configuration.fastsimCustoms import customiseDefault as fastCustomiseDefault
from SLHCUpgradeSimulations.Configuration.fastsimCustoms import customisePhase2 as fastCustomisePhase2
from SLHCUpgradeSimulations.Configuration.customise_mixing import customise_noPixelDataloss as cNoPixDataloss
from SLHCUpgradeSimulations.Configuration.customise_ecalTime import cust_ecalTime
from SLHCUpgradeSimulations.Configuration.customise_shashlikTime import cust_shashlikTime
import SLHCUpgradeSimulations.Configuration.aging as aging
import SLHCUpgradeSimulations.Configuration.jetCustoms as jetCustoms
def cust_2023HGCalPandora_common(process):
process=customisePostLS1(process)
process=customiseBE5DPixel10D(process)
process=customise_HcalPhase2(process)
process=customise_ev_BE5DPixel10D(process)
process=customise_gem2023(process)
process=customise_rpc(process)
process=jetCustoms.customise_jets(process)
if hasattr(process,'L1simulation_step'):
process.simEcalTriggerPrimitiveDigis.BarrelOnly = cms.bool(True)
if hasattr(process,'digitisation_step'):
process.mix.digitizers.ecal.accumulatorType = cms.string('EcalPhaseIIDigiProducer')
process.load('SimGeneral.MixingModule.hgcalDigitizer_cfi')
process.mix.digitizers.hgceeDigitizer=process.hgceeDigitizer
process.mix.digitizers.hgchebackDigitizer=process.hgchebackDigitizer
process.mix.digitizers.hgchefrontDigitizer=process.hgchefrontDigitizer
# Also need to tell the MixingModule to make the correct collections available from
# the pileup, even if not creating CrossingFrames.
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgceeDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgchebackDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgchefrontDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.subdets.append( process.hgceeDigitizer.hitCollection.value() )
process.mix.mixObjects.mixCH.subdets.append( process.hgchebackDigitizer.hitCollection.value() )
process.mix.mixObjects.mixCH.subdets.append( process.hgchefrontDigitizer.hitCollection.value() )
if hasattr(process,'raw2digi_step'):
process.ecalDigis.FEDs = cms.vint32(
# EE-:
#601, 602, 603, 604, 605,
#606, 607, 608, 609,
# EB-:
610, 611, 612, 613, 614, 615,
616, 617, 618, 619, 620, 621,
622, 623, 624, 625, 626, 627,
# EB+:
628, 629, 630, 631, 632, 633,
634, 635, 636, 637, 638, 639,
640, 641, 642, 643, 644, 645,
# EE+:
#646, 647, 648, 649, 650,
#651, 652, 653, 654
)
print "RAW2DIGI only for EB FEDs"
if hasattr(process,'reconstruction_step'):
process.particleFlowRecHitHGCNoEB = cms.Sequence(process.particleFlowRecHitHGCEE+process.particleFlowRecHitHGCHEF)
process.particleFlowClusterHGCNoEB = cms.Sequence(process.particleFlowClusterHGCEE+process.particleFlowClusterHGCHEF)
process.particleFlowCluster += process.particleFlowRecHitHGCNoEB
process.particleFlowCluster += process.particleFlowClusterHGCNoEB
if hasattr(process,'particleFlowSuperClusterECAL'):
process.particleFlowSuperClusterHGCEE = process.particleFlowSuperClusterECAL.clone()
process.particleFlowSuperClusterHGCEE.useHGCEmPreID = cms.bool(True)
process.particleFlowSuperClusterHGCEE.PFClusters = cms.InputTag('particleFlowClusterHGCEE')
process.particleFlowSuperClusterHGCEE.use_preshower = cms.bool(False)
process.particleFlowSuperClusterHGCEE.PFSuperClusterCollectionEndcapWithPreshower = cms.string('')
process.particleFlowCluster += process.particleFlowSuperClusterHGCEE
if hasattr(process,'ecalDrivenElectronSeeds'):
process.ecalDrivenElectronSeeds.endcapSuperClusters = cms.InputTag('particleFlowSuperClusterHGCEE')
process.ecalDrivenElectronSeeds.SeedConfiguration.endcapHCALClusters = cms.InputTag('particleFlowClusterHGCHEF')
process.ecalDrivenElectronSeeds.SeedConfiguration.hOverEMethodEndcap = cms.int32(3)
process.ecalDrivenElectronSeeds.SeedConfiguration.hOverEConeSizeEndcap = cms.double(0.087)
process.ecalDrivenElectronSeeds.SeedConfiguration.maxHOverEEndcaps = cms.double(0.1)
process.ecalDrivenElectronSeeds.SeedConfiguration.z2MinB = cms.double(-0.15)
process.ecalDrivenElectronSeeds.SeedConfiguration.z2MaxB = cms.double(0.15)
if hasattr(process,'ecalDrivenGsfElectrons'):
process.ecalDrivenGsfElectrons.hOverEMethodEndcap = cms.int32(3)
process.ecalDrivenGsfElectrons.hOverEConeSizeEndcap = cms.double(0.087)
process.ecalDrivenGsfElectrons.maxDeltaEtaEndcaps = cms.double(0.015)
process.ecalDrivenGsfElectrons.hcalEndcapClusters = cms.InputTag('particleFlowClusterHGCHEF')
if hasattr(process,'gsfElectrons'):
process.gsfElectrons.hOverEMethodEndcap = cms.int32(3)
process.gsfElectrons.hOverEConeSizeEndcap = cms.double(0.087)
process.gsfElectrons.maxDeltaEtaEndcaps = cms.double(0.015)
process.gsfElectrons.hcalEndcapClusters = cms.InputTag('particleFlowClusterHGCHEF')
# load pandora customization (note we have removed HGC clusters entirely from standard ParticleFlow
# doing this)
process.load('RecoParticleFlow.PandoraTranslator.HGCalTrackCollection_cfi')
process.load('RecoParticleFlow.PandoraTranslator.runPandora_cfi')
process.pandorapfanew.pf_electron_output_col = process.particleFlowTmp.pf_electron_output_col
process.particleFlowBlock.elementImporters[5].source = cms.InputTag('HGCalTrackCollection:TracksNotInHGCal')
process.pandoraSequence = cms.Sequence(process.HGCalTrackCollection*
process.particleFlowBlock*
process.pandorapfanew)
process.particleFlowReco.replace(process.particleFlowBlock,process.pandoraSequence)
process.particleFlowBarrel = process.particleFlowTmp.clone()
process.particleFlowTmp = cms.EDProducer(
"PFCandidateListMerger",
src = cms.VInputTag("particleFlowBarrel",
"pandorapfanew"),
src1 = cms.VInputTag("particleFlowBarrel:"+str(process.particleFlowTmp.pf_electron_output_col),
"pandorapfanew:"+str(process.particleFlowTmp.pf_electron_output_col)),
label1 = process.particleFlowTmp.pf_electron_output_col
)
process.mergedParticleFlowSequence = cms.Sequence(process.particleFlowBarrel*process.particleFlowTmp)
process.particleFlowReco.replace(process.particleFlowTmp,process.mergedParticleFlowSequence)
#mod event content
process.load('RecoLocalCalo.Configuration.hgcalLocalReco_EventContent_cff')
if hasattr(process,'FEVTDEBUGHLTEventContent'):
process.FEVTDEBUGHLTEventContent.outputCommands.extend(process.hgcalLocalRecoFEVT.outputCommands)
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_particleFlowSuperClusterHGCEE_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_pandorapfanew_*_*')
if hasattr(process,'RECOSIMEventContent'):
process.RECOSIMEventContent.outputCommands.extend(process.hgcalLocalRecoFEVT.outputCommands)
process.RECOSIMEventContent.outputCommands.append('keep *_particleFlowSuperClusterHGCEE_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_pandorapfanew_*_*')
return process
def cust_2023HGCalPandoraNoExtPix_common(process):
process=customisePostLS1(process)
process=customiseBE5D(process)
process=customise_HcalPhase2(process)
process=customise_ev_BE5D(process)
process=customise_gem2023(process)
process=customise_rpc(process)
process=jetCustoms.customise_jets(process)
if hasattr(process,'L1simulation_step'):
process.simEcalTriggerPrimitiveDigis.BarrelOnly = cms.bool(True)
if hasattr(process,'digitisation_step'):
process.mix.digitizers.ecal.accumulatorType = cms.string('EcalPhaseIIDigiProducer')
process.load('SimGeneral.MixingModule.hgcalDigitizer_cfi')
process.mix.digitizers.hgceeDigitizer=process.hgceeDigitizer
process.mix.digitizers.hgchebackDigitizer=process.hgchebackDigitizer
process.mix.digitizers.hgchefrontDigitizer=process.hgchefrontDigitizer
# Also need to tell the MixingModule to make the correct collections available from
# the pileup, even if not creating CrossingFrames.
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgceeDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgchebackDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.input.append( cms.InputTag("g4SimHits",process.hgchefrontDigitizer.hitCollection.value()) )
process.mix.mixObjects.mixCH.subdets.append( process.hgceeDigitizer.hitCollection.value() )
process.mix.mixObjects.mixCH.subdets.append( process.hgchebackDigitizer.hitCollection.value() )
process.mix.mixObjects.mixCH.subdets.append( process.hgchefrontDigitizer.hitCollection.value() )
if hasattr(process,'raw2digi_step'):
process.ecalDigis.FEDs = cms.vint32(
# EE-:
#601, 602, 603, 604, 605,
#606, 607, 608, 609,
# EB-:
610, 611, 612, 613, 614, 615,
616, 617, 618, 619, 620, 621,
622, 623, 624, 625, 626, 627,
# EB+:
628, 629, 630, 631, 632, 633,
634, 635, 636, 637, 638, 639,
640, 641, 642, 643, 644, 645,
# EE+:
#646, 647, 648, 649, 650,
#651, 652, 653, 654
)
print "RAW2DIGI only for EB FEDs"
if hasattr(process,'reconstruction_step'):
process.particleFlowRecHitHGCNoEB = cms.Sequence(process.particleFlowRecHitHGCEE+process.particleFlowRecHitHGCHEF)
process.particleFlowClusterHGCNoEB = cms.Sequence(process.particleFlowClusterHGCEE+process.particleFlowClusterHGCHEF)
process.particleFlowCluster += process.particleFlowRecHitHGCNoEB
process.particleFlowCluster += process.particleFlowClusterHGCNoEB
if hasattr(process,'particleFlowSuperClusterECAL'):
process.particleFlowSuperClusterHGCEE = process.particleFlowSuperClusterECAL.clone()
process.particleFlowSuperClusterHGCEE.useHGCEmPreID = cms.bool(True)
process.particleFlowSuperClusterHGCEE.PFClusters = cms.InputTag('particleFlowClusterHGCEE')
process.particleFlowSuperClusterHGCEE.use_preshower = cms.bool(False)
process.particleFlowSuperClusterHGCEE.PFSuperClusterCollectionEndcapWithPreshower = cms.string('')
process.particleFlowCluster += process.particleFlowSuperClusterHGCEE
if hasattr(process,'ecalDrivenElectronSeeds'):
process.ecalDrivenElectronSeeds.endcapSuperClusters = cms.InputTag('particleFlowSuperClusterHGCEE')
process.ecalDrivenElectronSeeds.SeedConfiguration.endcapHCALClusters = cms.InputTag('particleFlowClusterHGCHEF')
process.ecalDrivenElectronSeeds.SeedConfiguration.hOverEMethodEndcap = cms.int32(3)
process.ecalDrivenElectronSeeds.SeedConfiguration.hOverEConeSizeEndcap = cms.double(0.087)
process.ecalDrivenElectronSeeds.SeedConfiguration.maxHOverEEndcaps = cms.double(0.1)
process.ecalDrivenElectronSeeds.SeedConfiguration.z2MinB = cms.double(-0.15)
process.ecalDrivenElectronSeeds.SeedConfiguration.z2MaxB = cms.double(0.15)
if hasattr(process,'ecalDrivenGsfElectrons'):
process.ecalDrivenGsfElectrons.hOverEMethodEndcap = cms.int32(3)
process.ecalDrivenGsfElectrons.hOverEConeSizeEndcap = cms.double(0.087)
process.ecalDrivenGsfElectrons.maxDeltaEtaEndcaps = cms.double(0.015)
process.ecalDrivenGsfElectrons.hcalEndcapClusters = cms.InputTag('particleFlowClusterHGCHEF')
if hasattr(process,'gsfElectrons'):
process.gsfElectrons.hOverEMethodEndcap = cms.int32(3)
process.gsfElectrons.hOverEConeSizeEndcap = cms.double(0.087)
process.gsfElectrons.maxDeltaEtaEndcaps = cms.double(0.015)
process.gsfElectrons.hcalEndcapClusters = cms.InputTag('particleFlowClusterHGCHEF')
# load pandora customization (note we have removed HGC clusters entirely from standard ParticleFlow
# doing this)
process.load('RecoParticleFlow.PandoraTranslator.HGCalTrackCollection_cfi')
process.load('RecoParticleFlow.PandoraTranslator.runPandora_cfi')
process.pandorapfanew.pf_electron_output_col = process.particleFlowTmp.pf_electron_output_col
process.particleFlowBlock.elementImporters[5].source = cms.InputTag('HGCalTrackCollection:TracksNotInHGCal')
process.pandoraSequence = cms.Sequence(process.HGCalTrackCollection*
process.particleFlowBlock*
process.pandorapfanew)
process.particleFlowReco.replace(process.particleFlowBlock,process.pandoraSequence)
process.particleFlowBarrel = process.particleFlowTmp.clone()
process.particleFlowTmp = cms.EDProducer(
"PFCandidateListMerger",
src = cms.VInputTag("particleFlowBarrel",
"pandorapfanew"),
src1 = cms.VInputTag("particleFlowBarrel:"+str(process.particleFlowTmp.pf_electron_output_col),
"pandorapfanew:"+str(process.particleFlowTmp.pf_electron_output_col)),
label1 = process.particleFlowTmp.pf_electron_output_col
)
process.mergedParticleFlowSequence = cms.Sequence(process.particleFlowBarrel*process.particleFlowTmp)
process.particleFlowReco.replace(process.particleFlowTmp,process.mergedParticleFlowSequence)
#mod event content
process.load('RecoLocalCalo.Configuration.hgcalLocalReco_EventContent_cff')
if hasattr(process,'FEVTDEBUGHLTEventContent'):
process.FEVTDEBUGHLTEventContent.outputCommands.extend(process.hgcalLocalRecoFEVT.outputCommands)
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_particleFlowSuperClusterHGCEE_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_pandorapfanew_*_*')
if hasattr(process,'RECOSIMEventContent'):
process.RECOSIMEventContent.outputCommands.extend(process.hgcalLocalRecoFEVT.outputCommands)
process.RECOSIMEventContent.outputCommands.append('keep *_particleFlowSuperClusterHGCEE_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_pandorapfanew_*_*')
return process
def cust_2023HGCalPandoraMuon(process):
process = cust_2023HGCalPandora_common(process)
process = customise_me0(process)
return process
def mask_layer(mask,layer):
mask[layer-1] = 0
def mask_layers(layer_mask,masked_layers):
for det in layer_mask.keys():
for layer in masked_layers[det]:
mask_layer(layer_mask[det],layer)
def propagate_layerdropping(process,layer_mask):
process.pandorapfanew.DoLayerMasking = cms.bool(True)
process.pandorapfanew.LayerMaskingParams = cms.PSet( EE_layerMask = cms.vuint32(layer_mask['EE']),
HEF_layerMask = cms.vuint32(layer_mask['HEF']),
HEB_layerMask = cms.vuint32(layer_mask['HEB']) )
for i in range(3): #reset HGC PFRecHit masking
process.particleFlowRecHitHGCEE.producers[i].qualityTests[1].masking_info = process.pandorapfanew.LayerMaskingParams
process.particleFlowClusterHGCEE.initialClusteringStep.emEnergyCalibration.masking_info = process.pandorapfanew.LayerMaskingParams
process.particleFlowClusterHGCEE.initialClusteringStep.hadEnergyCalibration.masking_info = process.pandorapfanew.LayerMaskingParams
return process
def cust_2023HGCalPandoraMuonScopeDoc_ee28_fh12(process):
layer_mask = {}
layer_mask['EE'] = [1 for x in range(30)]
layer_mask['HEF'] = [1 for x in range(12)]
layer_mask['HEB'] = [1 for x in range(12)]
masked_layers = {}
masked_layers['EE'] = []
masked_layers['HEF'] = []
masked_layers['HEB'] = []
mask_layers(layer_mask,masked_layers)
process = cust_2023HGCalPandora_common(process)
process = customise_me0(process)
if hasattr(process,'reconstruction_step'):
process = propagate_layerdropping(process,layer_mask)
return process
def cust_2023HGCalPandoraMuonScopeDoc_ee24_fh11(process):
layer_mask = {}
layer_mask['EE'] = [1 for x in range(30)]
layer_mask['HEF'] = [1 for x in range(12)]
layer_mask['HEB'] = [1 for x in range(12)]
masked_layers = {}
masked_layers['EE'] = [2, 11, 16 , 26, 28]
masked_layers['HEF'] = [11]
masked_layers['HEB'] = []
mask_layers(layer_mask,masked_layers)
process = cust_2023HGCalPandora_common(process)
process = customise_me0(process)
if hasattr(process,'reconstruction_step'):
process = propagate_layerdropping(process,layer_mask)
return process
def cust_2023HGCalPandoraMuonScopeDoc_ee18_fh9(process):
layer_mask = {}
layer_mask['EE'] = [1 for x in range(30)]
layer_mask['HEF'] = [1 for x in range(12)]
layer_mask['HEB'] = [1 for x in range(12)]
masked_layers = {}
masked_layers['EE'] = [2, 4, 6, 8, 11, 13, 16, 19, 21, 24, 26, 28]
masked_layers['HEF'] = [7, 9, 11]
masked_layers['HEB'] = []
mask_layers(layer_mask,masked_layers)
process = cust_2023HGCalPandora_common(process)
process = customise_me0(process)
if hasattr(process,'reconstruction_step'):
process = propagate_layerdropping(process,layer_mask)
return process
def cust_2023HGCalNoExtPix_ee18_fh9(process):
layer_mask = {}
layer_mask['EE'] = [1 for x in range(30)]
layer_mask['HEF'] = [1 for x in range(12)]
layer_mask['HEB'] = [1 for x in range(12)]
masked_layers = {}
masked_layers['EE'] = [2, 4, 6, 8, 11, 13, 16, 19, 21, 24, 26, 28]
masked_layers['HEF'] = [7, 9, 11]
masked_layers['HEB'] = []
mask_layers(layer_mask,masked_layers)
process = cust_2023HGCalPandoraNoExtPix_common(process)
process = customise_me0(process)
if hasattr(process,'reconstruction_step'):
process = propagate_layerdropping(process,layer_mask)
return process
def cust_hgcalTime_common(process):
if hasattr(process,'g4SimHits'):
process.g4SimHits.HGCSD.TimeSliceUnit = cms.double(1e-3) # 1ps in ns
return process
def cust_hgcalPerfectTime(process):
cust_hgcalTime_common(process)
if hasattr(process,'digitisation_step'):
process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcResolutionInPs = cms.double( 0.001 )
process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcResolutionInPs = cms.double( 0.001 )
return process
#default of 50ps time resolution
def cust_hgcalTime(process):
cust_hgcalTime_common(process)
if hasattr(process,'digitisation_step'):
process.mix.digitizers.hgceeDigitizer.digiCfg.feCfg.tdcResolutionInPs = cms.double( 50.0 )
process.mix.digitizers.hgchefrontDigitizer.digiCfg.feCfg.tdcResolutionInPs = cms.double( 50.0 )
return process
def cust_2023HGCalPandoraMuonFastTime(process):
process = cust_2023HGCalPandora_common(process)
process = cust_ecalTime(process)
process = cust_hgcalTime(process)
if hasattr(process,'RECOSIMEventContent'):
process.RECOSIMEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.RECOSIMEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.RECOSIMEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'FEVTDEBUGEventContent'):
process.FEVTDEBUGEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'FEVTDEBUGHLTEventContent'):
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'digitisation_step'):
process.mix.digitizers.mergedtruth.createInitialVertexCollection = True
if hasattr(process,'reconstruction_step'):
process.load("SimTracker.TrackAssociation.quickTrackAssociatorByHits_cfi")
process.load("RecoParticleFlow.FastTiming.trackTimeValueMapProducer_cfi")
process.load("RecoParticleFlow.FastTiming.ecalBarrelClusterFastTimer_cfi")
process.offlinePrimaryVertices1D = process.offlinePrimaryVertices.clone()
process.offlinePrimaryVertices1D.TkFilterParameters.minPt = cms.double(1.0)
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(False), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(1.0)
process.particleFlowReco = cms.Sequence(process.trackTimeValueMapProducer+process.offlinePrimaryVertices1D+process.offlinePrimaryVertices4D+process.particleFlowReco)
process.RandomNumberGeneratorService.trackTimeValueMapProducer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
)
process.RandomNumberGeneratorService.ecalBarrelClusterFastTimer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
)
process.ecalDetailedTimeRecHit.correctForVertexZPosition=False
process.reconstruction_step += process.ecalBarrelClusterFastTimer
# This next part limits the pileup to be in time only, as
# requested by the fast timing group
if hasattr(process,'mix'):
process.mix.minBunch = 0
process.mix.maxBunch = 0
if hasattr(process.mix.digitizers,'mergedtruth'):
process.mix.digitizers.mergedtruth.select.signalOnlyTP = cms.bool(False)
process.mix.digitizers.mergedtruth.maximumPreviousBunchCrossing = cms.uint32(5)
process.mix.digitizers.mergedtruth.maximumSubsequentBunchCrossing = cms.uint32(9999)
process.mix.digitizers.mergedtruth.createInitialVertexCollection = cms.bool(True)
return process
def cust_2023HGCalPandoraMuonPerfectFastTime(process):
process = cust_2023HGCalPandora_common(process)
process = cust_ecalTime(process)
process = cust_hgcalPerfectTime(process)
if hasattr(process,'RECOSIMEventContent'):
process.RECOSIMEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.RECOSIMEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.RECOSIMEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.RECOSIMEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'FEVTDEBUGEventContent'):
process.FEVTDEBUGEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.FEVTDEBUGEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'FEVTDEBUGHLTEventContent'):
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_mix_MergedTrackTruth_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_mix_InitialVertices_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_trackTimeValueMapProducer_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_offlinePrimaryVertices*D_*_*')
process.FEVTDEBUGHLTEventContent.outputCommands.append('keep *_ecalBarrelClusterFastTimer_*_*')
if hasattr(process,'digitisation_step'):
process.mix.digitizers.mergedtruth.createInitialVertexCollection = True
if hasattr(process,'reconstruction_step'):
process.load("SimTracker.TrackAssociation.quickTrackAssociatorByHits_cfi")
process.load("RecoParticleFlow.FastTiming.trackTimeValueMapProducer_cfi")
process.load("RecoParticleFlow.FastTiming.ecalBarrelClusterFastTimer_cfi")
process.offlinePrimaryVertices1D = process.offlinePrimaryVertices.clone()
process.offlinePrimaryVertices1D.TkFilterParameters.minPt = cms.double(1.0)
process.offlinePrimaryVertices4D = process.offlinePrimaryVertices.clone( verbose = cms.untracked.bool(False), TkClusParameters = process.DA2DParameters )
process.offlinePrimaryVertices4D.TkFilterParameters.minPt = cms.double(1.0)
process.particleFlowReco = cms.Sequence(process.trackTimeValueMapProducer+process.offlinePrimaryVertices1D+process.offlinePrimaryVertices4D+process.particleFlowReco)
process.RandomNumberGeneratorService.trackTimeValueMapProducer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
)
process.RandomNumberGeneratorService.ecalBarrelClusterFastTimer = cms.PSet(
initialSeed = cms.untracked.uint32(1234), engineName = cms.untracked.string('TRandom3')
)
process.ecalDetailedTimeRecHit.correctForVertexZPosition=False
process.reconstruction_step += process.ecalBarrelClusterFastTimer
# This next part limits the pileup to be in time only, as
# requested by the fast timing group
if hasattr(process,'mix'):
process.mix.minBunch = 0
process.mix.maxBunch = 0
if hasattr(process.mix.digitizers,'mergedtruth'):
process.mix.digitizers.mergedtruth.select.signalOnlyTP = cms.bool(False)
process.mix.digitizers.mergedtruth.maximumPreviousBunchCrossing = cms.uint32(5)
process.mix.digitizers.mergedtruth.maximumSubsequentBunchCrossing = cms.uint32(9999)
process.mix.digitizers.mergedtruth.createInitialVertexCollection = cms.bool(True)
return process