ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/dc_tex_converter.py
Revision: 1.1
Committed: Tue Oct 9 21:07:24 2012 UTC (12 years, 7 months ago) by bortigno
Content type: text/x-python
Branch: MAIN
Log Message:
preliminay version of DC to tex coverter for yields

File Contents

# User Rev Content
1 bortigno 1.1 #!/afs/cern.ch/cms/slc5_amd64_gcc434/cms/cmssw/CMSSW_4_2_8/external/slc5_amd64_gcc434/bin/python2.6
2    
3     import os
4     import ROOT
5    
6    
7     files = [ 'vhbb_TH_BDT_M125_ZeeLowPt_8TeV.root' ]
8     histos=[ 'TT','ZjLF','ZjHF', 'VV','VH','s_Top' ]
9    
10     def dc_tex_converter(rootFile):
11     infile = ROOT.TFile(rootFile,"READ")
12     print infile.GetName()
13     for histo in histos:
14     th1 = infile.Get(histo)
15     error = ROOT.Double()
16     integral = th1.IntegralAndError(0,1000,error)
17     print th1.GetName() + ' ' + '%.2f' %(integral) + ' \pm ' + '%.2f' %(error)
18    
19    
20    
21     if __name__ == "__main__":
22     dc_tex_converter(files[0])