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