30 fin = ROOT.TFile.Open(infname,
'READ')
32 fout = ROOT.TFile.Open(outfname,
'UPDATE')
34 for objname
in [
'z_lumi',
'z_lumi_ratio']:
35 obj = fin.Get(objname)
37 d = fout.Get(
'run_%d/GLOBAL/DQTGlobalWZFinder' % run)
39 d.WriteTObject(obj, objname)
40 fin.Close(); fout.Close()
43 import DQUtils, DQDefects
47 print(
'Query run information...', end=
'')
48 from DQUtils.db
import fetch_iovs
49 dbinstance =
'CONDBR2'
50 eor = fetch_iovs(
'EOR', (
min(runs) << 32) | 1,
51 (
max(runs) << 32) | 0xFFFFFFFF,
52 with_channel=
False, what=[], database=
'COOLONL_TDAQ/%s' % dbinstance)
54 eor = DQUtils.IOVSet(iov
for iov
in eor
if iov.since.run
in runs)
56 print(
'Query defects...', end=
'')
57 ddb = DQDefects.DefectsDB(
'COOLOFL_GLOBAL/%s' % dbinstance, tag=tag)
58 ignores = {_
for _
in ddb.defect_names
if 'UNCHECKED' in _}
60 defectiovs = ddb.retrieve(since =
min(runs) << 32 | 1,
61 until =
max(runs) << 32 | 0xffffffff,
63 evaluate_full =
False,
65 except Exception
as e:
68 print(
'Doing exclusions...', end=
'')
69 okiovs = eor.logical_and(eor, defectiovs.logical_not())
72 print(
'Generating GRL...', end=
'')
73 data = DQUtils.grl.make_grl(okiovs,
'',
'2.1')
74 with open(fname,
'w')
as outf: