87 if self.
outFile.endswith(
".json"):
90 if self.
outFile.endswith(
".csv"):
100 lblb.setIOVRangeFromRun(run)
101 if not lblb.readData():
102 print(f
'RunLumiTime - No LBLB data found for run {run}!')
105 for obj
in lblb.data:
107 run = obj.since() >> 32
108 lb = obj.since() & 0xFFFFFFFF
110 startTime = obj.payload()[
'StartTime']
111 endTime = obj.payload()[
'EndTime']
113 if not run
in output:
117 "begin": startTime/1.e9,
121 entry = (run, lb, startTime/1.e9, endTime/1.e9)
122 separator =
',' if format==
'csv' else ' '
123 print(separator.join([str(v)
for v
in entry]), file=fp)
127 json.dump(output, fp, indent=4)
132 print(f
"Wrote file {self.outFile}")