1 import FWCore.ParameterSet.Config
as cms
5 return (module
for module
in process._Process__producers.values()
if module._TypedParameterizable__type
in types)
8 return (module
for module
in process._Process__esproducers.values()
if module._TypedParameterizable__type
in types)
12 from HLTrigger.Configuration.customizeHLTforNewJetCorrectors
import customizeHLTforNewJetCorrectors
16 if hasattr(process,
'hltEcalPhiSymFilter'):
17 if hasattr(process.hltEcalPhiSymFilter,
'ampCut_barrel'):
18 delattr(process.hltEcalPhiSymFilter,
'ampCut_barrel')
19 if hasattr(process.hltEcalPhiSymFilter,
'ampCut_endcap'):
20 delattr(process.hltEcalPhiSymFilter,
'ampCut_endcap')
25 if hasattr(process,
'hltBSoftMuonMu5L3') :
26 delattr(process.hltBSoftMuonMu5L3,
'min3DHit')
27 setattr(process.hltBSoftMuonMu5L3,
'minLayer', cms.int32(0))
28 setattr(process.hltBSoftMuonMu5L3,
'min3DLayer', cms.int32(0))
29 setattr(process.hltBSoftMuonMu5L3,
'minPixelHit', cms.int32(0))
30 setattr(process.hltBSoftMuonMu5L3,
'usePV', cms.bool(
False))
31 setattr(process.hltBSoftMuonMu5L3,
'vertexTag', cms.InputTag(
''))
38 Rescale_eta = cms.double( 3.0 ),
39 Rescale_phi = cms.double( 3.0 ),
40 Rescale_Dz = cms.double( 3.0 ),
41 EtaR_UpperLimit_Par1 = cms.double( 0.25 ),
42 EtaR_UpperLimit_Par2 = cms.double( 0.15 ),
43 PhiR_UpperLimit_Par1 = cms.double( 0.6 ),
44 PhiR_UpperLimit_Par2 = cms.double( 0.2 ),
45 UseVertex = cms.bool(
False ),
46 Pt_fixed = cms.bool(
False ),
47 Z_fixed = cms.bool(
True ),
48 Phi_fixed = cms.bool(
False ),
49 Eta_fixed = cms.bool(
False ),
50 Pt_min = cms.double( 1.5 ),
51 Phi_min = cms.double( 0.1 ),
52 Eta_min = cms.double( 0.1 ),
53 DeltaZ = cms.double( 15.9 ),
54 DeltaR = cms.double( 0.2 ),
55 DeltaEta = cms.double( 0.2 ),
56 DeltaPhi = cms.double( 0.2 ),
57 maxRegions = cms.int32( 2 ),
58 precise = cms.bool(
True ),
59 OnDemand = cms.int32( -1 ),
60 MeasurementTrackerName = cms.InputTag(
"hltESPMeasurementTracker" ),
61 beamSpot = cms.InputTag(
"hltOnlineBeamSpot" ),
62 vertexCollection = cms.InputTag(
"pixelVertices" ),
63 input = cms.InputTag(
'hltL2Muons',
'UpdatedAtVtx' )
67 if hasattr(l3MPModule,
'GlbRefitterParameters'):
68 l3MPModule.GlbRefitterParameters.RefitFlag = cms.bool(
True)
69 if hasattr(l3MPModule,
'L3TrajBuilderParameters'):
70 if hasattr(l3MPModule.L3TrajBuilderParameters,
'MuonTrackingRegionBuilder'):
71 l3MPModule.L3TrajBuilderParameters.MuonTrackingRegionBuilder = MTRBPSet
73 listL3seedingModule = [
'hltL3TrajSeedIOHit',
'hltL3NoFiltersNoVtxTrajSeedIOHit',
'hltHIL3TrajSeedIOHit']
74 for l3IOTrajModule
in listL3seedingModule:
75 if hasattr(process, l3IOTrajModule):
76 if hasattr(getattr(process, l3IOTrajModule),
'MuonTrackingRegionBuilder'):
77 setattr(getattr(process, l3IOTrajModule),
'MuonTrackingRegionBuilder', MTRBPSet)
84 if hasattr(process,
'trackerTopology'):
85 params = process.trackerTopology.parameterNames_()
87 delattr(process.trackerTopology, param)
88 setattr(process.trackerTopology,
'appendToDataLabel', cms.string(
""))
89 if hasattr(process,
'TrackerDigiGeometryESModule'):
90 if hasattr(process.TrackerDigiGeometryESModule,
'trackerGeometryConstants'):
91 delattr(process.TrackerDigiGeometryESModule,
'trackerGeometryConstants')
96 if hasattr(process,
'TrackerDigiGeometryESModule'):
97 if hasattr(process.TrackerDigiGeometryESModule,
'trackerGeometryConstants'):
98 if hasattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants,
'upgradeGeometry'):
99 delattr(process.TrackerDigiGeometryESModule.trackerGeometryConstants,
'upgradeGeometry')
105 if hasattr(process,
'hltCaloStage1Digis'):
106 if hasattr(process.hltCaloStage1Digis,
'FWId'):
107 delattr(process.hltCaloStage1Digis,
'FWId')
108 if hasattr(process.hltCaloStage1Digis,
'FedId'):
109 delattr(process.hltCaloStage1Digis,
'FedId')
113 if hasattr(process,
'hltCaloStage1Digis'):
114 if hasattr(process.hltCaloStage1Digis,
'FWId'):
115 delattr(process.hltCaloStage1Digis,
'FWId')
116 if hasattr(process.hltCaloStage1Digis,
'FedId'):
117 delattr(process.hltCaloStage1Digis,
'FedId')
122 if not hasattr(process,
'hcalDDDSimConstants'):
123 process.hcalDDDSimConstants = cms.ESProducer(
'HcalDDDSimConstantsESModule' )
124 if not hasattr(process,
'hcalDDDRecConstants'):
125 process.hcalDDDRecConstants = cms.ESProducer(
'HcalDDDRecConstantsESModule' )
130 if hasattr(process,
'hltBSoftMuonMu5L3') :
131 setattr(process.hltBSoftMuonMu5L3,
'originalAlgorithm', cms.vstring())
132 setattr(process.hltBSoftMuonMu5L3,
'algorithmMaskContains', cms.vstring())
137 if any(module.type_()
is 'RPCPointProducer' for module
in process.producers.itervalues()):
138 if not hasattr(process,
'CSCObjectMapESProducer'):
139 process.CSCObjectMapESProducer = cms.ESProducer(
'CSCObjectMapESProducer' )
140 if not hasattr(process,
'DTObjectMapESProducer'):
141 process.DTObjectMapESProducer = cms.ESProducer(
'DTObjectMapESProducer' )
146 if hasattr(process,
'hltBSoftMuonMu5L3'):
148 process.hltBSoftMuonMu5L3 = cms.EDProducer(
"RecoTrackRefSelector", **process.hltBSoftMuonMu5L3.parameters_())
153 def useMTEName(componentName):
154 if componentName
in [
"CandidateSeededTrackingRegionsProducer",
"TrackingRegionsFromBeamSpotAndL2Tau"]:
155 return "whereToUseMeasurementTracker"
156 return "howToUseMeasurementTracker"
158 def replaceInPSet(pset, moduleLabel):
159 for paramName
in pset.parameterNames_():
160 param = getattr(pset, paramName)
161 if isinstance(param, cms.PSet):
162 if hasattr(param,
"ComponentName")
and param.ComponentName.value()
in [
"CandidateSeededTrackingRegionsProducer",
"TauRegionalPixelSeedGenerator"]:
163 useMTE = useMTEName(param.ComponentName.value())
165 if hasattr(param.RegionPSet,
"measurementTrackerName"):
166 param.RegionPSet.measurementTrackerName = cms.InputTag(param.RegionPSet.measurementTrackerName.value())
167 if hasattr(param.RegionPSet, useMTE):
168 raise Exception(
"Assumption of CandidateSeededTrackingRegionsProducer not having '%s' parameter failed" % useMTE)
169 setattr(param.RegionPSet, useMTE, cms.string(
"ForSiStrips"))
171 setattr(param.RegionPSet, useMTE, cms.string(
"Never"))
173 replaceInPSet(param, moduleLabel)
174 elif isinstance(param, cms.VPSet):
175 for element
in param:
176 replaceInPSet(element, moduleLabel)
178 for label, module
in process.producers_().iteritems():
179 replaceInPSet(module, label)
186 if not hasattr(process,
'CaloTowerTopologyEP'):
187 process.CaloTowerTopologyEP = cms.ESProducer(
'CaloTowerTopologyEP' )
194 if not 'calibrationsLabel' in module.__dict__:
195 module.calibrationsLabel = cms.string(
'HLT')
202 if not 'recordLabel' in module.__dict__:
203 module.recordLabel = cms.string(
'HLT')
210 cmsswVersion = os.environ[
'CMSSW_VERSION']
212 if cmsswVersion >=
"CMSSW_7_6":
220 if cmsswVersion >=
"CMSSW_7_5":
229 if cmsswVersion >=
"CMSSW_7_4":
bool any(const std::vector< T > &v, const T &what)