ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/test/prepare_datacard.py
(Generate patch)

Comparing UserCode/VHbb/test/prepare_datacard.py (file contents):
Revision 1.1 by bortigno, Tue May 8 08:17:34 2012 UTC vs.
Revision 1.2 by bortigno, Wed May 9 09:23:30 2012 UTC

# Line 94 | Line 94 | correlation_file = open('CorrelationMatr
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 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines