94 |
|
corr = get_correlation_matrix( correlation_file ) |
95 |
|
print corr |
96 |
|
|
97 |
< |
dyl_string = 'CMS_vhbb_ZjLF_SF lnN - - - ' + str(1.+float(corr[0][0])*dyl_err) + ' ' + str(1.+(float(corr[0][1])*dyc_err)) + ' ' + str(1.+float(corr[0][2])*dyb_err) + ' ' + str(1.+float(corr[0][3])*ttbar_err) + ' - - - - ' |
98 |
< |
dyc_string = 'CMS_vhbb_ZjCF_SF lnN - - - ' + str(1.+float(corr[1][0])*dyl_err) + ' ' + str(1.+(float(corr[1][1])*dyc_err)) + ' ' + str(1.+float(corr[1][2])*dyb_err) + ' ' + str(1.+float(corr[1][3])*ttbar_err) + ' - - - - ' |
99 |
< |
dyb_string = 'CMS_vhbb_ZjHF_SF lnN - - - ' + str(1.+float(corr[2][0])*dyl_err) + ' ' + str(1.+(float(corr[2][1])*dyc_err)) + ' ' + str(1.+float(corr[2][2])*dyb_err) + ' ' + str(1.+float(corr[2][3])*ttbar_err) + ' - - - - ' |
100 |
< |
ttbar_string = 'CMS_vhbb_TT_SF lnN - - - ' + str(1.+float(corr[3][0])*dyl_err) + ' ' + str(1.+(float(corr[3][1])*dyc_err)) + ' ' + str(1.+float(corr[3][2])*dyb_err) + ' ' + str(1.+float(corr[3][3])*ttbar_err) + ' - - - - ' |
97 |
> |
dyl_string = 'CMS_vhbb_ZjLF_SF lnN - - - ' + '%.3f' % (1.+float(corr[0][0])*dyl_err) + ' ' + '%.3f' %(1.+(float(corr[0][1])*dyl_err)) + ' ' + '%.3f' %(1.+float(corr[0][2])*dyl_err) + ' ' + '%.3f' %(1.+float(corr[0][3])*dyl_err) + ' - - - - \n' |
98 |
> |
dyc_string = 'CMS_vhbb_ZjCF_SF lnN - - - ' + '%.3f' %(1.+float(corr[1][0])*dyc_err) + ' ' + '%.3f' %(1.+(float(corr[1][1])*dyc_err)) + ' ' + '%.3f' %(1.+float(corr[1][2])*dyc_err) + ' ' + '%.3f' %(1.+float(corr[1][3])*dyc_err) + ' - - - - \n' |
99 |
> |
dyb_string = 'CMS_vhbb_ZjHF_SF lnN - - - ' + '%.3f' %(1.+float(corr[2][0])*dyb_err) + ' ' + '%.3f' %(1.+(float(corr[2][1])*dyb_err)) + ' ' + '%.3f' %(1.+float(corr[2][2])*dyb_err) + ' ' + '%.3f' %(1.+float(corr[2][3])*dyb_err) + ' - - - - \n' |
100 |
> |
ttbar_string = 'CMS_vhbb_TT_SF lnN - - - ' + '%.3f' %(1.+float(corr[3][0])*ttbar_err) + ' ' + '%.3f' %(1.+(float(corr[3][1])*ttbar_err)) + ' ' + '%.3f' %(1.+float(corr[3][2])*ttbar_err) + ' ' + '%.3f' %(1.+float(corr[3][3])*ttbar_err) + ' - - - - \n' |
101 |
|
|
102 |
|
print dyl_string |
103 |
|
print dyc_string |
104 |
|
print dyb_string |
105 |
|
print ttbar_string |
106 |
|
|
107 |
+ |
outfile = open("Datacard.txt",'w') |
108 |
+ |
outfile.writelines(dyl_string) |
109 |
+ |
outfile.writelines(dyc_string) |
110 |
+ |
outfile.writelines(dyb_string) |
111 |
+ |
outfile.writelines(ttbar_string) |
112 |
+ |
outfile.close() |
113 |
+ |
|