CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
confdb.HLTProcess Class Reference
Inheritance diagram for confdb.HLTProcess:

Public Member Functions

def __init__
 
def customize
 
def dump
 
def getPathList
 
def getRawConfigurationFromDB
 
def releaseSpecificCustomize
 

Static Public Member Functions

def consolidateNegativeList
 
def consolidatePositiveList
 
def expandWildcards
 

Public Attributes

 config
 
 data
 
 labels
 
 options
 
 parent
 
 source
 

Static Public Attributes

tuple fastsimUnsupportedPaths
 

Detailed Description

Definition at line 21 of file confdb.py.

Constructor & Destructor Documentation

def confdb.HLTProcess.__init__ (   self,
  configuration 
)

Definition at line 96 of file confdb.py.

96 
97  def __init__(self, configuration):
98  self.config = configuration
99  self.data = None
100  self.source = None
101  self.parent = None
103  self.options = {
104  'essources' : [],
105  'esmodules' : [],
106  'modules' : [],
107  'sequences' : [],
108  'services' : [],
109  'paths' : [],
110  'psets' : [],
111  'blocks' : [],
112  }
114  self.labels = {}
115  if self.config.fragment:
116  self.labels['process'] = ''
117  self.labels['dict'] = 'locals()'
118  else:
119  self.labels['process'] = 'process.'
120  self.labels['dict'] = 'process.__dict__'
121 
122  if self.config.online:
123  self.labels['connect'] = 'frontier://(proxyurl=http://localhost:3128)(serverurl=http://localhost:8000/FrontierOnProd)(serverurl=http://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
124  else:
125  self.labels['connect'] = 'frontier://FrontierProd'
126 
127  # get the configuration from ConfdB
128  self.buildPathList()
129  self.buildOptions()
131  self.customize()
132 
def getRawConfigurationFromDB
Definition: confdb.py:133

Member Function Documentation

def confdb.HLTProcess.consolidateNegativeList (   elements)
static

Definition at line 192 of file confdb.py.

References runtimedef.set().

193  def consolidateNegativeList(elements):
194  # consolidate a list of path exclusions and re-inclusions
195  # the result is the list of paths to be removed from the dump
196  result = set()
197  for element in elements:
198  if element[0] == '-':
199  result.add( element )
200  else:
201  result.discard( '-' + element )
202  return sorted( element for element in result )
def consolidateNegativeList
Definition: confdb.py:192
void set(const std::string &name, int value)
set the flag, with a run-time name
def confdb.HLTProcess.consolidatePositiveList (   elements)
static

Definition at line 204 of file confdb.py.

References runtimedef.set().

205  def consolidatePositiveList(elements):
206  # consolidate a list of path selection and re-exclusions
207  # the result is the list of paths to be included in the dump
208  result = set()
209  for element in elements:
210  if element[0] == '-':
211  result.discard( element[1:] )
212  else:
213  result.add( element )
214  return sorted( element for element in result )
215 
def consolidatePositiveList
Definition: confdb.py:204
void set(const std::string &name, int value)
set the flag, with a run-time name
def confdb.HLTProcess.customize (   self)

Definition at line 374 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, DOTExport.DotProducer.data, CondIter< DataT >.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, @467.data, confdb.HLTProcess.data, cscdqm::Cache.data, DQMNet::Bucket.data, python.DBCopy.DBCopy.data, and confdb.HLTProcess.releaseSpecificCustomize().

375  def customize(self):
376 
377  # adapt the source to the current scenario
378  if not self.config.fragment:
379  self.build_source()
380 
381  # manual override some parameters
382  if self.config.type in ('GRun', ):
383  self.data += """
384 # Enable HF Noise filters in GRun menu
385 if 'hltHfreco' in %(dict)s:
386  %(process)shltHfreco.setNoiseFlags = cms.bool( True )
387 """
388  if self.config.type in ('HIon', ):
389  self.data += """
390 # Disable HF Noise filters in HIon menu
391 if 'hltHfreco' in %(dict)s:
392  %(process)shltHfreco.setNoiseFlags = cms.bool( False )
393 """
394 
# self.data += """
def confdb.HLTProcess.dump (   self)

Definition at line 217 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, DOTExport.DotProducer.data, CondIter< DataT >.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, @467.data, confdb.HLTProcess.data, DQMNet::Bucket.data, cscdqm::Cache.data, python.DBCopy.DBCopy.data, confdb.HLTProcess.labels, and svgfig.Ticks.labels.

218  def dump(self):
219  return self.data % self.labels
220 
def confdb.HLTProcess.expandWildcards (   globs,
  collection 
)
static

Definition at line 176 of file confdb.py.

References python.rootplot.root2matplotlib.replace().

177  def expandWildcards(globs, collection):
178  # expand a list of unix-style wildcards matching a given collection
179  # wildcards with no matches are silently discarded
180  matches = []
181  for glob in globs:
182  negate = ''
183  if glob[0] == '-':
184  negate = '-'
185  glob = glob[1:]
186  # translate a unix-style glob expression into a regular expression
187  filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
188  matches.extend( negate + element for element in collection if filter.match(element) )
189  return matches
190 
def expandWildcards
Definition: confdb.py:176
def confdb.HLTProcess.getPathList (   self)

Definition at line 151 of file confdb.py.

References SiPixelLorentzAngle_cfi.read.

152  def getPathList(self):
153  url = 'http://cms-project-confdb-hltdev.web.cern.ch/cms-project-confdb-hltdev/get.jsp'
154  postdata = {
155  'noedsources': '',
156  'noes': '',
157  'noservices': '',
158  'nosequences': '',
159  'nomodules' : '',
160  'cff': '',
161  }
162  if self.config.menu.run:
163  postdata['runNumber'] = self.config.menu.run
164  else:
165  postdata['dbName'] = self.config.menu.db
166  postdata['configName']= self.config.menu.name
167 
168  data = urllib2.urlopen(url, urllib.urlencode(postdata)).read()
169  if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
170  raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
171  filter = re.compile(r' *= *cms.(End)?Path.*')
172  paths = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
173  return paths
174 
def confdb.HLTProcess.getRawConfigurationFromDB (   self)

Definition at line 133 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, DOTExport.DotProducer.data, CondIter< DataT >.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, @467.data, confdb.HLTProcess.data, DQMNet::Bucket.data, cscdqm::Cache.data, python.DBCopy.DBCopy.data, python.multivaluedict.dict, join(), and SiPixelLorentzAngle_cfi.read.

134  def getRawConfigurationFromDB(self):
135  url = 'http://cms-project-confdb-hltdev.web.cern.ch/cms-project-confdb-hltdev/get.jsp'
136  postdata = dict([ (key, ','.join(vals)) for key, vals in self.options.iteritems() if vals ])
137  postdata['noedsources'] = ''
138  if self.config.fragment:
139  postdata['cff'] = ''
140  if self.config.menu.run:
141  postdata['runNumber'] = self.config.menu.run
142  else:
143  postdata['dbName'] = self.config.menu.db
144  postdata['configName']= self.config.menu.name
145 
146  data = urllib2.urlopen(url, urllib.urlencode(postdata)).read()
147  if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
148  raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
149  self.data = data
150 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRawConfigurationFromDB
Definition: confdb.py:133
def confdb.HLTProcess.releaseSpecificCustomize (   self)

Definition at line 222 of file confdb.py.

References CombinedSVCalibration.data, CombinedTauTagCalibration.data, TrackProbabilityCalibration.data, python.multivaluedict.MyUserList.data, ElectronLikelihoodCalibration.data, CSCTMBScope.data, DOTExport.DotProducer.data, CondIter< DataT >.data, dqmTnP::AbstractFitter.data, LASModuleProfile.data, comparisonPlots.data, cond::IOVProxyData.data, BaseMETv0.data, TkLasBeam.data, EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients.data, edm::MapOfVectors< K, T >::Iter.data, edm::DetSet< T >.data, EcalShowerContainmentCorrections::Coefficients.data, @467.data, confdb.HLTProcess.data, cscdqm::Cache.data, DQMNet::Bucket.data, and python.DBCopy.DBCopy.data.

Referenced by confdb.HLTProcess.customize().

223  def releaseSpecificCustomize(self):
224  # version specific customizations
225  self.data += """
226 # CMSSW version specific customizations
227 import os
228 cmsswVersion = os.environ['CMSSW_VERSION']
229 
230 # customization for CMSSW_5_2_X
231 if cmsswVersion.startswith('CMSSW_5_2_'):
232 
233  # force the use of the correct calo jet energy corrections
234  if 'hltESPL1FastJetCorrectionESProducer' in %(dict)s:
235  %(process)shltESPL1FastJetCorrectionESProducer.algorithm = "AK5CaloHLT"
236 
237  if 'hltESPL2RelativeCorrectionESProducer' in %(dict)s:
238  %(process)shltESPL2RelativeCorrectionESProducer.algorithm = "AK5CaloHLT"
239 
240  if 'hltESPL3AbsoluteCorrectionESProducer' in %(dict)s:
241  %(process)shltESPL3AbsoluteCorrectionESProducer.algorithm = "AK5CaloHLT"
242 
243 
244 # customization for CMSSW_5_3_X
245 if cmsswVersion.startswith('CMSSW_5_3_'):
246 
247  # do not override the calo jet energy corrections in 5.3.x for consistency with the current MC samples
248  pass
249 
250 
251 # customization for CMSSW_6_1_X and 6_2_X
252 if cmsswVersion.startswith('CMSSW_6_1_') or cmsswVersion.startswith('CMSSW_6_2_'):
253 
254  # force the use of the correct calo jet energy corrections
255  if 'hltESPL1FastJetCorrectionESProducer' in %(dict)s:
256  %(process)shltESPL1FastJetCorrectionESProducer.algorithm = "AK5CaloHLT"
257 
258  if 'hltESPL2RelativeCorrectionESProducer' in %(dict)s:
259  %(process)shltESPL2RelativeCorrectionESProducer.algorithm = "AK5CaloHLT"
260 
261  if 'hltESPL3AbsoluteCorrectionESProducer' in %(dict)s:
262  %(process)shltESPL3AbsoluteCorrectionESProducer.algorithm = "AK5CaloHLT"
263 
264  # adapt the HLT menu to the "prototype for Event Interpretation" development
265  if 'hltPFPileUp' in %(dict)s:
266  # define new PFCandidateFwdPtrProducer module
267  %(process)shltParticleFlowPtrs = cms.EDProducer("PFCandidateFwdPtrProducer",
268  src = cms.InputTag('hltParticleFlow')
269  )
270  # add the new module before the hltPFPileUp module
271  _sequence = None
272  for _sequence in [ _sequence for _sequence in %(dict)s.itervalues() if isinstance(_sequence, cms._ModuleSequenceType)]:
273  try:
274  _sequence.insert( _sequence.index(%(process)shltPFPileUp), %(process)shltParticleFlowPtrs )
275  except ValueError:
276  pass
277  # reconfigure hltPFPileUp and hltPFNoPileUp to use the new module
278  %(process)shltPFPileUp.PFCandidates = cms.InputTag( "hltParticleFlowPtrs" )
279  %(process)shltPFNoPileUp.bottomCollection = cms.InputTag( "hltParticleFlowPtrs" )
280 
281  # postLS1 muon extension
282  # /CalibMuon/CSCCalibration/python/CSCIndexer_cfi.py
283  %(process)sCSCIndexerESSource = cms.ESSource("EmptyESSource",
284  recordName = cms.string("CSCIndexerRecord"),
285  firstValid = cms.vuint32(1),
286  iovIsRunNotTime = cms.bool(True)
287  )
288  %(process)sCSCIndexerESProducer = cms.ESProducer("CSCIndexerESProducer",
289  AlgoName = cms.string("CSCIndexerStartup")
290  )
291  # /CalibMuon/CSCCalibration/python/CSCChannelMapper_cfi.py
292  %(process)sCSCChannelMapperESSource = cms.ESSource("EmptyESSource",
293  recordName = cms.string("CSCChannelMapperRecord"),
294  firstValid = cms.vuint32(1),
295  iovIsRunNotTime = cms.bool(True)
296  )
297  %(process)sCSCChannelMapperESProducer = cms.ESProducer("CSCChannelMapperESProducer",
298  AlgoName = cms.string("CSCChannelMapperStartup")
299  )
300 
301 # customization for CMSSW_6_2_X only
302 if cmsswVersion.startswith('CMSSW_6_2_'):
303  # /Geometry/TrackerNumberingBuilder/trackerTopologyConstants_cfi.py
304  %(process)strackerTopologyConstants = cms.ESProducer('TrackerTopologyEP',
305  pxb_layerStartBit = cms.uint32(16),
306  pxb_ladderStartBit = cms.uint32(8),
307  pxb_moduleStartBit = cms.uint32(2),
308  pxb_layerMask = cms.uint32(15),
309  pxb_ladderMask = cms.uint32(255),
310  pxb_moduleMask = cms.uint32(63),
311  pxf_sideStartBit = cms.uint32(23),
312  pxf_diskStartBit = cms.uint32(16),
313  pxf_bladeStartBit = cms.uint32(10),
314  pxf_panelStartBit = cms.uint32(8),
315  pxf_moduleStartBit = cms.uint32(2),
316  pxf_sideMask = cms.uint32(3),
317  pxf_diskMask = cms.uint32(15),
318  pxf_bladeMask = cms.uint32(63),
319  pxf_panelMask = cms.uint32(3),
320  pxf_moduleMask = cms.uint32(63),
321  tec_sideStartBit = cms.uint32(18),
322  tec_wheelStartBit = cms.uint32(14),
323  tec_petal_fw_bwStartBit = cms.uint32(12),
324  tec_petalStartBit = cms.uint32(8),
325  tec_ringStartBit = cms.uint32(5),
326  tec_moduleStartBit = cms.uint32(2),
327  tec_sterStartBit = cms.uint32(0),
328  tec_sideMask = cms.uint32(3),
329  tec_wheelMask = cms.uint32(15),
330  tec_petal_fw_bwMask = cms.uint32(3),
331  tec_petalMask = cms.uint32(15),
332  tec_ringMask = cms.uint32(7),
333  tec_moduleMask = cms.uint32(7),
334  tec_sterMask = cms.uint32(3),
335  tib_layerStartBit = cms.uint32(14),
336  tib_str_fw_bwStartBit = cms.uint32(12),
337  tib_str_int_extStartBit = cms.uint32(10),
338  tib_strStartBit = cms.uint32(4),
339  tib_moduleStartBit = cms.uint32(2),
340  tib_sterStartBit = cms.uint32(0),
341  tib_layerMask = cms.uint32(7),
342  tib_str_fw_bwMask = cms.uint32(3),
343  tib_str_int_extMask = cms.uint32(3),
344  tib_strMask = cms.uint32(63),
345  tib_moduleMask = cms.uint32(3),
346  tib_sterMask = cms.uint32(3),
347  tid_sideStartBit = cms.uint32(13),
348  tid_wheelStartBit = cms.uint32(11),
349  tid_ringStartBit = cms.uint32(9),
350  tid_module_fw_bwStartBit = cms.uint32(7),
351  tid_moduleStartBit = cms.uint32(2),
352  tid_sterStartBit = cms.uint32(0),
353  tid_sideMask = cms.uint32(3),
354  tid_wheelMask = cms.uint32(3),
355  tid_ringMask = cms.uint32(3),
356  tid_module_fw_bwMask = cms.uint32(3),
357  tid_moduleMask = cms.uint32(31),
358  tid_sterMask = cms.uint32(3),
359  tob_layerStartBit = cms.uint32(14),
360  tob_rod_fw_bwStartBit = cms.uint32(12),
361  tob_rodStartBit = cms.uint32(5),
362  tob_moduleStartBit = cms.uint32(2),
363  tob_sterStartBit = cms.uint32(0),
364  tob_layerMask = cms.uint32(7),
365  tob_rod_fw_bwMask = cms.uint32(3),
366  tob_rodMask = cms.uint32(127),
367  tob_moduleMask = cms.uint32(7),
368  tob_sterMask = cms.uint32(3),
369  appendToDataLabel = cms.string('')
370  )
371 
372 """
def releaseSpecificCustomize
Definition: confdb.py:222

Member Data Documentation

confdb.HLTProcess.config

Definition at line 97 of file confdb.py.

confdb.HLTProcess.data

Definition at line 98 of file confdb.py.

Referenced by confdb.HLTProcess.customize(), confdb.HLTProcess.dump(), confdb.HLTProcess.getRawConfigurationFromDB(), and confdb.HLTProcess.releaseSpecificCustomize().

tuple confdb.HLTProcess.fastsimUnsupportedPaths
static

Definition at line 23 of file confdb.py.

confdb.HLTProcess.labels

Definition at line 113 of file confdb.py.

Referenced by confdb.HLTProcess.dump().

confdb.HLTProcess.options

Definition at line 102 of file confdb.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), betterConfigParser.BetterConfigParser.checkInput(), DOTExport.DotExport.export(), and DOTExport.DotExport.write_output().

confdb.HLTProcess.parent

Definition at line 100 of file confdb.py.

Referenced by argparse.HelpFormatter._Section.__init__(), BeautifulSoup.PageElement._invert(), Vispa.Gui.ConnectableWidget.ConnectableWidget.addMenuEntry(), Vispa.Views.LineDecayView.LineDecayContainer.applyFilter(), Vispa.Views.BoxDecayView.BoxDecayContainer.arrangeUsingRelations(), Vispa.Views.BoxDecayView.BoxDecayContainer.autolayoutAlgorithm(), Vispa.Gui.ZoomableScrollableWidgetOwner.ZoomableScrollableWidgetOwner.autosizeScrollArea(), Vispa.Views.BoxDecayView.BoxDecayContainer.autosizeScrollArea(), Vispa.Gui.PortWidget.PortWidget.connectionPoint(), Vispa.Main.StartupScreen.StartupScreen.createDescriptionWidget(), Vispa.Views.BoxDecayView.BoxDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.dataAccessor(), Vispa.Views.LineDecayView.DecayLine.dataAccessor(), Vispa.Views.LineDecayView.LineDecayContainer.delete(), Vispa.Views.LineDecayView.DecayNode.delete(), Vispa.Views.LineDecayView.DecayLine.delete(), Vispa.Gui.VispaWidget.VispaWidget.delete(), Vispa.Gui.VispaWidget.VispaWidget.dragWidget(), Vispa.Share.ImageExporter.ImageExporter.exportImageDialog(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), argparse.HelpFormatter._Section.format_help(), python.rootplot.argparse.HelpFormatter._Section.format_help(), Vispa.Gui.VispaWidget.VispaWidget.keyPressEvent(), Vispa.Gui.MenuWidget.MenuWidget.leaveEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent(), Vispa.Gui.PortWidget.PortWidget.moduleParent(), Vispa.Gui.WidgetContainer.WidgetContainer.mouseDoubleClickEvent(), Vispa.Gui.VispaWidget.VispaWidget.mouseDoubleClickEvent(), Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), Vispa.Views.LineDecayView.ParticleWidget.mousePressEvent(), Vispa.Views.LineDecayView.DecayNode.move(), Vispa.Views.LineDecayView.LineDecayContainer.noDecorationsMode(), Vispa.Views.LineDecayView.LineDecayContainer.operationId(), Vispa.Views.LineDecayView.DecayLine.paint(), Vispa.Gui.VispaWidget.VispaWidget.paintEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.positionizeMenuWidget(), Vispa.Views.LineDecayView.DecayLine.qtLineStyle(), Vispa.Views.WidgetView.WidgetView.restoreSelection(), Vispa.Views.WidgetView.WidgetView.select(), Vispa.Gui.PortConnection.PointToPointConnection.select(), Vispa.Gui.VispaWidget.VispaWidget.select(), Vispa.Views.LineDecayView.LineDecayContainer.select(), Vispa.Views.LineDecayView.LineDecayContainer.sizeHint(), Vispa.Views.LineDecayView.LineDecayContainer.tabController(), Vispa.Views.BoxDecayView.BoxDecayContainer.toggleCollapsed(), Vispa.Views.LineDecayView.DecayNode.unite(), Vispa.Views.PropertyView.PropertyView.valueChanged(), Vispa.Views.BoxDecayView.BoxDecayContainer.widgetByObject(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDoubleClicked(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDragged().

confdb.HLTProcess.source

Definition at line 99 of file confdb.py.