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:run2_mc_FULL',
7  'GRun' : 'auto:run2_mc_GRun', # used as default
8  '2018v32' : 'auto:run2_mc_2018v32',
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
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
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
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
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.globaltag = None # (*) if set, override the GlobalTag
114  self.l1 = None # (*) if set, override the L1 menu
115  self.l1Xml = None # (*) if set, override the L1 menu Xml
116  self.emulator = None # (*) if set, run (part of) the L1 emulator instead of taking the L1 results from the data
117  self.prescale = None # (*) if set, force the use of a specific prescale column. If set to "none", unprescale all paths
118  self.open = False # if set, cms.ignore all filters, making all paths run on and accept all events
119  self.eras = None # if set, select the defined Eras into the HLT configuration
120  self.customise = None # if set, apply the user-defined customization functions using the format HLTrigger/Configuration/customizeHLTTrackingForPhaseI2017.customizeHLTForPFTrackingPhaseI2017
121  self.errortype = False # if set, change all HLTTriggerTypeFilter EDFilters to accept only error events (SelectedTriggerType = 0)
122  self.profiling = False # if set, instrument the menu for profiling measurements
123  self.timing = False # if set, instrument the menu for timing measurements (implies profiling)
124  self.paths = None # if set, include in the dump only the given paths (wildcards are supported)
125  self.input = None # (*) if set, specify the input file(s) or dataset
126  self.parent = None # (*) if set, specify the parent input file(s) or dataset
127  self.events = 100 # (*) run on these many events
128  self.output = 'all' # (*) output 'all', 'minimal' or 'none' output modules
129  self.fragment = False # prepare a configuration fragment (true) or a whole process (false)
130  self.hilton = False # prepare a configuration for running with hilton-like modules
131  self.setup = None # if set, downlad the setup_cff from the specified configuration and load it.
132 
133 
134  # convert HLT and L1 menus to a dedicated object representation on the fly
135  def __setattr__(self, name, value):
136  if name is 'menu' and not isinstance(value, ConnectionHLTMenu):
137  # format 'menu' as needed
138  object.__setattr__(self, name, ConnectionHLTMenu(value))
139  elif name is 'l1' and not isinstance(value, ConnectionL1TMenu):
140  # format '--l1' as needed
141  object.__setattr__(self, name, ConnectionL1TMenu(value))
142  elif name is 'l1Xml' and not isinstance(value, ConnectionL1TMenuXml):
143  # format '--l1Xml' as needed
144  object.__setattr__(self, name, ConnectionL1TMenuXml(value))
145  elif name is 'open' and value:
146  # '--open' implies '--unprescale'
147  object.__setattr__(self, 'open', True)
148  object.__setattr__(self, 'prescale', "none")
149  elif name is 'prescale' and value is not None:
150  # '--open' overrides '--prescale', set the prescale value only if '--open' is not set
151  if not self.open:
152  object.__setattr__(self, 'prescale', value)
153  elif name is 'profiling' and value:
154  # '--profiling'
155  object.__setattr__(self, 'profiling', True)
156  elif name is 'timing' and value:
157  # '--timing' implies '--profiling'
158  object.__setattr__(self, 'timing', True)
159  object.__setattr__(self, 'profiling', True)
160  else:
161  object.__setattr__(self, name, value)
def __setattr__(self, name, value)
Definition: options.py:135
def __init__(self, value)
Definition: options.py:34
def __init__(self, value)
Definition: options.py:18
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __init__(self, value)
Definition: options.py:54