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 # Add new parameters to RecoTrackRefSelector
21 def customiseFor19029(process):
22  for producer in producers_by_type(process, "RecoTrackRefSelector"):
23  if not hasattr(producer, "minPhi"):
24  producer.minPhi = cms.double(-3.2)
25  producer.maxPhi = cms.double(3.2)
26  return process
27 
28 def customiseFor20269(process) :
29  for producer in esproducers_by_type(process, "ClusterShapeHitFilterESProducer"):
30  producer.PixelShapeFile = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_noL1.par')
31  producer.PixelShapeFileL1 = cms.string('RecoPixelVertexing/PixelLowPtUtilities/data/pixelShapePhase1_loose.par')
32  return process
33 
34 # Migrate uGT non-CondDB parameters to new cff: remove StableParameters dependence in favour of GlobalParameters
35 def customiseFor19989(process):
36  if hasattr(process,'StableParametersRcdSource'):
37  delattr(process,'StableParametersRcdSource')
38  if hasattr(process,'StableParameters'):
39  delattr(process,'StableParameters')
40  if not hasattr(process,'GlobalParameters'):
41  from L1Trigger.L1TGlobal.GlobalParameters_cff import GlobalParameters
42  process.GlobalParameters = GlobalParameters
43  return process
44 
45 # new parameter for HCAL method 2 reconstruction
46 def customiseFor20422(process):
47  from RecoLocalCalo.HcalRecProducers.HBHEMethod2Parameters_cfi import m2Parameters
48  for producer in producers_by_type(process, "HBHEPhase1Reconstructor"):
49  producer.algorithm.applyDCConstraint = m2Parameters.applyDCConstraint
50  for producer in producers_by_type(process, "HcalHitReconstructor"):
51  producer.applyDCConstraint = m2Parameters.applyDCConstraint
52  return process
53 
54 # Refactor track MVA classifiers
55 def customiseFor20429(process):
56  for producer in producers_by_type(process, "TrackMVAClassifierDetached", "TrackMVAClassifierPrompt"):
57  producer.mva.GBRForestLabel = producer.GBRForestLabel
58  producer.mva.GBRForestFileName = producer.GBRForestFileName
59  del producer.GBRForestLabel
60  del producer.GBRForestFileName
61  for producer in producers_by_type(process, "TrackCutClassifier"):
62  del producer.GBRForestLabel
63  del producer.GBRForestFileName
64  return process
65 
66 
67 # to be able to run HLT with new ECAL code and default values
68 def customiseFor22967(process):
69  for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
70  if hasattr(process,hltParticleFlowRecHitECAL):
71  module = getattr(process,hltParticleFlowRecHitECAL)
72  for producer in module.producers:
73  if hasattr(producer,'qualityTests'):
74  for qualityTest in producer.qualityTests:
75  if hasattr(qualityTest,'thresholds'):
76  qualityTest.applySelectionsToAllCrystals = cms.bool(False)
77  return process
78 
79 
80 # CMSSW version specific customizations
81 def customizeHLTforCMSSW(process, menuType="GRun"):
82 
83  # add call to action function in proper order: newest last!
84  # process = customiseFor12718(process)
85 
86  process = customiseFor19029(process)
87  process = customiseFor20269(process)
88  process = customiseFor19989(process)
89  process = customiseFor20422(process)
90  process = customiseFor20429(process)
91  process = customiseFor22967(process)
92 
93  return process
def customizeHLTforCMSSW(process, menuType="GRun")
def producers_by_type(process, types)
Definition: common.py:5
def esproducers_by_type(process, types)
Definition: common.py:17