68 Compute luminosity per channel for an IOVSet iovs using
69 lbs, lumis from fetch_lumi_inputs.
71 exclude_iovsets is a list of IOVSets for channels to be excluded from the
72 calculation such as not_ready, busy, etc.
74 good_runs is an optional set of runs to consider, such as the set of runs
75 which are OK for physics.
77 Return type is a dictionary of {channel name: lumi}
80 chans, iovsets = iovs.chans_iovsets
95 num_exclude = len(exclude_iovsets)
96 full_iovsets = exclude_iovsets
97 full_iovsets.extend(iovsets)
99 for since, until, states
in inputs:
103 (lb, lumi), defectstates = states[:2], states[2:]
104 excludes, defects = defectstates[:num_exclude], defectstates[num_exclude:]
109 if not lb
or not lumi
or any(excludes):
113 if good_runs
and since.run
not in good_runs:
117 lumi = (lb.EndTime - lb.StartTime)/1e9 * lumi.LBAvInstLumi
119 for name, defect_iov
in zip(chans, defects):
121 result[name] = result.get(name, 0) + lumi