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.
1 import FWCore.ParameterSet.Config as cms
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  print """
48  #
49  # -- Warning! You are using a deprecated customisation function. --
50  #
51  # It will probably run fine, but the customisations you are getting may be out of date.
52  # You should update your configuration file by
53  # If using cmsDriver:
54  # 1) remove the "--customise SLHCUpgradeSimulations/Configuration/postLS1Customs.customisePostLS1" option
55  # 2) add the option "--era Run2_25ns"
56  # If using a pre-made configuration file:
57  # 1) remove or comment out the "process = customisePostLS1(process)" line.
58  # 2) add "from Configuration.StandardSequences.Eras import eras" to the TOP of the config file (above
59  # the process declaration).
60  # 3) add "eras.Run2_25ns" as a parameter to the process object, e.g. "process = cms.Process('HLT',eras.Run2_25ns)"
61  #
62  # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras
63  #
64  """
65  # common customisation
66  process = customisePostLS1_Common(process)
67 
68  # 25ns specific customisation
69  if hasattr(process,'digitisation_step'):
70  process = customise_Digi_25ns(process)
71  if hasattr(process,'dqmoffline_step'):
72  process = customise_DQM_25ns(process)
73 
74  return process
75 
76 
78 
79  # common customisations
80  process = customisePostLS1_Common(process)
81 
82  # 50ns specific customisation
83  if hasattr(process,'digitisation_step'):
84  process = customise_Digi_50ns(process)
85 
86  return process
87 
88 
89 def customisePostLS1_50ns(process):
90  print """
91  #
92  # -- Warning! You are using a deprecated customisation function. --
93  #
94  # It will probably run fine, but the customisations you are getting may be out of date.
95  # You should update your configuration file by
96  # If using cmsDriver:
97  # 1) remove the "--customise SLHCUpgradeSimulations/Configuration/postLS1Customs.customisePostLS1_50ns" option
98  # 2) add the option "--era Run2_50ns"
99  # If using a pre-made configuration file:
100  # 1) remove or comment out the "process = customisePostLS1_50ns(process)" line.
101  # 2) add "from Configuration.StandardSequences.Eras import eras" to the TOP of the config file (above
102  # the process declaration).
103  # 3) add "eras.Run2_50ns" as a parameter to the process object, e.g. "process = cms.Process('HLT',eras.Run2_50ns)"
104  #
105  # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras
106  #
107  """
108 
109  # common customisations
110  process = customisePostLS1_Common(process)
111 
112  # 50ns specific customisation
113  if hasattr(process,'digitisation_step'):
114  process = customise_Digi_50ns(process)
115 
116  return process
117 
118 
119 def customisePostLS1_HI(process):
120  print """
121  #
122  # -- Warning! You are using a deprecated customisation function. --
123  #
124  # It will probably run fine, but the customisations you are getting may be out of date.
125  # You should update your configuration file by
126  # If using cmsDriver:
127  # 1) remove the "--customise SLHCUpgradeSimulations/Configuration/postLS1Customs.customisePostLS1_HI" option
128  # 2) add the option "--era Run2_HI"
129  # If using a pre-made configuration file:
130  # 1) remove or comment out the "process = customisePostLS1_HI(process)" line.
131  # 2) add "from Configuration.StandardSequences.Eras import eras" to the TOP of the config file (above
132  # the process declaration).
133  # 3) add "eras.Run2_HI" as a parameter to the process object, e.g. "process = cms.Process('HLT',eras.Run2_HI)"
134  #
135  # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras
136  #
137  """
138 
139  # common customisation
140  process = customisePostLS1_Common(process)
141 
142  # HI Specific additional customizations:
143  from L1Trigger.L1TCommon.customsPostLS1 import customiseSimL1EmulatorForPostLS1_Additional_HI
145 
146  # HI L1Menu:
147  #from L1Trigger.Configuration.customise_overwriteL1Menu import L1Menu_CollisionsHeavyIons2015_v0
148  #process = L1Menu_CollisionsHeavyIons2015_v0(process)
149 
150  return process
151 
152 def customisePostLS1_B0T(process):
153  # 50ns only
154 
155  process=customisePostLS1_50ns(process)
156  process=customiseForRunI(process)
157 
158  return process
159 
161  # 50ns only
162 
163  process=customisePostLS1_lowPU(process)
164  process=customiseForRunI(process)
165 
166  return process
167 
168 
169 def digiEventContent(process):
170  #extend the event content
171 
172  alist=['RAWDEBUG','FEVTDEBUG','FEVTDEBUGHLT','GENRAW','RAWSIMHLT','FEVT']
173  for a in alist:
174  b = a + 'output'
175  if hasattr(process,b):
176  getattr(process,b).outputCommands.append('keep *_simMuonCSCDigis_*_*')
177  getattr(process,b).outputCommands.append('keep *_simMuonRPCDigis_*_*')
178  getattr(process,b).outputCommands.append('keep *_simHcalUnsuppressedDigis_*_*')
179 
180  return process
181 
182 
183 def customise_DQM(process):
184  #process.dqmoffline_step.remove(process.jetMETAnalyzer)
185  # Turn off flag of gangedME11a
186  process.l1tCsctf.gangedME11a = cms.untracked.bool(False)
187  # Turn off "low bias voltage" region in HCAL noise filters
188  if hasattr(process,'HBHENoiseFilterResultProducer'):
189  process.HBHENoiseFilterResultProducer.IgnoreTS4TS5ifJetInLowBVRegion = cms.bool(False)
190  return process
191 
192 
193 def customise_DQM_25ns(process):
194  #Empty place-holder
195  return process
196 
197 
198 def customise_Validation(process):
199  #process.validation_step.remove(process.PixelTrackingRecHitsValid)
200  # We don't run the HLT
201  #process.validation_step.remove(process.HLTSusyExoVal)
202  #process.validation_step.remove(process.hltHiggsValidator)
203  return process
204 
205 
206 def customise_Sim(process):
207  # enable 2015 HF shower library
208  process.g4SimHits.HFShowerLibrary.FileName = 'SimG4CMS/Calo/data/HFShowerLibrary_npmt_noatt_eta4_16en_v3.root'
209  return process
210 
212  process = digiEventContent(process)
213  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
214  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'ho'):
215  process.mix.digitizers.hcal.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16)
216  process.mix.digitizers.hcal.ho.siPMCode = cms.int32(1)
217  process.mix.digitizers.hcal.ho.pixels = cms.int32(2500)
218  process.mix.digitizers.hcal.ho.doSiPMSmearing = cms.bool(False)
219  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf1'):
220  process.mix.digitizers.hcal.hf1.samplingFactor = cms.double(0.60)
221  if hasattr(process.mix.digitizers,'hcal') and hasattr(process.mix.digitizers.hcal,'hf2'):
222  process.mix.digitizers.hcal.hf2.samplingFactor = cms.double(0.60)
223  return process
224 
225 def customise_DataMix(process):
226  if hasattr(process,'mixData'):
227  if hasattr(process.mixData,'ho'):
228  process.mixData.ho.photoelectronsToAnalog = cms.vdouble([4.0]*16)
229  process.mixData.ho.siPMCode = cms.int32(1)
230  process.mixData.ho.pixels = cms.int32(2500)
231  process.mixData.ho.doSiPMSmearing = cms.bool(False)
232  if hasattr(process.mixData,'hf1'):
233  process.mixData.hf1.samplingFactor = cms.double(0.60)
234  if hasattr(process.mixData,'hf2'):
235  process.mixData.hf2.samplingFactor = cms.double(0.60)
236  return process
237 
238 
239 def customise_Digi_50ns(process):
240  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
241  if hasattr(process.mix.digitizers,'pixel'):
242  # pixel dynamic inefficency - 13TeV - 50ns case
243  process.mix.digitizers.pixel.theInstLumiScaleFactor = cms.double(246.4)
244  process.mix.digitizers.pixel.theLadderEfficiency_BPix1 = cms.vdouble(
245  0.979259,
246  0.976677,
247  0.979259,
248  0.976677,
249  0.979259,
250  0.976677,
251  0.979259,
252  0.976677,
253  0.979259,
254  0.976677,
255  0.979259,
256  0.976677,
257  0.979259,
258  0.976677,
259  0.979259,
260  0.976677,
261  0.979259,
262  0.976677,
263  0.979259,
264  0.976677,
265  )
266  process.mix.digitizers.pixel.theLadderEfficiency_BPix2 = cms.vdouble(
267  0.994321,
268  0.993944,
269  0.994321,
270  0.993944,
271  0.994321,
272  0.993944,
273  0.994321,
274  0.993944,
275  0.994321,
276  0.993944,
277  0.994321,
278  0.993944,
279  0.994321,
280  0.993944,
281  0.994321,
282  0.993944,
283  0.994321,
284  0.993944,
285  0.994321,
286  0.993944,
287  0.994321,
288  0.993944,
289  0.994321,
290  0.993944,
291  0.994321,
292  0.993944,
293  0.994321,
294  0.993944,
295  0.994321,
296  0.993944,
297  0.994321,
298  0.993944,
299  )
300  process.mix.digitizers.pixel.theLadderEfficiency_BPix3 = cms.vdouble(
301  0.996787,
302  0.996945,
303  0.996787,
304  0.996945,
305  0.996787,
306  0.996945,
307  0.996787,
308  0.996945,
309  0.996787,
310  0.996945,
311  0.996787,
312  0.996945,
313  0.996787,
314  0.996945,
315  0.996787,
316  0.996945,
317  0.996787,
318  0.996945,
319  0.996787,
320  0.996945,
321  0.996787,
322  0.996945,
323  0.996787,
324  0.996945,
325  0.996787,
326  0.996945,
327  0.996787,
328  0.996945,
329  0.996787,
330  0.996945,
331  0.996787,
332  0.996945,
333  0.996787,
334  0.996945,
335  0.996787,
336  0.996945,
337  0.996787,
338  0.996945,
339  0.996787,
340  0.996945,
341  0.996787,
342  0.996945,
343  0.996787,
344  0.996945,
345  )
346  if hasattr(process,'mixData'):
347  # pixel dynamic inefficency - 13TeV - 50ns case
348  process.mixData.theInstLumiScaleFactor = cms.double(246.4)
349  process.mixData.theLadderEfficiency_BPix1 = cms.vdouble(
350  0.979259,
351  0.976677,
352  0.979259,
353  0.976677,
354  0.979259,
355  0.976677,
356  0.979259,
357  0.976677,
358  0.979259,
359  0.976677,
360  0.979259,
361  0.976677,
362  0.979259,
363  0.976677,
364  0.979259,
365  0.976677,
366  0.979259,
367  0.976677,
368  0.979259,
369  0.976677,
370  )
371  process.mixData.theLadderEfficiency_BPix2 = cms.vdouble(
372  0.994321,
373  0.993944,
374  0.994321,
375  0.993944,
376  0.994321,
377  0.993944,
378  0.994321,
379  0.993944,
380  0.994321,
381  0.993944,
382  0.994321,
383  0.993944,
384  0.994321,
385  0.993944,
386  0.994321,
387  0.993944,
388  0.994321,
389  0.993944,
390  0.994321,
391  0.993944,
392  0.994321,
393  0.993944,
394  0.994321,
395  0.993944,
396  0.994321,
397  0.993944,
398  0.994321,
399  0.993944,
400  0.994321,
401  0.993944,
402  0.994321,
403  0.993944,
404  )
405  process.mixData.theLadderEfficiency_BPix3 = cms.vdouble(
406  0.996787,
407  0.996945,
408  0.996787,
409  0.996945,
410  0.996787,
411  0.996945,
412  0.996787,
413  0.996945,
414  0.996787,
415  0.996945,
416  0.996787,
417  0.996945,
418  0.996787,
419  0.996945,
420  0.996787,
421  0.996945,
422  0.996787,
423  0.996945,
424  0.996787,
425  0.996945,
426  0.996787,
427  0.996945,
428  0.996787,
429  0.996945,
430  0.996787,
431  0.996945,
432  0.996787,
433  0.996945,
434  0.996787,
435  0.996945,
436  0.996787,
437  0.996945,
438  0.996787,
439  0.996945,
440  0.996787,
441  0.996945,
442  0.996787,
443  0.996945,
444  0.996787,
445  0.996945,
446  0.996787,
447  0.996945,
448  0.996787,
449  0.996945,
450  )
451  return process
452 
453 
454 def customise_Digi_25ns(process):
455  if hasattr(process,'mix') and hasattr(process.mix,'digitizers'):
456  if hasattr(process.mix.digitizers,'pixel'):
457  # pixel dynamic inefficency - 13TeV - 25ns case
458  process.mix.digitizers.pixel.theInstLumiScaleFactor = cms.double(364)
459  process.mix.digitizers.pixel.theLadderEfficiency_BPix1 = cms.vdouble(
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  )
481  process.mix.digitizers.pixel.theLadderEfficiency_BPix2 = cms.vdouble(
482  1,
483  1,
484  1,
485  1,
486  1,
487  1,
488  1,
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  )
515  process.mix.digitizers.pixel.theLadderEfficiency_BPix3 = cms.vdouble(
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  1,
534  1,
535  1,
536  1,
537  1,
538  1,
539  1,
540  1,
541  1,
542  1,
543  1,
544  1,
545  1,
546  1,
547  1,
548  1,
549  1,
550  1,
551  1,
552  1,
553  1,
554  1,
555  1,
556  1,
557  1,
558  1,
559  1,
560  )
561  process.mix.digitizers.pixel.theModuleEfficiency_BPix1 = cms.vdouble(
562  1,
563  1,
564  1,
565  1,
566  )
567  process.mix.digitizers.pixel.theModuleEfficiency_BPix2 = cms.vdouble(
568  1,
569  1,
570  1,
571  1,
572  )
573  process.mix.digitizers.pixel.theModuleEfficiency_BPix3 = cms.vdouble(
574  1,
575  1,
576  1,
577  1,
578  )
579  process.mix.digitizers.pixel.thePUEfficiency_BPix1 = cms.vdouble(
580  1.00023,
581  -3.18350e-06,
582  5.08503e-10,
583  -6.79785e-14,
584  )
585  process.mix.digitizers.pixel.thePUEfficiency_BPix2 = cms.vdouble(
586  9.99974e-01,
587  -8.91313e-07,
588  5.29196e-12,
589  -2.28725e-15,
590  )
591  process.mix.digitizers.pixel.thePUEfficiency_BPix3 = cms.vdouble(
592  1.00005,
593  -6.59249e-07,
594  2.75277e-11,
595  -1.62683e-15,
596  )
597  if hasattr(process,'mixData'):
598  # pixel dynamic inefficency - 13TeV - 25ns case
599  process.mixData.theInstLumiScaleFactor = cms.double(364)
600  process.mixData.theLadderEfficiency_BPix1 = cms.vdouble(
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  )
622  process.mixData.theLadderEfficiency_BPix2 = cms.vdouble(
623  1,
624  1,
625  1,
626  1,
627  1,
628  1,
629  1,
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  )
656  process.mixData.theLadderEfficiency_BPix3 = cms.vdouble(
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  1,
675  1,
676  1,
677  1,
678  1,
679  1,
680  1,
681  1,
682  1,
683  1,
684  1,
685  1,
686  1,
687  1,
688  1,
689  1,
690  1,
691  1,
692  1,
693  1,
694  1,
695  1,
696  1,
697  1,
698  1,
699  1,
700  1,
701  )
702  process.mixData.theModuleEfficiency_BPix1 = cms.vdouble(
703  1,
704  1,
705  1,
706  1,
707  )
708  process.mixData.theModuleEfficiency_BPix2 = cms.vdouble(
709  1,
710  1,
711  1,
712  1,
713  )
714  process.mixData.theModuleEfficiency_BPix3 = cms.vdouble(
715  1,
716  1,
717  1,
718  1,
719  )
720  process.mixData.thePUEfficiency_BPix1 = cms.vdouble(
721  1.00023,
722  -3.18350e-06,
723  5.08503e-10,
724  -6.79785e-14,
725  )
726  process.mixData.thePUEfficiency_BPix2 = cms.vdouble(
727  9.99974e-01,
728  -8.91313e-07,
729  5.29196e-12,
730  -2.28725e-15,
731  )
732  process.mixData.thePUEfficiency_BPix3 = cms.vdouble(
733  1.00005,
734  -6.59249e-07,
735  2.75277e-11,
736  -1.62683e-15,
737  )
738  return process
739 
740 
741 def customise_L1Emulator(process):
742  return process
743 
744 
745 def customise_RawToDigi(process):
746  process.RawToDigi.remove(process.gtEvmDigis)
747  return process
748 
749 
750 def customise_DigiToRaw(process):
751  return process
752 
753 
754 def customise_HLT(process):
755  return process
756 
757 
758 def customise_Reco(process):
759  #lowering HO threshold with SiPM
760  if hasattr(process,'particleFlowRecHitHO'):
761  for prod in process.particleFlowRecHitHO.producers:
762  prod.qualityTests = cms.VPSet(
763  cms.PSet(
764  name = cms.string("PFRecHitQTestThreshold"),
765  threshold = cms.double(0.05) # new threshold for SiPM HO
766  ),
767  cms.PSet(
768  name = cms.string("PFRecHitQTestHCALChannel"),
769  maxSeverities = cms.vint32(11),
770  cleaningThresholds = cms.vdouble(0.0),
771  flags = cms.vstring('Standard')
772  )
773  )
774 
775  #Lower Thresholds also for Clusters!!!
776 
777  for p in process.particleFlowClusterHO.seedFinder.thresholdsByDetector:
778  p.seedingThreshold = cms.double(0.08)
779 
780  for p in process.particleFlowClusterHO.initialClusteringStep.thresholdsByDetector:
781  p.gatheringThreshold = cms.double(0.05)
782 
783  for p in process.particleFlowClusterHO.pfClusterBuilder.recHitEnergyNorms:
784  p.recHitEnergyNorm = cms.double(0.05)
785 
786  process.particleFlowClusterHO.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
787  process.particleFlowClusterHO.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
788 
789  # Muon reconstruction do not exclude bad chambers
790  if hasattr(process, 'muonDetIdAssociator'):
791  process.muonDetIdAssociator.includeBadChambers = cms.bool(True)
792 
793  return process
794 
795 
796 def customise_harvesting(process):
797  #process.dqmHarvesting.remove(process.dataCertificationJetMET)
798  #process.dqmHarvesting.remove(process.sipixelEDAClient)
799  #process.dqmHarvesting.remove(process.sipixelCertification)
800  return (process)
801 
802 
803 def recoOutputCustoms(process):
804 
805  alist=['AODSIM','RECOSIM','FEVTSIM','FEVTDEBUG','FEVTDEBUGHLT','RECODEBUG','RAWRECOSIMHLT','RAWRECODEBUGHLT']
806  for a in alist:
807  b = a + 'output'
808  if hasattr(process,b):
809  getattr(process,b).outputCommands.append('keep *_simMuonCSCDigis_*_*')
810  getattr(process,b).outputCommands.append('keep *_simMuonRPCDigis_*_*')
811  getattr(process,b).outputCommands.append('keep *_simHcalUnsuppressedDigis_*_*')
812  getattr(process,b).outputCommands.append('keep *_rawDataCollector_*_*')
813  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