CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
postLS1Customs.py
Go to the documentation of this file.
2 
3 from RecoTracker.Configuration.customiseForRunI import customiseForRunI
4 
6 
7  # deal with L1 Emulation separately
8  from L1Trigger.L1TCommon.customsPostLS1 import customiseSimL1EmulatorForStage1
9  process = customiseSimL1EmulatorForStage1(process)
10 
11  # deal with CSC separately
12  from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_PostLS1
13  process = customise_csc_PostLS1(process)
14 
15  # deal with FastSim separately
16  from SLHCUpgradeSimulations.Configuration.fastSimCustoms import customise_fastSimPostLS1
17  process = customise_fastSimPostLS1(process)
18 
19  # all the rest
20  if hasattr(process,'g4SimHits'):
21  process = customise_Sim(process)
22  if hasattr(process,'DigiToRaw'):
23  process = customise_DigiToRaw(process)
24  if hasattr(process,'RawToDigi'):
25  process = customise_RawToDigi(process)
26  if hasattr(process,'reconstruction'):
27  process = customise_Reco(process)
28  if hasattr(process,'digitisation_step') or ( hasattr(process,'mix') and hasattr(process.mix,'digitizers')):
29  process = customise_Digi_Common(process)
30  if hasattr(process,'HLTSchedule'):
31  process = customise_HLT(process)
32  if hasattr(process,'L1simulation_step'):
33  process = customise_L1Emulator(process)
34  if hasattr(process,'dqmoffline_step'):
35  process = customise_DQM(process)
36  if hasattr(process,'dqmHarvesting'):
37  process = customise_harvesting(process)
38  if hasattr(process,'validation_step'):
39  process = customise_Validation(process)
40  if hasattr(process,'datamixing_step'):
41  process = customise_DataMix(process)
42 
43  return process
44 
45 
46 def customisePostLS1(process):
47 
48  # common customisation
49  process = customisePostLS1_Common(process)
50 
51  # 25ns specific customisation
52  if hasattr(process,'digitisation_step'):
53  process = customise_Digi_25ns(process)
54  if hasattr(process,'dqmoffline_step'):
55  process = customise_DQM_25ns(process)
56 
57  return process
58 
59 
61 
62  # common customisations
63  process = customisePostLS1_Common(process)
64 
65  # 50ns specific customisation
66  if hasattr(process,'digitisation_step'):
67  process = customise_Digi_50ns(process)
68 
69  return process
70 
71 
72 def customisePostLS1_50ns(process):
73 
74  # common customisations
75  process = customisePostLS1_Common(process)
76 
77  # 50ns specific customisation
78  if hasattr(process,'digitisation_step'):
79  process = customise_Digi_50ns(process)
80 
81  return process
82 
83 
84 def customisePostLS1_HI(process):
85 
86  # common customisation
87  process = customisePostLS1_Common(process)
88 
89  # HI Specific additional customizations:
90  from L1Trigger.L1TCommon.customsPostLS1 import customiseSimL1EmulatorForPostLS1_Additional_HI
92 
93  # HI L1Menu:
94  #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_CollisionsHeavyIons2015_v0
95  #process = L1Menu_CollisionsHeavyIons2015_v0(process)
96 
97  return process
98 
99 def customisePostLS1_B0T(process):
100  # 50ns only
101 
102  process=customisePostLS1_50ns(process)
103  process=customiseForRunI(process)
104 
105  return process
106 
108  # 50ns only
109 
110  process=customisePostLS1_lowPU(process)
111  process=customiseForRunI(process)
112 
113  return process
114 
115 
116 def digiEventContent(process):
117  #extend the event content
118 
119  alist=['RAWDEBUG','FEVTDEBUG','FEVTDEBUGHLT','GENRAW','RAWSIMHLT','FEVT']
120  for a in alist:
121  b = a + 'output'
122  if hasattr(process,b):
123  getattr(process,b).outputCommands.append('keep *_simMuonCSCDigis_*_*')
124  getattr(process,b).outputCommands.append('keep *_simMuonRPCDigis_*_*')
125  getattr(process,b).outputCommands.append('keep *_simHcalUnsuppressedDigis_*_*')
126 
127  return process
128 
129 
130 def customise_DQM(process):
131  #process.dqmoffline_step.remove(process.jetMETAnalyzer)
132  # Turn off flag of gangedME11a
133  process.l1tCsctf.gangedME11a = cms.untracked.bool(False)
134  # Turn off "low bias voltage" region in HCAL noise filters
135  if hasattr(process,'HBHENoiseFilterResultProducer'):
136  process.HBHENoiseFilterResultProducer.IgnoreTS4TS5ifJetInLowBVRegion = cms.bool(False)
137  return process
138 
139 
140 def customise_DQM_25ns(process):
141  # Switch the default decision of the HCAL noise filter
142  if hasattr(process,'HBHENoiseFilterResultProducer'):
143  process.HBHENoiseFilterResultProducer.defaultDecision = cms.string("HBHENoiseFilterResultRun2Loose")
144  return process
145 
146 
147 def customise_Validation(process):
148  #process.validation_step.remove(process.PixelTrackingRecHitsValid)
149  # We don't run the HLT
150  #process.validation_step.remove(process.HLTSusyExoVal)
151  #process.validation_step.remove(process.hltHiggsValidator)
152  return process
153 
154 
155 def customise_Sim(process):
156  # enable 2015 HF shower library
157  process.g4SimHits.HFShowerLibrary.FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_npmt_noatt_eta4_16en_v3.root'
158  return process
159 
160 def customise_New_HCAL(process):
161  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
162  if hasattr(process.mix.digitizers,'hcal'):
163  process.mix.digitizers.hcal.minFCToDelay=5.
164  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf1'):
165  process.mix.digitizers.hcal.hf1.samplingFactor = cms.double(0.67)
166  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf2'):
167  process.mix.digitizers.hcal.hf2.samplingFactor = cms.double(0.67)
168 
169  if hasattr(process,'mixData'):
170 # if hasattr(process.mixData.digitizers,'hcal'):
171 # process.mixData.digitizers.hcal.minFCToDelay=5.
172  if hasattr(process.mixData,'hf1'):
173  process.mixData.hf1.samplingFactor = cms.double(0.67)
174  if hasattr(process.mixData,'hf2'):
175  process.mixData.hf2.samplingFactor = cms.double(0.67)
176 
177  if hasattr(process,'hltHbhereco'):
178  process.hltHbhereco.timeSlewPars = cms.vdouble( 12.2999, -2.19142, 0, 12.2999, -2.19142, 0, 12.2999, -2.19142, 0 )
179  process.hltHbhereco.respCorrM3 = cms.double( 0.95 )
180 
181  return process
182 
183 
185  process = digiEventContent(process)
186  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
187  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'ho'):
188  process.mix.digitizers.hcal.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16)
189  process.mix.digitizers.hcal.ho.siPMCode = cms.int32(1)
190  process.mix.digitizers.hcal.ho.pixels = cms.int32(2500)
191  process.mix.digitizers.hcal.ho.doSiPMSmearing = cms.bool(False)
192  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf1'):
193  process.mix.digitizers.hcal.hf1.samplingFactor = cms.double(0.60)
194  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf2'):
195  process.mix.digitizers.hcal.hf2.samplingFactor = cms.double(0.60)
196  return process
197 
198 def customise_DataMix(process):
199  if hasattr(process,'mixData'):
200  if hasattr(process.mixData,'ho'):
201  process.mixData.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16)
202  process.mixData.ho.siPMCode = cms.int32(1)
203  process.mixData.ho.pixels = cms.int32(2500)
204  process.mixData.ho.doSiPMSmearing = cms.bool(False)
205  if hasattr(process.mixData,'hf1'):
206  process.mixData.hf1.samplingFactor = cms.double(0.60)
207  if hasattr(process.mixData,'hf2'):
208  process.mixData.hf2.samplingFactor = cms.double(0.60)
209  return process
210 
211 
212 def customise_Digi_50ns(process):
213  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
214  if hasattr(process.mix.digitizers,'pixel'):
215  # pixel dynamic inefficency - 13TeV - 50ns case
216  process.mix.digitizers.pixel.theInstLumiScaleFactor = cms.double(246.4)
217  process.mix.digitizers.pixel.theLadderEfficiency_BPix1 = cms.vdouble(
218  0.979259,
219  0.976677,
220  0.979259,
221  0.976677,
222  0.979259,
223  0.976677,
224  0.979259,
225  0.976677,
226  0.979259,
227  0.976677,
228  0.979259,
229  0.976677,
230  0.979259,
231  0.976677,
232  0.979259,
233  0.976677,
234  0.979259,
235  0.976677,
236  0.979259,
237  0.976677,
238  )
239  process.mix.digitizers.pixel.theLadderEfficiency_BPix2 = cms.vdouble(
240  0.994321,
241  0.993944,
242  0.994321,
243  0.993944,
244  0.994321,
245  0.993944,
246  0.994321,
247  0.993944,
248  0.994321,
249  0.993944,
250  0.994321,
251  0.993944,
252  0.994321,
253  0.993944,
254  0.994321,
255  0.993944,
256  0.994321,
257  0.993944,
258  0.994321,
259  0.993944,
260  0.994321,
261  0.993944,
262  0.994321,
263  0.993944,
264  0.994321,
265  0.993944,
266  0.994321,
267  0.993944,
268  0.994321,
269  0.993944,
270  0.994321,
271  0.993944,
272  )
273  process.mix.digitizers.pixel.theLadderEfficiency_BPix3 = cms.vdouble(
274  0.996787,
275  0.996945,
276  0.996787,
277  0.996945,
278  0.996787,
279  0.996945,
280  0.996787,
281  0.996945,
282  0.996787,
283  0.996945,
284  0.996787,
285  0.996945,
286  0.996787,
287  0.996945,
288  0.996787,
289  0.996945,
290  0.996787,
291  0.996945,
292  0.996787,
293  0.996945,
294  0.996787,
295  0.996945,
296  0.996787,
297  0.996945,
298  0.996787,
299  0.996945,
300  0.996787,
301  0.996945,
302  0.996787,
303  0.996945,
304  0.996787,
305  0.996945,
306  0.996787,
307  0.996945,
308  0.996787,
309  0.996945,
310  0.996787,
311  0.996945,
312  0.996787,
313  0.996945,
314  0.996787,
315  0.996945,
316  0.996787,
317  0.996945,
318  )
319  if hasattr(process,'mixData'):
320  # pixel dynamic inefficency - 13TeV - 50ns case
321  process.mixData.theInstLumiScaleFactor = cms.double(246.4)
322  process.mixData.theLadderEfficiency_BPix1 = cms.vdouble(
323  0.979259,
324  0.976677,
325  0.979259,
326  0.976677,
327  0.979259,
328  0.976677,
329  0.979259,
330  0.976677,
331  0.979259,
332  0.976677,
333  0.979259,
334  0.976677,
335  0.979259,
336  0.976677,
337  0.979259,
338  0.976677,
339  0.979259,
340  0.976677,
341  0.979259,
342  0.976677,
343  )
344  process.mixData.theLadderEfficiency_BPix2 = cms.vdouble(
345  0.994321,
346  0.993944,
347  0.994321,
348  0.993944,
349  0.994321,
350  0.993944,
351  0.994321,
352  0.993944,
353  0.994321,
354  0.993944,
355  0.994321,
356  0.993944,
357  0.994321,
358  0.993944,
359  0.994321,
360  0.993944,
361  0.994321,
362  0.993944,
363  0.994321,
364  0.993944,
365  0.994321,
366  0.993944,
367  0.994321,
368  0.993944,
369  0.994321,
370  0.993944,
371  0.994321,
372  0.993944,
373  0.994321,
374  0.993944,
375  0.994321,
376  0.993944,
377  )
378  process.mixData.theLadderEfficiency_BPix3 = cms.vdouble(
379  0.996787,
380  0.996945,
381  0.996787,
382  0.996945,
383  0.996787,
384  0.996945,
385  0.996787,
386  0.996945,
387  0.996787,
388  0.996945,
389  0.996787,
390  0.996945,
391  0.996787,
392  0.996945,
393  0.996787,
394  0.996945,
395  0.996787,
396  0.996945,
397  0.996787,
398  0.996945,
399  0.996787,
400  0.996945,
401  0.996787,
402  0.996945,
403  0.996787,
404  0.996945,
405  0.996787,
406  0.996945,
407  0.996787,
408  0.996945,
409  0.996787,
410  0.996945,
411  0.996787,
412  0.996945,
413  0.996787,
414  0.996945,
415  0.996787,
416  0.996945,
417  0.996787,
418  0.996945,
419  0.996787,
420  0.996945,
421  0.996787,
422  0.996945,
423  )
424  return process
425 
426 
427 def customise_Digi_25ns(process):
428  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
429  if hasattr(process.mix.digitizers,'pixel'):
430  # pixel dynamic inefficency - 13TeV - 25ns case
431  process.mix.digitizers.pixel.theInstLumiScaleFactor = cms.double(364)
432  process.mix.digitizers.pixel.theLadderEfficiency_BPix1 = cms.vdouble(
433  1,
434  1,
435  1,
436  1,
437  1,
438  1,
439  1,
440  1,
441  1,
442  1,
443  1,
444  1,
445  1,
446  1,
447  1,
448  1,
449  1,
450  1,
451  1,
452  1,
453  )
454  process.mix.digitizers.pixel.theLadderEfficiency_BPix2 = cms.vdouble(
455  1,
456  1,
457  1,
458  1,
459  1,
460  1,
461  1,
462  1,
463  1,
464  1,
465  1,
466  1,
467  1,
468  1,
469  1,
470  1,
471  1,
472  1,
473  1,
474  1,
475  1,
476  1,
477  1,
478  1,
479  1,
480  1,
481  1,
482  1,
483  1,
484  1,
485  1,
486  1,
487  )
488  process.mix.digitizers.pixel.theLadderEfficiency_BPix3 = cms.vdouble(
489  1,
490  1,
491  1,
492  1,
493  1,
494  1,
495  1,
496  1,
497  1,
498  1,
499  1,
500  1,
501  1,
502  1,
503  1,
504  1,
505  1,
506  1,
507  1,
508  1,
509  1,
510  1,
511  1,
512  1,
513  1,
514  1,
515  1,
516  1,
517  1,
518  1,
519  1,
520  1,
521  1,
522  1,
523  1,
524  1,
525  1,
526  1,
527  1,
528  1,
529  1,
530  1,
531  1,
532  1,
533  )
534  process.mix.digitizers.pixel.theModuleEfficiency_BPix1 = cms.vdouble(
535  1,
536  1,
537  1,
538  1,
539  )
540  process.mix.digitizers.pixel.theModuleEfficiency_BPix2 = cms.vdouble(
541  1,
542  1,
543  1,
544  1,
545  )
546  process.mix.digitizers.pixel.theModuleEfficiency_BPix3 = cms.vdouble(
547  1,
548  1,
549  1,
550  1,
551  )
552  process.mix.digitizers.pixel.thePUEfficiency_BPix1 = cms.vdouble(
553  1.00023,
554  -3.18350e-06,
555  5.08503e-10,
556  -6.79785e-14,
557  )
558  process.mix.digitizers.pixel.thePUEfficiency_BPix2 = cms.vdouble(
559  9.99974e-01,
560  -8.91313e-07,
561  5.29196e-12,
562  -2.28725e-15,
563  )
564  process.mix.digitizers.pixel.thePUEfficiency_BPix3 = cms.vdouble(
565  1.00005,
566  -6.59249e-07,
567  2.75277e-11,
568  -1.62683e-15,
569  )
570  if hasattr(process,'mixData'):
571  # pixel dynamic inefficency - 13TeV - 25ns case
572  process.mixData.theInstLumiScaleFactor = cms.double(364)
573  process.mixData.theLadderEfficiency_BPix1 = cms.vdouble(
574  1,
575  1,
576  1,
577  1,
578  1,
579  1,
580  1,
581  1,
582  1,
583  1,
584  1,
585  1,
586  1,
587  1,
588  1,
589  1,
590  1,
591  1,
592  1,
593  1,
594  )
595  process.mixData.theLadderEfficiency_BPix2 = cms.vdouble(
596  1,
597  1,
598  1,
599  1,
600  1,
601  1,
602  1,
603  1,
604  1,
605  1,
606  1,
607  1,
608  1,
609  1,
610  1,
611  1,
612  1,
613  1,
614  1,
615  1,
616  1,
617  1,
618  1,
619  1,
620  1,
621  1,
622  1,
623  1,
624  1,
625  1,
626  1,
627  1,
628  )
629  process.mixData.theLadderEfficiency_BPix3 = cms.vdouble(
630  1,
631  1,
632  1,
633  1,
634  1,
635  1,
636  1,
637  1,
638  1,
639  1,
640  1,
641  1,
642  1,
643  1,
644  1,
645  1,
646  1,
647  1,
648  1,
649  1,
650  1,
651  1,
652  1,
653  1,
654  1,
655  1,
656  1,
657  1,
658  1,
659  1,
660  1,
661  1,
662  1,
663  1,
664  1,
665  1,
666  1,
667  1,
668  1,
669  1,
670  1,
671  1,
672  1,
673  1,
674  )
675  process.mixData.theModuleEfficiency_BPix1 = cms.vdouble(
676  1,
677  1,
678  1,
679  1,
680  )
681  process.mixData.theModuleEfficiency_BPix2 = cms.vdouble(
682  1,
683  1,
684  1,
685  1,
686  )
687  process.mixData.theModuleEfficiency_BPix3 = cms.vdouble(
688  1,
689  1,
690  1,
691  1,
692  )
693  process.mixData.thePUEfficiency_BPix1 = cms.vdouble(
694  1.00023,
695  -3.18350e-06,
696  5.08503e-10,
697  -6.79785e-14,
698  )
699  process.mixData.thePUEfficiency_BPix2 = cms.vdouble(
700  9.99974e-01,
701  -8.91313e-07,
702  5.29196e-12,
703  -2.28725e-15,
704  )
705  process.mixData.thePUEfficiency_BPix3 = cms.vdouble(
706  1.00005,
707  -6.59249e-07,
708  2.75277e-11,
709  -1.62683e-15,
710  )
711  return process
712 
713 
714 def customise_L1Emulator(process):
715  return process
716 
717 
718 def customise_RawToDigi(process):
719  process.RawToDigi.remove(process.gtEvmDigis)
720  return process
721 
722 
723 def customise_DigiToRaw(process):
724  return process
725 
726 
727 def customise_HLT(process):
728  return process
729 
730 
731 def customise_Reco(process):
732  #lowering HO threshold with SiPM
733  if hasattr(process,'particleFlowRecHitHO'):
734  for prod in process.particleFlowRecHitHO.producers:
735  prod.qualityTests = cms.VPSet(
736  cms.PSet(
737  name = cms.string("PFRecHitQTestThreshold"),
738  threshold = cms.double(0.05) # new threshold for SiPM HO
739  ),
740  cms.PSet(
741  name = cms.string("PFRecHitQTestHCALChannel"),
742  maxSeverities = cms.vint32(11),
743  cleaningThresholds = cms.vdouble(0.0),
744  flags = cms.vstring('Standard')
745  )
746  )
747 
748  #Lower Thresholds also for Clusters!!!
749 
750  for p in process.particleFlowClusterHO.seedFinder.thresholdsByDetector:
751  p.seedingThreshold = cms.double(0.08)
752 
753  for p in process.particleFlowClusterHO.initialClusteringStep.thresholdsByDetector:
754  p.gatheringThreshold = cms.double(0.05)
755 
756  for p in process.particleFlowClusterHO.pfClusterBuilder.recHitEnergyNorms:
757  p.recHitEnergyNorm = cms.double(0.05)
758 
759  process.particleFlowClusterHO.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
760  process.particleFlowClusterHO.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
761 
762  from RecoHI.Configuration.customise_PPwithHI import addHIIsolationProducer
763  process = addHIIsolationProducer(process)
764 
765  return process
766 
767 
768 def customise_harvesting(process):
769  #process.dqmHarvesting.remove(process.dataCertificationJetMET)
770  #process.dqmHarvesting.remove(process.sipixelEDAClient)
771  #process.dqmHarvesting.remove(process.sipixelCertification)
772  return (process)
773 
774 
775 def recoOutputCustoms(process):
776 
777  alist=['AODSIM','RECOSIM','FEVTSIM','FEVTDEBUG','FEVTDEBUGHLT','RECODEBUG','RAWRECOSIMHLT','RAWRECODEBUGHLT']
778  for a in alist:
779  b = a + 'output'
780  if hasattr(process,b):
781  getattr(process,b).outputCommands.append('keep *_simMuonCSCDigis_*_*')
782  getattr(process,b).outputCommands.append('keep *_simMuonRPCDigis_*_*')
783  getattr(process,b).outputCommands.append('keep *_simHcalUnsuppressedDigis_*_*')
784  getattr(process,b).outputCommands.append('keep *_rawDataCollector_*_*')
785  return process
def customisePostLS1_lowPU
def customisePostLS1_Common
def customiseSimL1EmulatorForPostLS1_Additional_HI
def customiseSimL1EmulatorForStage1
def customise_csc_PostLS1
Definition: muonCustoms.py:233
def customise_fastSimPostLS1
def customisePostLS1_B0T_lowPU