281 colours = [ c_NovelRed, 4, c_DarkOrange, c_DarkGreen, c_Violet, c_LightBlue, 3, c_VDarkYellow, c_Gray,
282 1, 2, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ]
285 run_and_time =
sorted(rootstreamdic[DataKey(
'Start and endtime')])
286 runs = [x[0]
for x
in run_and_time]
290 tmin =
min([x[1][0]
for x
in run_and_time])
291 tmax =
max([x[1][1]
for x
in run_and_time])
294 tminS = time.gmtime(tmin)
295 tmaxS = time.gmtime(tmax)
303 maxnev = {
'all_':-1,
'debug_':-1,
'calibration_':-1 }
304 for key, content
in rootstreamdic.iteritems():
305 if type(key)==DataKey:
307 if 'Start and endtime' not in key:
308 graphs.append( TGraph( len(content) ) )
309 graphs[-1].SetName( key.strip().
replace(
' ',
'_') )
310 graphs[-1].SetTitle( key.strip() )
312 for i
in range(len(content)):
317 cumulsum += content[j][1]/scale
318 graphs[-1].SetPoint( i, content[j][0], cumulsum )
319 for stype
in maxnev.keys():
321 if cumulsum > maxnev[stype]:
322 maxnev[stype] = cumulsum
323 if 'debug_' not in key
and cumulsum > maxnev[
'all_']:
324 maxnev[
'all_'] = cumulsum
325 sortdic[len(graphs)-1] = cumulsum
328 sortedlist =
sorted(sortdic, key=sortdic.__getitem__, reverse=
True)
335 if 'physics_' in name
or 'express_' in name:
338 g.GetPoint( g.GetN()-1, x, y )
340 legend.SetX2( legend.GetX2() - 0.2 )
341 legend.SetY1( legend.GetY2() - 0.05 )
342 DrawGraph( g, colours[ic], 2, 1, legend, name.replace(
'physics_',
'').
replace(
'express_',
'').
replace(
'express',
'Express'),
True,
'M', TText() )
346 frame.Draw(
"sameaxis")
350 fname =
'%s/atlrunquery_%s.png' % (datapath, name)
355 htmlstr.append(
MakeHtml( [
'Events in streams %s versus run' % name], [fname],
True, 60, 5 ) )
358 c, frame, legend =
CreateCanvasAndFrame( runmin, runmax, tminS, tmaxS, maxnev[
'all_'],
'',
'million' )
363 if '#Events (streamed)' in name:
364 DrawGraph( g, c_NovelBlue, 2, 2, legend,
"Total number of streamed events" )
365 elif '#Events' == name:
366 DrawGraph( g, c_NovelBlue, 5, 1, legend,
"Total number of triggered events (excl. calib)",
True,
'M', TText() )
367 elif 'physics_' in name
or 'express_' in name:
368 DrawGraph( g, colours[ic], 2, 1, legend, name.replace(
'physics_',
'').
replace(
'express_',
'').
replace(
'express',
'Express') )
372 frame.Draw(
"sameaxis")
376 fname =
'%s/atlrunquery_physicsstreams.png' % datapath
381 htmlstr.append(
MakeHtml( [
'Events in physics streams versus run'], [fname],
True, 60, 5 ) )
385 plottypes = {
'debug_' : [
'Debug',
'thousand',
'k' ],
386 'calibration_' : [
'Calibration',
'million',
'M' ] }
389 for key, cprop
in plottypes.iteritems():
391 c, frame, legend =
CreateCanvasAndFrame( runmin, runmax, tminS, tmaxS, maxnev[key], cprop[0], cprop[1] )
392 legend.SetY1( legend.GetY1() + 0.15 )
393 legend.SetX2( legend.GetX2() - 0.15 )
399 DrawGraph( g, colours[ic], 2, 1, legend, name, ic == 0, cprop[2], TText() )
403 frame.Draw(
"sameaxis")
407 fname =
'%s/atlrunquery_%sstreams.png' % (datapath, cprop[0].lower())
412 htmlstr.append(
MakeHtml( [
'Events in %s streams versus run' % cprop[0].lower()], [fname],
True, 60, 5 ) )
415 retstr =
'<table width="900" style="margin-left: 14px; background-color: #f0f0f0; border: 2px white solid; border-collapse: collapse;"><tr>'
416 for i,s
in enumerate(htmlstr):
417 retstr +=
'<td style="padding: 4px">%s</td>' % s
419 retstr +=
'</tr><tr>'
420 retstr +=
'</tr></table>'