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