CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions

confdb::HLTProcess Class Reference

List of all members.

Public Member Functions

def __init__
def consolidateNegativeList
def consolidatePositiveList
def customize
def dump
def expandWildcards
def getPathList
def getRawConfigurationFromDB
def releaseSpecificCustomize

Public Attributes

 config
 data
 labels
 options
 parent
 source

Static Public Attributes

tuple fastsimUnsupportedPaths

Private Member Functions

def _build_cmdline
def _build_options
def _build_query

Detailed Description

Definition at line 20 of file confdb.py.


Constructor & Destructor Documentation

def confdb::HLTProcess::__init__ (   self,
  configuration 
)

Definition at line 88 of file confdb.py.

00089                                    :
00090     self.config = configuration
00091     self.data   = None
00092     self.source = None
00093     self.parent = None
00094 
00095     self.options = {
00096       'essources' : [],
00097       'esmodules' : [],
00098       'modules'   : [],
00099       'sequences' : [],
00100       'services'  : [],
00101       'paths'     : [],
00102       'psets'     : [],
00103       'blocks'    : [],
00104     }
00105 
00106     self.labels = {}
00107     if self.config.fragment:
00108       self.labels['process'] = ''
00109       self.labels['dict']    = 'locals()'
00110     else:
00111       self.labels['process'] = 'process.'
00112       self.labels['dict']    = 'process.__dict__'
00113 
00114     if self.config.online:
00115       self.labels['connect'] = 'frontier://(proxyurl=https://localhost:3128)(serverurl=https://localhost:8000/FrontierOnProd)(serverurl=https://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
00116     else:
00117       self.labels['connect'] = 'frontier://FrontierProd'
00118 
00119     # get the configuration from ConfdB
00120     self.buildPathList()
00121     self.buildOptions()
00122     self.getRawConfigurationFromDB()
00123     self.customize()
00124 


Member Function Documentation

def confdb::HLTProcess::_build_cmdline (   self) [private]

Definition at line 134 of file confdb.py.

00135                           :
00136     if not self.config.fragment:
00137       return 'edmConfigFromDB       %s --noedsources %s' % (self._build_query(), self._build_options())
00138     else:
00139       return 'edmConfigFromDB --cff %s --noedsources %s' % (self._build_query(), self._build_options())
00140 

def confdb::HLTProcess::_build_options (   self) [private]

Definition at line 131 of file confdb.py.

00132                           :
00133     return ' '.join(['--%s %s' % (key, ','.join(vals)) for key, vals in self.options.iteritems() if vals])

def confdb::HLTProcess::_build_query (   self) [private]

Definition at line 125 of file confdb.py.

00126                         :
00127     if self.config.menu.run:
00128       return '--runNumber %s' % self.config.menu.run
00129     else:
00130       return '--%s --configName %s' % (self.config.menu.db, self.config.menu.name)

def confdb::HLTProcess::consolidateNegativeList (   elements)

Definition at line 176 of file confdb.py.

00177                                        :
00178     # consolidate a list of path exclusions and re-inclusions
00179     # the result is the list of paths to be removed from the dump
00180     result = set()
00181     for element in elements:
00182       if element[0] == '-':
00183         result.add( element )
00184       else:
00185         result.discard( '-' + element )
00186     return sorted( element for element in result )

def confdb::HLTProcess::consolidatePositiveList (   elements)

Definition at line 188 of file confdb.py.

00189                                        :
00190     # consolidate a list of path selection and re-exclusions
00191     # the result is the list of paths to be included in the dump
00192     result = set()
00193     for element in elements:
00194       if element[0] == '-':
00195         result.discard( element[1:] )
00196       else:
00197         result.add( element )
00198     return sorted( element for element in result )
00199 

def confdb::HLTProcess::customize (   self)

Definition at line 215 of file confdb.py.

00216                      :
00217 
00218     # adapt the source to the current scenario
00219     if not self.config.fragment:
00220       self.build_source()
00221 
00222     # manual override some parameters
00223     if self.config.type in ('GRun', ):
00224       self.data += """
00225 # Enable HF Noise filters in GRun menu
00226 if 'hltHfreco' in %(dict)s:
00227     %(process)shltHfreco.setNoiseFlags = cms.bool( True )
00228 """
00229     if self.config.type in ('HIon', ):
00230       self.data += """
00231 # Disable HF Noise filters in HIon menu
00232 if 'hltHfreco' in %(dict)s:
00233     %(process)shltHfreco.setNoiseFlags = cms.bool( False )
00234 """
00235 
#    self.data += """
def confdb::HLTProcess::dump (   self)

Definition at line 201 of file confdb.py.

00202                 :
00203     return self.data % self.labels
00204 

def confdb::HLTProcess::expandWildcards (   globs,
  collection 
)

Definition at line 160 of file confdb.py.

00161                                         :
00162     # expand a list of unix-style wildcards matching a given collection
00163     # wildcards with no matches are silently discarded
00164     matches = []
00165     for glob in globs:
00166       negate = ''
00167       if glob[0] == '-':
00168         negate = '-'
00169         glob   = glob[1:]
00170       # translate a unix-style glob expression into a regular expression
00171       filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
00172       matches.extend( negate + element for element in collection if filter.match(element) )
00173     return matches
00174 

def confdb::HLTProcess::getPathList (   self)

Definition at line 149 of file confdb.py.

00150                        :
00151     cmdline = 'edmConfigFromDB --cff %s --noedsources --noes --noservices --nosequences --nomodules' % self._build_query()
00152     data = _pipe(cmdline)
00153     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00154       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00155     filter = re.compile(r' *= *cms.(End)?Path.*')
00156     paths  = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
00157     return paths
00158 

def confdb::HLTProcess::getRawConfigurationFromDB (   self)

Definition at line 141 of file confdb.py.

00142                                      :
00143     cmdline = self._build_cmdline()
00144     data = _pipe(cmdline)
00145     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00146       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00147     self.data = data
00148 

def confdb::HLTProcess::releaseSpecificCustomize (   self)

Definition at line 206 of file confdb.py.

00207                                     :
00208     # version specific customizations
00209     self.data += """
00210 # CMSSW version specific customizations
00211 import os
00212 cmsswVersion = os.environ['CMSSW_VERSION']
00213 """


Member Data Documentation

Definition at line 88 of file confdb.py.

Definition at line 88 of file confdb.py.

Definition at line 22 of file confdb.py.

Definition at line 88 of file confdb.py.

Definition at line 88 of file confdb.py.

Definition at line 88 of file confdb.py.

Definition at line 88 of file confdb.py.