ATLAS Offline Software
Loading...
Searching...
No Matches
python.detmaskmod Namespace Reference

Functions

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

Variables

dict detmaskmap_defects

Function Documentation

◆ decodeBlack()

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

Definition at line 45 of file detmaskmod.py.

45def 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
static void reduce(HepMC::GenEvent *ge, HepMC::GenParticle *gp)
Remove an unwanted particle from the event, collapsing the graph structure consistently.
Definition FixHepMC.cxx:39

◆ getNumLumiBlocks()

python.detmaskmod.getNumLumiBlocks ( run)

Definition at line 73 of file detmaskmod.py.

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

python.detmaskmod.getRunMask ( run)

Definition at line 61 of file detmaskmod.py.

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

python.detmaskmod.getSubDetectorObj ( sdstr)

Definition at line 42 of file detmaskmod.py.

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

Variable Documentation

◆ detmaskmap_defects

dict python.detmaskmod.detmaskmap_defects

Definition at line 8 of file detmaskmod.py.