ATLAS Offline Software
Loading...
Searching...
No Matches
python.utils.AtlRunQueryLookup Namespace Reference

Functions

 DQChannels ()
 DQChannel (name)
 isDQ (name)
 InitDetectorMaskDecoder (lhcRun)
 InitDetectorMaskDecoderRun1 ()
 InitDetectorMaskDecoderRun2 ()
 InitDetectorMaskDecoderRun3 ()
 DecodeDetectorMaskToString (detmask, lhcRun, smart)
 splitAt (line, splitstring=',', splitsize=80)
 DecodeDetectorMask (mask, lhcRun=3, smart=False)
 LArConfig (type)

Variables

dict DQChannelDict
dict DQSuperGroupsDict
dict DQGroupDict
dict OLCAlgorithms
str mask = "0x1fffffffffff7"

Function Documentation

◆ DecodeDetectorMask()

python.utils.AtlRunQueryLookup.DecodeDetectorMask ( mask,
lhcRun = 3,
smart = False )
takes an decimal or hex string (hex string must start with 0x) and returns an HTML element

Definition at line 419 of file AtlRunQueryLookup.py.

419def DecodeDetectorMask( mask, lhcRun=3, smart=False ):
420 """
421 takes an decimal or hex string (hex string must start with 0x) and returns an HTML element
422 """
423 if type(mask)!=str:
424 raise RuntimeError("DetectorMask must be a string")
425
426 if mask.startswith('0x'):
427 mask = int(mask[2:],16)
428 else:
429 mask = int(mask)
430
431 detectors, inclusion = DecodeDetectorMaskToString(mask, lhcRun=lhcRun, smart=smart)
432
433 col = '#106734' if smart else '#000000'
434 if inclusion:
435 res = '<b>Detector mask = %s (%s), corresponding to the systems:</b><br><font color="%s">' % (mask,hex(mask).rstrip('L'),col)
436 else:
437 res = '<b>Detector mask = %i (%s).<br> <font color="#aa0000">The following systems are NOT included:</b><br>' % (mask,hex(mask).rstrip('L'))
438 res += detectors
439 res += '</font>'
440
441 return res
442
443

◆ DecodeDetectorMaskToString()

python.utils.AtlRunQueryLookup.DecodeDetectorMaskToString ( detmask,
lhcRun,
smart )
takes (int) detmask
returns ( (string) listOfDetectors, (bool) inclusion )
if smart is set to True, then the listOfDetectors might be inversed and excluded ones are shown

Definition at line 373 of file AtlRunQueryLookup.py.

373def DecodeDetectorMaskToString( detmask, lhcRun, smart ):
374 """
375 takes (int) detmask
376 returns ( (string) listOfDetectors, (bool) inclusion )
377 if smart is set to True, then the listOfDetectors might be inversed and excluded ones are shown
378 """
379
380 dName, _, vetoedbits = InitDetectorMaskDecoder(lhcRun=lhcRun)
381
382 ic = 0
383 res = ""
384 inclusion = True
385 for i in range( len(dName) ):
386 if i not in vetoedbits and (detmask & (1 << i)):
387 res += dName[i] + ", "
388 ic += 1
389 if res=="":
390 res = "none"
391 else:
392 res = res[:-2] # chop off last comma-space
393
394 if smart and ic > 30:
395 # many included prefer to show excluded sub detectors
396 inclusion = False
397 res = ""
398 for i in range( len(dName) ):
399 if i not in vetoedbits and not (detmask & (1 << i)):
400 res += dName[i] + ", "
401 if res=="":
402 res = "all"
403 else:
404 res = res[:-2] # chop off last comma-space
405
406 return (res, inclusion)
407
408

◆ DQChannel()

python.utils.AtlRunQueryLookup.DQChannel ( name)

Definition at line 125 of file AtlRunQueryLookup.py.

125def DQChannel(name):
126 name = name.upper()
127 if ':' in name:
128 name = name[name.index(':')+1:]
129 # OLD: if name.startswith('CP_'): return -1
130 if '_' in name:
131 return -1
132 return DQChannelDict[name]
133
134

◆ DQChannels()

python.utils.AtlRunQueryLookup.DQChannels ( )

Definition at line 118 of file AtlRunQueryLookup.py.

118def DQChannels():
119 # sort disctionary
120 dqitems = DQChannelDict.items()
121 dqitems = [(v, k) for (k, v) in dqitems]
122 dqitems.sort()
123 return dqitems
124

◆ InitDetectorMaskDecoder()

python.utils.AtlRunQueryLookup.InitDetectorMaskDecoder ( lhcRun)

Definition at line 170 of file AtlRunQueryLookup.py.

170def InitDetectorMaskDecoder( lhcRun ):
171 if lhcRun==3:
172 return InitDetectorMaskDecoderRun3()
173 elif lhcRun==2:
174 return InitDetectorMaskDecoderRun2()
175 else:
176 return InitDetectorMaskDecoderRun1()
177

◆ InitDetectorMaskDecoderRun1()

python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun1 ( )

Definition at line 178 of file AtlRunQueryLookup.py.

178def InitDetectorMaskDecoderRun1():
179
180 # taken from:
181 # https://svnweb.cern.ch/trac/atlastdaq/browser/DAQ/DataFlow/eformat/tags/eformat-04-04-03/src/DetectorMask.cxx
182 #
183 # note that these here are obsolete:
184 # https://svnweb.cern.ch/trac/atlastdaq/browser/DAQ/online/RCUtils/trunk/src/get_detectormask.cc
185 # http://isscvs.cern.ch/cgi-bin/viewcvs-all.cgi/DAQ/online/RunControl/src/get_detectormask.cc?root=atlastdaq&view=markup
186
187 dName = ['unknown']*54
188 dName[0] = "Pix Barrel"
189 dName[1] = "Pix Disks"
190 dName[2] = "Pix B-Layer"
191 dName[3] = "REMOVED"
192 dName[4] = "SCT BA"
193 dName[5] = "SCT BC"
194 dName[6] = "SCT EA"
195 dName[7] = "SCT EC"
196 dName[8] = "TRT BA"
197 dName[9] = "TRT BC"
198 dName[10] = "TRT EA"
199 dName[11] = "TRT EC"
200 dName[12] = "LAr EMBA"
201 dName[13] = "LAr EMBC"
202 dName[14] = "LAr EMECA"
203 dName[15] = "LAr EMECC"
204 dName[16] = "LAr HECA"
205 dName[17] = "LAr HECC"
206 dName[18] = "LAr FCALA"
207 dName[19] = "LAr FCALC"
208 dName[20] = "Tile BA"
209 dName[21] = "Tile BC"
210 dName[22] = "Tile EA"
211 dName[23] = "Tile EC"
212 dName[24] = "MDT BA"
213 dName[25] = "MDT BC"
214 dName[26] = "MDT EA"
215 dName[27] = "MDT EC"
216 dName[28] = "RPC BA"
217 dName[29] = "RPC BC"
218 dName[30] = "TGC EA"
219 dName[31] = "TGC EC"
220 dName[32] = "CSC EA"
221 dName[33] = "CSC EC"
222 dName[34] = "L1Calo preprocessor"
223 dName[35] = "L1Calo cluster DAQ"
224 dName[36] = "L1Calo cluster RoI"
225 dName[37] = "L1Calo Jet/E DAQ"
226 dName[38] = "L1Calo Jet/E RoI"
227 dName[39] = "MUCTPI"
228 dName[40] = "CTP"
229 dName[41] = "L2SV"
230 dName[42] = "SFI"
231 dName[43] = "SFO"
232 dName[44] = "LVL2"
233 dName[45] = "EF"
234 dName[46] = "BCM"
235 dName[47] = "Lucid"
236 dName[48] = "ZDC"
237 dName[49] = "Alfa"
238 dName[50] = "TRT_ANCILLARY_CRATE"
239 dName[51] = "TILECAL_LASER_CRATE"
240 dName[52] = "MUON_ANCILLARY_CRATE"
241 dName[53] = "TDAQ_BEAM_CRATE"
242
243 # list of detector NOT part of 'all' tag (means, they can be in, but are not required)
244 notInAll = ['CSC', 'L2SV', 'SFI', 'SFO', 'LVL2', 'EF', 'Lucid', 'ZDC', 'Alfa',
245 'TRT_ANCILLARY_CRATE','TILECAL_LASER_CRATE','MUON_ANCILLARY_CRATE','TDAQ_BEAM_CRATE' ]
246
247 notPartOfAllRequirement = ['']*54
248 for i in range(0,len(dName)):
249 for n in notInAll:
250 if dName[i] == n:
251 notPartOfAllRequirement[i] = ' NotInAll'
252
253 vetoedbits = [3, 50, 51, 52, 53] #+ list(range(54,64))
254
255 return (dName, notPartOfAllRequirement, vetoedbits)
256
257

◆ InitDetectorMaskDecoderRun2()

python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun2 ( )

Definition at line 258 of file AtlRunQueryLookup.py.

258def InitDetectorMaskDecoderRun2():
259
260 # taken from:
261 # http://alxr.usatlas.bnl.gov/lxr/source/tdaq-common/eformat/src/DetectorMask.cxx
262 #
263 # note that these here are obsolete:
264 # https://svnweb.cern.ch/trac/atlastdaq/browser/DAQ/online/RCUtils/trunk/src/get_detectormask.cc
265 # http://isscvs.cern.ch/cgi-bin/viewcvs-all.cgi/DAQ/online/RunControl/src/get_detectormask.cc?root=atlastdaq&view=markup
266
267 dName = ['unknown']*64
268 dName[0] = "Pix Barrel"
269 dName[1] = "Pix Disks"
270 dName[2] = "Pix B-Layer"
271 dName[3] = "REMOVED"
272 dName[4] = "SCT BA"
273 dName[5] = "SCT BC"
274 dName[6] = "SCT EA"
275 dName[7] = "SCT EC"
276 dName[8] = "TRT BA"
277 dName[9] = "TRT BC"
278 dName[10] = "TRT EA"
279 dName[11] = "TRT EC"
280 dName[12] = "LAr EMBA"
281 dName[13] = "LAr EMBC"
282 dName[14] = "LAr EMECA"
283 dName[15] = "LAr EMECC"
284 dName[16] = "LAr HECA"
285 dName[17] = "LAr HECC"
286 dName[18] = "LAr FCALA"
287 dName[19] = "LAr FCALC"
288 dName[20] = "Tile BA"
289 dName[21] = "Tile BC"
290 dName[22] = "Tile EA"
291 dName[23] = "Tile EC"
292 dName[24] = "MDT BA"
293 dName[25] = "MDT BC"
294 dName[26] = "MDT EA"
295 dName[27] = "MDT EC"
296 dName[28] = "RPC BA"
297 dName[29] = "RPC BC"
298 dName[30] = "TGC EA"
299 dName[31] = "TGC EC"
300 dName[32] = "CSC EA"
301 dName[33] = "CSC EC"
302 dName[34] = "L1Calo preprocessor"
303 dName[35] = "L1Calo cluster DAQ"
304 dName[36] = "L1Calo cluster RoI"
305 dName[37] = "L1Calo Jet/E DAQ"
306 dName[38] = "L1Calo Jet/E RoI"
307 dName[39] = "MUCTPI"
308 dName[40] = "CTP"
309 dName[41] = "L2SV"
310 dName[42] = "SFI"
311 dName[43] = "SFO"
312 dName[44] = "LVL2"
313 dName[45] = "HLT"
314 dName[46] = "BCM"
315 dName[47] = "Lucid"
316 dName[48] = "ZDC"
317 dName[49] = "ALFA"
318 dName[50] = "TRT_ANCILLARY_CRATE"
319 dName[51] = "TILECAL_LASER_CRATE"
320 dName[52] = "MUON_ANCILLARY_CRATE"
321 dName[53] = "TDAQ_BEAM_CRATE"
322 dName[54] = "FTK"
323 dName[55] = "Offline"
324 dName[56] = "L1Topo"
325 dName[57] = "L1Calo DIG"
326 dName[58] = "L1Calo DAQ"
327 dName[59] = "L1Calo ROI"
328 dName[60] = "MMEGA EA"
329 dName[61] = "MMEGA EC"
330 dName[62] = "Pix IBL"
331 dName[63] = "Pix DBM"
332
333 # list of detector NOT part of 'all' tag (means, they can be in, but are not required)
334 notInAll = ['L2SV', 'SFI', 'SFO', 'LVL2', 'Lucid', 'ZDC', 'Alfa',
335 'TRT_ANCILLARY_CRATE','TILECAL_LASER_CRATE','MUON_ANCILLARY_CRATE','TDAQ_BEAM_CRATE' ]
336
337 notPartOfAllRequirement = map(lambda x: ' NotInAll' if x in notInAll else '', dName)
338
339 # these bits are ignored
340 vetoedbits = [3, 41, 42, 44, 50, 51, 52, 53, 55, 57, 58, 59] #+ list(range(64,128))
341
342 return (dName, notPartOfAllRequirement, vetoedbits)
343
344
STL class.

◆ InitDetectorMaskDecoderRun3()

python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun3 ( )

Definition at line 345 of file AtlRunQueryLookup.py.

345def InitDetectorMaskDecoderRun3():
346 # https://gitlab.cern.ch/atlas-tdaq-software/eformat/-/blob/eformat-05-08-03/src/DetectorMask.cxx
347
348 (dName, _, vetoedbits) = InitDetectorMaskDecoderRun2()
349
350 dName += [
351 "AFP", # 65
352 "LAr EMBAECA", # 66
353 "LAr EMBAECC",
354 "LAr EMHAECA",
355 "LAr EMHAECC",
356 "STGC A", # 70
357 "STGC C"
358 ]
359
360 notInAll = ['L2SV', 'SFI', 'SFO', 'LVL2', 'Lucid', 'ZDC', 'Alfa',
361 'TRT_ANCILLARY_CRATE','TILECAL_LASER_CRATE','MUON_ANCILLARY_CRATE','TDAQ_BEAM_CRATE' ]
362 notInAll += [ "CSC EA", "CSC EC", "FTK", "Pix DBM" ]
363
364 notPartOfAllRequirement = map(lambda x: ' NotInAll' if x in notInAll else '', dName)
365
366 # these bits are ignored
367 vetoedbits = [3, 32, 33, 41, 42, 44, 50, 51, 52, 53, 54, 55, 57, 58, 59, 63]
368
369 return (dName, notPartOfAllRequirement, vetoedbits)
370
371
372

◆ isDQ()

python.utils.AtlRunQueryLookup.isDQ ( name)

Definition at line 135 of file AtlRunQueryLookup.py.

135def isDQ(name):
136 name = (name.split(':')[-1].split('#')[0]).upper()
137 if name.startswith("CP_") or name.startswith("PHYS_") or name.startswith("TRIG_") or name.startswith("LUM_") or name.startswith("GLOBAL_"):
138 return True
139 return name in DQChannelDict
140
141
int upper(int c)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ LArConfig()

python.utils.AtlRunQueryLookup.LArConfig ( type)

Definition at line 444 of file AtlRunQueryLookup.py.

444def LArConfig(type):
445 # runtype, format
446 if 'runtype' in type.lower():
447 return {0:'RawData', 1:'RawDataResult', 2:'Result'}
448 elif 'format' in type.lower():
449 return {0:'Transparent', 1:'Format 1', 2:'Format 2'}
450 else:
451 print ('ERROR in LArconfig: unknown type %s' % type)
452 sys.exit()
453
454
455

◆ splitAt()

python.utils.AtlRunQueryLookup.splitAt ( line,
splitstring = ',',
splitsize = 80 )

Definition at line 409 of file AtlRunQueryLookup.py.

409def splitAt(line, splitstring=',', splitsize=80):
410 res = [line]
411 while len( res[-1] ):
412 linebreak = res[-1].find( splitstring, splitsize)
413 if linebreak==-1:
414 break
415 res[-1:] = [ res[-1][:linebreak], res[-1][linebreak+len(splitstring):] ]
416 return res
417
418
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138

Variable Documentation

◆ DQChannelDict

dict python.utils.AtlRunQueryLookup.DQChannelDict

Definition at line 21 of file AtlRunQueryLookup.py.

◆ DQGroupDict

dict python.utils.AtlRunQueryLookup.DQGroupDict

Definition at line 85 of file AtlRunQueryLookup.py.

◆ DQSuperGroupsDict

dict python.utils.AtlRunQueryLookup.DQSuperGroupsDict
Initial value:
1= {1 : ['Inner detector', ['PIXB','PIX0','PIXEA','PIXEC','SCTB','SCTEA','SCTEC','TRTB','TRTEA','TRTEC','TRTTR',
2 'IDGL','IDAL','IDBS','IDVX']],
3 2 : ['Calorimeter', ['EMBA','EMBC','EMECA','EMECC','HECA','HECC','FCALA','FCALC',
4 'TIGB','TILBA','TILBC','TIEBA','TIEBC','CALBA','CALEA','CALEC']],
5 3 : ['Muon systems', ['MDTBA','MDTBC','MDTEA','MDTEC','RPCBA','RPCBC','TGCEA','TGCEC','CSCEA','CSCEC']],
6 4 : ['Forward detectors and luminosity', ['MBTSA','MBTSC','IDBCM','LCDA','LCDC','ALFA','ZDC','LUMI']],
7 5 : ['Global, Magnets, DAQ and Trigger',['ATLGL','ATLSOL','ATLTOR','RUNCLT','RCOPS',
8 'L1CAL','L1MUB','L1MUE','L1CTP',
9 'TRCAL','TRBJT','TRBPH','TRCOS','TRELE','TRGAM','TRJET','TRMET','TRMBI','TRMUO','TRTAU','TRIDT']],
10 6 : ['Combined performance', ['EIDB','EIDCR','EIDE',
11 'PIDB','PIDCR','PIDE',
12 'EIDF','EIDSOFT',
13 'MSTACO','MMUIDCB','MMUIDVX',
14 'MMUGIRL','MMUBOY','MMUIDSA',
15 'MMUTAG','MMTIMO','MCMUTAG',
16 'MCALLHR',
17 'JETB','JETEA','JETEC','JETFA','JETFC',
18 'METCALO','METMUON',
19 'BTGLIFE','BTGSOFTE','BTGSOFTM',
20 'TAUB','TAUCR','TAUE']]}

Definition at line 64 of file AtlRunQueryLookup.py.

◆ mask

str python.utils.AtlRunQueryLookup.mask = "0x1fffffffffff7"

Definition at line 459 of file AtlRunQueryLookup.py.

◆ OLCAlgorithms

dict python.utils.AtlRunQueryLookup.OLCAlgorithms
Initial value:
1= {
2 0: 'ATLAS_PREFERRED',
3 1: 'LHC',
4 101: 'LUCID_ZEROS_OR',
5 102: 'LUCID_ZEROS_AND',
6 103: 'LUCID_HITS_OR',
7 104: 'LUCID_HITS_AND',
8 151: 'LUCID_AND',
9 201: 'BCM_H_ZEROS_AND',
10 202: 'BCM_H_EVENTS_AND',
11 203: 'BCM_H_EVENTS_XORA',
12 204: 'BCM_H_EVENTS_XORC',
13 205: 'BCM_V_ZEROS_AND',
14 206: 'BCM_V_EVENTS_AND',
15 207: 'BCM_V_EVENTS_XORA',
16 208: 'BCM_V_EVENTS_XORC',
17 301: 'MBTS_ZEROS_AND',
18 302: 'MBTS_ZEROS_OR',
19 303: 'MBTS_HITS_AND',
20 304: 'MBTS_HITS_OR',
21 401: 'ZDC',
22 501: 'FCAL',
23 601: 'HLT',
24 901: 'OffLumi_LArTime_Events',
25 998: 'OflLumi_Fake0',
26 999: 'OflLumi_Fake1'
27 }

Definition at line 142 of file AtlRunQueryLookup.py.