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

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


Member Function Documentation

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

Definition at line 141 of file confdb.py.

00142                           :
00143     if not self.config.fragment:
00144       return 'edmConfigFromDB       %s --noedsources %s' % (self._build_query(), self._build_options())
00145     else:
00146       return 'edmConfigFromDB --cff %s --noedsources %s' % (self._build_query(), self._build_options())
00147 

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

Definition at line 138 of file confdb.py.

00139                           :
00140     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 132 of file confdb.py.

00133                         :
00134     if self.config.menu.run:
00135       return '--runNumber %s' % self.config.menu.run
00136     else:
00137       return '--%s --configName %s' % (self.config.menu.db, self.config.menu.name)

def confdb::HLTProcess::consolidateNegativeList (   elements)

Definition at line 183 of file confdb.py.

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

def confdb::HLTProcess::consolidatePositiveList (   elements)

Definition at line 195 of file confdb.py.

00196                                        :
00197     # consolidate a list of path selection and re-exclusions
00198     # the result is the list of paths to be included in the dump
00199     result = set()
00200     for element in elements:
00201       if element[0] == '-':
00202         result.discard( element[1:] )
00203       else:
00204         result.add( element )
00205     return sorted( element for element in result )
00206 

def confdb::HLTProcess::customize (   self)

Definition at line 365 of file confdb.py.

00366                      :
00367 
00368     # adapt the source to the current scenario
00369     if not self.config.fragment:
00370       self.build_source()
00371 
00372     # manual override some parameters
00373     if self.config.type in ('GRun', ):
00374       self.data += """
00375 # Enable HF Noise filters in GRun menu
00376 if 'hltHfreco' in %(dict)s:
00377     %(process)shltHfreco.setNoiseFlags = cms.bool( True )
00378 """
00379     if self.config.type in ('HIon', ):
00380       self.data += """
00381 # Disable HF Noise filters in HIon menu
00382 if 'hltHfreco' in %(dict)s:
00383     %(process)shltHfreco.setNoiseFlags = cms.bool( False )
00384 """
00385 
#    self.data += """
def confdb::HLTProcess::dump (   self)

Definition at line 208 of file confdb.py.

00209                 :
00210     return self.data % self.labels
00211 

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

Definition at line 167 of file confdb.py.

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

def confdb::HLTProcess::getPathList (   self)

Definition at line 156 of file confdb.py.

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

def confdb::HLTProcess::getRawConfigurationFromDB (   self)

Definition at line 148 of file confdb.py.

00149                                      :
00150     cmdline = self._build_cmdline()
00151     data = _pipe(cmdline)
00152     if 'Exhausted Resultset' in data or 'CONFIG_NOT_FOUND' in data:
00153       raise ImportError('%s is not a valid HLT menu' % self.config.menuConfig.value)
00154     self.data = data
00155 

def confdb::HLTProcess::releaseSpecificCustomize (   self)

Definition at line 213 of file confdb.py.

00214                                     :
00215     # version specific customizations
00216     self.data += """
00217 # CMSSW version specific customizations
00218 import os
00219 cmsswVersion = os.environ['CMSSW_VERSION']
00220 
00221 # customization for CMSSW_5_2_X
00222 if cmsswVersion.startswith('CMSSW_5_2_'):
00223 
00224     # force the use of the correct calo jet energy corrections
00225     if 'hltESPL1FastJetCorrectionESProducer' in %(dict)s:
00226         %(process)shltESPL1FastJetCorrectionESProducer.algorithm  = "AK5CaloHLT"
00227 
00228     if 'hltESPL2RelativeCorrectionESProducer' in %(dict)s:
00229         %(process)shltESPL2RelativeCorrectionESProducer.algorithm = "AK5CaloHLT"
00230 
00231     if 'hltESPL3AbsoluteCorrectionESProducer' in %(dict)s:
00232         %(process)shltESPL3AbsoluteCorrectionESProducer.algorithm = "AK5CaloHLT"
00233 
00234 
00235 # customization for CMSSW_5_3_X
00236 if cmsswVersion.startswith('CMSSW_5_3_'):
00237 
00238     # do not override the calo jet energy corrections in 5.3.x for consistency with the current MC samples
00239     pass
00240 
00241 
00242 # customization for CMSSW_6_1_X and 6_2_X
00243 if cmsswVersion.startswith('CMSSW_6_1_') or cmsswVersion.startswith('CMSSW_6_2_'):
00244 
00245     # force the use of the correct calo jet energy corrections
00246     if 'hltESPL1FastJetCorrectionESProducer' in %(dict)s:
00247         %(process)shltESPL1FastJetCorrectionESProducer.algorithm  = "AK5CaloHLT"
00248 
00249     if 'hltESPL2RelativeCorrectionESProducer' in %(dict)s:
00250         %(process)shltESPL2RelativeCorrectionESProducer.algorithm = "AK5CaloHLT"
00251 
00252     if 'hltESPL3AbsoluteCorrectionESProducer' in %(dict)s:
00253         %(process)shltESPL3AbsoluteCorrectionESProducer.algorithm = "AK5CaloHLT"
00254 
00255     # adapt the HLT menu to the "prototype for Event Interpretation" development
00256     if 'hltPFPileUp' in %(dict)s:
00257         # define new PFCandidateFwdPtrProducer module
00258         %(process)shltParticleFlowPtrs = cms.EDProducer("PFCandidateFwdPtrProducer",
00259             src = cms.InputTag('hltParticleFlow')
00260         )
00261         # add the new module before the hltPFPileUp module
00262         _sequence = None
00263         for _sequence in [ _sequence for _sequence in %(dict)s.itervalues() if isinstance(_sequence, cms._ModuleSequenceType)]:
00264             try:
00265                 _sequence.insert( _sequence.index(%(process)shltPFPileUp), %(process)shltParticleFlowPtrs )
00266             except ValueError:
00267                 pass
00268         # reconfigure hltPFPileUp and hltPFNoPileUp to use the new module
00269         %(process)shltPFPileUp.PFCandidates       = cms.InputTag( "hltParticleFlowPtrs" )
00270         %(process)shltPFNoPileUp.bottomCollection = cms.InputTag( "hltParticleFlowPtrs" )
00271 
00272     # postLS1 muon extension
00273     # /CalibMuon/CSCCalibration/python/CSCIndexer_cfi.py
00274     %(process)sCSCIndexerESSource = cms.ESSource("EmptyESSource",
00275       recordName = cms.string("CSCIndexerRecord"),
00276       firstValid = cms.vuint32(1),
00277       iovIsRunNotTime = cms.bool(True)
00278     )
00279     %(process)sCSCIndexerESProducer = cms.ESProducer("CSCIndexerESProducer",
00280       AlgoName = cms.string("CSCIndexerStartup")
00281     )
00282     # /CalibMuon/CSCCalibration/python/CSCChannelMapper_cfi.py
00283     %(process)sCSCChannelMapperESSource = cms.ESSource("EmptyESSource",
00284       recordName = cms.string("CSCChannelMapperRecord"),
00285       firstValid = cms.vuint32(1),
00286       iovIsRunNotTime = cms.bool(True)
00287     )
00288     %(process)sCSCChannelMapperESProducer = cms.ESProducer("CSCChannelMapperESProducer",
00289       AlgoName = cms.string("CSCChannelMapperStartup")
00290     )
00291 
00292 # customization for CMSSW_6_2_X only
00293 if cmsswVersion.startswith('CMSSW_6_2_'):
00294     # /Geometry/TrackerNumberingBuilder/trackerTopologyConstants_cfi.py
00295     %(process)strackerTopologyConstants = cms.ESProducer('TrackerTopologyEP',
00296       pxb_layerStartBit = cms.uint32(16),
00297       pxb_ladderStartBit = cms.uint32(8),
00298       pxb_moduleStartBit = cms.uint32(2),
00299       pxb_layerMask = cms.uint32(15),
00300       pxb_ladderMask = cms.uint32(255),
00301       pxb_moduleMask = cms.uint32(63),
00302       pxf_sideStartBit = cms.uint32(23),
00303       pxf_diskStartBit = cms.uint32(16),
00304       pxf_bladeStartBit = cms.uint32(10),
00305       pxf_panelStartBit = cms.uint32(8),
00306       pxf_moduleStartBit = cms.uint32(2),
00307       pxf_sideMask = cms.uint32(3),
00308       pxf_diskMask = cms.uint32(15),
00309       pxf_bladeMask = cms.uint32(63),
00310       pxf_panelMask = cms.uint32(3),
00311       pxf_moduleMask = cms.uint32(63),
00312       tec_sideStartBit = cms.uint32(18),
00313       tec_wheelStartBit = cms.uint32(14),
00314       tec_petal_fw_bwStartBit = cms.uint32(12),
00315       tec_petalStartBit = cms.uint32(8),
00316       tec_ringStartBit = cms.uint32(5),
00317       tec_moduleStartBit = cms.uint32(2),
00318       tec_sterStartBit = cms.uint32(0),
00319       tec_sideMask = cms.uint32(3),
00320       tec_wheelMask = cms.uint32(15),
00321       tec_petal_fw_bwMask = cms.uint32(3),
00322       tec_petalMask = cms.uint32(15),
00323       tec_ringMask = cms.uint32(7),
00324       tec_moduleMask = cms.uint32(7),
00325       tec_sterMask = cms.uint32(3),
00326       tib_layerStartBit = cms.uint32(14),
00327       tib_str_fw_bwStartBit = cms.uint32(12),
00328       tib_str_int_extStartBit = cms.uint32(10),
00329       tib_strStartBit = cms.uint32(4),
00330       tib_moduleStartBit = cms.uint32(2),
00331       tib_sterStartBit = cms.uint32(0),
00332       tib_layerMask = cms.uint32(7),
00333       tib_str_fw_bwMask = cms.uint32(3),
00334       tib_str_int_extMask = cms.uint32(3),
00335       tib_strMask = cms.uint32(63),
00336       tib_moduleMask = cms.uint32(3),
00337       tib_sterMask = cms.uint32(3),
00338       tid_sideStartBit = cms.uint32(13),
00339       tid_wheelStartBit = cms.uint32(11),
00340       tid_ringStartBit = cms.uint32(9),
00341       tid_module_fw_bwStartBit = cms.uint32(7),
00342       tid_moduleStartBit = cms.uint32(2),
00343       tid_sterStartBit = cms.uint32(0),
00344       tid_sideMask = cms.uint32(3),
00345       tid_wheelMask = cms.uint32(3),
00346       tid_ringMask = cms.uint32(3),
00347       tid_module_fw_bwMask = cms.uint32(3),
00348       tid_moduleMask = cms.uint32(31),
00349       tid_sterMask = cms.uint32(3),
00350       tob_layerStartBit = cms.uint32(14),
00351       tob_rod_fw_bwStartBit = cms.uint32(12),
00352       tob_rodStartBit = cms.uint32(5),
00353       tob_moduleStartBit = cms.uint32(2),
00354       tob_sterStartBit = cms.uint32(0),
00355       tob_layerMask = cms.uint32(7),
00356       tob_rod_fw_bwMask = cms.uint32(3),
00357       tob_rodMask = cms.uint32(127),
00358       tob_moduleMask = cms.uint32(7),
00359       tob_sterMask = cms.uint32(3),
00360       appendToDataLabel = cms.string('')
00361     )
00362 
00363 """


Member Data Documentation

Definition at line 95 of file confdb.py.

Definition at line 95 of file confdb.py.

Definition at line 22 of file confdb.py.

Definition at line 95 of file confdb.py.

Definition at line 95 of file confdb.py.

Definition at line 95 of file confdb.py.

Definition at line 95 of file confdb.py.