42 if run
not in runlstime.keys():
43 print(
"Reading lumi time from lumireg localcopy files")
44 filename=
"localcopy/BeamFitResults_Run"+run+
".txt" 45 if not os.path.exists(filename):
46 print(
"WARNING: file ",filename,
" does not exist. Returning null.")
51 in_file = open(filename)
52 pieces = paragraphs(in_file,start_of_new_beamspot_measurement,
True)
57 tmp = BeamspotMeasurement(piece)
58 except Exception
as err:
59 print(
" ERROR Found corrupt " \
60 "beamspot measurement entry!", file=sys.stderr)
61 print(
" !!! %s !!!" %
str(err), file=sys.stderr)
64 runfromfile=tmp.run_number
65 (lumimin,lumimax)=tmp.lumi_range
66 time_begin=tmp.time_begin
68 time_begin=calendar.timegm(time_begin.timetuple())
69 time_end=calendar.timegm(time_end.timetuple())-23
70 lstime[lumimin]=time_begin
71 lstime[lumimax]=time_end
74 lslist=sorted(lstime.keys())
77 lstimesorted.append((ls,lstime[ls]))
78 runlstime[run]=lstimesorted
90 lstimesorted=runlstime[run]
92 for pair
in lstimesorted:
94 if abs(lumisection-lumi)<dcloselumi:
95 dcloselumi=
abs(lumisection-lumi)
99 finaltime=closetime+(lumisection-closelumi)*23
S & print(S &os, JobReport::InputFile const &f)
Abs< T >::type abs(const T &t)
def timeof(run, lumisection)