CMS 3D CMS Logo

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  'Fake2': 'auto:run2_mc_Fake2',
6  'FULL' : 'auto:run3_mc_FULL',
7  'GRun' : 'auto:run3_mc_GRun', # used as default
8  'HIon' : 'auto:run3_mc_HIon',
9  'PIon' : 'auto:run3_mc_PIon',
10  'PRef' : 'auto:run3_mc_PRef',
11  'Special' : 'auto:run3_mc_GRun', # same as GRun
12  'data' : 'auto:run3_hlt_relval',
13  '2024v13' : 'auto:run3_mc_2024v13',
14 }
15 
16 
17 # type used to store a reference to an L1 menu
19  def __init__(self, value):
20  self.override = None
21  self.snapshotTime = None
22 
23  # extract the override tag and the connection string
24  if value:
25  if ',' in value:
26  self.override = value.split(',')[0]
27  self.snapshotTime = value.split(',')[1]
28  else:
29  self.override = value
30  self.smapshotTime = None
31 
32 
33 # type used to store a reference to an L1 menu
35  def __init__(self, value):
36  self.XmlFile = None
37  self.LumiDir = None
38 
39  # extract the override tag and the connection string
40  if value:
41  if ',' in value:
42  self.XmlFile = value.split(',')[0]
43  self.LumiDir = value.split(',')[1]
44  else:
45  self.XmlFile = value
46  self.LumiDir = "startup"
47 
48 
49 # type used to store a reference to an HLT configuration
51  valid_versions = 'v1', 'v2', 'v3', 'v3-beta', 'v3-test'
52  valid_databases = 'online', 'run3', 'adg','dev','run2'
53  compatibility = { 'hltdev': ('v3', 'run3'), 'orcoff': ('v3', 'adg') }
54 
55  def __init__(self, value):
56  self.version = None
57  self.database = None
58  self.name = None
59  self.run = None
60 
61  if not value:
62  return
63 
64  if not ':' in value:
65  # default to 'v3/run3'
66  self.version = 'v3'
67  self.database = 'run3'
68  self.name = value
69  return
70 
71  # extract the version, database and configuration name
72  tokens = value.split(':')
73  if len(tokens) != 2:
74  raise Exception('Invalid HLT menu specification "%s"' % value)
75  (db, name) = tokens
76  # check if the menu should be automatically determined based on the run number
77  if db == 'run':
78  self.version = 'v3'
79  self.database = 'adg'
80  self.run = name
81  # check for backward compatibility names
82  elif db in self.compatibility:
83  self.version, self.database = self.compatibility[db]
84  self.name = name
85  else:
86  if '/' in db:
87  # extract the version and database
88  tokens = db.split('/')
89  if len(tokens) != 2:
90  raise Exception('Invalid HLT menu specification "%s"' % value)
91  (v, db) = tokens
92  if v not in self.valid_versions:
93  raise Exception('Invalid HLT database version "%s", valid values are "%s"' % (v, '", "'.join(self.valid_versions)))
94  if db not in self.valid_databases:
95  raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
96  self.version = v
97  self.database = db
98  self.name = name
99  else:
100  # use the confdb v3 by default
101  if db not in self.valid_databases:
102  raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
103  self.database = db
104  self.version = 'v3'
105  self.name = name
106 
107 # options marked with a (*) only apply when creating a whole process configuration
109  def __init__(self):
110  self.menu = None # hlt menu
111  self.name = 'HLTX' # (*) if set, override the process name
112  self.type = 'GRun' # defines global options for 'GRun', 'HIon', 'PIon', 'PRef' or 'online' menus
113  self.data = True # run on data (true) or mc (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.eras = None # if set, select the defined Eras into the HLT configuration
121  self.customise = None # if set, apply the user-defined customization functions using the format HLTrigger/Configuration/customizeHLTTrackingForPhaseI2017.customizeHLTForPFTrackingPhaseI2017
122  self.errortype = False # if set, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
123  self.profiling = False # if set, instrument the menu for profiling measurements
124  self.timing = False # if set, instrument the menu for timing measurements (implies profiling)
125  self.paths = None # if set, include in the dump only the given paths (wildcards are supported)
126  self.input = None # (*) if set, specify the input file(s) or dataset
127  self.parent = None # (*) if set, specify the parent input file(s) or dataset
128  self.events = 100 # (*) run on these many events
129  self.output = 'all' # (*) output 'all', 'minimal' or 'none' output modules
130  self.fragment = False # prepare a configuration fragment (true) or a whole process (false)
131  self.hilton = False # prepare a configuration for running with hilton-like modules
132  self.setup = None # if set, downlad the setup_cff from the specified configuration and load it.
133  self.proxy = False # use a socks proxy to connect
134  self.proxy_host = 'localhost' # host of the proxy server
135  self.proxy_port = '8080' # port of the proxy server
136  self.tunnel = False # use a direct tunnel on localhost to connect
137  self.tunnel_port = '10121' # port to connect to on localhost when tunneling
138 
139  # convert HLT and L1 menus to a dedicated object representation on the fly
140  def __setattr__(self, name, value):
141  if name == 'menu' and not isinstance(value, ConnectionHLTMenu):
142  # format 'menu' as needed
143  object.__setattr__(self, name, ConnectionHLTMenu(value))
144  elif name == 'l1' and not isinstance(value, ConnectionL1TMenu):
145  # format '--l1' as needed
146  object.__setattr__(self, name, ConnectionL1TMenu(value))
147  elif name == 'l1Xml' and not isinstance(value, ConnectionL1TMenuXml):
148  # format '--l1Xml' as needed
149  object.__setattr__(self, name, ConnectionL1TMenuXml(value))
150  elif name == 'open' and value:
151  # '--open' implies '--unprescale'
152  object.__setattr__(self, 'open', True)
153  object.__setattr__(self, 'prescale', "none")
154  elif name == 'prescale' and value is not None:
155  # '--open' overrides '--prescale', set the prescale value only if '--open' is not set
156  if not self.open:
157  object.__setattr__(self, 'prescale', value)
158  elif name == 'profiling' and value:
159  # '--profiling'
160  object.__setattr__(self, 'profiling', True)
161  elif name == 'timing' and value:
162  # '--timing' implies '--profiling'
163  object.__setattr__(self, 'timing', True)
164  object.__setattr__(self, 'profiling', True)
165  elif name == 'setup' and value and value.find(":")!=-1:
166  raise Exception('you can not specify a converter/database in the setup option.\nIt takes the converter database specified by the primary config.\nPlease remove the text upto and including the ":" in\n {} '.format(value))
167  else:
168  object.__setattr__(self, name, value)
def __setattr__(self, name, value)
Definition: options.py:140
def __init__(self, value)
Definition: options.py:35
def __init__(self, value)
Definition: options.py:19
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def __init__(self, value)
Definition: options.py:55