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 |
|
|
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 |
|
|
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 |
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) |