14 histfilename = histfile
if histfile
else "hist.root"
18 for filename
in xAODFiles:
19 cmd = [
'checkxAOD', filename]
20 outlog = subprocess.Popen(cmd, stdout = subprocess.PIPE)
21 lines =
str(outlog.communicate()).
split(
"\\n")
26 if line.startswith(
"CSV"):
27 domainlist = lines[iline+1].strip().
split(
",")
28 domainsize = lines[iline+2].strip().
split(
",")
29 domaindict = dict(zip(domainlist, domainsize))
31 sizes.append(
float(domaindict[
'Total']))
34 hfile = ROOT.TFile( histfilename,
'UPDATE',
'ROOT file with histograms' )
40 hsize = ROOT.TH1F(
'hist PHYSLITE PHYS AOD event size',
'hist PHYSLITE PHYS AOD event size', len(sizes), -0.5, len(sizes)-0.5 )
41 for i
in range(0,len(sizes)):
42 hsize.Fill(i, sizes[i])
46 xbins = [*
range(len(sizes))]
48 for i
in range(len(sizes)):
52 grsize = ROOT.TGraph(len(sizes),x,y)
53 grsize.SetTitle(
'graph PHYSLITE PHYS AOD file size')
54 grsize.SetName(
'graph PHYSLITE PHYS AOD file size')
58 xbinsLabel = [
'PHYSLITE %3.1f'%sizes[0],
59 'PHYS %3.1f'%sizes[1],
60 'AOD %3.1f'%sizes[2] ]
62 graxis = grsize.GetXaxis()
63 for ibin
in range(0,len(sizes)):
64 tmpbin = graxis.FindBin(ibin)
65 graxis.SetBinLabel(tmpbin, xbinsLabel[ibin])