ATLAS Offline Software
Functions | Variables
python.detmaskmod Namespace Reference

Functions

def getSubDetectorObj (sdstr)
 
def decodeBlack (mask, defects=True)
 
def getRunMask (run)
 
def getNumLumiBlocks (run)
 

Variables

dictionary detmaskmap_defects
 

Function Documentation

◆ decodeBlack()

def python.detmaskmod.decodeBlack (   mask,
  defects = True 
)

Definition at line 45 of file detmaskmod.py.

45 def decodeBlack(mask, defects=True): # defects argument is deprecated and now a nop
46  dm = eformat.helper.DetectorMask(mask)
47  rv = []
48  dmap = detmaskmap_defects
49  for keys, value in dmap.items():
50  if isinstance(keys, str):
51  keys = [keys]
52  if reduce(operator.and_,
53  [not dm.is_set(getSubDetectorObj(key)) for key in keys]):
54  flags = value
55  if isinstance(flags, str):
56  flags = [flags]
57  rv += list(flags)
58 
59  return sorted(rv)
60 

◆ getNumLumiBlocks()

def python.detmaskmod.getNumLumiBlocks (   run)

Definition at line 73 of file detmaskmod.py.

73 def getNumLumiBlocks(run):
74  from DQUtils.db import fetch_iovs
75  lbs = fetch_iovs('LBLB', (run, 1), (run, 0xFFFFFFFF), database='oracle://ATLAS_COOLPROD;dbname=CONDBR2;schema=ATLAS_COOLONL_TRIGGER')
76  return len(lbs)
77 
78 

◆ getRunMask()

def python.detmaskmod.getRunMask (   run)

Definition at line 61 of file detmaskmod.py.

61 def getRunMask(run):
62  from PyCool import cool
63  dbSvc = cool.DatabaseSvcFactory.databaseService()
64  # Necessary to work around COOL database lookup stupidity
65  db = dbSvc.openDatabase('oracle://ATLAS_COOLPROD;dbname=CONDBR2;schema=ATLAS_COOLONL_TDAQ', True)
66  iov = run << 32
67  folder = db.getFolder('/TDAQ/RunCtrl/SOR')
68  obj = folder.findObject(iov, 0)
69  mask = obj.payload()['DetectorMask']
70  db.closeDatabase()
71  return mask
72 

◆ getSubDetectorObj()

def python.detmaskmod.getSubDetectorObj (   sdstr)

Definition at line 42 of file detmaskmod.py.

42 def getSubDetectorObj(sdstr):
43  return getattr(eformat.helper.SubDetector, sdstr)
44 

Variable Documentation

◆ detmaskmap_defects

dictionary python.detmaskmod.detmaskmap_defects

Definition at line 8 of file detmaskmod.py.

python.detmaskmod.getSubDetectorObj
def getSubDetectorObj(sdstr)
Definition: detmaskmod.py:42
python.detmaskmod.getNumLumiBlocks
def getNumLumiBlocks(run)
Definition: detmaskmod.py:73
python.db.fetch_iovs
def fetch_iovs(folder_name, since=None, until=None, channels=None, tag="", what="all", max_records=-1, with_channel=True, loud=False, database=None, convert_time=False, named_channels=False, selection=None, runs=None, with_time=False, unicode_strings=False)
Definition: DQUtils/python/db.py:67
reduce
void reduce(HepMC::GenEvent *ge, std::vector< HepMC::GenParticlePtr > toremove)
Remove unwanted particles from the event, collapsing the graph structure consistently.
Definition: FixHepMC.cxx:81
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.detmaskmod.getRunMask
def getRunMask(run)
Definition: detmaskmod.py:61
python.detmaskmod.decodeBlack
def decodeBlack(mask, defects=True)
Definition: detmaskmod.py:45