ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/Configuration/scripts/makePlots.py
(Generate patch)

Comparing UserCode/OSUT3Analysis/Configuration/scripts/makePlots.py (file contents):
Revision 1.7 by lantonel, Tue Feb 5 10:50:45 2013 UTC vs.
Revision 1.8 by lantonel, Tue Feb 5 13:52:03 2013 UTC

# Line 130 | Line 130 | for channel in channels: # loop over fin
130              Histogram.SetDirectory(0)
131              inputFile.Close()
132              xAxisLabel = Histogram.GetXaxis().GetTitle()
133 +            histoTitle = Histogram.GetTitle()
134              
135              if( types[sample] == "bgMC"):
136  
# Line 196 | Line 197 | for channel in channels: # loop over fin
197          outputFile.cd(rootDirectory+"/"+channel)        
198  
199          if(numBgMCSamples is not 0):
200 +            Stack.SetTitle(histoTitle)
201              Stack.Draw("HIST")
202 +            Stack.GetXaxis().SetTitle(xAxisLabel)
203              Stack.SetMaximum(1.1*finalMax)
204              for signalMCHist in SignalMCHistograms:
205                  signalMCHist.Draw("HIST SAME")
# Line 204 | Line 207 | for channel in channels: # loop over fin
207                  dataHist.Draw("E SAME")
208                                  
209          elif(numSignalSamples is not 0):
210 +            SignalMCHistograms[0].SetTitle(histoTitle)
211              SignalMCHistograms[0].Draw("HIST")
212 +            SignalMCHistograms[0].GetXaxis().SetTitle(xAxisLabel)
213              SignalMCHistograms[0].SetMaximum(1.1*finalMax)
214              for signalMCHist in SignalMCHistograms:
215                  if(signalMCHist is not SignalMCHistograms[0]):
# Line 212 | Line 217 | for channel in channels: # loop over fin
217              for dataHist in DataHistograms:
218                  dataHist.Draw("E SAME")
219          elif(numDataSamples is not 0):
220 +            DataHistograms[0].SetTitle(histoTitle)
221              DataHistograms[0].Draw("E")
222 +            DataHistograms[0].GetXaxis().SetTitle(xAxisLabel)
223              DataHistograms[0].SetMaximum(1.1*finalMax)
224              for dataHist in DataHistograms:
225                  if(dataHist is not DataHistograms[0]):
226                      dataHist.Draw("E SAME")
227  
228 <
222 <
223 <        
224 <        if(numBgMCSamples is not 0):
225 <            Stack.GetXaxis().SetTitle(xAxisLabel)
226 <        elif(numSignalSamples is not 0):
227 <            SignalMCHistograms[0].GetXaxis().SetTitle(xAxisLabel)
228 <        elif(numDataSamples is not 0):
229 <            DataHistograms[0].GetXaxis().SetTitle(xAxisLabel)
230 <
228 >            
229          if(numBgMCSamples is not 0 or numDataSamples is not 0):
230              BgMCLegend.Draw()
231          if(numSignalSamples is not 0):
232              SignalMCLegend.Draw()
233  
234          LumiLabel.Draw()
235 <        if options.normalize:
235 >        if options.normalize and numBgMCSamples > 0 and numDataSamples > 0:
236              NormLabel = TPaveLabel(0.1,0.75,0.35,0.85,"MC scaled to data","NDC")
237              NormLabel.SetBorderSize(0)
238              NormLabel.SetFillColor(0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines