ATLAS Offline Software
Functions | Variables
python.utils.AtlRunQueryLookup Namespace Reference

Functions

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

Variables

dictionary DQChannelDict
 
dictionary DQSuperGroupsDict
 
dictionary DQGroupDict
 
dictionary OLCAlgorithms
 
string mask = "0x1fffffffffff7"
 

Function Documentation

◆ DecodeDetectorMask()

def 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.

419 def 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()

def 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.

373 def 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()

def python.utils.AtlRunQueryLookup.DQChannel (   name)

Definition at line 125 of file AtlRunQueryLookup.py.

125 def 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()

def python.utils.AtlRunQueryLookup.DQChannels ( )

Definition at line 118 of file AtlRunQueryLookup.py.

118 def 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()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoder (   lhcRun)

Definition at line 170 of file AtlRunQueryLookup.py.

170 def InitDetectorMaskDecoder( lhcRun ):
171  if lhcRun==3:
173  elif lhcRun==2:
175  else:
177 

◆ InitDetectorMaskDecoderRun1()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun1 ( )

Definition at line 178 of file AtlRunQueryLookup.py.

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()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun2 ( )

Definition at line 258 of file AtlRunQueryLookup.py.

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 

◆ InitDetectorMaskDecoderRun3()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun3 ( )

Definition at line 345 of file AtlRunQueryLookup.py.

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()

def python.utils.AtlRunQueryLookup.isDQ (   name)

Definition at line 135 of file AtlRunQueryLookup.py.

135 def 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 

◆ LArConfig()

def python.utils.AtlRunQueryLookup.LArConfig (   type)

Definition at line 444 of file AtlRunQueryLookup.py.

444 def 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()

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

Definition at line 409 of file AtlRunQueryLookup.py.

409 def 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 

Variable Documentation

◆ DQChannelDict

dictionary python.utils.AtlRunQueryLookup.DQChannelDict

Definition at line 21 of file AtlRunQueryLookup.py.

◆ DQGroupDict

dictionary python.utils.AtlRunQueryLookup.DQGroupDict

Definition at line 85 of file AtlRunQueryLookup.py.

◆ DQSuperGroupsDict

dictionary 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

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

Definition at line 459 of file AtlRunQueryLookup.py.

◆ OLCAlgorithms

dictionary 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.

python.utils.AtlRunQueryLookup.DecodeDetectorMaskToString
def DecodeDetectorMaskToString(detmask, lhcRun, smart)
Definition: AtlRunQueryLookup.py:373
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun2
def InitDetectorMaskDecoderRun2()
Definition: AtlRunQueryLookup.py:258
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
upper
int upper(int c)
Definition: LArBadChannelParser.cxx:49
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
python.utils.AtlRunQueryLookup.isDQ
def isDQ(name)
Definition: AtlRunQueryLookup.py:135
python.utils.AtlRunQueryLookup.DecodeDetectorMask
def DecodeDetectorMask(mask, lhcRun=3, smart=False)
Definition: AtlRunQueryLookup.py:419
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.utils.AtlRunQueryLookup.DQChannels
def DQChannels()
Definition: AtlRunQueryLookup.py:118
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun3
def InitDetectorMaskDecoderRun3()
Definition: AtlRunQueryLookup.py:345
python.utils.AtlRunQueryLookup.splitAt
def splitAt(line, splitstring=',', splitsize=80)
Definition: AtlRunQueryLookup.py:409
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun1
def InitDetectorMaskDecoderRun1()
Definition: AtlRunQueryLookup.py:178
python.utils.AtlRunQueryLookup.LArConfig
def LArConfig(type)
Definition: AtlRunQueryLookup.py:444
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoder
def InitDetectorMaskDecoder(lhcRun)
Definition: AtlRunQueryLookup.py:170
python.utils.AtlRunQueryLookup.DQChannel
def DQChannel(name)
Definition: AtlRunQueryLookup.py:125
Trk::split
@ split
Definition: LayerMaterialProperties.h:38