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