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 # Update to replace old jet corrector mechanism
4 from HLTrigger.Configuration.customizeHLTforNewJetCorrectors import customizeHLTforNewJetCorrectors
5 
6 # Possibility to put different ring dependent cut on ADC (PR #9232)
7 def customiseFor9232(process):
8  if hasattr(process,'hltEcalPhiSymFilter'):
9  if hasattr(process.hltEcalPhiSymFilter,'ampCut_barrel'):
10  delattr(process.hltEcalPhiSymFilter,'ampCut_barrel')
11  if hasattr(process.hltEcalPhiSymFilter,'ampCut_endcap'):
12  delattr(process.hltEcalPhiSymFilter,'ampCut_endcap')
13  return process
14 
15 # upgrade RecoTrackSelector to allow BTV-like cuts (PR #8679)
16 def customiseFor8679(process):
17  if hasattr(process,'hltBSoftMuonMu5L3') :
18  delattr(process.hltBSoftMuonMu5L3,'min3DHit')
19  setattr(process.hltBSoftMuonMu5L3,'minLayer', cms.int32(0))
20  setattr(process.hltBSoftMuonMu5L3,'min3DLayer', cms.int32(0))
21  setattr(process.hltBSoftMuonMu5L3,'minPixelHit', cms.int32(0))
22  setattr(process.hltBSoftMuonMu5L3,'usePV', cms.bool(False))
23  setattr(process.hltBSoftMuonMu5L3,'vertexTag', cms.InputTag(''))
24  return process
25 
26 
27 # Updating the config (PR #8356)
28 def customiseFor8356(process):
29  MTRBPSet = cms.PSet(
30  Rescale_eta = cms.double( 3.0 ),
31  Rescale_phi = cms.double( 3.0 ),
32  Rescale_Dz = cms.double( 3.0 ),
33  EtaR_UpperLimit_Par1 = cms.double( 0.25 ),
34  EtaR_UpperLimit_Par2 = cms.double( 0.15 ),
35  PhiR_UpperLimit_Par1 = cms.double( 0.6 ),
36  PhiR_UpperLimit_Par2 = cms.double( 0.2 ),
37  UseVertex = cms.bool( False ),
38  Pt_fixed = cms.bool( False ),
39  Z_fixed = cms.bool( True ),
40  Phi_fixed = cms.bool( False ),
41  Eta_fixed = cms.bool( False ),
42  Pt_min = cms.double( 1.5 ),
43  Phi_min = cms.double( 0.1 ),
44  Eta_min = cms.double( 0.1 ),
45  DeltaZ = cms.double( 15.9 ),
46  DeltaR = cms.double( 0.2 ),
47  DeltaEta = cms.double( 0.2 ),
48  DeltaPhi = cms.double( 0.2 ),
49  maxRegions = cms.int32( 2 ),
50  precise = cms.bool( True ),
51  OnDemand = cms.int32( -1 ),
52  MeasurementTrackerName = cms.InputTag( "hltESPMeasurementTracker" ),
53  beamSpot = cms.InputTag( "hltOnlineBeamSpot" ),
54  vertexCollection = cms.InputTag( "pixelVertices" ),
55  input = cms.InputTag( 'hltL2Muons','UpdatedAtVtx' )
56  )
57 
58  def producers_by_type(process, type):
59  return (module for module in process._Process__producers.values() if module._TypedParameterizable__type == type)
60 
61  for l3MPModule in producers_by_type(process, 'L3MuonProducer'):
62  if hasattr(l3MPModule, 'GlbRefitterParameters'):
63  l3MPModule.GlbRefitterParameters.RefitFlag = cms.bool(True)
64  if hasattr(l3MPModule, 'L3TrajBuilderParameters'):
65  if hasattr(l3MPModule.L3TrajBuilderParameters, 'MuonTrackingRegionBuilder'):
66  l3MPModule.L3TrajBuilderParameters.MuonTrackingRegionBuilder = MTRBPSet
67 
68  listL3seedingModule = ['hltL3TrajSeedIOHit','hltL3NoFiltersNoVtxTrajSeedIOHit','hltHIL3TrajSeedIOHit']
69  for l3IOTrajModule in listL3seedingModule:
70  if hasattr(process, l3IOTrajModule):
71  if hasattr(getattr(process, l3IOTrajModule), 'MuonTrackingRegionBuilder'):
72  setattr(getattr(process, l3IOTrajModule), 'MuonTrackingRegionBuilder', MTRBPSet)
73 
74  return process
75 
76 
77 # Simplified TrackerTopologyEP config (PR #7966)
78 def customiseFor7966(process):
79  if hasattr(process, 'trackerTopology'):
80  params = process.trackerTopology.parameterNames_()
81  for param in params:
82  delattr(process.trackerTopology, param)
83  setattr(process.trackerTopology, 'appendToDataLabel', cms.string(""))
84  if hasattr(process,'TrackerDigiGeometryESModule'):
85  if hasattr(process.TrackerDigiGeometryESModule,'trackerGeometryConstants'):
86  delattr(process.TrackerDigiGeometryESModule,'trackerGeometryConstants')
87  return process
88 
89 # Removal of 'upgradeGeometry' from TrackerDigiGeometryESModule (PR #7794)
90 def customiseFor7794(process):
91  if hasattr(process, 'TrackerDigiGeometryESModule'):
92  if hasattr(process.TrackerDigiGeometryESModule, 'trackerGeometryConstants'):
93  if hasattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants, 'upgradeGeometry'):
94  delattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants, 'upgradeGeometry')
95  return process
96 
97 
98 # Removal of L1 Stage 1 unpacker configuration from config (PR #10XXX)
99 def customiseFor10234(process):
100  if hasattr(process, 'hltCaloStage1Digis'):
101  if hasattr(process.hltCaloStage1Digis, 'FWId'):
102  delattr(process.hltCaloStage1Digis, 'FWId')
103  if hasattr(process.hltCaloStage1Digis, 'FedId'):
104  delattr(process.hltCaloStage1Digis, 'FedId')
105  return process
106 
107 
108 # migrate RPCPointProducer to a global::EDProducer (PR #10927)
109 def customiseFor10927(process):
110  if any(module.type_() is 'RPCPointProducer' for module in process.producers.itervalues()):
111  if not hasattr(process, 'CSCObjectMapESProducer'):
112  process.CSCObjectMapESProducer = cms.ESProducer( 'CSCObjectMapESProducer' )
113  if not hasattr(process, 'DTObjectMapESProducer'):
114  process.DTObjectMapESProducer = cms.ESProducer( 'DTObjectMapESProducer' )
115  return process
116 
117 
118 # CMSSW version specific customizations
119 def customiseHLTforCMSSW(process, menuType="GRun", fastSim=False):
120  import os
121  cmsswVersion = os.environ['CMSSW_VERSION']
122 
123  if cmsswVersion >= "CMSSW_7_5":
124  process = customiseFor10927(process)
125  process = customiseFor9232(process)
126  process = customiseFor8679(process)
127  process = customiseFor8356(process)
128  process = customiseFor7966(process)
129  process = customiseFor7794(process)
130  process = customizeHLTforNewJetCorrectors(process)
131  if cmsswVersion >= "CMSSW_7_4":
132  process = customiseFor10234(process)
133 
134  return process
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34