CMS 3D CMS Logo

customizeHLTforCMSSW.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # helper functions
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 
22 def customiseForOffline(process):
23  # For running HLT offline on Run-3 Data, use "(OnlineBeamSpotESProducer).timeThreshold = 1e6",
24  # in order to pick the beamspot that was actually used by the HLT (instead of a "fake" beamspot).
25  # These same settings can be used offline for Run-3 Data and Run-3 MC alike.
26  # Note: the products of the OnlineBeamSpotESProducer are used only
27  # if the configuration uses "(BeamSpotOnlineProducer).useTransientRecord = True".
28  # See CMSHLT-2271 and CMSHLT-2300 for further details.
29  for prod in esproducers_by_type(process, 'OnlineBeamSpotESProducer'):
30  prod.timeThreshold = int(1e6)
31 
32  # For running HLT offline and relieve the strain on Frontier so it will no longer inject a
33  # transaction id which tells Frontier to add a unique "&freshkey" to many query URLs.
34  # That was intended as a feature to only be used by the Online HLT, to guarantee that fresh conditions
35  # from the database were loaded at each Lumi section
36  # Seee CMSHLT-3123 for further details
37  if hasattr(process, 'GlobalTag'):
38  # Set ReconnectEachRun and RefreshEachRun to False
39  process.GlobalTag.ReconnectEachRun = cms.untracked.bool(False)
40  process.GlobalTag.RefreshEachRun = cms.untracked.bool(False)
41 
42  if hasattr(process.GlobalTag, 'toGet'):
43  # Filter out PSet objects containing only 'record' and 'refreshTime'
44  process.GlobalTag.toGet = [
45  pset for pset in process.GlobalTag.toGet
46  if set(pset.parameterNames_()) != {'record', 'refreshTime'}
47  ]
48 
49  return process
50 
51 def customiseHLTFor46647(process):
52  for prod in producers_by_type(process, 'CtfSpecialSeedGenerator'):
53  if hasattr(prod, "DontCountDetsAboveNClusters"):
54  value = prod.DontCountDetsAboveNClusters.value()
55  delattr(prod, "DontCountDetsAboveNClusters")
56  # Replace it with cms.uint32
57  prod.DontCountDetsAboveNClusters = cms.uint32(value)
58 
59  for prod in producers_by_type(process, 'SeedCombiner'):
60  if hasattr(prod, "PairCollection"):
61  delattr(prod, "PairCollection")
62  if hasattr(prod, "TripletCollection"):
63  delattr(prod, "TripletCollection")
64 
65  return process
66 
67 # CMSSW version specific customizations
68 def customizeHLTforCMSSW(process, menuType="GRun"):
69 
70  process = customiseForOffline(process)
71 
72  # add call to action function in proper order: newest last!
73  # process = customiseFor12718(process)
74 
75  process = customiseHLTFor46647(process)
76 
77  return process
def producers_by_type(process, types)
def customizeHLTforCMSSW(process, menuType="GRun")
def customiseForOffline(process)
def customiseHLTFor46647(process)
def esproducers_by_type(process, types)
Definition: common.py:21