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.10 by lantonel, Wed Feb 13 15:43:39 2013 UTC vs.
Revision 1.11 by lantonel, Wed Feb 20 16:20:37 2013 UTC

# Line 149 | Line 149 | for channel in channels: # loop over fin
149                  elif( types[sample] == "signalMC"):
150                      
151                      numSignalSamples += 1
152 <                    
152 >
153                      Histogram.SetFillStyle(0)
154                      Histogram.SetLineColor(colors[sample])
155                      Histogram.SetLineStyle(1)
156                      Histogram.SetLineWidth(2)
157 <                    
157 >                    if(normalizeToUnitArea and Histogram.Integral > 0):
158 >                        Histogram.Scale(1./Histogram.Integral())
159                      SignalMCLegend.AddEntry(Histogram,labels[sample],"L")
160                      SignalMCHistograms.append(Histogram)
161                      
# Line 166 | Line 167 | for channel in channels: # loop over fin
167                      Histogram.SetLineColor(colors[sample])
168                      Histogram.SetLineStyle(1)
169                      Histogram.SetLineWidth(2)
170 +                    if(normalizeToUnitArea and Histogram.Integral > 0):
171 +                        Histogram.Scale(1./Histogram.Integral())
172                      
173                      dataIntegral += Histogram.Integral()
174                      
# Line 175 | Line 178 | for channel in channels: # loop over fin
178              if dataIntegral > 0 and backgroundIntegral > 0:
179                  scaleFactor = dataIntegral/backgroundIntegral
180              for bgMCHist in BgMCHistograms:
181 <                if options.normalize:
181 >                if options.normalizeToData:
182                      bgMCHist.Scale(scaleFactor)
183 +                if options.normalizeToUnitArea and backgroundIntegral > 0:
184 +                    bgMCHist.Scale(1./backgroundIntegral)
185                  Stack.Add(bgMCHist)
186  
187 +
188                  
189              stackMax = Stack.GetMaximum()
190              finalMax = stackMax
# Line 231 | Line 237 | for channel in channels: # loop over fin
237                  SignalMCLegend.Draw()
238  
239              LumiLabel.Draw()
240 <            if options.normalize and numBgMCSamples > 0 and numDataSamples > 0:
240 >            if options.normalizeToData and numBgMCSamples > 0 and numDataSamples > 0:
241                  NormLabel = TPaveLabel(0.1,0.75,0.35,0.85,"MC scaled to data","NDC")
242                  NormLabel.SetBorderSize(0)
243                  NormLabel.SetFillColor(0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines