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