CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customizeHLTforCMSSW.py
Go to the documentation of this file.
2 
3 # upgrade RecoTrackSelector to allow BTV-like cuts (PR #8679)
4 def customiseFor8679(process):
5  if hasattr(process,'hltBSoftMuonMu5L3') :
6  delattr(process.hltBSoftMuonMu5L3,'min3DHit')
7  setattr(process.hltBSoftMuonMu5L3,'minLayer', cms.int32(0))
8  setattr(process.hltBSoftMuonMu5L3,'min3DLayer', cms.int32(0))
9  setattr(process.hltBSoftMuonMu5L3,'minPixelHit', cms.int32(0))
10  setattr(process.hltBSoftMuonMu5L3,'usePV', cms.bool(False))
11  setattr(process.hltBSoftMuonMu5L3,'vertexTag', cms.InputTag(''))
12  return process
13 
14 
15 # Updating the config (PR #8356)
16 def customiseFor8356(process):
17  MTRBPSet = cms.PSet(
18  Rescale_eta = cms.double( 3.0 ),
19  Rescale_phi = cms.double( 3.0 ),
20  Rescale_Dz = cms.double( 3.0 ),
21  EtaR_UpperLimit_Par1 = cms.double( 0.25 ),
22  EtaR_UpperLimit_Par2 = cms.double( 0.15 ),
23  PhiR_UpperLimit_Par1 = cms.double( 0.6 ),
24  PhiR_UpperLimit_Par2 = cms.double( 0.2 ),
25  UseVertex = cms.bool( False ),
26  Pt_fixed = cms.bool( False ),
27  Z_fixed = cms.bool( True ),
28  Phi_fixed = cms.bool( False ),
29  Eta_fixed = cms.bool( False ),
30  Pt_min = cms.double( 1.5 ),
31  Phi_min = cms.double( 0.1 ),
32  Eta_min = cms.double( 0.1 ),
33  DeltaZ = cms.double( 15.9 ),
34  DeltaR = cms.double( 0.2 ),
35  DeltaEta = cms.double( 0.2 ),
36  DeltaPhi = cms.double( 0.2 ),
37  maxRegions = cms.int32( 2 ),
38  precise = cms.bool( True ),
39  OnDemand = cms.int32( -1 ),
40  MeasurementTrackerName = cms.InputTag( "hltESPMeasurementTracker" ),
41  beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
42  vertexCollection = cms.InputTag( "pixelVertices" ),
43  input = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
44  )
45 
46  def producers_by_type(process, type):
47  return (module for module in process._Process__producers.values() if module._TypedParameterizable__type == type)
48 
49  for l3MPModule in producers_by_type(process, 'L3MuonProducer'):
50  if hasattr(l3MPModule, 'GlbRefitterParameters'):
51  l3MPModule.GlbRefitterParameters.RefitFlag = cms.bool(True)
52  if hasattr(l3MPModule, 'L3TrajBuilderParameters'):
53  if hasattr(l3MPModule.L3TrajBuilderParameters, 'MuonTrackingRegionBuilder'):
54  l3MPModule.L3TrajBuilderParameters.MuonTrackingRegionBuilder = MTRBPSet
55 
56  listL3seedingModule = ['hltL3TrajSeedIOHit','hltL3NoFiltersNoVtxTrajSeedIOHit','hltHIL3TrajSeedIOHit']
57  for l3IOTrajModule in listL3seedingModule:
58  if hasattr(process, l3IOTrajModule):
59  if hasattr(getattr(process, l3IOTrajModule), 'MuonTrackingRegionBuilder'):
60  setattr(getattr(process, l3IOTrajModule), 'MuonTrackingRegionBuilder', MTRBPSet)
61 
62  return process
63 
64 
65 # Simplified TrackerTopologyEP config (PR #7966)
66 def customiseFor7966(process):
67  if hasattr(process, 'trackerTopology'):
68  params = process.trackerTopology.parameterNames_()
69  for param in params:
70  delattr(process.trackerTopology, param)
71  setattr(process.trackerTopology, 'appendToDataLabel', cms.string(""))
72  if hasattr(process,'TrackerDigiGeometryESModule'):
73  if hasattr(process.TrackerDigiGeometryESModule,'trackerGeometryConstants'):
74  delattr(process.TrackerDigiGeometryESModule,'trackerGeometryConstants')
75  return process
76 
77 # Removal of 'upgradeGeometry' from TrackerDigiGeometryESModule (PR #7794)
78 def customiseFor7794(process):
79  if hasattr(process, 'TrackerDigiGeometryESModule'):
80  if hasattr(process.TrackerDigiGeometryESModule, 'trackerGeometryConstants'):
81  if hasattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants, 'upgradeGeometry'):
82  delattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants, 'upgradeGeometry')
83  return process
84 
85 
86 # CMSSW version specific customizations
87 def customiseHLTforCMSSW(process,menuType="GRun",fastSim=False):
88  import os
89  cmsswVersion = os.environ['CMSSW_VERSION']
90 
91  if cmsswVersion >= "CMSSW_7_5":
92  process = customiseFor8679(process)
93  process = customiseFor8356(process)
94  process = customiseFor7966(process)
95  process = customiseFor7794(process)
96 
97  return process