CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

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

Detailed Description

Definition at line 21 of file confdb.py.


Constructor & Destructor Documentation

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

Definition at line 65 of file confdb.py.

00066                                    :
00067     self.config = configuration
00068     self.data   = None
00069     self.source = None
00070     self.parent = None
00071 
00072     self.options = {
00073       'essources' : [],
00074       'esmodules' : [],
00075       'modules'   : [],
00076       'sequences' : [],
00077       'services'  : [],
00078       'paths'     : [],
00079       'psets'     : [],
00080       'blocks'    : [],
00081     }
00082 
00083     self.labels = {}
00084     if self.config.fragment:
00085       self.labels['process'] = ''
00086       self.labels['dict']    = 'locals()'
00087     else:
00088       self.labels['process'] = 'process.'
00089       self.labels['dict']    = 'process.__dict__'
00090 
00091     if self.config.online:
00092       self.labels['connect'] = 'frontier://(proxyurl=http://localhost:3128)(serverurl=http://localhost:8000/FrontierOnProd)(serverurl=http://localhost:8000/FrontierOnProd)(retrieve-ziplevel=0)'
00093     else:
00094       self.labels['connect'] = 'frontier://FrontierProd'
00095 
00096     # get the configuration from ConfdB
00097     self.buildPathList()
00098     self.buildOptions()
00099     self.getRawConfigurationFromDB()
00100     self.customize()
00101 


Member Function Documentation

def confdb::HLTProcess::consolidateNegativeList (   elements)

Definition at line 161 of file confdb.py.

00162                                        :
00163     # consolidate a list of path exclusions and re-inclusions
00164     # the result is the list of paths to be removed from the dump
00165     result = set()
00166     for element in elements:
00167       if element[0] == '-':
00168         result.add( element )
00169       else:
00170         result.discard( '-' + element )
00171     return sorted( element for element in result )

def confdb::HLTProcess::consolidatePositiveList (   elements)

Definition at line 173 of file confdb.py.

00174                                        :
00175     # consolidate a list of path selection and re-exclusions
00176     # the result is the list of paths to be included in the dump
00177     result = set()
00178     for element in elements:
00179       if element[0] == '-':
00180         result.discard( element[1:] )
00181       else:
00182         result.add( element )
00183     return sorted( element for element in result )
00184 

def confdb::HLTProcess::customize (   self)

Definition at line 205 of file confdb.py.

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

Definition at line 186 of file confdb.py.

00187                 :
00188     return self.data % self.labels
00189 

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

Definition at line 145 of file confdb.py.

00146                                         :
00147     # expand a list of unix-style wildcards matching a given collection
00148     # wildcards with no matches are silently discarded
00149     matches = []
00150     for glob in globs:
00151       negate = ''
00152       if glob[0] == '-':
00153         negate = '-'
00154         glob   = glob[1:]
00155       # translate a unix-style glob expression into a regular expression
00156       filter = re.compile(r'^' + glob.replace('?', '.').replace('*', '.*').replace('[!', '[^') + r'$')
00157       matches.extend( negate + element for element in collection if filter.match(element) )
00158     return matches
00159 

def confdb::HLTProcess::getPathList (   self)

Definition at line 120 of file confdb.py.

00121                        :
00122     url = 'http://j2eeps.cern.ch/cms-project-confdb-hltdev/get.jsp'
00123     postdata = { 
00124       'noedsources': '', 
00125       'noes':        '',
00126       'noservices':  '',
00127       'nosequences': '',
00128       'nomodules' :  '',
00129       'cff':         '',
00130     }
00131     if self.config.menu.run:
00132       postdata['runNumber'] = self.config.menu.run
00133     else:
00134       postdata['dbName']    = self.config.menu.db
00135       postdata['configName']= self.config.menu.name
00136 
00137     data = urllib2.urlopen(url, urllib.urlencode(postdata)).read()
00138     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00139       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00140     filter = re.compile(r' *= *cms.(End)?Path.*')
00141     paths  = [ filter.sub('', line) for line in data.splitlines() if filter.search(line) ]
00142     return paths
00143 

def confdb::HLTProcess::getRawConfigurationFromDB (   self)

Definition at line 102 of file confdb.py.

00103                                      :
00104     url = 'http://j2eeps.cern.ch/cms-project-confdb-hltdev/get.jsp'
00105     postdata = dict([ (key, ','.join(vals)) for key, vals in self.options.iteritems() if vals ])
00106     postdata['noedsources'] = ''
00107     if self.config.fragment:
00108       postdata['cff'] = ''
00109     if self.config.menu.run:
00110       postdata['runNumber'] = self.config.menu.run
00111     else:
00112       postdata['dbName']    = self.config.menu.db
00113       postdata['configName']= self.config.menu.name
00114 
00115     data = urllib2.urlopen(url, urllib.urlencode(postdata)).read()
00116     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00117       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00118     self.data = data
00119 

def confdb::HLTProcess::releaseSpecificCustomize (   self)

Definition at line 191 of file confdb.py.

00192                                     :
00193     # version specific customizations
00194     self.data += """
00195 # CMSSW version specific customizations
00196 import os
00197 cmsswVersion = os.environ['CMSSW_VERSION']
00198 
00199 # customization for 6_2_X
00200 
00201 # none for now
00202 
00203 """


Member Data Documentation

Definition at line 65 of file confdb.py.

Definition at line 65 of file confdb.py.

Definition at line 23 of file confdb.py.

Definition at line 65 of file confdb.py.

Definition at line 65 of file confdb.py.

Definition at line 65 of file confdb.py.

Definition at line 65 of file confdb.py.