test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
customizeHLTforCMSSW Namespace Reference

Functions

def analyzers_by_type
 
def customiseFor13753
 
def customiseFor14356
 
def customiseFor15439
 
def customizeHLTforCMSSW
 
def esproducers_by_type
 
def filters_by_type
 
def producers_by_type
 

Function Documentation

def customizeHLTforCMSSW.analyzers_by_type (   process,
  types 
)

Definition at line 9 of file customizeHLTforCMSSW.py.

9 
10 def analyzers_by_type(process, *types):
11  return (analyzer for analyzer in process._Process__analyzers.values() if analyzer._TypedParameterizable__type in types)
def customizeHLTforCMSSW.customiseFor13753 (   process)

Definition at line 39 of file customizeHLTforCMSSW.py.

References producers_by_type().

Referenced by customizeHLTforCMSSW().

39 
40 def customiseFor13753(process):
41  for producer in producers_by_type(process, "PixelTrackProducer"):
42  if producer.CleanerPSet.ComponentName.value() == "PixelTrackCleanerBySharedHits" and not hasattr(producer.CleanerPSet, "useQuadrupletAlgo"):
43  producer.CleanerPSet.useQuadrupletAlgo = cms.bool(False)
44  return process
45 
# Add pixel seed extension (PR #14356)
def customizeHLTforCMSSW.customiseFor14356 (   process)

Definition at line 46 of file customizeHLTforCMSSW.py.

Referenced by customizeHLTforCMSSW().

46 
47 def customiseFor14356(process):
48  for name, pset in process.psets_().iteritems():
49  if hasattr(pset, "ComponentType") and pset.ComponentType.value() == "CkfBaseTrajectoryFilter" and not hasattr(pset, "pixelSeedExtension"):
50  pset.pixelSeedExtension = cms.bool(False)
51  return process
52 
53 #
# CMSSW version specific customizations
def customizeHLTforCMSSW.customiseFor15439 (   process)

Definition at line 28 of file customizeHLTforCMSSW.py.

References producers_by_type().

Referenced by customizeHLTforCMSSW().

28 
29 def customiseFor15439(process):
30  for producer in producers_by_type(process, "EgammaHLTBcHcalIsolationProducersRegional", "EgammaHLTEcalPFClusterIsolationProducer", "EgammaHLTHcalPFClusterIsolationProducer", "MuonHLTEcalPFClusterIsolationProducer", "MuonHLTHcalPFClusterIsolationProducer"):
31  if hasattr(producer, "effectiveAreaBarrel") and hasattr(producer, "effectiveAreaEndcap"):
32  if not hasattr(producer, "effectiveAreas") and not hasattr(producer, "absEtaLowEdges"):
33  producer.absEtaLowEdges = cms.vdouble( 0.0, 1.479 )
34  producer.effectiveAreas = cms.vdouble( producer.effectiveAreaBarrel.value(), producer.effectiveAreaEndcap.value() )
35  del producer.effectiveAreaBarrel
36  del producer.effectiveAreaEndcap
37  return process
38 
# Add quadruplet-specific pixel track duplicate cleaning mode (PR #13753)
def customizeHLTforCMSSW.customizeHLTforCMSSW (   process,
  menuType = "GRun" 
)

Definition at line 54 of file customizeHLTforCMSSW.py.

References customiseFor13753(), customiseFor14356(), and customiseFor15439().

54 
55 def customizeHLTforCMSSW(process, menuType="GRun"):
56 
57  import os
58  cmsswVersion = os.environ['CMSSW_VERSION']
59 
60  if cmsswVersion >= "CMSSW_8_0":
61  process = customiseFor15439(process)
62 
63  if cmsswVersion >= "CMSSW_8_1":
64  process = customiseFor14356(process)
65  process = customiseFor13753(process)
66 # process = customiseFor12718(process)
67  pass
68 
69 # stage-2 changes only if needed
70  if ("Fake" in menuType):
71  return process
72 
73 # if ( menuType in ("FULL","GRun","PIon")):
74 # from HLTrigger.Configuration.CustomConfigs import L1XML
75 # process = L1XML(process,"L1Menu_Collisions2016_dev_v3.xml")
76 # from HLTrigger.Configuration.CustomConfigs import L1REPACK
77 # process = L1REPACK(process)
78 #
79 # _debug = False
80 #
81 # special case
82 # for module in filters_by_type(process,"HLTL1TSeed"):
83 # label = module._Labelable__label
84 # if hasattr(getattr(process,label),'SaveTags'):
85 # delattr(getattr(process,label),'SaveTags')
86 #
87 # replace converted l1extra=>l1t plugins which are not yet in ConfDB
88 # replaceList = {
89 # 'EDAnalyzer' : { },
90 # 'EDFilter' : {
91 # 'HLTMuonL1Filter' : 'HLTMuonL1TFilter',
92 # 'HLTMuonL1RegionalFilter' : 'HLTMuonL1TRegionalFilter',
93 # 'HLTMuonTrkFilter' : 'HLTMuonTrkL1TFilter',
94 # 'HLTMuonL1toL3TkPreFilter' : 'HLTMuonL1TtoL3TkPreFilter',
95 # 'HLTMuonDimuonL2Filter' : 'HLTMuonDimuonL2FromL1TFilter',
96 # 'HLTEgammaL1MatchFilterRegional' : 'HLTEgammaL1TMatchFilterRegional',
97 # 'HLTMuonL2PreFilter' : 'HLTMuonL2FromL1TPreFilter',
98 # 'HLTPixelIsolTrackFilter' : 'HLTPixelIsolTrackL1TFilter',
99 # },
100 # 'EDProducer' : {
101 # 'CaloTowerCreatorForTauHLT' : 'CaloTowerFromL1TCreatorForTauHLT',
102 # 'L1HLTTauMatching' : 'L1THLTTauMatching',
103 # 'HLTCaloJetL1MatchProducer' : 'HLTCaloJetL1TMatchProducer',
104 # 'HLTPFJetL1MatchProducer' : 'HLTPFJetL1TMatchProducer',
105 # 'HLTL1MuonSelector' : 'HLTL1TMuonSelector',
106 # 'L2MuonSeedGenerator' : 'L2MuonSeedGeneratorFromL1T',
107 # 'IsolatedPixelTrackCandidateProducer' : 'IsolatedPixelTrackCandidateL1TProducer',
108 # }
109 # }
110 # for type,list in replaceList.iteritems():
111 # if (type=="EDAnalyzer"):
112 # if _debug:
113 # print "# Replacing EDAnalyzers:"
114 # for old,new in list.iteritems():
115 # if _debug:
116 # print '## EDAnalyzer plugin type: ',old,' -> ',new
117 # for module in analyzers_by_type(process,old):
118 # label = module._Labelable__label
119 # if _debug:
120 # print '### Instance: ',label
121 # setattr(process,label,cms.EDAnalyzer(new,**module.parameters_()))
122 # elif (type=="EDFilter"):
123 # if _debug:
124 # print "# Replacing EDFilters :"
125 # for old,new in list.iteritems():
126 # if _debug:
127 # print '## EDFilter plugin type : ',old,' -> ',new
128 # for module in filters_by_type(process,old):
129 # label = module._Labelable__label
130 # if _debug:
131 # print '### Instance: ',label
132 # setattr(process,label,cms.EDFilter(new,**module.parameters_()))
133 # elif (type=="EDProducer"):
134 # if _debug:
135 # print "# Replacing EDProducers:"
136 # for old,new in list.iteritems():
137 # if _debug:
138 # print '## EDProducer plugin type: ',old,' -> ',new
139 # for module in producers_by_type(process,old):
140 # label = module._Labelable__label
141 # if _debug:
142 # print '### Instance: ',label
143 # setattr(process,label,cms.EDProducer(new,**module.parameters_()))
144 # if (new == 'CaloTowerFromL1TCreatorForTauHLT'):
145 # setattr(getattr(process,label),'TauTrigger',cms.InputTag('hltCaloStage2Digis:Tau'))
146 # if ((new == 'HLTCaloJetL1TMatchProducer') or (new == 'HLTPFJetL1TMatchProducer')):
147 # setattr(getattr(process,label),'L1Jets',cms.InputTag('hltCaloStage2Digis:Jet'))
148 # if hasattr(getattr(process,label),'L1CenJets'):
149 # delattr(getattr(process,label),'L1CenJets')
150 # if hasattr(getattr(process,label),'L1ForJets'):
151 # delattr(getattr(process,label),'L1ForJets')
152 # if hasattr(getattr(process,label),'L1TauJets'):
153 # delattr(getattr(process,label),'L1TauJets')
154 # if (new == 'HLTL1TMuonSelector'):
155 # setattr(getattr(process,label),'InputObjects',cms.InputTag('hltGmtStage2Digis:Muon'))
156 # if (new == 'L2MuonSeedGeneratorFromL1T'):
157 # setattr(getattr(process,label),'GMTReadoutCollection',cms.InputTag(''))
158 # setattr(getattr(process,label),'InputObjects',cms.InputTag('hltGmtStage2Digis:Muon'))
159 # if (new == 'IsolatedPixelTrackCandidateL1TProducer'):
160 # setattr(getattr(process,label),'L1eTauJetsSource',cms.InputTag('hltCaloStage2Digis:Tau'))
161 #
162 # else:
163 # if _debug:
164 # print "# Error - Type ',type,' not recognised!"
165 #
166 # Both of the HLTEcalRecHitInAllL1RegionsProducer instances need InputTag fixes
167 # for module in producers_by_type(process,'HLTEcalRecHitInAllL1RegionsProducer'):
168 # label = module._Labelable__label
169 # setattr(getattr(process,label).l1InputRegions[0],'inputColl',cms.InputTag('hltCaloStage2Digis:EGamma'))
170 # setattr(getattr(process,label).l1InputRegions[0],'type',cms.string("EGamma"))
171 # setattr(getattr(process,label).l1InputRegions[1],'inputColl',cms.InputTag('hltCaloStage2Digis:EGamma'))
172 # setattr(getattr(process,label).l1InputRegions[1],'type',cms.string("EGamma"))
173 # setattr(getattr(process,label).l1InputRegions[2],'inputColl',cms.InputTag('hltCaloStage2Digis:Jet'))
174 # setattr(getattr(process,label).l1InputRegions[2],'type',cms.string("Jet"))
175 #
176 # One of the EgammaHLTCaloTowerProducer instances need InputTag fixes
177 # if hasattr(process,'hltRegionalTowerForEgamma'):
178 # setattr(getattr(process,'hltRegionalTowerForEgamma'),'L1NonIsoCand',cms.InputTag('hltCaloStage2Digis:EGamma'))
179 # setattr(getattr(process,'hltRegionalTowerForEgamma'),'L1IsoCand' ,cms.InputTag('hltCaloStage2Digis:EGamma'))
180 #
181 # replace remaining l1extra modules with filter returning 'false'
182 # badTypes = (
183 # 'HLTLevel1Activity',
184 # )
185 # if _debug:
186 # print "# Unconverted module types: ",badTypes
187 # badModules = [ ]
188 # for badType in badTypes:
189 # if _debug:
190 # print '## Unconverted module type: ',badType
191 # for module in analyzers_by_type(process,badType):
192 # label = module._Labelable__label
193 # badModules += [label]
194 # if _debug:
195 # print '### analyzer label: ',label
196 # for module in filters_by_type(process,badType):
197 # label = module._Labelable__label
198 # badModules += [label]
199 # if _debug:
200 # print '### filter label: ',label
201 # for module in producers_by_type(process,badType):
202 # label = module._Labelable__label
203 # badModules += [label]
204 # if _debug:
205 # print '### producer label: ',label
206 # for label in badModules:
207 # setattr(process,label,cms.EDFilter("HLTBool",result=cms.bool(False)))
208 
209  return process
def customizeHLTforCMSSW.esproducers_by_type (   process,
  types 
)

Definition at line 12 of file customizeHLTforCMSSW.py.

12 
13 def esproducers_by_type(process, *types):
14  return (module for module in process._Process__esproducers.values() if module._TypedParameterizable__type in types)
15 
16 #
17 # one action function per PR - put the PR number into the name of the function
18 
19 # example:
20 # def customiseFor12718(process):
21 # for pset in process._Process__psets.values():
22 # if hasattr(pset,'ComponentType'):
23 # if (pset.ComponentType == 'CkfBaseTrajectoryFilter'):
24 # if not hasattr(pset,'minGoodStripCharge'):
25 # pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
26 # return process
27 
# Module restructuring for PR #15439
def customizeHLTforCMSSW.filters_by_type (   process,
  types 
)

Definition at line 7 of file customizeHLTforCMSSW.py.

7 
8 def filters_by_type(process, *types):
return (filter for filter in process._Process__filters.values() if filter._TypedParameterizable__type in types)
def customizeHLTforCMSSW.producers_by_type (   process,
  types 
)

Definition at line 5 of file customizeHLTforCMSSW.py.

Referenced by customiseFor13753(), and customiseFor15439().

5 
6 def producers_by_type(process, *types):
return (module for module in process._Process__producers.values() if module._TypedParameterizable__type in types)