File indexing completed on 2024-07-26 17:49:22
0001
0002 globalTag = {
0003 'Fake' : 'auto:run1_mc_Fake',
0004 'Fake1': 'auto:run2_mc_Fake1',
0005 'Fake2': 'auto:run2_mc_Fake2',
0006 'FULL' : 'auto:run3_mc_FULL',
0007 'GRun' : 'auto:run3_mc_GRun',
0008 'HIon' : 'auto:run3_mc_HIon',
0009 'PIon' : 'auto:run3_mc_PIon',
0010 'PRef' : 'auto:run3_mc_PRef',
0011 'Special' : 'auto:run3_mc_GRun',
0012 'data' : 'auto:run3_hlt_relval',
0013 '2024v14' : 'auto:run3_mc_2024v14',
0014 }
0015
0016
0017
0018 class ConnectionL1TMenu(object):
0019 def __init__(self, value):
0020 self.override = None
0021 self.snapshotTime = None
0022
0023
0024 if value:
0025 if ',' in value:
0026 self.override = value.split(',')[0]
0027 self.snapshotTime = value.split(',')[1]
0028 else:
0029 self.override = value
0030 self.smapshotTime = None
0031
0032
0033
0034 class ConnectionL1TMenuXml(object):
0035 def __init__(self, value):
0036 self.XmlFile = None
0037 self.LumiDir = None
0038
0039
0040 if value:
0041 if ',' in value:
0042 self.XmlFile = value.split(',')[0]
0043 self.LumiDir = value.split(',')[1]
0044 else:
0045 self.XmlFile = value
0046 self.LumiDir = "startup"
0047
0048
0049
0050 class ConnectionHLTMenu(object):
0051 valid_versions = 'v1', 'v2', 'v3', 'v3-beta', 'v3-test'
0052 valid_databases = 'online', 'run3', 'adg','dev','run2'
0053 compatibility = { 'hltdev': ('v3', 'run3'), 'orcoff': ('v3', 'adg') }
0054
0055 def __init__(self, value):
0056 self.version = None
0057 self.database = None
0058 self.name = None
0059 self.run = None
0060
0061 if not value:
0062 return
0063
0064 if not ':' in value:
0065
0066 self.version = 'v3'
0067 self.database = 'run3'
0068 self.name = value
0069 return
0070
0071
0072 tokens = value.split(':')
0073 if len(tokens) != 2:
0074 raise Exception('Invalid HLT menu specification "%s"' % value)
0075 (db, name) = tokens
0076
0077 if db == 'run':
0078 self.version = 'v3'
0079 self.database = 'adg'
0080 self.run = name
0081
0082 elif db in self.compatibility:
0083 self.version, self.database = self.compatibility[db]
0084 self.name = name
0085 else:
0086 if '/' in db:
0087
0088 tokens = db.split('/')
0089 if len(tokens) != 2:
0090 raise Exception('Invalid HLT menu specification "%s"' % value)
0091 (v, db) = tokens
0092 if v not in self.valid_versions:
0093 raise Exception('Invalid HLT database version "%s", valid values are "%s"' % (v, '", "'.join(self.valid_versions)))
0094 if db not in self.valid_databases:
0095 raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
0096 self.version = v
0097 self.database = db
0098 self.name = name
0099 else:
0100
0101 if db not in self.valid_databases:
0102 raise Exception('Invalid HLT database "%s", valid values are "%s"' % (db, '", "'.join(self.valid_databases)))
0103 self.database = db
0104 self.version = 'v3'
0105 self.name = name
0106
0107
0108 class HLTProcessOptions(object):
0109 def __init__(self):
0110 self.menu = None
0111 self.name = 'HLTX'
0112 self.type = 'GRun'
0113 self.data = True
0114 self.globaltag = None
0115 self.l1 = None
0116 self.l1Xml = None
0117 self.emulator = None
0118 self.prescale = None
0119 self.open = False
0120 self.eras = None
0121 self.customise = None
0122 self.errortype = False
0123 self.profiling = False
0124 self.timing = False
0125 self.paths = None
0126 self.input = None
0127 self.parent = None
0128 self.events = 100
0129 self.output = 'all'
0130 self.fragment = False
0131 self.hilton = False
0132 self.setup = None
0133 self.proxy = False
0134 self.proxy_host = 'localhost'
0135 self.proxy_port = '8080'
0136 self.tunnel = False
0137 self.tunnel_port = '10121'
0138
0139
0140 def __setattr__(self, name, value):
0141 if name == 'menu' and not isinstance(value, ConnectionHLTMenu):
0142
0143 object.__setattr__(self, name, ConnectionHLTMenu(value))
0144 elif name == 'l1' and not isinstance(value, ConnectionL1TMenu):
0145
0146 object.__setattr__(self, name, ConnectionL1TMenu(value))
0147 elif name == 'l1Xml' and not isinstance(value, ConnectionL1TMenuXml):
0148
0149 object.__setattr__(self, name, ConnectionL1TMenuXml(value))
0150 elif name == 'open' and value:
0151
0152 object.__setattr__(self, 'open', True)
0153 object.__setattr__(self, 'prescale', "none")
0154 elif name == 'prescale' and value is not None:
0155
0156 if not self.open:
0157 object.__setattr__(self, 'prescale', value)
0158 elif name == 'profiling' and value:
0159
0160 object.__setattr__(self, 'profiling', True)
0161 elif name == 'timing' and value:
0162
0163 object.__setattr__(self, 'timing', True)
0164 object.__setattr__(self, 'profiling', True)
0165 elif name == 'setup' and value and value.find(":")!=-1:
0166 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))
0167 else:
0168 object.__setattr__(self, name, value)