1 |
lucieg |
1.1 |
import FWCore.ParameterSet.Config as cms
|
2 |
|
|
import ROOT
|
3 |
|
|
|
4 |
|
|
from styles import *
|
5 |
|
|
|
6 |
|
|
def makeEffPlots(histos, denHisto, cuts, xTitle, yTitle, title, leg):
|
7 |
|
|
|
8 |
|
|
cut = 0
|
9 |
|
|
color = [1, 1, 4, 4, 3, 3, 28, 28, 7, 7]
|
10 |
|
|
style = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
|
11 |
|
|
|
12 |
|
|
for histo in histos :
|
13 |
|
|
|
14 |
|
|
if (cut == 0):
|
15 |
|
|
setStyle(histo, color[cut], style[cut], xTitle, yTitle )
|
16 |
|
|
histo.SetMaximum(1)
|
17 |
|
|
histo.Draw()
|
18 |
|
|
leg.AddEntry(histo, "no cut","l")
|
19 |
|
|
|
20 |
|
|
else :
|
21 |
|
|
histo.Sumw2()
|
22 |
|
|
# denHisto.Sumw2()
|
23 |
|
|
histo.Divide(denHisto)
|
24 |
|
|
setStyle(histo, color[cut], style[cut])
|
25 |
|
|
histo.Draw("SAME")
|
26 |
|
|
leg.AddEntry(histo, cuts[cut],"l")
|
27 |
|
|
cut += 1
|
28 |
|
|
|
29 |
|
|
leg.Draw("SAME")
|
30 |
|
|
|