Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-14 04:15:39

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # helper functions
0004 from HLTrigger.Configuration.common import *
0005 
0006 # add one customisation function per PR
0007 # - put the PR number into the name of the function
0008 # - add a short comment
0009 # for example:
0010 
0011 # CCCTF tuning
0012 # def customiseFor12718(process):
0013 #     for pset in process._Process__psets.values():
0014 #         if hasattr(pset,'ComponentType'):
0015 #             if (pset.ComponentType == 'CkfBaseTrajectoryFilter'):
0016 #                 if not hasattr(pset,'minGoodStripCharge'):
0017 #                     pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
0018 #     return process
0019 
0020 
0021 
0022 def customiseForOffline(process):
0023     # For running HLT offline on Run-3 Data, use "(OnlineBeamSpotESProducer).timeThreshold = 1e6",
0024     # in order to pick the beamspot that was actually used by the HLT (instead of a "fake" beamspot).
0025     # These same settings can be used offline for Run-3 Data and Run-3 MC alike.
0026     # Note: the products of the OnlineBeamSpotESProducer are used only
0027     #       if the configuration uses "(BeamSpotOnlineProducer).useTransientRecord = True".
0028     # See CMSHLT-2271 and CMSHLT-2300 for further details.
0029     for prod in esproducers_by_type(process, 'OnlineBeamSpotESProducer'):
0030         prod.timeThreshold = int(1e6)
0031 
0032     # For running HLT offline and relieve the strain on Frontier so it will no longer inject a
0033     # transaction id which tells Frontier to add a unique "&freshkey" to many query URLs.
0034     # That was intended as a feature to only be used by the Online HLT, to guarantee that fresh conditions
0035     # from the database were loaded at each Lumi section
0036     # Seee CMSHLT-3123 for further details
0037     if hasattr(process, 'GlobalTag'):
0038         # Set ReconnectEachRun and RefreshEachRun to False
0039         process.GlobalTag.ReconnectEachRun = cms.untracked.bool(False)
0040         process.GlobalTag.RefreshEachRun = cms.untracked.bool(False)
0041 
0042         if hasattr(process.GlobalTag, 'toGet'):
0043             # Filter out PSet objects containing only 'record' and 'refreshTime'
0044             process.GlobalTag.toGet = [
0045                 pset for pset in process.GlobalTag.toGet
0046                 if set(pset.parameterNames_()) != {'record', 'refreshTime'}
0047             ]
0048 
0049     return process
0050 
0051 def customiseHLTFor46647(process):
0052     for prod in producers_by_type(process, 'CtfSpecialSeedGenerator'):
0053         if hasattr(prod, "DontCountDetsAboveNClusters"):
0054             value = prod.DontCountDetsAboveNClusters.value()
0055             delattr(prod, "DontCountDetsAboveNClusters")
0056             # Replace it with cms.uint32
0057             prod.DontCountDetsAboveNClusters = cms.uint32(value)
0058 
0059         for prod in producers_by_type(process, 'SeedCombiner'):
0060             if hasattr(prod, "PairCollection"):
0061                 delattr(prod, "PairCollection")
0062             if hasattr(prod, "TripletCollection"):
0063                 delattr(prod, "TripletCollection")
0064 
0065     return process
0066 
0067 # CMSSW version specific customizations
0068 def customizeHLTforCMSSW(process, menuType="GRun"):
0069 
0070     process = customiseForOffline(process)
0071 
0072     # add call to action function in proper order: newest last!
0073     # process = customiseFor12718(process)
0074 
0075     process = customiseHLTFor46647(process)
0076     
0077     return process