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

Functions

 statusCutsToRange (dbconn, foldername, since, until, tag, statusreq)
 testStatusCutsToRange ()

Function Documentation

◆ statusCutsToRange()

python.DetStatusCoolLib.statusCutsToRange ( dbconn,
foldername,
since,
until,
tag,
statusreq )
Return a RangeList giving the good IOV range corresponding to the
specified set of daetector status cuts, using the given DB and folder

Definition at line 11 of file DetStatusCoolLib.py.

11def statusCutsToRange(dbconn,foldername,since,until,tag,statusreq):
12 """Return a RangeList giving the good IOV range corresponding to the
13 specified set of daetector status cuts, using the given DB and folder"""
14 range=RangeList(since,until)
15 reqs=DetStatusReq()
16 reqs.setFromString(statusreq)
17 folder=dbconn.getFolder(foldername)
18 # loop over all requested status cuts
19 for (ichan,req) in reqs.getDict().items():
20 itr=folder.browseObjects(since,until,cool.ChannelSelection(ichan),tag)
21 lastiov=since
22 while itr.goToNext():
23 obj=itr.currentRef()
24 status=obj.payload()['Code']
25 if (lastiov<obj.since()):
26 # veto gaps where no status data was provided - assume bad
27 range.vetoRange(lastiov,obj.since())
28 if (status<req):
29 range.vetoRange(obj.since(),obj.until())
30 lastiov=obj.until()
31 # veto final gap (if any)
32 range.vetoRange(lastiov,until)
33 itr.close()
34 return range
35

◆ testStatusCutsToRange()

python.DetStatusCoolLib.testStatusCutsToRange ( )

Definition at line 36 of file DetStatusCoolLib.py.

36def testStatusCutsToRange():
37 dbconn=indirectOpen('COOLOFL_GLOBAL/COMP200')
38 statusCutsToRange(dbconn,'/GLOBAL/DETSTATUS/LBSUMM',0,cool.ValidityKeyMax,'TRTB 3')
39