1 |
nowak |
1.1 |
import ROOT
|
2 |
|
|
import sys, re
|
3 |
|
|
sys.path.append("/afs/naf.desy.de/user/n/nowaf/UserCode/nowaf/PythonScripts/")
|
4 |
|
|
import definitions as Def
|
5 |
|
|
import styles as Style
|
6 |
|
|
import MakeRealTauEst_cff as RT
|
7 |
|
|
|
8 |
|
|
if __name__ == "__main__":
|
9 |
|
|
|
10 |
|
|
Def.SetGlobalStyles( withTitle=True )
|
11 |
|
|
|
12 |
|
|
lumi = 1000.
|
13 |
|
|
### v4
|
14 |
|
|
#lumi = 927.9
|
15 |
|
|
|
16 |
|
|
#fileName = "_cxviii"
|
17 |
|
|
fileName = "_full_iii"
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
saveName = "plots/plots_pre"
|
21 |
|
|
|
22 |
|
|
saveToPS = False
|
23 |
|
|
saveToEPS = False
|
24 |
|
|
|
25 |
|
|
##sampleList = []
|
26 |
|
|
##sampleList.append( "LM13" )
|
27 |
|
|
###sampleList.append( "LM8" )
|
28 |
|
|
###sampleList.append( "LM7" )
|
29 |
|
|
###sampleList.append( "GMSBc" )
|
30 |
|
|
##sampleList.append( "TTbar" )
|
31 |
|
|
##sampleList.append( "GVJets" )
|
32 |
|
|
##sampleList.append( "WWJets" )
|
33 |
|
|
###sampleList.append( "Zinv" )
|
34 |
|
|
##sampleList.append( "ZJets" )
|
35 |
|
|
##sampleList.append( "WJets" )
|
36 |
|
|
###sampleList.append( "Multijet" )
|
37 |
|
|
|
38 |
|
|
removeSamplesAcc = []
|
39 |
|
|
#removeSamplesAcc.append( "TTbar" )
|
40 |
|
|
removeSamplesAcc.append( "GVJets" )
|
41 |
|
|
#removeSamplesAcc.append( "WWJets" )
|
42 |
|
|
#removeSamplesAcc.append( "Zinv" )
|
43 |
|
|
#removeSamplesAcc.append( "ZJets" )
|
44 |
|
|
#removeSamplesAcc.append( "WJets" )
|
45 |
|
|
#removeSamplesAcc.append( "QCDFlat" )
|
46 |
|
|
removeSamplesAcc.append( "Data" )
|
47 |
|
|
|
48 |
|
|
addSample = []
|
49 |
|
|
addSample.append( "LM13" )
|
50 |
|
|
addSample.append( "LM2" )
|
51 |
|
|
|
52 |
|
|
fileDir = "/scratch/hh/lustre/cms/user/nowaf/2011Data/VersionII/Plots/RealTauEst/"
|
53 |
|
|
|
54 |
|
|
theTitle = "Simulation only, " + str( int( lumi/1000. ) ) + " fb^{-1}, #sqrt{s}=7 TeV"
|
55 |
|
|
#theTitle = "CMS Simulation, " + str( int( lumi/1000. ) ) + " fb^{-1}, #sqrt{s}=7 TeV"
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
dir = "finalPlotTauPreSelection/"
|
59 |
|
|
#dir = "finalPlotTau/"
|
60 |
|
|
#dir = "finalPlotTauN1/"
|
61 |
|
|
|
62 |
|
|
histList = []
|
63 |
|
|
#histList.append( "MHTMHT" )
|
64 |
|
|
histList.append( "HTHT" )
|
65 |
|
|
|
66 |
|
|
hList = []
|
67 |
|
|
for hist in histList:
|
68 |
|
|
hList.append( hist + "_n1" )
|
69 |
|
|
pass
|
70 |
|
|
histList = [] ### ueberfluessig
|
71 |
|
|
histList = hList
|
72 |
|
|
|
73 |
|
|
rebinDict = {}
|
74 |
|
|
rebinDict[ "MHTMHT" ] = 2
|
75 |
|
|
rebinDict[ "MHTMHTEta" ] = 2
|
76 |
|
|
rebinDict[ "MHTMHTPhi" ] = 2
|
77 |
|
|
rebinDict[ "HTHT" ] = 1
|
78 |
|
|
#rebinDict[ "JetSelection30Jet1Pt" ] = 2
|
79 |
|
|
#rebinDict[ "JetSelection30Jet2Pt" ] = 2
|
80 |
|
|
#rebinDict[ "JetSelection30Jet3Pt" ] = 2
|
81 |
|
|
rebinDict[ "JetSelection30Jet1Eta" ] = 2
|
82 |
|
|
rebinDict[ "JetSelection30Jet2Eta" ] = 2
|
83 |
|
|
rebinDict[ "JetSelection30Jet3Eta" ] = 2
|
84 |
|
|
rebinDict[ "JetSelection30Jet1Phi" ] = 2
|
85 |
|
|
rebinDict[ "JetSelection30Jet2Phi" ] = 2
|
86 |
|
|
rebinDict[ "JetSelection30Jet3Phi" ] = 2
|
87 |
|
|
rebinDict[ "TauSelectionTau1Pt" ] = 2
|
88 |
|
|
rebinDict[ "TauSelectionTau1Eta" ] = 2
|
89 |
|
|
rebinDict[ "TauSelectionTau1Phi" ] = 2
|
90 |
|
|
if dir == "finalPlotTau/":
|
91 |
|
|
rebinDict[ "MHTMHT" ] = 2
|
92 |
|
|
rebinDict[ "HTHT" ] = 2
|
93 |
|
|
pass
|
94 |
|
|
|
95 |
|
|
rDict = {}
|
96 |
|
|
for key in rebinDict.keys():
|
97 |
|
|
rDict[ key + "_n1" ] = rebinDict[ key ]
|
98 |
|
|
pass
|
99 |
|
|
rebinDict = rDict.copy()
|
100 |
|
|
|
101 |
|
|
|
102 |
|
|
colorDict = {}
|
103 |
|
|
colorDict[ "QCDFlat" ] = ROOT.kYellow + 3
|
104 |
|
|
colorDict[ "TTbar" ] = ROOT.kRed + 3
|
105 |
|
|
#colorDict[ "GVJets" ] = ROOT.kRed
|
106 |
|
|
colorDict[ "ZJets" ] = ROOT.kOrange
|
107 |
|
|
colorDict[ "Zinv" ] = ROOT.kOrange - 3
|
108 |
|
|
#colorDict[ "WWJets" ] = ROOT.kOrange
|
109 |
|
|
#colorDict[ "ZZJets" ] = ROOT.kOrange
|
110 |
|
|
#colorDict[ "WZJets" ] = ROOT.kOrange
|
111 |
|
|
#colorDict[ "WWJets" ] = ROOT.kOrange + 7
|
112 |
|
|
colorDict[ "WWJets" ] = ROOT.kRed
|
113 |
|
|
colorDict[ "WJets" ] = ROOT.kYellow + 2
|
114 |
|
|
#colorDict[ "LM13" ] = ROOT.kBlue
|
115 |
|
|
colorDict[ "LM2" ] = ROOT.kBlue - 7
|
116 |
|
|
colorDict[ "LM13" ] = ROOT.kAzure + 10
|
117 |
|
|
colorDict[ "GMSBc" ] = ROOT.kCyan + 2
|
118 |
|
|
colorDict[ "Data" ] = ROOT.kBlack
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
xrangeDict = {}
|
122 |
|
|
xrangeDict[ "MHTMHT" ] = ( 250,1000 )
|
123 |
|
|
xrangeDict[ "MHTMHTEta" ] = ( -5,5 )
|
124 |
|
|
xrangeDict[ "MHTMHTPhi" ] = ( -3.14,3.14 )
|
125 |
|
|
xrangeDict[ "HTHT" ] = ( 0,2500 )
|
126 |
|
|
#xrangeDict[ "HTHT" ] = ( 350,2500 )
|
127 |
|
|
xrangeDict[ "JetSelection30Jet1Pt" ] = ( 0,1000 )
|
128 |
|
|
xrangeDict[ "JetSelection30Jet2Pt" ] = ( 0,1000 )
|
129 |
|
|
xrangeDict[ "JetSelection30Jet3Pt" ] = ( 0,1000 )
|
130 |
|
|
xrangeDict[ "JetSelection30Jet1Eta" ] = ( -5,5 )
|
131 |
|
|
xrangeDict[ "JetSelection30Jet2Eta" ] = ( -5,5 )
|
132 |
|
|
xrangeDict[ "JetSelection30Jet3Eta" ] = ( -5,5 )
|
133 |
|
|
xrangeDict[ "JetSelection30Jet1Phi" ] = ( -3.14,3.14 )
|
134 |
|
|
xrangeDict[ "JetSelection30Jet2Phi" ] = ( -3.14,3.14 )
|
135 |
|
|
xrangeDict[ "JetSelection30Jet3Phi" ] = ( -3.14,3.14 )
|
136 |
|
|
xrangeDict[ "JetSelection30NumberOfJets" ] = ( 0,20 )
|
137 |
|
|
xrangeDict[ "MHTdPhiMindPhiJet1MHT" ] = ( 0,4 )
|
138 |
|
|
xrangeDict[ "MHTdPhiMindPhiJet2MHT" ] = ( 0,4 )
|
139 |
|
|
xrangeDict[ "MHTdPhiMindPhiJet3MHT" ] = ( 0,4 )
|
140 |
|
|
xrangeDict[ "ElectronVetonElectrons" ] = ( 0,10 )
|
141 |
|
|
xrangeDict[ "MuonVetonMuons" ] = ( 0,10 )
|
142 |
|
|
xrangeDict[ "TauSelectionNumberOfTaus" ] = ( 0,10 )
|
143 |
|
|
xrangeDict[ "TauSelectionTau1Pt" ] = ( 0,500 )
|
144 |
|
|
xrangeDict[ "TauSelectionTau1Eta" ] = ( -5,5 )
|
145 |
|
|
xrangeDict[ "TauSelectionTau1Phi" ] = ( -3.14,3.14 )
|
146 |
|
|
xrangeDict[ "TauSelectionTau2Pt" ] = ( 0,1000 )
|
147 |
|
|
xrangeDict[ "dPhiJ12dphi" ] = ( 0,4 )
|
148 |
|
|
|
149 |
|
|
xrDict = {}
|
150 |
|
|
for key in xrangeDict.keys():
|
151 |
|
|
xrDict[ key + "_n1" ] = xrangeDict[ key ]
|
152 |
|
|
pass
|
153 |
|
|
xrangeDict = xrDict.copy()
|
154 |
|
|
|
155 |
|
|
yrangeDict = {}
|
156 |
|
|
yrangeDict[ "MHTMHT" ] = ( 10**-2,10**2 )
|
157 |
|
|
yrangeDict[ "MHTMHTEta" ] = ( 10**-2,8*10**3 )
|
158 |
|
|
yrangeDict[ "MHTMHTPhi" ] = ( 10**-2,8*10**3 )
|
159 |
|
|
yrangeDict[ "HTHT" ] = ( 10**-2,2*10 )
|
160 |
|
|
yrangeDict[ "JetSelection30Jet1Pt" ] = ( 10**-2,2*10**2 )
|
161 |
|
|
yrangeDict[ "JetSelection30Jet2Pt" ] = ( 10**-2,2*10**2 )
|
162 |
|
|
yrangeDict[ "JetSelection30Jet3Pt" ] = ( 10**-2,2*10**2 )
|
163 |
|
|
yrangeDict[ "JetSelection30Jet1Eta" ] = ( 10**-2,8*10**3 )
|
164 |
|
|
yrangeDict[ "JetSelection30Jet2Eta" ] = ( 10**-2,8*10**3 )
|
165 |
|
|
yrangeDict[ "JetSelection30Jet3Eta" ] = ( 10**-2,8*10**3 )
|
166 |
|
|
yrangeDict[ "JetSelection30Jet1Phi" ] = ( 10**-2,8*10**3 )
|
167 |
|
|
yrangeDict[ "JetSelection30Jet2Phi" ] = ( 10**-2,8*10**3 )
|
168 |
|
|
yrangeDict[ "JetSelection30Jet3Phi" ] = ( 10**-2,8*10**3 )
|
169 |
|
|
yrangeDict[ "JetSelection30NumberOfJets" ] = ( 10**-2,8*10**3 )
|
170 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet1MHT" ] = ( 10**-2,2*10**2 )
|
171 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet2MHT" ] = ( 10**-2,2*10**2 )
|
172 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet3MHT" ] = ( 10**-2,2*10**2 )
|
173 |
|
|
yrangeDict[ "ElectronVetonElectrons" ] = ( 10**-2,2*10**2 )
|
174 |
|
|
yrangeDict[ "MuonVetonMuons" ] = ( 10**-2,2*10**2 )
|
175 |
|
|
yrangeDict[ "TauSelectionNumberOfTaus" ] = ( 10**-2,2*10**2 )
|
176 |
|
|
yrangeDict[ "TauSelectionTau1Pt" ] = ( 10**-2,2*10**2 )
|
177 |
|
|
yrangeDict[ "TauSelectionTau1Eta" ] = ( 10**-2,8*10**3 )
|
178 |
|
|
yrangeDict[ "TauSelectionTau1Phi" ] = ( 10**-2,8*10**3 )
|
179 |
|
|
yrangeDict[ "TauSelectionTau2Pt" ] = ( 10**-2,2*10**2 )
|
180 |
|
|
yrangeDict[ "dPhiJ12dphi" ] = ( 10**-2,2*10**2 )
|
181 |
|
|
if re.search( "Pre", dir ):
|
182 |
|
|
yrangeDict[ "MHTMHT" ] = ( 10**-2,3*10**3 )
|
183 |
|
|
yrangeDict[ "MHTMHTEta" ] = ( 10**-2,8*10**3 )
|
184 |
|
|
yrangeDict[ "MHTMHTPhi" ] = ( 10**-2,8*10**3 )
|
185 |
|
|
yrangeDict[ "HTHT" ] = ( 10**-2,3*10**3 )
|
186 |
|
|
yrangeDict[ "JetSelection30Jet1Pt" ] = ( 10**-2,3*10**3 )
|
187 |
|
|
yrangeDict[ "JetSelection30Jet2Pt" ] = ( 10**-2,3*10**3 )
|
188 |
|
|
yrangeDict[ "JetSelection30Jet3Pt" ] = ( 10**-2,3*10**3 )
|
189 |
|
|
yrangeDict[ "JetSelection30Jet1Eta" ] = ( 10**-2,8*10**3 )
|
190 |
|
|
yrangeDict[ "JetSelection30Jet2Eta" ] = ( 10**-2,8*10**3 )
|
191 |
|
|
yrangeDict[ "JetSelection30Jet3Eta" ] = ( 10**-2,8*10**3 )
|
192 |
|
|
yrangeDict[ "JetSelection30Jet1Phi" ] = ( 10**-2,8*10**3 )
|
193 |
|
|
yrangeDict[ "JetSelection30Jet2Phi" ] = ( 10**-2,8*10**3 )
|
194 |
|
|
yrangeDict[ "JetSelection30Jet3Phi" ] = ( 10**-2,8*10**3 )
|
195 |
|
|
yrangeDict[ "JetSelection30NumberOfJets" ] = ( 10**-2,8*10**3 )
|
196 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet1MHT" ] = ( 10**-2,3*10**3 )
|
197 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet2MHT" ] = ( 10**-2,3*10**3 )
|
198 |
|
|
yrangeDict[ "MHTdPhiMindPhiJet3MHT" ] = ( 10**-2,3*10**3 )
|
199 |
|
|
yrangeDict[ "ElectronVetonElectrons" ] = ( 10**-2,3*10**3 )
|
200 |
|
|
yrangeDict[ "MuonVetonMuons" ] = ( 10**-2,3*10**3 )
|
201 |
|
|
yrangeDict[ "TauSelectionNumberOfTaus" ] = ( 10**-2,3*10**3 )
|
202 |
|
|
yrangeDict[ "TauSelectionTau1Pt" ] = ( 10**-2,3*10**3 )
|
203 |
|
|
yrangeDict[ "TauSelectionTau1Eta" ] = ( 10**-2,8*10**3 )
|
204 |
|
|
yrangeDict[ "TauSelectionTau1Phi" ] = ( 10**-2,8*10**3 )
|
205 |
|
|
yrangeDict[ "TauSelectionTau2Pt" ] = ( 10**-2,3*10**3 )
|
206 |
|
|
yrangeDict[ "dPhiJ12dphi" ] = ( 10**-2,3*10**3 )
|
207 |
|
|
pass
|
208 |
|
|
|
209 |
|
|
yrDict = {}
|
210 |
|
|
for key in yrangeDict.keys():
|
211 |
|
|
yrDict[ key + "_n1" ] = yrangeDict[ key ]
|
212 |
|
|
pass
|
213 |
|
|
yrangeDict = yrDict.copy()
|
214 |
|
|
|
215 |
|
|
logDict = {}
|
216 |
|
|
logDict[ "MHTMHT" ] = True
|
217 |
|
|
logDict[ "MHTMHTEta" ] = True
|
218 |
|
|
logDict[ "MHTMHTPhi" ] = True
|
219 |
|
|
logDict[ "HTHT" ] = True
|
220 |
|
|
logDict[ "JetSelection30Jet1Pt" ] = True
|
221 |
|
|
logDict[ "JetSelection30Jet2Pt" ] = True
|
222 |
|
|
logDict[ "JetSelection30Jet3Pt" ] = True
|
223 |
|
|
logDict[ "JetSelection30Jet1Eta" ] = True
|
224 |
|
|
logDict[ "JetSelection30Jet2Eta" ] = True
|
225 |
|
|
logDict[ "JetSelection30Jet3Eta" ] = True
|
226 |
|
|
logDict[ "JetSelection30Jet1Phi" ] = True
|
227 |
|
|
logDict[ "JetSelection30Jet2Phi" ] = True
|
228 |
|
|
logDict[ "JetSelection30Jet3Phi" ] = True
|
229 |
|
|
logDict[ "JetSelection30NumberOfJets" ] = True
|
230 |
|
|
logDict[ "MHTdPhiMindPhiJet1MHT" ] = True
|
231 |
|
|
logDict[ "MHTdPhiMindPhiJet2MHT" ] = True
|
232 |
|
|
logDict[ "MHTdPhiMindPhiJet3MHT" ] = True
|
233 |
|
|
logDict[ "ElectronVetonElectrons" ] = True
|
234 |
|
|
logDict[ "MuonVetonMuons" ] = True
|
235 |
|
|
logDict[ "TauSelectionNumberOfTaus" ] = True
|
236 |
|
|
logDict[ "TauSelectionTau1Pt" ] = True
|
237 |
|
|
logDict[ "TauSelectionTau1Eta" ] = True
|
238 |
|
|
logDict[ "TauSelectionTau1Phi" ] = True
|
239 |
|
|
logDict[ "TauSelectionTau2Pt" ] = True
|
240 |
|
|
logDict[ "dPhiJ12dphi" ] = True
|
241 |
|
|
|
242 |
|
|
lDict = {}
|
243 |
|
|
for key in logDict.keys():
|
244 |
|
|
lDict[ key + "_n1" ] = logDict[ key ]
|
245 |
|
|
pass
|
246 |
|
|
logDict = lDict.copy()
|
247 |
|
|
|
248 |
|
|
#scalingFactors = {}
|
249 |
|
|
#scalingFactors[ "QCDFlat" ] = lumi/100.
|
250 |
|
|
#scalingFactors[ "Z+Jets" ] = lumi/100.
|
251 |
|
|
#scalingFactors[ "VV+Jets" ] = lumi/100.
|
252 |
|
|
#scalingFactors[ "W+Jets" ] = lumi * 31300. / ( 15110974 * 0.65 )
|
253 |
|
|
#scalingFactors[ "TTbar" ] = lumi * 165 / ( 1164208. * 0.90 )
|
254 |
|
|
#scalingFactors[ "GV+Jets" ] = lumi * 173 / 1102193.
|
255 |
|
|
#scalingFactors[ "Zinv" ] = lumi * 5760 / 2165002.
|
256 |
|
|
#scalingFactors[ "LM13" ] = lumi * 6.9 / 219915.
|
257 |
|
|
#scalingFactors[ "LM7" ] = lumi * 1.2 / 220000.
|
258 |
|
|
#scalingFactors[ "LM8" ] = lumi * 0.7 / 220000.
|
259 |
|
|
#scalingFactors[ "GMSBc" ] = lumi * 0.25 / 219595.
|
260 |
|
|
|
261 |
|
|
titleDict = {}
|
262 |
|
|
titleDict[ "MHTMHT" ] = ( "#slash H_{T} [GeV]", "" )
|
263 |
|
|
titleDict[ "MHTMHTPhi" ] = ( "#phi^{MHT}", "" )
|
264 |
|
|
titleDict[ "MHTMHTEta" ] = ( "#eta^{MHT}", "" )
|
265 |
|
|
titleDict[ "HTHT" ] = ( "H_{T} [GeV]", "" )
|
266 |
|
|
titleDict[ "JetSelection30Jet1Pt" ] = ( "P_{T}^{Jet1} [GeV]", "" )
|
267 |
|
|
titleDict[ "JetSelection30Jet2Pt" ] = ( "P_{T}^{Jet2} [GeV]", "" )
|
268 |
|
|
titleDict[ "JetSelection30Jet3Pt" ] = ( "P_{T}^{Jet3} [GeV]", "" )
|
269 |
|
|
titleDict[ "JetSelection30Jet1Eta" ] = ( "#eta^{Jet1} [GeV]", "" )
|
270 |
|
|
titleDict[ "JetSelection30Jet2Eta" ] = ( "#eta^{Jet2} [GeV]", "" )
|
271 |
|
|
titleDict[ "JetSelection30Jet2Eta" ] = ( "#eta^{Jet3} [GeV]", "" )
|
272 |
|
|
titleDict[ "JetSelection30Jet1Phi" ] = ( "#phi^{Jet1} [GeV]", "" )
|
273 |
|
|
titleDict[ "JetSelection30Jet2Phi" ] = ( "#phi^{Jet2} [GeV]", "" )
|
274 |
|
|
titleDict[ "JetSelection30Jet3Phi" ] = ( "#phi^{Jet3} [GeV]", "" )
|
275 |
|
|
titleDict[ "JetSelection30NumberOfJets" ] = ( "Number of jets", "" )
|
276 |
|
|
titleDict[ "MHTdPhiMindPhiJet1MHT" ] = ( "#Delta #Phi (Jet1,MHT)", "" )
|
277 |
|
|
titleDict[ "MHTdPhiMindPhiJet2MHT" ] = ( "#Delta #Phi (Jet2,MHT)", "" )
|
278 |
|
|
titleDict[ "MHTdPhiMindPhiJet3MHT" ] = ( "#Delta #Phi (Jet3,MHT)", "" )
|
279 |
|
|
titleDict[ "ElectronVetonElectrons" ] = ( "number of electrons", "" )
|
280 |
|
|
titleDict[ "MuonVetonMuons" ] = ( "number of muons", "" )
|
281 |
|
|
titleDict[ "TauSelectionNumberOfTaus" ] = ( "Number of taus", "" )
|
282 |
|
|
titleDict[ "TauSelectionTau1Pt" ] = ( "P_{T}^{#tau} [GeV]", "" )
|
283 |
|
|
titleDict[ "TauSelectionTau1Eta" ] = ( "#eta^{#tau} [GeV]", "" )
|
284 |
|
|
titleDict[ "TauSelectionTau1Phi" ] = ( "#phi^{#tau} [GeV]", "" )
|
285 |
|
|
titleDict[ "TauSelectionTau2Pt" ] = ( "P_{T} (Tau2) [GeV]", "" )
|
286 |
|
|
titleDict[ "dPhiJ12dphi" ] = ( "#Delta #Phi (Jet1,Jet2)", "" )
|
287 |
|
|
|
288 |
|
|
tDict = {}
|
289 |
|
|
for key in titleDict.keys():
|
290 |
|
|
tDict[ key + "_n1" ] = titleDict[ key ]
|
291 |
|
|
pass
|
292 |
|
|
titleDict = tDict.copy()
|
293 |
|
|
|
294 |
|
|
positionDict = {}
|
295 |
|
|
positionDict[ "MHTdPhiMindPhiJet1MHT" ] = "ul"
|
296 |
|
|
positionDict[ "MHTdPhiMindPhiJet2MHT" ] = "ul"
|
297 |
|
|
positionDict[ "MHTdPhiMindPhiJet3MHT" ] = "ul"
|
298 |
|
|
positionDict[ "dPhiJ12dphi" ] = "ul"
|
299 |
|
|
|
300 |
|
|
pDict = {}
|
301 |
|
|
for key in positionDict.keys():
|
302 |
|
|
pDict[ key + "_n1" ] = positionDict[ key ]
|
303 |
|
|
pass
|
304 |
|
|
positionDict = pDict.copy()
|
305 |
|
|
|
306 |
|
|
lineDict = {}
|
307 |
|
|
lineDict[ "HTHT" ] = ( 600, 600, 10**-2, 10 )
|
308 |
|
|
lineDict[ "MHTMHT" ] = ( 400, 400, 10**-2, 10 )
|
309 |
|
|
if re.search( "Pre", dir ):
|
310 |
|
|
lineDict[ "HTHT" ] = ( 350, 350, 10**-2, 10**3 )
|
311 |
|
|
lineDict[ "MHTMHT" ] = ( 200, 200, 10**-2, 10**3 )
|
312 |
|
|
pass
|
313 |
|
|
|
314 |
|
|
liDict = {}
|
315 |
|
|
for key in lineDict.keys():
|
316 |
|
|
liDict[ key + "_n1" ] = lineDict[ key ]
|
317 |
|
|
pass
|
318 |
|
|
lineDict = liDict.copy()
|
319 |
|
|
|
320 |
|
|
lDict = {}
|
321 |
|
|
lDict[ "QCDFlat" ] = "QCD"
|
322 |
|
|
lDict[ "TTbar" ] = "t#bar{t}"
|
323 |
|
|
lDict[ "GVJets" ] = "#gamma+V+Jets"
|
324 |
|
|
lDict[ "ZJets" ] = "Z->ll +Jets"
|
325 |
|
|
lDict[ "Zinv" ] = "Z->#nu#nu +Jets"
|
326 |
|
|
lDict[ "WWJets" ] = "WW + Jets"
|
327 |
|
|
lDict[ "WJets" ] = "W + Jets"
|
328 |
|
|
lDict[ "LM13" ] = "LM13"
|
329 |
|
|
lDict[ "LM2" ] = "LM2"
|
330 |
|
|
#lDict[ "LM8" ] = "Signal"
|
331 |
|
|
#lDict[ "GMSBc" ] = "Signal"
|
332 |
|
|
lDict[ "Data" ] = "Data"
|
333 |
|
|
|
334 |
|
|
statusDict = {}
|
335 |
|
|
statusDict[ "QCDFlat" ] = "BG"
|
336 |
|
|
statusDict[ "QCD" ] = "BG"
|
337 |
|
|
#statusDict[ "QCDFlat" ] = "Signal"
|
338 |
|
|
statusDict[ "TTbar" ] = "BG"
|
339 |
|
|
statusDict[ "t#bar{t}" ] = "BG"
|
340 |
|
|
statusDict[ "GVJets" ] = "BG"
|
341 |
|
|
statusDict[ "#gamma+V+Jets" ] = "BG"
|
342 |
|
|
statusDict[ "ZJets" ] = "BG"
|
343 |
|
|
statusDict[ "Z->ll +Jets" ] = "BG"
|
344 |
|
|
statusDict[ "Zinv" ] = "BG"
|
345 |
|
|
statusDict[ "Z->#nu#nu +Jets" ] = "BG"
|
346 |
|
|
statusDict[ "WWJets" ] = "BG"
|
347 |
|
|
statusDict[ "WW + Jets" ] = "BG"
|
348 |
|
|
statusDict[ "WJets" ] = "BG"
|
349 |
|
|
statusDict[ "W + Jets" ] = "BG"
|
350 |
|
|
statusDict[ "LM13" ] = "Signal"
|
351 |
|
|
statusDict[ "LM2" ] = "Signal"
|
352 |
|
|
statusDict[ "LM8" ] = "Signal"
|
353 |
|
|
statusDict[ "GMSBc" ] = "Signal"
|
354 |
|
|
statusDict[ "Data" ] = "Data"
|
355 |
|
|
|
356 |
|
|
legendList = []
|
357 |
|
|
|
358 |
|
|
#######################################################################
|
359 |
|
|
|
360 |
|
|
accReadIn = RT.ReadIn( fileDir, fileName, lumi, rebinDict )
|
361 |
|
|
#if fileName == "_full":
|
362 |
|
|
# accReadIn.changeScalingFactor( "Zinv", lumi * 32.92 / ( 3067017. * 0.9 ) ) ### only 90% finished
|
363 |
|
|
# accReadIn.changeScalingFactor( "LM13", lumi * 6.899 / ( 517000 * 1 ) ) ### skim is 77000 events,
|
364 |
|
|
# ### 517000 - 77000 added afterwards
|
365 |
|
|
# accReadIn.changeScalingFactor( "LM2", lumi * 0.6027 / ( 445060 * 1. ) ) ### after adding additional events
|
366 |
|
|
# pass
|
367 |
|
|
|
368 |
|
|
accReadIn.removeSamples( removeSamplesAcc )
|
369 |
|
|
accReadIn.addSamples( addSample )
|
370 |
|
|
accReadIn.removeHists( [ "MHT" ] )
|
371 |
|
|
accReadIn.addHists( histList ) #accReadIn.dontScale()
|
372 |
|
|
histDict = accReadIn.getHists( dir )
|
373 |
|
|
for hist in accReadIn.histList:
|
374 |
|
|
for file in accReadIn.sampleList:
|
375 |
|
|
if hist in titleDict.keys():
|
376 |
|
|
|
377 |
|
|
binWidth = histDict[ hist ][ file ].GetBinWidth( 1 )
|
378 |
|
|
|
379 |
|
|
xtitle = titleDict[ hist ][ 0 ]
|
380 |
|
|
ytitle = "Events/" + str( int( binWidth ) ) + " GeV"
|
381 |
|
|
if not hist in titleDict.keys() or not re.search( "GeV", titleDict[ hist ][ 0 ] ):
|
382 |
|
|
ytitle = "Events"
|
383 |
|
|
pass
|
384 |
|
|
histDict[ hist ][ file ].UseCurrentStyle()
|
385 |
|
|
Style.setHistStyle( histDict[ hist ][ file ] , status=statusDict[ file ],\
|
386 |
|
|
color=colorDict[ file ], xTitle=xtitle, yTitle=ytitle,
|
387 |
|
|
markerStyle=20, title=theTitle )
|
388 |
|
|
if hist in xrangeDict.keys():
|
389 |
|
|
histDict[ hist ][ file ].GetXaxis().SetRangeUser( xrangeDict[ hist ][ 0 ],
|
390 |
|
|
xrangeDict[ hist ][ 1 ] )
|
391 |
|
|
pass
|
392 |
|
|
if hist in yrangeDict.keys():
|
393 |
|
|
histDict[ hist ][ file ].GetYaxis().SetRangeUser( yrangeDict[ hist ][ 0 ],
|
394 |
|
|
yrangeDict[ hist ][ 1 ] )
|
395 |
|
|
pass
|
396 |
|
|
pass
|
397 |
|
|
pass
|
398 |
|
|
|
399 |
|
|
for file in accReadIn.sampleList:
|
400 |
|
|
legendList.append( lDict[ file ] )
|
401 |
|
|
pass
|
402 |
|
|
|
403 |
|
|
#### get lists of samples not to be stacked
|
404 |
|
|
NonStackList = []
|
405 |
|
|
DataList = []
|
406 |
|
|
StackList = []
|
407 |
|
|
for sample in accReadIn.sampleList:
|
408 |
|
|
if statusDict[ sample ] == "Data":
|
409 |
|
|
DataList.append( sample )
|
410 |
|
|
elif statusDict[ sample ] == "Signal":
|
411 |
|
|
NonStackList.append( sample )
|
412 |
|
|
#elif statusDict[ sample ] == "BG":
|
413 |
|
|
# StackList.append( sample )
|
414 |
|
|
pass
|
415 |
|
|
pass
|
416 |
|
|
|
417 |
|
|
|
418 |
|
|
cDict = {}
|
419 |
|
|
stackDict = {}
|
420 |
|
|
legDict = {}
|
421 |
|
|
textDict = {}
|
422 |
|
|
tlineDict = {}
|
423 |
|
|
for hist in histList:
|
424 |
|
|
|
425 |
|
|
#### make the stack
|
426 |
|
|
if len( NonStackList + DataList ) != len( accReadIn.sampleList ):
|
427 |
|
|
stackDict[ hist ] = ROOT.THStack( hist, hist )
|
428 |
|
|
for sample in accReadIn.sampleList:
|
429 |
|
|
if statusDict[ sample ] == "BG":
|
430 |
|
|
stackDict[ hist ].Add( histDict[ hist ][ sample ] )
|
431 |
|
|
pass
|
432 |
|
|
pass
|
433 |
|
|
pass
|
434 |
|
|
|
435 |
|
|
cDict[ hist ] = ROOT.TCanvas( hist, hist )
|
436 |
|
|
cDict[ hist ].cd()
|
437 |
|
|
|
438 |
|
|
#### draw non-stack stuff first
|
439 |
|
|
option = ""
|
440 |
|
|
for dsample in DataList:
|
441 |
|
|
histDict[ hist ][ dsample ].Draw( option )
|
442 |
|
|
option = "same"
|
443 |
|
|
pass
|
444 |
|
|
|
445 |
|
|
nondataOption = "hist"
|
446 |
|
|
for nssample in NonStackList:
|
447 |
|
|
histDict[ hist ][ nssample ].Draw( nondataOption+option )
|
448 |
|
|
option = "same"
|
449 |
|
|
pass
|
450 |
|
|
|
451 |
|
|
|
452 |
|
|
#### i hate stacks.
|
453 |
|
|
#### set all the fucking stylings AGAIN.
|
454 |
|
|
if stackDict:
|
455 |
|
|
|
456 |
|
|
#### now draw the stack
|
457 |
|
|
stackDict[ hist ].Draw( nondataOption+option )
|
458 |
|
|
|
459 |
|
|
if hist in xrangeDict.keys():
|
460 |
|
|
stackDict[ hist ].GetXaxis().SetRangeUser( xrangeDict[ hist ][ 0 ],
|
461 |
|
|
xrangeDict[ hist ][ 1 ] )
|
462 |
|
|
pass
|
463 |
|
|
if hist in yrangeDict.keys():
|
464 |
|
|
#stackDict[ hist ].GetYaxis().SetRangeUser( yrangeDict[ hist ][ 0 ], yrangeDict[ hist ][ 1 ] )
|
465 |
|
|
stackDict[ hist ].SetMinimum( yrangeDict[ hist ][ 0 ] )
|
466 |
|
|
stackDict[ hist ].SetMaximum( yrangeDict[ hist ][ 1 ] )
|
467 |
|
|
pass
|
468 |
|
|
if hist in titleDict.keys():
|
469 |
|
|
stackDict[ hist ].GetXaxis().SetTitle( titleDict[ hist ][ 0 ] )
|
470 |
|
|
stackDict[ hist ].GetYaxis().SetTitle( titleDict[ hist ][ 1 ] )
|
471 |
|
|
pass
|
472 |
|
|
|
473 |
|
|
stackDict[ hist ].SetTitle( "" )
|
474 |
|
|
axis = stackDict[ hist ].GetHistogram()
|
475 |
|
|
pass
|
476 |
|
|
|
477 |
|
|
#### draw non-stack stuff again
|
478 |
|
|
|
479 |
|
|
for nssample in NonStackList:
|
480 |
|
|
histDict[ hist ][ nssample ].GetXaxis().SetRangeUser( xrangeDict[ hist ][ 0 ],
|
481 |
|
|
xrangeDict[ hist ][ 1 ] )
|
482 |
|
|
histDict[ hist ][ nssample ].SetMinimum( yrangeDict[ hist ][ 0 ] )
|
483 |
|
|
histDict[ hist ][ nssample ].SetMaximum( yrangeDict[ hist ][ 1 ] )
|
484 |
|
|
histDict[ hist ][ nssample ].Draw( nondataOption + option )
|
485 |
|
|
option = "same"
|
486 |
|
|
pass
|
487 |
|
|
|
488 |
|
|
for dsample in DataList:
|
489 |
|
|
histDict[ hist ][ dsample ].GetXaxis().SetRangeUser( xrangeDict[ hist ][ 0 ],
|
490 |
|
|
xrangeDict[ hist ][ 1 ] )
|
491 |
|
|
histDict[ hist ][ dsample ].SetMinimum( yrangeDict[ hist ][ 0 ] )
|
492 |
|
|
histDict[ hist ][ dsample ].SetMaximum( yrangeDict[ hist ][ 1 ] )
|
493 |
|
|
histDict[ hist ][ dsample ].Draw( option )
|
494 |
|
|
option = "same"
|
495 |
|
|
pass
|
496 |
|
|
|
497 |
|
|
|
498 |
|
|
|
499 |
|
|
if hist in logDict.keys() and logDict[ hist ]:
|
500 |
|
|
ROOT.gPad.SetLogy()
|
501 |
|
|
pass
|
502 |
|
|
cDict[ hist ].Update()
|
503 |
|
|
|
504 |
|
|
position = "ur"
|
505 |
|
|
if hist in positionDict.keys():
|
506 |
|
|
position = positionDict[ hist ]
|
507 |
|
|
pass
|
508 |
|
|
|
509 |
|
|
legDict[ hist ] = Style.makeLegend( hist, histDict, accReadIn.sampleList, statusDict=statusDict,
|
510 |
|
|
position=position, aliasList=legendList )
|
511 |
|
|
legDict[ hist ].Draw( "same" )
|
512 |
|
|
|
513 |
|
|
#if hist in latexDict.keys():
|
514 |
|
|
# for i in range( 0, len( latexDict[ hist ][ 0 ] ) ):
|
515 |
|
|
# textDict[ hist + str ( i ) ] = ROOT.TLatex( latexDict[ hist ][ 1 ][ i ], \
|
516 |
|
|
# latexDict[ hist ][ 2 ][ i ], \
|
517 |
|
|
# latexDict[ hist ][ 0 ][ i ] )
|
518 |
|
|
# textDict[ hist + str ( i ) ].Draw( "same" )
|
519 |
|
|
# pass
|
520 |
|
|
# pass
|
521 |
|
|
|
522 |
|
|
if hist in lineDict:
|
523 |
|
|
tlineDict[ hist ] = ROOT.TLine( lineDict[ hist ][ 0 ],
|
524 |
|
|
lineDict[ hist ][ 2 ],
|
525 |
|
|
lineDict[ hist ][ 1 ],
|
526 |
|
|
lineDict[ hist ][ 3 ])
|
527 |
|
|
tlineDict[ hist ].SetLineWidth( 2 )
|
528 |
|
|
tlineDict[ hist ].SetLineColor( 13 )
|
529 |
|
|
tlineDict[ hist ].Draw( "same" )
|
530 |
|
|
pass
|
531 |
|
|
|
532 |
|
|
axis.Draw( "axissame" )
|
533 |
|
|
|
534 |
|
|
|
535 |
|
|
cDict[ hist ].Update()
|
536 |
|
|
|
537 |
|
|
pass
|
538 |
|
|
|
539 |
|
|
if saveToPS:
|
540 |
|
|
Style.saveToPS( saveName, cDict, histList )
|
541 |
|
|
if saveToEPS:
|
542 |
|
|
Style.saveToEPS( saveName, cDict )
|
543 |
|
|
pass
|
544 |
|
|
|
545 |
|
|
Def.DontQuit()
|
546 |
|
|
|
547 |
|
|
|
548 |
|
|
|
549 |
|
|
|