CMS 3D CMS Logo

customizeHLTforCMSSW.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # helper fuctions
5 
6 # add one customisation function per PR
7 # - put the PR number into the name of the function
8 # - add a short comment
9 # for example:
10 
11 # CCCTF tuning
12 # def customiseFor12718(process):
13 # for pset in process._Process__psets.values():
14 # if hasattr(pset,'ComponentType'):
15 # if (pset.ComponentType == 'CkfBaseTrajectoryFilter'):
16 # if not hasattr(pset,'minGoodStripCharge'):
17 # pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
18 # return process
19 
20 def customiseFor21810(process):
21  for producer in producers_by_type(process, "CaloTowersCreator"):
22  producer.HcalPhase = cms.int32(0)
23  producer.HcalCollapsed = cms.bool(True)
24  producer.HESThreshold1 = cms.double(0.8)
25  producer.HESThreshold = cms.double(0.8)
26  producer.HEDThreshold1 = cms.double(0.8)
27  producer.HEDThreshold = cms.double(0.8)
28  return process
29 
30 def customiseFor21845(process):
31 
32  for producer in producers_by_type(process, "PFClusterProducer"):
33  if producer.seedFinder.thresholdsByDetector[0].detector.value()=='HCAL_BARREL1':
34  producer.seedFinder.thresholdsByDetector[0].depths = cms.vint32(1, 2, 3, 4)
35  producer.seedFinder.thresholdsByDetector[0].seedingThreshold = cms.vdouble(1.0, 1.0, 1.0, 1.0)
36  producer.seedFinder.thresholdsByDetector[0].seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
37 
38  if producer.seedFinder.thresholdsByDetector[1].detector.value()=='HCAL_ENDCAP':
39  producer.seedFinder.thresholdsByDetector[1].depths = cms.vint32(1, 2, 3, 4, 5, 6, 7)
40  producer.seedFinder.thresholdsByDetector[1].seedingThreshold = cms.vdouble(1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1)
41  producer.seedFinder.thresholdsByDetector[1].seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
42 
43  #############
44 
45  if producer.initialClusteringStep.thresholdsByDetector[0].detector.value()=='HCAL_BARREL1':
46  producer.initialClusteringStep.thresholdsByDetector[0].depths = cms.vint32(1, 2, 3, 4)
47  producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = cms.vdouble(0.8, 0.8, 0.8, 0.8)
48  producer.initialClusteringStep.thresholdsByDetector[0].gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
49 
50  if producer.initialClusteringStep.thresholdsByDetector[1].detector.value()=='HCAL_ENDCAP':
51  producer.initialClusteringStep.thresholdsByDetector[1].depths = cms.vint32(1, 2, 3, 4, 5, 6, 7)
52  producer.initialClusteringStep.thresholdsByDetector[1].gatheringThreshold = cms.vdouble(0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
53  producer.initialClusteringStep.thresholdsByDetector[1].gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
54 
55  #############
56 
57  if producer.pfClusterBuilder.recHitEnergyNorms[0].detector.value()=='HCAL_BARREL1':
58  producer.pfClusterBuilder.recHitEnergyNorms[0].depths = cms.vint32(1, 2, 3, 4)
59  producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = cms.vdouble(0.8, 0.8, 0.8, 0.8)
60 
61  if producer.pfClusterBuilder.recHitEnergyNorms[1].detector.value()=='HCAL_ENDCAP':
62  producer.pfClusterBuilder.recHitEnergyNorms[1].depths = cms.vint32(1, 2, 3, 4, 5, 6, 7)
63  producer.pfClusterBuilder.recHitEnergyNorms[1].recHitEnergyNorm = cms.vdouble(0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
64 
65  #############
66 
67  for producer in producers_by_type(process, "PFRecHitProducer"):
68  if producer.producers[0].name.value()=='PFHBHERecHitCreator':
69  producer.producers[0].qualityTests[0].cuts = cms.VPSet(
70  cms.PSet(),
71  cms.PSet()
72  )
73  producer.producers[0].qualityTests[0].cuts[0].depth = cms.vint32(1, 2, 3, 4)
74  producer.producers[0].qualityTests[0].cuts[0].threshold = cms.vdouble(0.8, 0.8, 0.8, 0.8)
75  producer.producers[0].qualityTests[0].cuts[0].detectorEnum = cms.int32(1)
76 
77  producer.producers[0].qualityTests[0].cuts[1].depth = cms.vint32(1, 2, 3, 4, 5, 6, 7)
78  producer.producers[0].qualityTests[0].cuts[1].threshold = cms.vdouble(0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
79  producer.producers[0].qualityTests[0].cuts[1].detectorEnum = cms.int32(2)
80 
81  for producer in producers_by_type(process, "PFRecHitProducer"):
82  if producer.producers[0].name.value()=='PFHFRecHitCreator':
83  producer.producers[0].qualityTests[1].cuts = cms.VPSet(
84  cms.PSet()
85  )
86  producer.producers[0].qualityTests[1].cuts[0].depth = cms.vint32(1,2)
87  producer.producers[0].qualityTests[1].cuts[0].threshold = cms.vdouble(1.2,1.8)
88  producer.producers[0].qualityTests[1].cuts[0].detectorEnum = cms.int32(4)
89 
90  return process
91 
92 
94  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
95  producer.algorithm.useMahi = cms.bool(True)
96  producer.algorithm.useM2 = cms.bool(False)
97  producer.algorithm.useM3 = cms.bool(False)
98  return process
99 
101  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
102  if (producer.algorithm.useM2 == cms.bool(True)):
103  producer.algorithm.useMahi = cms.bool(True)
104  producer.algorithm.useM2 = cms.bool(False)
105  producer.algorithm.useM3 = cms.bool(False)
106  return process
107 
108 # Needs the ESProducer for HcalTimeSlewRecord
109 def customiseFor21733(process):
110  process.load('CalibCalorimetry.HcalPlugins.HcalTimeSlew_cff')
111  return process
112 
113 # CMSSW version specific customizations
114 def customizeHLTforCMSSW(process, menuType="GRun"):
115 
116  # add call to action function in proper order: newest last!
117  # process = customiseFor12718(process)
118 
119  process = customiseFor21733(process)
120 
121  process = customiseFor21810(process)
122 
123  process = customiseFor21845(process)
124 
125  return process
def customizeHLTforCMSSW(process, menuType="GRun")
def customiseFor21664_forMahiOn(process)
def producers_by_type(process, types)
Definition: common.py:5
def customiseFor21664_forMahiOnM2only(process)