ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/algomez/FourTop/TreeAnalyzer/test/plotCSVMjets.py
Revision: 1.1
Committed: Mon Nov 5 01:25:15 2012 UTC (12 years, 6 months ago) by algomez
Content type: text/x-python
Branch: MAIN
CVS Tags: HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 from ROOT import *
2 import sys
3 import os
4 import sys
5
6 # CMS Style
7 if os.path.isfile('tdrstyle.C'):
8 gROOT.ProcessLine('.L tdrstyle.C')
9 ROOT.setTDRStyle()
10 print "Found tdrstyle.C file, using this style."
11 HasCMSStyle = True
12 if os.path.isfile('CMSTopStyle.cc'):
13 gROOT.ProcessLine('.L CMSTopStyle.cc+')
14 style = CMSTopStyle()
15 style.setupDefault()
16 print "Found CMSTopStyle.cc file, use TOP style if requested in xml file."
17
18 gROOT.SetBatch()
19
20 filename = sys.argv[1] #'mu_templates.root'
21 file = TFile(filename)
22
23 variable = sys.argv[2]
24
25
26 file.cd()
27 list = file.GetListOfKeys()
28
29 hbb = {}
30 #hcc = {}
31 #hqq = {}
32
33 for key in list:
34 file.cd()
35 #print "key name "+key.GetName()
36 #print "name = "+ key.GetName() +" title = "+ key.GetTitle()
37 name = key.GetName()
38 #print "key name = " + name
39 obj = file.Get(name)
40 #obj.SetName( key.GetName() )
41 #print "obj name = "+ obj.GetName() +" title = "+ obj.GetTitle()
42 if name ==variable+"_tttt_Gh400":
43 hbb['tttt_Gh400'] = obj
44 if name ==variable+"_tttt_Gh400_woC":
45 hbb['tttt_Gh400_woC'] = obj
46 if name ==variable+"_tttt_Gh600":
47 hbb['tttt_Gh600'] = obj
48 if name ==variable+"_tttt_Gh600_woC":
49 hbb['tttt_Gh600_woC'] = obj
50 if name ==variable+"_tttt_Gh1000":
51 hbb['tttt_Gh1000'] = obj
52 if name ==variable+"_tttt_Gh1000_woC":
53 hbb['tttt_Gh1000_woC'] = obj
54 #if name.find("mu1allb_mass__wqq") !=-1: obj.Scale( SF_Wqq)
55 #outfile.cd()
56 #obj.Write()
57
58
59
60 cbb = TCanvas("cbb","cbb",800,600)
61 hbb['tttt_Gh400'].SetLineColor(kBlue)
62 hbb['tttt_Gh400'].SetLineWidth(2)
63 hbb['tttt_Gh400'].SetLineStyle(2)
64 hbb['tttt_Gh400'].SetYTitle("Unit Area")
65 #hbb['tttt_Gh400'].SetXTitle("Tagged b-jets CSVM")
66 max1 = hbb['tttt_Gh400'].GetMaximum()
67 hbb['tttt_Gh400_woC'].SetLineColor(kBlue)
68 hbb['tttt_Gh400_woC'].SetLineWidth(2)
69 hbb['tttt_Gh400_woC'].SetLineStyle(3)
70 max2 = hbb['tttt_Gh400_woC'].GetMaximum()
71 hbb['tttt_Gh600'].SetLineColor(kRed)
72 hbb['tttt_Gh600'].SetLineWidth(2)
73 hbb['tttt_Gh600'].SetLineStyle(2)
74 max3 = hbb['tttt_Gh600'].GetMaximum()
75 hbb['tttt_Gh600_woC'].SetLineColor(kRed)
76 hbb['tttt_Gh600_woC'].SetLineWidth(2)
77 hbb['tttt_Gh600_woC'].SetLineStyle(3)
78 max4 = hbb['tttt_Gh600_woC'].GetMaximum()
79 hbb['tttt_Gh1000'].SetLineColor(kGreen)
80 hbb['tttt_Gh1000'].SetLineWidth(2)
81 hbb['tttt_Gh1000'].SetLineStyle(2)
82 max5 = hbb['tttt_Gh1000'].GetMaximum()
83 hbb['tttt_Gh1000_woC'].SetLineColor(kGreen)
84 hbb['tttt_Gh1000_woC'].SetLineWidth(2)
85 hbb['tttt_Gh1000_woC'].SetLineStyle(3)
86 max6 = hbb['tttt_Gh1000_woC'].GetMaximum()
87
88 list = [max1, max2, max3, max4, max5, max6]
89 theMax = max(list)
90
91 #hbb['plus'].SetMarkerColor(2)
92 #hbb['tttt_Gh400'].SetMarkerColor(1)
93 #hbb['minus'].SetMarkerColor(4)
94 #hbb['plus'].SetMarkerStyle(2)
95 #hbb['tttt_Gh400'].SetMarkerStyle(2)
96 #hbb['minus'].SetMarkerStyle(2)
97
98 #cbb.SetLogy()
99 #hbb['data'].SetMaximum(10)
100 #hbb['ttbar'].SetMaximum(theMax * 1.55 )
101 #hbb['ttbar'].SetMaximum( max1 * 2.00)
102 #hbb['ttbar'].DrawNormalized("hist")
103 #hbb['ttbar'].DrawNormalized("hist same")
104 #hbb['tttt_Gh400'].DrawNormalized("hist")
105 hbb['tttt_Gh400'].DrawNormalized("hist")
106 hbb['tttt_Gh400'].SetMaximum( theMax * 2.00)
107 hbb['tttt_Gh400_woC'].DrawNormalized("hist same")
108 hbb['tttt_Gh600'].DrawNormalized("hist same")
109 hbb['tttt_Gh600_woC'].DrawNormalized("hist same")
110 hbb['tttt_Gh1000'].DrawNormalized("hist same")
111 hbb['tttt_Gh1000_woC'].DrawNormalized("hist same")
112 #hbb['tttt_Gh700'].DrawNormalized("hist same")
113 #hbb['tttt_Gh800'].DrawNormalized("hist same")
114 #hbb['tttt_Gh900'].DrawNormalized("hist same")
115 #hbb['tttt_Gh1000'].DrawNormalized("hist same")
116
117 #aleg = TLegend(0.2,0.20,0.50,0.40)
118 aleg = TLegend(0.60,0.60,0.93,0.93)
119 SetOwnership( aleg, 0 )
120 aleg.SetHeader("CMS Simulation #mu+jets") #Preliminary") # - 5.0 fb^{-1} at #sqrt{s}=7TeV")
121 aleg.SetMargin(0.12)
122 aleg.SetTextSize(0.035)
123 aleg.SetFillColor(0)
124 aleg.SetFillStyle(0)
125 aleg.SetBorderSize(0)
126
127 #aleg.AddEntry(hbb['data'],"Data","L")
128 #aleg.AddEntry(hbb['ttbar'],"t#bar{t}","L")
129 aleg.AddEntry(hbb['tttt_Gh400'],"t#bar{t}t#bar{t} G_{H} 0.4 TeV","L")
130 aleg.AddEntry(hbb['tttt_Gh400_woC'],"t#bar{t}t#bar{t} G_{H} 0.4 TeV w/o Btag Corr","L")
131 aleg.AddEntry(hbb['tttt_Gh600'],"t#bar{t}t#bar{t} G_{H} 0.6 TeV","L")
132 aleg.AddEntry(hbb['tttt_Gh600_woC'],"t#bar{t}t#bar{t} G_{H} 0.6 TeV w/o Btag Corr","L")
133 aleg.AddEntry(hbb['tttt_Gh1000'],"t#bar{t}t#bar{t} G_{H} 1.0 TeV","L")
134 aleg.AddEntry(hbb['tttt_Gh1000_woC'],"t#bar{t}t#bar{t} G_{H} 1.0 TeV w/o Btag Corr","L")
135 aleg.Draw()
136
137 cbb.Print(variable+"_diff.pdf")
138
139 #sigma_bb = 0.28
140 #sigma_cc = 0.06
141 #sigma_qq = 0.5
142 #outfile.Close()
143 #os.system('rm tmp_'+filename)
144
145 #raw_input ("Enter to quit:")