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 83 of file confdb.py.

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


Member Function Documentation

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

Definition at line 129 of file confdb.py.

00130                           :
00131     if not self.config.fragment:
00132       return 'edmConfigFromDB       %s --noedsources %s' % (self._build_query(), self._build_options())
00133     else:
00134       return 'edmConfigFromDB --cff %s --noedsources %s' % (self._build_query(), self._build_options())
00135 

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

Definition at line 126 of file confdb.py.

00127                           :
00128     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 120 of file confdb.py.

00121                         :
00122     if self.config.menu.run:
00123       return '--runNumber %s' % self.config.menu.run
00124     else:
00125       return '--%s --configName %s' % (self.config.menu.db, self.config.menu.name)

def confdb::HLTProcess::consolidateNegativeList (   elements)

Definition at line 171 of file confdb.py.

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

def confdb::HLTProcess::consolidatePositiveList (   elements)

Definition at line 183 of file confdb.py.

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

def confdb::HLTProcess::customize (   self)

Definition at line 210 of file confdb.py.

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

Definition at line 196 of file confdb.py.

00197                 :
00198     return self.data % self.labels
00199 

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

Definition at line 155 of file confdb.py.

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

def confdb::HLTProcess::getPathList (   self)

Definition at line 144 of file confdb.py.

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

def confdb::HLTProcess::getRawConfigurationFromDB (   self)

Definition at line 136 of file confdb.py.

00137                                      :
00138     cmdline = self._build_cmdline()
00139     data = _pipe(cmdline)
00140     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00141       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00142     self.data = data
00143 

def confdb::HLTProcess::releaseSpecificCustomize (   self)

Definition at line 201 of file confdb.py.

00202                                     :
00203     # version specific customizations
00204     self.data += """
00205 # CMSSW version specific customizations
00206 import os
00207 cmsswVersion = os.environ['CMSSW_VERSION']
00208 """


Member Data Documentation

Definition at line 83 of file confdb.py.

Definition at line 83 of file confdb.py.

Definition at line 22 of file confdb.py.

Definition at line 83 of file confdb.py.

Definition at line 83 of file confdb.py.

Definition at line 83 of file confdb.py.

Definition at line 83 of file confdb.py.