CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/HLTrigger/Configuration/python/Tools/options.py

Go to the documentation of this file.
00001 # available "type"s and relative global tags
00002 globalTag = {
00003   'FULL': 'auto:startup',
00004   'GRun': 'auto:startup',       # use as default
00005   'data': 'auto:hltonline',
00006   'HIon': 'auto:starthi',
00007 }
00008 
00009 
00010 # type used to store a reference to an L1 menu
00011 class ConnectionL1TMenu(object):
00012   def __init__(self, value):
00013     self.override = None
00014     self.connect  = None
00015 
00016     # extract the override tag and the connection string
00017     if value:
00018       if ',' in value:
00019         self.override = value.split(',')[0]
00020         self.connect  = value.split(',')[1]
00021       else:
00022         self.override = value
00023         self.connect  = None
00024 
00025 
00026 # type used to store a reference to an L1 menu
00027 class ConnectionL1TMenuXml(object):
00028   def __init__(self, value):
00029     self.XmlFile = None
00030     self.LumiDir = None
00031 
00032     # extract the override tag and the connection string
00033     if value:
00034       if ',' in value:
00035         self.XmlFile = value.split(',')[0]
00036         self.LumiDir = value.split(',')[1]
00037       else:
00038         self.XmlFile = value
00039         self.LumiDir = "startup"
00040 
00041 
00042 # type used to store a reference to an HLT configuration
00043 class ConnectionHLTMenu(object):
00044   def __init__(self, value):
00045     self.value = value
00046     self.db    = None
00047     self.name  = None
00048     self.run   = None
00049 
00050     # extract the database and configuration name
00051     if value:
00052       if ':' in self.value:
00053         (db, name) = self.value.split(':')
00054         if db == 'run':
00055           self.run  = name
00056         elif db in ('hltdev', 'orcoff'):
00057           self.db   = db
00058           self.name = name
00059         else:
00060           raise Exception('Unknown ConfDB database "%s", valid values are "hltdev" (default) and "orcoff")' % db)
00061       else:
00062         self.db   = 'hltdev'
00063         self.name = self.value
00064 
00065 
00066 # options marked with a (*) only apply when creating a whole process configuration
00067 class HLTProcessOptions(object):
00068   def __init__(self):
00069     self.menu       = None        #     hlt menu
00070     self.name       = 'HLTX'      # (*) if set, override the process name
00071     self.type       = 'GRun'      #     defines global options for 'GRun', 'HIon' or 'online' menus
00072     self.data       = True        #     run on data (true) or mc (false)
00073     self.online     = False       # (*) run online (true) or offline (false)
00074     self.globaltag  = None        # (*) if set, override the GlobalTag
00075     self.l1         = None        # (*) if set, override the L1 menu
00076     self.l1Xml      = None        # (*) if set, override the L1 menu Xml
00077     self.emulator   = None        # (*) if set, run (part of) the L1 emulator instead of taking the L1 results from the data
00078     self.unprescale = False       # (*) if set, unprescale all paths
00079     self.open       = False       #     if set, cms.ignore all filters, making all paths run on and accept all events
00080     self.profiling  = False       #     if set, instrument the menu for profiling measurements
00081     self.timing     = False       #     if set, instrument the menu for timing measurements (implies profiling)
00082     self.paths      = None        #     if set, include in the dump only the given paths (wildcards are supported)
00083     self.input      = None        # (*) if set, run on a specific input file
00084     self.output     = 'all'       # (*) output 'all', 'minimal' or 'none' output modules
00085     self.fragment   = False       #     prepare a configuration fragment (true) or a whole process (false)
00086     self.fastsim    = False       #     prepare a configuration fragment suitable for FastSim
00087 
00088 
00089   # convert HLT and L1 menus to a dedicated object representation on the fly
00090   def __setattr__(self, name, value):
00091     if name is 'menu' and type(value) is not ConnectionHLTMenu:
00092       # format 'menu' as needed
00093       object.__setattr__(self, name, ConnectionHLTMenu(value))
00094     elif name is 'l1' and type(value) is not ConnectionL1TMenu:
00095       # format '--l1' as needed
00096       object.__setattr__(self, name, ConnectionL1TMenu(value))
00097     elif name is 'l1Xml' and type(value) is not ConnectionL1TMenuXml:
00098       # format '--l1Xml' as needed
00099       object.__setattr__(self, name, ConnectionL1TMenuXml(value))
00100     elif name is 'fastsim' and value:
00101       # '--fastsim' implies '--fragment' and '--mc'
00102       object.__setattr__(self, 'fastsim',    True)
00103       object.__setattr__(self, 'fragment',   True)
00104       object.__setattr__(self, 'data',       False)
00105     elif name is 'open' and value:
00106       # '--open' implies '--unprescale'
00107       object.__setattr__(self, 'open',       True)
00108       object.__setattr__(self, 'unprescale', True)
00109     elif name is 'profiling' and value:
00110       # '--profiling' implies implies '--no-output'
00111       object.__setattr__(self, 'profiling',  True)
00112       object.__setattr__(self, 'output',     'none')
00113     elif name is 'timing' and value:
00114       # '--timing' implies '--profiling' and '--no-output'
00115       object.__setattr__(self, 'timing',     True)
00116       object.__setattr__(self, 'profiling',  True)
00117       object.__setattr__(self, 'output',     'none')
00118     else:
00119       object.__setattr__(self, name, value)