1 import FWCore.ParameterSet.Config
as cms
21 """Customise the HLT to run on Run 2 data/MC using the old readout for the HCAL barel""" 25 producer.processQIE8 =
True 29 producer.HBThreshold1 = 0.7
30 producer.HBThreshold2 = 0.7
31 producer.HBThreshold = 0.7
36 logWeightDenominatorHCAL2018 = cms.VPSet(
38 depths = cms.vint32(1, 2, 3, 4),
39 detector = cms.string(
'HCAL_BARREL1'),
40 logWeightDenominator = _thresholdsHB
43 depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
44 detector = cms.string(
'HCAL_ENDCAP'),
45 logWeightDenominator = _thresholdsHEphase1
50 if producer.producers[0].name.value() ==
'PFHBHERecHitCreator':
51 producer.producers[0].qualityTests[0].cuts[0].threshold = _thresholdsHB
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
62 producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
68 """Adapt the HLT to run the legacy DT unpacking 69 for pre2018 data/MC workflows as the default""" 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 )
89 performDataIntegrityMonitor = cms.untracked.bool(
False )
91 dqmOnly = cms.bool(
False )
97 """Customise the HLT to run on Run 2 data/MC using the old definition of the pixel calibrations 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 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 111 Since the conditions for Run 2 have not been updated to the new scheme, the HLT configuration needs to be reverted. 115 producer.VCaltoElectronGain = 47
116 producer.VCaltoElectronGain_L1 = 50
117 producer.VCaltoElectronOffset = -60
118 producer.VCaltoElectronOffset_L1 = -670
120 for pluginType
in [
"SiPixelRawToClusterCUDA",
"SiPixelRawToClusterCUDAPhase1",
"SiPixelRawToClusterCUDAHIonPhase1"]:
122 producer.VCaltoElectronGain = 47
123 producer.VCaltoElectronGain_L1 = 50
124 producer.VCaltoElectronOffset = -60
125 producer.VCaltoElectronOffset_L1 = -670
132 if hasattr(producer,
"ClusterThreshold_L1"):
133 producer.ClusterThreshold_L1 = 2000
134 for pluginType
in [
"SiPixelRawToClusterCUDA",
"SiPixelRawToClusterCUDAPhase1",
"SiPixelRawToClusterCUDAHIonPhase1"]:
136 if hasattr(producer,
"clusterThreshold_layer1"):
137 producer.clusterThreshold_layer1 = 2000
139 if hasattr(producer,
"clusterThreshold_layer1"):
140 producer.clusterThreshold_layer1 = 2000
154 if hasattr(prod,
'regressionConfig'):
155 prod.regressionConfig.regTrainedWithPS = cms.bool(
False)
160 """Customisation for the HLT BeamSpot when running on Run-2 (2018) data: 161 - For Run-2 data, disable the use of the BS transient record, in order to read the BS record from SCAL. 162 - Additionally, remove all instances of OnlineBeamSpotESProducer (not needed if useTransientRecord=False). 163 - See CMSHLT-2271 and CMSHLT-2300 for further details. 166 prod.useTransientRecord =
False 167 onlineBeamSpotESPLabels = [prod.label_()
for prod
in esproducers_by_type(process,
'OnlineBeamSpotESProducer')]
168 for espLabel
in onlineBeamSpotESPLabels:
169 delattr(process, espLabel)
172 if not hasattr(process,
'hltScalersRawToDigi')
and hasattr(process,
'HLTBeamSpot')
and isinstance(process.HLTBeamSpot, cms.Sequence):
174 if hasattr(process,
'hltOnlineBeamSpot'):
175 process.hltOnlineBeamSpot.src =
'hltScalersRawToDigi' 177 if hasattr(process,
'hltPixelTrackerHVOn'):
178 process.hltPixelTrackerHVOn.DcsStatusLabel =
'hltScalersRawToDigi' 180 if hasattr(process,
'hltStripTrackerHVOn'):
181 process.hltStripTrackerHVOn.DcsStatusLabel =
'hltScalersRawToDigi' 183 process.hltScalersRawToDigi = cms.EDProducer(
"ScalersRawToDigi",
184 scalersInputTag = cms.InputTag(
"rawDataCollector" )
187 process.HLTBeamSpot.insert(0, process.hltScalersRawToDigi)
192 """Customisation to apply the ECAL Run-2 Ultra-Legacy calibrations (CMSHLT-2339)""" 193 if hasattr(process,
'GlobalTag'):
194 if not hasattr(process.GlobalTag,
'toGet'):
195 process.GlobalTag.toGet = cms.VPSet()
196 process.GlobalTag.toGet += [
198 record = cms.string(
'EcalLaserAlphasRcd'),
199 tag = cms.string(
'EcalLaserAlphas_UL_Run1_Run2_2018_lastIOV_movedTo1')
202 record = cms.string(
'EcalIntercalibConstantsRcd'),
203 tag = cms.string(
'EcalIntercalibConstants_UL_Run1_Run2_2018_lastIOV_movedTo1')
207 print(
'# customiseECALCalibrationsFor2018Input -- the process.GlobalTag ESSource does not exist: no customisation applied.')
212 """Customise the HLT to run on Run 2 data/MC""" 232 prod.timeThreshold =
int(1e6)
239 if hasattr(process,
'GlobalTag'):
241 process.GlobalTag.ReconnectEachRun = cms.untracked.bool(
False)
242 process.GlobalTag.RefreshEachRun = cms.untracked.bool(
False)
244 if hasattr(process.GlobalTag,
'toGet'):
246 process.GlobalTag.toGet = [
247 pset
for pset
in process.GlobalTag.toGet
248 if set(pset.parameterNames_()) != {
'record',
'refreshTime'}
254 filt_types = [
"HLTEgammaGenericFilter",
"HLTEgammaGenericQuadraticEtaFilter",
"HLTEgammaGenericQuadraticFilter",
"HLTElectronGenericFilter"]
255 absAbleVar = [
"DEta",
"deta",
"DetaSeed",
"Dphi",
"OneOESuperMinusOneOP",
"OneOESeedMinusOneOP"]
256 for filt_type
in filt_types:
258 if filt.varTag.productInstanceLabel
in absAbleVar:
259 if (filt.useAbs != cms.bool(
True)):
260 print(
'# TSG WARNING: check value of parameter "useAbs" in',filt,
'(expect True but is False)!')
265 """Ensure TrackerAdditionalParametersPerDetRcd ESProducer is run when needed""" 267 process.load(
"Geometry.TrackerGeometryBuilder.TrackerAdditionalParametersPerDet_cfi")
272 """Assigns value of MuonHLTSeedMVAClassifier mva input file, scales and mean values according to the value of isFromL1""" 274 if hasattr(prod,
"isFromL1"):
275 if (prod.isFromL1 ==
True):
276 if hasattr(prod,
"mvaFileBL1"):
277 prod.mvaFileB = prod.mvaFileBL1
278 if hasattr(prod,
"mvaFileEL1"):
279 prod.mvaFileE = prod.mvaFileEL1
280 if hasattr(prod,
"mvaScaleMeanBL1"):
281 prod.mvaScaleMeanB = prod.mvaScaleMeanBL1
282 if hasattr(prod,
"mvaScaleStdBL1"):
283 prod.mvaScaleStdB = prod.mvaScaleStdBL1
284 if hasattr(prod,
"mvaScaleMeanEL1"):
285 prod.mvaScaleMeanE = prod.mvaScaleMeanEL1
286 if hasattr(prod,
"mvaScaleStdEL1"):
287 prod.mvaScaleStdE = prod.mvaScaleStdEL1
289 if hasattr(prod,
"mvaFileBL2"):
290 prod.mvaFileB = prod.mvaFileBL2
291 if hasattr(prod,
"mvaFileEL2"):
292 prod.mvaFileE = prod.mvaFileEL2
293 if hasattr(prod,
"mvaScaleMeanBL2"):
294 prod.mvaScaleMeanB = prod.mvaScaleMeanBL2
295 if hasattr(prod,
"mvaScaleStdBL2"):
296 prod.mvaScaleStdB = prod.mvaScaleStdBL2
297 if hasattr(prod,
"mvaScaleMeanEL2"):
298 prod.mvaScaleMeanE = prod.mvaScaleMeanEL2
299 if hasattr(prod,
"mvaScaleStdEL2"):
300 prod.mvaScaleStdE = prod.mvaScaleStdEL2
303 delattr(prod,
"mvaFileBL1")
304 delattr(prod,
"mvaFileEL1")
305 delattr(prod,
"mvaScaleMeanBL1")
306 delattr(prod,
"mvaScaleStdBL1")
307 delattr(prod,
"mvaScaleMeanEL1")
308 delattr(prod,
"mvaScaleStdEL1")
309 delattr(prod,
"mvaFileBL2")
310 delattr(prod,
"mvaFileEL2")
311 delattr(prod,
"mvaScaleMeanBL2")
312 delattr(prod,
"mvaScaleStdBL2")
313 delattr(prod,
"mvaScaleMeanEL2")
314 delattr(prod,
"mvaScaleStdEL2")
def producers_by_type(process, types)
def customisePixelL1ClusterThresholdForRun2Input(process)
def customizeHLTforCMSSW(process, menuType="GRun")
def filters_by_type(process, types)
def customiseECALCalibrationsFor2018Input(process)
def customiseFor2017DtUnpacking(process)
def customiseForOffline(process)
def customizeHLTfor44576(process)
def customizeHLTfor45063(process)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def customiseHCALFor2018Input(process)
def customiseCTPPSFor2018Input(process)
def customiseFor2018Input(process)
def customiseEGammaRecoFor2018Input(process)
def customiseBeamSpotFor2018Input(process)
def checkHLTfor43774(process)
def customisePixelGainForRun2Input(process)
def esproducers_by_type(process, types)