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

Comparing UserCode/VHbb/python/StackMaker.py (file contents):
Revision 1.1 by nmohr, Thu Oct 18 13:44:02 2012 UTC vs.
Revision 1.2 by peller, Fri Oct 19 15:44:07 2012 UTC

# Line 61 | Line 61 | class StackMaker:
61          self.lumi = None
62          self.histos = None
63          self.typs = None
64 +        self.AddErrors = None
65          print self.setup
66  
67      def myText(self,txt="CMS Preliminary",ndcX=0,ndcY=0,size=0.8):
# Line 118 | Line 119 | class StackMaker:
119          #print setup
120  
121  
122 +        if not 'DYc' in self.typs: self.typLegendDict.update({'DYlight':self.typLegendDict['DYlc']})
123 +        print self.typLegendDict
124 +
125          k=len(self.histos)
126      
127          for j in range(0,k):
128              #print histos[j].GetBinContent(1)
129              i=k-j-1
130 <            self.histos[i].SetFillColor(int(self.colorDict[self.setup[i]]))
130 >            self.histos[i].SetFillColor(int(self.colorDict[self.typs[i]]))
131              self.histos[i].SetLineColor(1)
132              allStack.Add(self.histos[i])
133  
# Line 201 | Line 205 | class StackMaker:
205          unten.cd()
206          ROOT.gPad.SetTicks(1,1)
207  
208 +        l2 = ROOT.TLegend(0.5, 0.75,0.92,0.95)
209 +        l2.SetLineWidth(2)
210 +        l2.SetBorderSize(0)
211 +        l2.SetFillColor(0)
212 +        l2.SetFillStyle(4000)
213 +        l2.SetTextFont(62)
214 +        #l2.SetTextSize(0.035)
215 +        l2.SetNColumns(2)
216 +
217          ratio, error = getRatio(d1,allMC,self.xMin,self.xMax)
218          ksScore = d1.KolmogorovTest( allMC )
219          chiScore = d1.Chi2Test( allMC , "UWCHI2/NDF")
# Line 212 | Line 225 | class StackMaker:
225          ratioError.SetFillColor(ROOT.kGray+3)
226          ratioError.SetFillStyle(3013)
227          ratio.Draw("E1")
228 +
229 +
230 +
231 +        if not self.AddErrors == None:
232 +            self.AddErrors.SetFillColor(5)
233 +            self.AddErrors.SetFillStyle(1001)
234 +            self.AddErrors.Draw('SAME2')
235 +
236 +            l2.AddEntry(self.AddErrors,"MC uncert. (stat. + syst.)","f")
237 +
238 +        l2.AddEntry(ratioError,"MC uncert. (stat.)","f")
239 +
240 +        l2.Draw()
241 +
242          ratioError.Draw('SAME2')
243          ratio.Draw("E1SAME")
244          ratio.SetTitle("")

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines