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 
21 from RecoParticleFlow.PFClusterProducer.particleFlowClusterHBHE_cfi import _seedingThresholdsHEphase1, _thresholdsHEphase1
22 from RecoParticleFlow.PFClusterProducer.particleFlowClusterHCAL_cfi import _thresholdsHEphase1 as _thresholdsHEphase1HCAL
23 from RecoParticleFlow.PFClusterProducer.particleFlowRecHitHBHE_cfi import _thresholdsHEphase1 as _thresholdsHEphase1Rec
24 
26  for producer in producers_by_type(process, "PFClusterProducer"):
27  if producer.seedFinder.thresholdsByDetector[1].detector.value() == 'HCAL_ENDCAP':
28  producer.seedFinder.thresholdsByDetector[1].seedingThreshold = _seedingThresholdsHEphase1
29  producer.initialClusteringStep.thresholdsByDetector[1].gatheringThreshold = _thresholdsHEphase1
30  producer.pfClusterBuilder.recHitEnergyNorms[1].recHitEnergyNorm = _thresholdsHEphase1
31  producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector[1].logWeightDenominator = _thresholdsHEphase1
32  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[1].logWeightDenominator = _thresholdsHEphase1
33 
34  for producer in producers_by_type(process, "PFMultiDepthClusterProducer"):
35  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector[1].logWeightDenominator = _thresholdsHEphase1HCAL
36 
37  for producer in producers_by_type(process, "PFRecHitProducer"):
38  if producer.producers[0].name.value() == 'PFHBHERecHitCreator':
39  producer.producers[0].qualityTests[0].cuts[1].threshold = _thresholdsHEphase1Rec
40 
41  for producer in producers_by_type(process, "CaloTowersCreator"):
42  producer.HcalPhase = cms.int32(1)
43  producer.HESThreshold1 = cms.double(0.1)
44  producer.HESThreshold = cms.double(0.2)
45  producer.HEDThreshold1 = cms.double(0.1)
46  producer.HEDThreshold = cms.double(0.2)
47 
48 
49  #remove collapser from sequence
50  process.hltHbhereco = process.hltHbhePhase1Reco.clone()
51  process.HLTDoLocalHcalSequence = cms.Sequence( process.hltHcalDigis + process.hltHbhereco + process.hltHfprereco + process.hltHfreco + process.hltHoreco )
52  process.HLTStoppedHSCPLocalHcalReco = cms.Sequence( process.hltHcalDigis + process.hltHbhereco )
53 
54 
55  return process
56 
57 
59  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
60  producer.algorithm.useMahi = cms.bool(True)
61  producer.algorithm.useM2 = cms.bool(False)
62  producer.algorithm.useM3 = cms.bool(False)
63  return process
64 
66  """Adapt the HLT to run the legacy DT unpacking
67  for pre2018 data/MC workflows as the default"""
68 
69  if hasattr(process,'hltMuonDTDigis'):
70  process.hltMuonDTDigis = cms.EDProducer( "DTUnpackingModule",
71  useStandardFEDid = cms.bool( True ),
72  maxFEDid = cms.untracked.int32( 779 ),
73  inputLabel = cms.InputTag( "rawDataCollector" ),
74  minFEDid = cms.untracked.int32( 770 ),
75  dataType = cms.string( "DDU" ),
76  readOutParameters = cms.PSet(
77  localDAQ = cms.untracked.bool( False ),
78  debug = cms.untracked.bool( False ),
79  rosParameters = cms.PSet(
80  localDAQ = cms.untracked.bool( False ),
81  debug = cms.untracked.bool( False ),
82  writeSC = cms.untracked.bool( True ),
83  readDDUIDfromDDU = cms.untracked.bool( True ),
84  readingDDU = cms.untracked.bool( True ),
85  performDataIntegrityMonitor = cms.untracked.bool( False )
86  ),
87  performDataIntegrityMonitor = cms.untracked.bool( False )
88  ),
89  dqmOnly = cms.bool( False )
90  )
91 
92  return process
93 
94 
95 
96 # particleFlowRechitECAL new default value "false" flag to be added
98 
99  for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
100  if hasattr(process,hltParticleFlowRecHitECAL):
101  module = getattr(process,hltParticleFlowRecHitECAL)
102 
103  for producer in module.producers:
104  if hasattr(producer,'srFlags'):
105  producer.srFlags = cms.InputTag("")
106  if hasattr(producer,'qualityTests'):
107  for qualityTest in producer.qualityTests:
108  if hasattr(qualityTest,'thresholds'):
109  qualityTest.applySelectionsToAllCrystals = cms.bool(True)
110 
111  return process
112 
113 
114 
115 #
116 # The three different set of thresholds will be used to study
117 # possible new thresholds of pfrechits and effects on high level objects
118 # The values proposed (A, B, C) are driven by expected noise levels
119 #
120 
121 # Test thresholds for particleFlowRechitECAL ~ 0.5 sigma
123  from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
124  from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_A
125 
126  for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
127  if hasattr(process,hltParticleFlowRecHitECAL):
128  module = getattr(process,hltParticleFlowRecHitECAL)
129 
130  for producer in module.producers:
131  if hasattr(producer,'srFlags'):
132  producer.srFlags = cms.InputTag("")
133  if hasattr(producer,'qualityTests'):
134  for qualityTest in producer.qualityTests:
135  if hasattr(qualityTest,'thresholds'):
136  qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_A.thresholds
137  qualityTest.applySelectionsToAllCrystals = cms.bool(True)
138 
139  return process
140 
141 
142 
143 
144 
145 # Test thresholds for particleFlowRechitECAL ~ 1 sigma
147  from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
148  from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_B
149 
150  for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
151  if hasattr(process,hltParticleFlowRecHitECAL):
152  module = getattr(process,hltParticleFlowRecHitECAL)
153 
154  for producer in module.producers:
155  if hasattr(producer,'srFlags'):
156  producer.srFlags = cms.InputTag("")
157  if hasattr(producer,'qualityTests'):
158  for qualityTest in producer.qualityTests:
159  if hasattr(qualityTest,'thresholds'):
160  qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_B.thresholds
161  qualityTest.applySelectionsToAllCrystals = cms.bool(True)
162 
163  return process
164 
165 
166 
167 
168 # Test thresholds for particleFlowRechitECAL ~ 2 sigma
170  from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
171  from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_C
172 
173  for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
174  if hasattr(process,hltParticleFlowRecHitECAL):
175  module = getattr(process,hltParticleFlowRecHitECAL)
176 
177  for producer in module.producers:
178  if hasattr(producer,'srFlags'):
179  producer.srFlags = cms.InputTag("")
180  if hasattr(producer,'qualityTests'):
181  for qualityTest in producer.qualityTests:
182  if hasattr(qualityTest,'thresholds'):
183  qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_C.thresholds
184  qualityTest.applySelectionsToAllCrystals = cms.bool(True)
185 
186  return process
187 
188 
189 # CMSSW version specific customizations
190 def customizeHLTforCMSSW(process, menuType="GRun"):
191 
192  # add call to action function in proper order: newest last!
193  # process = customiseFor12718(process)
194 
195  return process
def customiseForEcalTestPR22254thresholdA(process)
def customizeHLTforCMSSW(process, menuType="GRun")
def customiseForEcalTestPR22254Default(process)
def customiseForEcalTestPR22254thresholdB(process)
def customiseForUncollapsed(process)
def customiseFor2017DtUnpacking(process)
def customiseFor21664_forMahiOn(process)
def customiseForEcalTestPR22254thresholdC(process)
def producers_by_type(process, types)
Definition: common.py:6