test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
options.py
Go to the documentation of this file.
1 # available "type"s and relative global tags
2 globalTag = {
3  'Fake' : 'auto:run1_mc_Fake',
4  'Fake1': 'auto:run2_mc_Fake1',
5  'FULL' : 'auto:run2_mc_FULL',
6  'GRun' : 'auto:run2_mc_GRun', # used as default
7  '25ns10e33_v2' : 'auto:run2_mc_25ns10e33_v2',
8  '25ns15e33_v4' : 'auto:run2_mc_25ns15e33_v4',
9  'HIon' : 'auto:run2_mc_HIon',
10  'PIon' : 'auto:run2_mc_PIon',
11  'PRef' : 'auto:run2_mc_PRef',
12  'data' : 'auto:run2_hlt_relval',
13 }
14 
15 
16 # type used to store a reference to an L1 menu
17 class ConnectionL1TMenu(object):
18  def __init__(self, value):
19  self.override = None
20  self.snapshotTime = None
21 
22  # extract the override tag and the connection string
23  if value:
24  if ',' in value:
25  self.override = value.split(',')[0]
26  self.snapshotTime = value.split(',')[1]
27  else:
28  self.override = value
29  self.smapshotTime = None
30 
31 
32 # type used to store a reference to an L1 menu
33 class ConnectionL1TMenuXml(object):
34  def __init__(self, value):
35  self.XmlFile = None
36  self.LumiDir = None
37 
38  # extract the override tag and the connection string
39  if value:
40  if ',' in value:
41  self.XmlFile = value.split(',')[0]
42  self.LumiDir = value.split(',')[1]
43  else:
44  self.XmlFile = value
45  self.LumiDir = "startup"
46 
47 
48 # type used to store a reference to an HLT configuration
49 class ConnectionHLTMenu(object):
50  valid_versions = 'v1', 'v2'
51  valid_databases = 'online', 'offline', 'adg'
52  compatibility = { 'hltdev': ('v2', 'offline'), 'orcoff': ('v2', 'adg') }
53 
54  def __init__(self, value):
55  self.version = None
56  self.database = None
57  self.name = None
58  self.run = None
59 
60  if not value:
61  return
62 
63  if not ':' in value:
64  # default to 'v2/offline'
65  self.version = 'v2'
66  self.database = 'offline'
67  self.name = value
68  return
69 
70  # extract the version, database and configuration name
71  tokens = value.split(':')
72  if len(tokens) != 2:
73  raise Exception('Invalid HLT menu specification "%s"' % value)
74  (db, name) = tokens
75  # check if the menu should be automatically determined based on the run number
76  if db == 'run':
77  self.version = 'v2'
78  self.database = 'adg'
79  self.run = name
80  # check for backward compatibility names
81  elif db in self.compatibility:
82  self.version, self.database = self.compatibility[db]
83  self.name = name
84  else:
85  if '/' in db:
86  # extract the version and database
87  tokens = db.split('/')
88  if len(tokens) != 2:
89  raise Exception('Invalid HLT menu specification "%s"' % value)
90  (v, db) = tokens
91  if v not in self.valid_versions:
92  raise Exception('Invalid HLT database version "%s", valid values are "%s"' % (v, '", "'.join(self.valid_versions)))
93  if db not in self.valid_databases:
94  raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
95  self.version = v
96  self.database = db
97  self.name = name
98  else:
99  # use the confdb v2 by default
100  if db not in self.valid_databases:
101  raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
102  self.database = db
103  self.version = 'v2'
104  self.name = name
105 
106 # options marked with a (*) only apply when creating a whole process configuration
107 class HLTProcessOptions(object):
108  def __init__(self):
109  self.menu = None # hlt menu
110  self.name = 'HLTX' # (*) if set, override the process name
111  self.type = 'GRun' # defines global options for 'GRun', 'HIon', 'PIon', 'PRef' or 'online' menus
112  self.data = True # run on data (true) or mc (false)
113  self.online = False # (*) run online (true) or offline (false)
114  self.globaltag = None # (*) if set, override the GlobalTag
115  self.l1 = None # (*) if set, override the L1 menu
116  self.l1Xml = None # (*) if set, override the L1 menu Xml
117  self.emulator = None # (*) if set, run (part of) the L1 emulator instead of taking the L1 results from the data
118  self.prescale = None # (*) if set, force the use of a specific prescale column. If set to "none", unprescale all paths
119  self.open = False # if set, cms.ignore all filters, making all paths run on and accept all events
120  self.errortype = False # if set, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
121  self.profiling = False # if set, instrument the menu for profiling measurements
122  self.timing = False # if set, instrument the menu for timing measurements (implies profiling)
123  self.paths = None # if set, include in the dump only the given paths (wildcards are supported)
124  self.input = None # (*) if set, specify the input file(s) or dataset
125  self.parent = None # (*) if set, specify the parent input file(s) or dataset
126  self.events = 100 # (*) run on these many events
127  self.output = 'all' # (*) output 'all', 'minimal' or 'none' output modules
128  self.fragment = False # prepare a configuration fragment (true) or a whole process (false)
129  self.hilton = False # prepare a configuration for running with hilton-like modules
130 
131 
132  # convert HLT and L1 menus to a dedicated object representation on the fly
133  def __setattr__(self, name, value):
134  if name is 'menu' and type(value) is not ConnectionHLTMenu:
135  # format 'menu' as needed
136  object.__setattr__(self, name, ConnectionHLTMenu(value))
137  elif name is 'l1' and type(value) is not ConnectionL1TMenu:
138  # format '--l1' as needed
139  object.__setattr__(self, name, ConnectionL1TMenu(value))
140  elif name is 'l1Xml' and type(value) is not ConnectionL1TMenuXml:
141  # format '--l1Xml' as needed
142  object.__setattr__(self, name, ConnectionL1TMenuXml(value))
143  elif name is 'open' and value:
144  # '--open' implies '--unprescale'
145  object.__setattr__(self, 'open', True)
146  object.__setattr__(self, 'prescale', "none")
147  elif name is 'prescale' and value is not None:
148  # '--open' overrides '--prescale', set the prescale value only if '--open' is not set
149  if not self.open:
150  object.__setattr__(self, 'prescale', value)
151  elif name is 'profiling' and value:
152  # '--profiling'
153  object.__setattr__(self, 'profiling', True)
154  elif name is 'timing' and value:
155  # '--timing' implies '--profiling'
156  object.__setattr__(self, 'timing', True)
157  object.__setattr__(self, 'profiling', True)
158  else:
159  object.__setattr__(self, name, value)
dictionary compatibility
Definition: options.py:52
static std::string join(char **cmd)
Definition: RemoteFile.cc:18