CMS 3D CMS Logo

Functions
customizeHLTforCMSSW Namespace Reference

Functions

def customiseBeamSpotFor2018Input (process)
 
def customiseCTPPSFor2018Input (process)
 
def customiseECALCalibrationsFor2018Input (process)
 
def customiseEGammaRecoFor2018Input (process)
 
def customiseFor2017DtUnpacking (process)
 
def customiseFor2018Input (process)
 
def customiseForOffline (process)
 
def customiseHCALFor2018Input (process)
 
def customisePixelGainForRun2Input (process)
 
def customisePixelL1ClusterThresholdForRun2Input (process)
 
def customizeHLTfor41058 (process)
 
def customizeHLTfor41495 (process)
 
def customizeHLTfor41632 (process)
 
def customizeHLTfor41815 (process)
 
def customizeHLTfor42410 (process)
 
def customizeHLTforCMSSW (process, menuType="GRun")
 

Function Documentation

◆ customiseBeamSpotFor2018Input()

def customizeHLTforCMSSW.customiseBeamSpotFor2018Input (   process)
Customisation for the HLT BeamSpot when running on Run-2 (2018) data:
   - For Run-2 data, disable the use of the BS transient record, in order to read the BS record from SCAL.
   - Additionally, remove all instances of OnlineBeamSpotESProducer (not needed if useTransientRecord=False).
   - See CMSHLT-2271 and CMSHLT-2300 for further details.

Definition at line 158 of file customizeHLTforCMSSW.py.

References common.esproducers_by_type(), and common.producers_by_type().

Referenced by customiseFor2018Input().

158 def customiseBeamSpotFor2018Input(process):
159  """Customisation for the HLT BeamSpot when running on Run-2 (2018) data:
160  - For Run-2 data, disable the use of the BS transient record, in order to read the BS record from SCAL.
161  - Additionally, remove all instances of OnlineBeamSpotESProducer (not needed if useTransientRecord=False).
162  - See CMSHLT-2271 and CMSHLT-2300 for further details.
163  """
164  for prod in producers_by_type(process, 'BeamSpotOnlineProducer'):
165  prod.useTransientRecord = False
166  onlineBeamSpotESPLabels = [prod.label_() for prod in esproducers_by_type(process, 'OnlineBeamSpotESProducer')]
167  for espLabel in onlineBeamSpotESPLabels:
168  delattr(process, espLabel)
169 
170  return process
171 
def producers_by_type(process, types)
Definition: common.py:4
def customiseBeamSpotFor2018Input(process)
def esproducers_by_type(process, types)
Definition: common.py:21

◆ customiseCTPPSFor2018Input()

def customizeHLTforCMSSW.customiseCTPPSFor2018Input (   process)

Definition at line 143 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customiseFor2018Input().

143 def customiseCTPPSFor2018Input(process):
144  for prod in producers_by_type(process, 'CTPPSGeometryESModule'):
145  prod.isRun2 = True
146  for prod in producers_by_type(process, 'CTPPSPixelRawToDigi'):
147  prod.isRun3 = False
148 
149  return process
150 
def customiseCTPPSFor2018Input(process)
def producers_by_type(process, types)
Definition: common.py:4

◆ customiseECALCalibrationsFor2018Input()

def customizeHLTforCMSSW.customiseECALCalibrationsFor2018Input (   process)
Customisation to apply the ECAL Run-2 Ultra-Legacy calibrations (CMSHLT-2339)

Definition at line 172 of file customizeHLTforCMSSW.py.

References print().

Referenced by customiseFor2018Input().

173  """Customisation to apply the ECAL Run-2 Ultra-Legacy calibrations (CMSHLT-2339)"""
174  if hasattr(process, 'GlobalTag'):
175  if not hasattr(process.GlobalTag, 'toGet'):
176  process.GlobalTag.toGet = cms.VPSet()
177  process.GlobalTag.toGet += [
178  cms.PSet(
179  record = cms.string('EcalLaserAlphasRcd'),
180  tag = cms.string('EcalLaserAlphas_UL_Run1_Run2_2018_lastIOV_movedTo1')
181  ),
182  cms.PSet(
183  record = cms.string('EcalIntercalibConstantsRcd'),
184  tag = cms.string('EcalIntercalibConstants_UL_Run1_Run2_2018_lastIOV_movedTo1')
185  )
186  ]
187  else:
188  print('# customiseECALCalibrationsFor2018Input -- the process.GlobalTag ESSource does not exist: no customisation applied.')
189 
190  return process
191 
def customiseECALCalibrationsFor2018Input(process)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ customiseEGammaRecoFor2018Input()

def customizeHLTforCMSSW.customiseEGammaRecoFor2018Input (   process)

Definition at line 151 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customiseFor2018Input().

152  for prod in producers_by_type(process, 'PFECALSuperClusterProducer'):
153  if hasattr(prod, 'regressionConfig'):
154  prod.regressionConfig.regTrainedWithPS = cms.bool(False)
155 
156  return process
157 
def customiseEGammaRecoFor2018Input(process)
def producers_by_type(process, types)
Definition: common.py:4

◆ customiseFor2017DtUnpacking()

def customizeHLTforCMSSW.customiseFor2017DtUnpacking (   process)
Adapt the HLT to run the legacy DT unpacking
for pre2018 data/MC workflows as the default

Definition at line 67 of file customizeHLTforCMSSW.py.

67 def customiseFor2017DtUnpacking(process):
68  """Adapt the HLT to run the legacy DT unpacking
69  for pre2018 data/MC workflows as the default"""
70 
71  if hasattr(process,'hltMuonDTDigis'):
72  process.hltMuonDTDigis = cms.EDProducer( "DTUnpackingModule",
73  useStandardFEDid = cms.bool( True ),
74  maxFEDid = cms.untracked.int32( 779 ),
75  inputLabel = cms.InputTag( "rawDataCollector" ),
76  minFEDid = cms.untracked.int32( 770 ),
77  dataType = cms.string( "DDU" ),
78  readOutParameters = cms.PSet(
79  localDAQ = cms.untracked.bool( False ),
80  debug = cms.untracked.bool( False ),
81  rosParameters = cms.PSet(
82  localDAQ = cms.untracked.bool( False ),
83  debug = cms.untracked.bool( False ),
84  writeSC = cms.untracked.bool( True ),
85  readDDUIDfromDDU = cms.untracked.bool( True ),
86  readingDDU = cms.untracked.bool( True ),
87  performDataIntegrityMonitor = cms.untracked.bool( False )
88  ),
89  performDataIntegrityMonitor = cms.untracked.bool( False )
90  ),
91  dqmOnly = cms.bool( False )
92  )
93 
94  return process
95 
def customiseFor2017DtUnpacking(process)

◆ customiseFor2018Input()

def customizeHLTforCMSSW.customiseFor2018Input (   process)
Customise the HLT to run on Run 2 data/MC

Definition at line 192 of file customizeHLTforCMSSW.py.

References customiseBeamSpotFor2018Input(), customiseCTPPSFor2018Input(), customiseECALCalibrationsFor2018Input(), customiseEGammaRecoFor2018Input(), customiseHCALFor2018Input(), customisePixelGainForRun2Input(), and customisePixelL1ClusterThresholdForRun2Input().

192 def customiseFor2018Input(process):
193  """Customise the HLT to run on Run 2 data/MC"""
194  process = customisePixelGainForRun2Input(process)
196  process = customiseHCALFor2018Input(process)
197  process = customiseCTPPSFor2018Input(process)
198  process = customiseEGammaRecoFor2018Input(process)
199  process = customiseBeamSpotFor2018Input(process)
200  process = customiseECALCalibrationsFor2018Input(process)
201 
202  return process
203 
204 
def customisePixelL1ClusterThresholdForRun2Input(process)
def customiseECALCalibrationsFor2018Input(process)
def customiseHCALFor2018Input(process)
def customiseCTPPSFor2018Input(process)
def customiseFor2018Input(process)
def customiseEGammaRecoFor2018Input(process)
def customiseBeamSpotFor2018Input(process)
def customisePixelGainForRun2Input(process)

◆ customiseForOffline()

def customizeHLTforCMSSW.customiseForOffline (   process)

Definition at line 205 of file customizeHLTforCMSSW.py.

References common.esproducers_by_type(), and createfilelist.int.

Referenced by customizeHLTforCMSSW().

205 def customiseForOffline(process):
206  # For running HLT offline on Run-3 Data, use "(OnlineBeamSpotESProducer).timeThreshold = 1e6",
207  # in order to pick the beamspot that was actually used by the HLT (instead of a "fake" beamspot).
208  # These same settings can be used offline for Run-3 Data and Run-3 MC alike.
209  # Note: the products of the OnlineBeamSpotESProducer are used only
210  # if the configuration uses "(BeamSpotOnlineProducer).useTransientRecord = True".
211  # See CMSHLT-2271 and CMSHLT-2300 for further details.
212  for prod in esproducers_by_type(process, 'OnlineBeamSpotESProducer'):
213  prod.timeThreshold = int(1e6)
214 
215  return process
216 
def esproducers_by_type(process, types)
Definition: common.py:21

◆ customiseHCALFor2018Input()

def customizeHLTforCMSSW.customiseHCALFor2018Input (   process)
Customise the HLT to run on Run 2 data/MC using the old readout for the HCAL barel

Definition at line 20 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customiseFor2018Input().

20 def customiseHCALFor2018Input(process):
21  """Customise the HLT to run on Run 2 data/MC using the old readout for the HCAL barel"""
22 
23  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
24  # switch on the QI8 processing for 2018 HCAL barrel
25  producer.processQIE8 = True
26 
27  # adapt CaloTowers threshold for 2018 HCAL barrel with only one depth
28  for producer in producers_by_type(process, "CaloTowersCreator"):
29  producer.HBThreshold1 = 0.7
30  producer.HBThreshold2 = 0.7
31  producer.HBThreshold = 0.7
32 
33  # adapt Particle Flow threshold for 2018 HCAL barrel with only one depth
34  from RecoParticleFlow.PFClusterProducer.particleFlowClusterHBHE_cfi import _thresholdsHB, _thresholdsHEphase1, _seedingThresholdsHB
35 
36  logWeightDenominatorHCAL2018 = cms.VPSet(
37  cms.PSet(
38  depths = cms.vint32(1, 2, 3, 4),
39  detector = cms.string('HCAL_BARREL1'),
40  logWeightDenominator = _thresholdsHB
41  ),
42  cms.PSet(
43  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
44  detector = cms.string('HCAL_ENDCAP'),
45  logWeightDenominator = _thresholdsHEphase1
46  )
47  )
48 
49  for producer in producers_by_type(process, "PFRecHitProducer"):
50  if producer.producers[0].name.value() == 'PFHBHERecHitCreator':
51  producer.producers[0].qualityTests[0].cuts[0].threshold = _thresholdsHB
52 
53  for producer in producers_by_type(process, "PFClusterProducer"):
54  if producer.seedFinder.thresholdsByDetector[0].detector.value() == 'HCAL_BARREL1':
55  producer.seedFinder.thresholdsByDetector[0].seedingThreshold = _seedingThresholdsHB
56  producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = _thresholdsHB
57  producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = _thresholdsHB
58  producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
59  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
60 
61  for producer in producers_by_type(process, "PFMultiDepthClusterProducer"):
62  producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
63 
64  # done
65  return process
66 
def customiseHCALFor2018Input(process)
def producers_by_type(process, types)
Definition: common.py:4

◆ customisePixelGainForRun2Input()

def customizeHLTforCMSSW.customisePixelGainForRun2Input (   process)
Customise the HLT to run on Run 2 data/MC using the old definition of the pixel calibrations

Up to 11.0.x, the pixel calibarations were fully specified in the configuration:
    VCaltoElectronGain      =   47
    VCaltoElectronGain_L1   =   50
    VCaltoElectronOffset    =  -60
    VCaltoElectronOffset_L1 = -670

Starting with 11.1.x, the calibrations for Run 3 were moved to the conditions, leaving in the configuration only:
    VCaltoElectronGain      =    1
    VCaltoElectronGain_L1   =    1
    VCaltoElectronOffset    =    0
    VCaltoElectronOffset_L1 =    0

Since the conditions for Run 2 have not been updated to the new scheme, the HLT configuration needs to be reverted.

Definition at line 96 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customiseFor2018Input().

97  """Customise the HLT to run on Run 2 data/MC using the old definition of the pixel calibrations
98 
99  Up to 11.0.x, the pixel calibarations were fully specified in the configuration:
100  VCaltoElectronGain = 47
101  VCaltoElectronGain_L1 = 50
102  VCaltoElectronOffset = -60
103  VCaltoElectronOffset_L1 = -670
104 
105  Starting with 11.1.x, the calibrations for Run 3 were moved to the conditions, leaving in the configuration only:
106  VCaltoElectronGain = 1
107  VCaltoElectronGain_L1 = 1
108  VCaltoElectronOffset = 0
109  VCaltoElectronOffset_L1 = 0
110 
111  Since the conditions for Run 2 have not been updated to the new scheme, the HLT configuration needs to be reverted.
112  """
113  # revert the Pixel parameters to be compatible with the Run 2 conditions
114  for producer in producers_by_type(process, "SiPixelClusterProducer"):
115  producer.VCaltoElectronGain = 47
116  producer.VCaltoElectronGain_L1 = 50
117  producer.VCaltoElectronOffset = -60
118  producer.VCaltoElectronOffset_L1 = -670
119 
120  for producer in producers_by_type(process, "SiPixelRawToClusterCUDA"):
121  producer.VCaltoElectronGain = cms.double(1.)
122  producer.VCaltoElectronGain_L1 = cms.double(1.)
123  producer.VCaltoElectronOffset = cms.double(0.)
124  producer.VCaltoElectronOffset_L1 = cms.double(0.)
125  producer.isRun2 = True
126 
127  return process
128 
def producers_by_type(process, types)
Definition: common.py:4
def customisePixelGainForRun2Input(process)

◆ customisePixelL1ClusterThresholdForRun2Input()

def customizeHLTforCMSSW.customisePixelL1ClusterThresholdForRun2Input (   process)

Definition at line 129 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customiseFor2018Input().

130  # revert the pixel Layer 1 cluster threshold to be compatible with Run2:
131  for producer in producers_by_type(process, "SiPixelClusterProducer"):
132  if hasattr(producer,"ClusterThreshold_L1"):
133  producer.ClusterThreshold_L1 = 2000
134  for producer in producers_by_type(process, "SiPixelRawToClusterCUDA"):
135  if hasattr(producer,"clusterThreshold_layer1"):
136  producer.clusterThreshold_layer1 = 2000
137  for producer in producers_by_type(process, "SiPixelDigisClustersFromSoA"):
138  if hasattr(producer,"clusterThreshold_layer1"):
139  producer.clusterThreshold_layer1 = 2000
140 
141  return process
142 
def customisePixelL1ClusterThresholdForRun2Input(process)
def producers_by_type(process, types)
Definition: common.py:4

◆ customizeHLTfor41058()

def customizeHLTforCMSSW.customizeHLTfor41058 (   process)

Definition at line 217 of file customizeHLTforCMSSW.py.

References common.esproducers_by_type().

Referenced by customizeHLTforCMSSW().

217 def customizeHLTfor41058(process):
218  for prod in esproducers_by_type(process, 'ClusterShapeHitFilterESProducer'):
219  prod.PixelShapeFile = "RecoTracker/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par"
220  prod.PixelShapeFileL1 = "RecoTracker/PixelLowPtUtilities/data/pixelShapePhase1_loose.par"
221 
222  return process
223 
def esproducers_by_type(process, types)
Definition: common.py:21

◆ customizeHLTfor41495()

def customizeHLTforCMSSW.customizeHLTfor41495 (   process)

Definition at line 224 of file customizeHLTforCMSSW.py.

References common.filters_by_type().

Referenced by customizeHLTforCMSSW().

224 def customizeHLTfor41495(process):
225  for producer in filters_by_type(process, 'HLTPixelIsolTrackL1TFilter'):
226  if hasattr(producer, 'L1GTSeedLabel'):
227  del producer.L1GTSeedLabel
228  if hasattr(producer, 'MinDeltaPtL1Jet'):
229  del producer.MinDeltaPtL1Jet
230 
231  return process
232 
def filters_by_type(process, types)
Definition: common.py:13

◆ customizeHLTfor41632()

def customizeHLTforCMSSW.customizeHLTfor41632 (   process)

Definition at line 243 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customizeHLTforCMSSW().

243 def customizeHLTfor41632(process):
244  for producerType in [
245  'SiPixelRawToClusterCUDA',
246  'SiPixelRawToClusterCUDAPhase1',
247  'SiPixelRawToClusterCUDAHIonPhase1',
248  ]:
249  for producer in producers_by_type(process, producerType):
250  # use explicit cms.double as parameters may not already be present, and
251  # set values to the correct Run-3 values (even when the parameters are already defined)
252  producer.VCaltoElectronGain = cms.double(1.)
253  producer.VCaltoElectronGain_L1 = cms.double(1.)
254  producer.VCaltoElectronOffset = cms.double(0.)
255  producer.VCaltoElectronOffset_L1 = cms.double(0.)
256 
257  return process
258 
def producers_by_type(process, types)
Definition: common.py:4

◆ customizeHLTfor41815()

def customizeHLTforCMSSW.customizeHLTfor41815 (   process)

Definition at line 233 of file customizeHLTforCMSSW.py.

References edm::eventsetup::heterocontainer.insert(), and common.producers_by_type().

Referenced by customizeHLTforCMSSW().

233 def customizeHLTfor41815(process):
234  # use hlt online BeamSpot for SiStripClusters2ApproxClusters
235  for producer in producers_by_type(process, 'SiStripClusters2ApproxClusters'):
236  producer.beamSpot = cms.InputTag('hltOnlineBeamSpot')
237 
238  if hasattr(process, 'HLT_HIRandom_v4'):
239  getattr(process,'HLT_HIRandom_v4').insert(2,process.HLTBeamSpot)
240 
241  return process
242 
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
def producers_by_type(process, types)
Definition: common.py:4

◆ customizeHLTfor42410()

def customizeHLTforCMSSW.customizeHLTfor42410 (   process)

Definition at line 259 of file customizeHLTforCMSSW.py.

References common.producers_by_type().

Referenced by customizeHLTforCMSSW().

259 def customizeHLTfor42410(process):
260  for producerType in [
261  'SiPixelRawToClusterCUDA',
262  'SiPixelRawToClusterCUDAPhase1',
263  'SiPixelRawToClusterCUDAHIonPhase1',
264  ]:
265  for producer in producers_by_type(process, producerType):
266  if hasattr(producer, 'isRun2'):
267  del producer.isRun2
268 
269  return process
270 
271 # CMSSW version specific customizations
def producers_by_type(process, types)
Definition: common.py:4

◆ customizeHLTforCMSSW()

def customizeHLTforCMSSW.customizeHLTforCMSSW (   process,
  menuType = "GRun" 
)

Definition at line 272 of file customizeHLTforCMSSW.py.

References customiseForOffline(), customizeHLTfor41058(), customizeHLTfor41495(), customizeHLTfor41632(), customizeHLTfor41815(), and customizeHLTfor42410().

272 def customizeHLTforCMSSW(process, menuType="GRun"):
273 
274  process = customiseForOffline(process)
275 
276  # add call to action function in proper order: newest last!
277  # process = customiseFor12718(process)
278 
279  process = customizeHLTfor41058(process)
280  process = customizeHLTfor41495(process)
281  process = customizeHLTfor41815(process)
282  process = customizeHLTfor41632(process)
283  process = customizeHLTfor42410(process)
284 
285  return process
286 
def customizeHLTforCMSSW(process, menuType="GRun")