194 collect_runs =
getRunLB(beg_run, end_run)
198 physics_runs = [
Run(run, lbs.values())
for run,lbs
in collect_runs.items()]
200 if len(physics_runs) == 0:
201 print(
'WARNING::Found 0 physics runs')
204 physics_runs.sort(key =
lambda x: x.run_number)
207 for run
in physics_runs:
210 key_since = run.GetRunStartTime() - 100000
211 key_until = run.GetRunEndTime() + 100000
213 f =
Folder(
'COOLOFL_TRIGGER/CONDBR2',
'/TRIGGER/OFLLUMI/LumiAccounting')
214 taglist=f.folder.listTags()
217 objs = f.folder.browseObjects(key_since, key_until, cool.ChannelSelection.all(), tag)
219 filledTags[tag] = len(objs)
221 if len(filledTags) == 0:
222 print (
"ERROR: no filled tag")
224 elif len(filledTags) > 1:
225 print (
"WARNING: the number filled tags is more than 1")
227 filledTags =
sorted(filledTags.items(),key=
lambda x:x[1],reverse=
True)
228 objs = f.folder.browseObjects(key_since, key_until, cool.ChannelSelection.all(), filledTags[0][0])
231 crun = obj.payload()[
'Run']
232 clb = obj.payload()[
'LumiBlock']
234 if crun != run.run_number:
239 lb.ReadPhysicsLumiInfo(obj.payload())
243 i_LB = obj.payload()[
'LumiBlock']
245 'AtlasPhysics' : obj.payload()[
'AtlasPhysics'],
246 'InstLumi' : obj.payload()[
'InstLumi']/10000.,
247 'LiveFraction' : obj.payload()[
'LiveFraction'],
248 'Duration' : lb.GetLBSecs(),
249 'start_time' : lb.start_time,
250 'end_time' : lb.end_time
253 if len(run.lbs) != icount:
254 print(
'WARNING::getRunPhysicsLumi - number of missed lbs=%d' ,(len(run.lbs) - icount))
255 print(
'WARNING:: number of run lbs=%d' ,(len(run.lbs)))
256 print(
'WARNING:: number of matched lbs=%d' ,(icount))
258 RunsLumiDic = LumiDic