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