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 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 28 of file customizeHLTforCMSSW.py.

References producers_by_type().

Referenced by customizeHLTforCMSSW().

28 
29 def customiseFor13753(process):
30  for producer in producers_by_type(process, "PixelTrackProducer"):
31  if producer.CleanerPSet.ComponentName.value() == "PixelTrackCleanerBySharedHits" and not hasattr(producer.CleanerPSet, "useQuadrupletAlgo"):
32  producer.CleanerPSet.useQuadrupletAlgo = cms.bool(False)
33  return process
34 
# Add pixel seed extension (PR #14356)
def customizeHLTforCMSSW.customiseFor14356 (   process)

Definition at line 35 of file customizeHLTforCMSSW.py.

Referenced by customizeHLTforCMSSW().

35 
36 def customiseFor14356(process):
37  for name, pset in process.psets_().iteritems():
38  if hasattr(pset, "ComponentType") and pset.ComponentType.value() == "CkfBaseTrajectoryFilter" and not hasattr(pset, "pixelSeedExtension"):
39  pset.pixelSeedExtension = cms.bool(False)
40  return process
41 
42 #
# CMSSW version specific customizations
def customizeHLTforCMSSW.customizeHLTforCMSSW (   process,
  menuType = "GRun" 
)

Definition at line 43 of file customizeHLTforCMSSW.py.

References customiseFor13753(), and customiseFor14356().

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

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