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 420 of file AtlRunQueryLookup.py.

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

◆ 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 374 of file AtlRunQueryLookup.py.

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

◆ DQChannel()

def python.utils.AtlRunQueryLookup.DQChannel (   name)

Definition at line 126 of file AtlRunQueryLookup.py.

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

◆ DQChannels()

def python.utils.AtlRunQueryLookup.DQChannels ( )

Definition at line 119 of file AtlRunQueryLookup.py.

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

◆ InitDetectorMaskDecoder()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoder (   lhcRun)

Definition at line 171 of file AtlRunQueryLookup.py.

171 def InitDetectorMaskDecoder( lhcRun ):
172  if lhcRun==3:
174  elif lhcRun==2:
176  else:
178 

◆ InitDetectorMaskDecoderRun1()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun1 ( )

Definition at line 179 of file AtlRunQueryLookup.py.

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

◆ InitDetectorMaskDecoderRun2()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun2 ( )

Definition at line 259 of file AtlRunQueryLookup.py.

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

◆ InitDetectorMaskDecoderRun3()

def python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun3 ( )

Definition at line 346 of file AtlRunQueryLookup.py.

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

◆ isDQ()

def python.utils.AtlRunQueryLookup.isDQ (   name)

Definition at line 136 of file AtlRunQueryLookup.py.

136 def isDQ(name):
137  name = (name.split(':')[-1].split('#')[0]).upper()
138  if name.startswith("CP_") or name.startswith("PHYS_") or name.startswith("TRIG_") or name.startswith("LUM_") or name.startswith("GLOBAL_"):
139  return True
140  return name in DQChannelDict
141 
142 

◆ LArConfig()

def python.utils.AtlRunQueryLookup.LArConfig (   type)

Definition at line 445 of file AtlRunQueryLookup.py.

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

◆ splitAt()

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

Definition at line 410 of file AtlRunQueryLookup.py.

410 def splitAt(line, splitstring=',', splitsize=80):
411  res = [line]
412  while len( res[-1] ):
413  linebreak = res[-1].find( splitstring, splitsize)
414  if linebreak==-1:
415  break
416  res[-1:] = [ res[-1][:linebreak], res[-1][linebreak+len(splitstring):] ]
417  return res
418 
419 

Variable Documentation

◆ DQChannelDict

dictionary python.utils.AtlRunQueryLookup.DQChannelDict

Definition at line 22 of file AtlRunQueryLookup.py.

◆ DQGroupDict

dictionary python.utils.AtlRunQueryLookup.DQGroupDict

Definition at line 86 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 65 of file AtlRunQueryLookup.py.

◆ mask

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

Definition at line 460 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 143 of file AtlRunQueryLookup.py.

python.utils.AtlRunQueryLookup.DecodeDetectorMaskToString
def DecodeDetectorMaskToString(detmask, lhcRun, smart)
Definition: AtlRunQueryLookup.py:374
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun2
def InitDetectorMaskDecoderRun2()
Definition: AtlRunQueryLookup.py:259
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:136
python.utils.AtlRunQueryLookup.DecodeDetectorMask
def DecodeDetectorMask(mask, lhcRun=3, smart=False)
Definition: AtlRunQueryLookup.py:420
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.utils.AtlRunQueryLookup.DQChannels
def DQChannels()
Definition: AtlRunQueryLookup.py:119
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun3
def InitDetectorMaskDecoderRun3()
Definition: AtlRunQueryLookup.py:346
python.utils.AtlRunQueryLookup.splitAt
def splitAt(line, splitstring=',', splitsize=80)
Definition: AtlRunQueryLookup.py:410
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoderRun1
def InitDetectorMaskDecoderRun1()
Definition: AtlRunQueryLookup.py:179
python.utils.AtlRunQueryLookup.LArConfig
def LArConfig(type)
Definition: AtlRunQueryLookup.py:445
python.utils.AtlRunQueryLookup.InitDetectorMaskDecoder
def InitDetectorMaskDecoder(lhcRun)
Definition: AtlRunQueryLookup.py:171
python.utils.AtlRunQueryLookup.DQChannel
def DQChannel(name)
Definition: AtlRunQueryLookup.py:126
Trk::split
@ split
Definition: LayerMaterialProperties.h:38