9 c1 = ROOT.TCanvas(
'c1',
'', 400, 400)
11 location =
'/disk/homedisk/home/sjh2/public_web/twiki/'
12 derivationTag =
'p1851'
16 if quantity ==
'totalSize':
17 toGB = 1. / 1000. / 1000. / 1000.
19 primaryxAOD = ami.askAmi(
'data12_8TeV.*' + stream +
'.merge.AOD.r572*_p1751_p2309', quantity)
20 topq1_round1 = ami.askAmi(
'data12_8TeV.*' + stream +
'*DAOD_TOPQ1*' + derivationTag, quantity)
24 topq2_round1 = ami.askAmi(
'data12_8TeV.*' + stream +
'*DAOD_TOPQ2*' + derivationTag, quantity)
26 h_topq1_frac = ROOT.TH1D(
'h_topq1_frac',
';TOPQ1 Size / Primary Size [%];Number of datasets', 20, 0, 10)
27 h_topq2_frac = ROOT.TH1D(
'h_topq2_frac',
';TOPQ2 Size / Primary Size [%];Number of datasets', 20, 0, 1)
29 h_topq1_abs = ROOT.TH1D(
'h_topq1_abs',
';TOPQ1 Size [GB];Number of datasets', 20, 0, 200)
30 h_topq2_abs = ROOT.TH1D(
'h_topq2_abs',
';TOPQ2 Size [GB];Number of datasets', 30, 0, 15)
32 out.write(
'---+ !%s\n' % stream)
34 out.write(
'| *%s* | *%s* | *%s* | *%s* | *%s* | *%s* |\n' % (
'Primary xAOD name',
'Size [GB]',
'TOPQ1 size [GB]',
'%',
'TOPQ2 size [GB]',
'%'))
36 out.write(
'| *%s* | *%s* | *%s* | *%s* |\n' % (
'Primary xAOD name',
'Size [GB]',
'TOPQ1 size [GB]',
'%'))
41 for k
in sorted(primaryxAOD.keys()):
42 primaryNum = primaryxAOD[k] * toGB
44 topq1_name = k.replace(
'AOD',
'DAOD_TOPQ1') +
'_' + derivationTag
46 if topq1_round1.has_key(topq1_name):
47 topq1Num = topq1_round1[topq1_name] * toGB
49 topq2_name = k.replace(
'AOD',
'DAOD_TOPQ2') +
'_' + derivationTag
51 if topq2_round1.has_key(topq2_name):
52 topq2Num = topq2_round1[topq2_name] * toGB
62 tot_prim += primaryNum
64 topq1Frac = 100. * topq1Num / primaryNum
65 h_topq1_frac.Fill(topq1Frac)
66 h_topq1_abs.Fill(topq1Num)
69 topq1Num = cstart + (
'%4.2f' % topq1Num) + cend
70 topq1Frac = cstart + (
'%4.2f' % topq1Frac) + cend
72 topq1Num = cstart +
'-' + cend
73 topq1Frac = cstart +
'-' + cend
77 topq2Frac = 100. * topq2Num / primaryNum
78 h_topq2_frac.Fill(topq2Frac)
79 h_topq2_abs.Fill(topq2Num)
82 topq2Num = cstart + (
'%4.2f' % topq2Num) + cend
83 topq2Frac = cstart + (
'%4.2f' % topq2Frac) + cend
85 topq2Num = cstart +
'-' + cend
86 topq2Frac = cstart +
'-' + cend
89 primaryNum = cstart + (
'%4.2f' % primaryNum) + cend
92 txt =
'| %s | %s | %s | %s | %s | %s |\n' % (k, primaryNum, topq1Num, topq1Frac, topq2Num, topq2Frac)
94 txt =
'| %s | %s | %s | %s |\n' % (k, primaryNum, topq1Num, topq1Frac)
99 txt =
'| total (only include primary that have derivation) | %4.2f | %4.2f | %4.2f | %4.2f | %4.2f |\n' % (tot_prim, tot_topq1, 100. * tot_topq1 / tot_prim, tot_topq2, 100. * tot_topq2 / tot_prim)
101 txt =
'| total (only include primary that have derivation) | %4.2f | %4.2f | %4.2f |\n' % (tot_prim, tot_topq1, 100. * tot_topq1 / tot_prim)
106 name = stream +
'_topq1_abs.gif'
107 h_topq1_abs.SetFillColor(ROOT.kRed)
108 h_topq1_abs.Draw(
'hist')
109 c1.Print(location + name)
110 out.write(
'http://epweb2.ph.bham.ac.uk/user/head/twiki/%s\n' % name)
112 name = stream +
'_topq1_frac.gif'
113 h_topq1_frac.SetFillColor(ROOT.kRed)
114 h_topq1_frac.Draw(
'hist')
115 c1.Print(location + name)
116 out.write(
'http://epweb2.ph.bham.ac.uk/user/head/twiki/%s\n' % name)
119 name = stream +
'_topq2_abs.gif'
120 h_topq2_abs.SetFillColor(ROOT.kRed)
121 h_topq2_abs.Draw(
'hist')
122 c1.Print(location + name)
123 out.write(
'http://epweb2.ph.bham.ac.uk/user/head/twiki/%s\n' % name)
125 name = stream +
'_topq2_frac.gif'
126 h_topq2_frac.SetFillColor(ROOT.kRed)
127 h_topq2_frac.Draw(
'hist')
128 c1.Print(location + name)
129 out.write(
'http://epweb2.ph.bham.ac.uk/user/head/twiki/%s\n' % name)
131 if __name__ ==
"__main__":
132 qunatityFromAmi =
'totalEvents'
133 qunatityFromAmi =
'totalSize'
135 out =
open(location +
'derivation_progress.html',
'w')
138 d_string = datetime.datetime.now().strftime(
'%Y-%m-%d %H:%M:%S')
140 out.write(
'---+ Introduction\n')
144 Hello, this page lists the most recent round of top derivations for DC14 (2012 Period B, about 5 fb-1).
146 For more information on which containers are kept and the cuts that are applied in TOPQ1, and TOPQ2, see TopDerivations)
148 The p-tag used for this page is %s
150 You can find derivations on rucio with:
151 =rucio list-dids data12_8TeV:*DAOD_TOPQ1*p1851= (or =TOPQ2=)
153 ''' % (d_string, derivationTag)
154 out.write(txt +
'\n')
158 printTable(out,
'JetTauEtmiss', qunatityFromAmi,
True)