1 |
csander |
1.1 |
// -*- C++ -*-
|
2 |
|
|
//
|
3 |
|
|
// Package: MCResolutions
|
4 |
|
|
// Class: MCResolutions
|
5 |
csander |
1.2 |
//
|
6 |
csander |
1.1 |
/**\class MCResolutions MCResolutions.cc JetResolutionFromMC/MCResolutions/src/MCResolutions.cc
|
7 |
csander |
1.2 |
|
8 |
csander |
1.1 |
Description: [one line class summary]
|
9 |
csander |
1.2 |
|
10 |
csander |
1.1 |
Implementation:
|
11 |
|
|
[Notes on implementation]
|
12 |
|
|
*/
|
13 |
|
|
//
|
14 |
|
|
// Original Author: Christian Sander,,,
|
15 |
|
|
// Created: Wed Oct 6 18:22:21 CEST 2010
|
16 |
csander |
1.9 |
// $Id: MCResolutions.cc,v 1.8 2011/01/18 09:26:28 csander Exp $
|
17 |
csander |
1.1 |
//
|
18 |
|
|
//
|
19 |
|
|
|
20 |
csander |
1.2 |
#include "JetResolutionFromMC/MCResolutions/interface/MCResolutions.h"
|
21 |
csander |
1.1 |
|
22 |
|
|
//
|
23 |
|
|
// constructors and destructor
|
24 |
|
|
//
|
25 |
csander |
1.3 |
MCResolutions::MCResolutions(const edm::ParameterSet& iConfig) {
|
26 |
csander |
1.2 |
//now do what ever initialization is needed
|
27 |
|
|
_jetTag = iConfig.getParameter<edm::InputTag> ("jetTag");
|
28 |
|
|
_muonTag = iConfig.getParameter<edm::InputTag> ("muonTag");
|
29 |
|
|
_genJetTag = iConfig.getParameter<edm::InputTag> ("genJetTag");
|
30 |
|
|
_weightName = iConfig.getParameter<edm::InputTag> ("weightName");
|
31 |
csander |
1.3 |
_bTag = iConfig.getParameter<edm::InputTag> ("bTag");
|
32 |
csander |
1.2 |
_EBRecHits = iConfig.getParameter<edm::InputTag> ("EBRecHits");
|
33 |
|
|
_EERecHits = iConfig.getParameter<edm::InputTag> ("EERecHits");
|
34 |
csander |
1.5 |
_jetMultPtCut = iConfig.getParameter<double> ("jetMultPtCut");
|
35 |
|
|
_jetMultEtaCut = iConfig.getParameter<double> ("jetMultEtaCut");
|
36 |
csander |
1.2 |
_deltaPhiDiJet = iConfig.getParameter<double> ("deltaPhiDiJet");
|
37 |
|
|
_absCut3rdJet = iConfig.getParameter<double> ("absCut3rdJet");
|
38 |
|
|
_relCut3rdJet = iConfig.getParameter<double> ("relCut3rdJet");
|
39 |
|
|
_deltaRMatch = iConfig.getParameter<double> ("deltaRMatch");
|
40 |
|
|
_deltaRMatchVeto = iConfig.getParameter<double> ("deltaRMatchVeto");
|
41 |
|
|
_absPtVeto = iConfig.getParameter<double> ("absPtVeto");
|
42 |
|
|
_relPtVeto = iConfig.getParameter<double> ("relPtVeto");
|
43 |
|
|
_deltaRDeadECal = iConfig.getParameter<double> ("deltaRDeadECal");
|
44 |
csander |
1.3 |
_GenJetPtCut = iConfig.getParameter<double> ("GenJetPtCut");
|
45 |
|
|
_bTagCut = iConfig.getParameter<double> ("bTagCut");
|
46 |
|
|
_bTagDeltaR = iConfig.getParameter<double> ("bTagDelatR");
|
47 |
csander |
1.9 |
_Bid = iConfig.getParameter<std::string> ("Bid");
|
48 |
csander |
1.3 |
_maskedEcalChannelStatusThreshold = iConfig.getParameter<int> ("maskedEcalChannelStatusThreshold");
|
49 |
csander |
1.5 |
_fileName = iConfig.getParameter<std::string> ("fileName");
|
50 |
|
|
|
51 |
|
|
hfile = new TFile(_fileName.c_str(), "RECREATE", "Jet response in pT and eta bins");
|
52 |
csander |
1.6 |
//hfile->mkdir(_dirName.c_str(), _dirName.c_str());
|
53 |
|
|
|
54 |
|
|
// EBinEdges.push_back(0);
|
55 |
|
|
// EBinEdges.push_back(20);
|
56 |
|
|
// EBinEdges.push_back(30);
|
57 |
|
|
// EBinEdges.push_back(50);
|
58 |
|
|
// EBinEdges.push_back(80);
|
59 |
|
|
// EBinEdges.push_back(120);
|
60 |
|
|
// EBinEdges.push_back(170);
|
61 |
|
|
// EBinEdges.push_back(230);
|
62 |
|
|
// EBinEdges.push_back(300);
|
63 |
|
|
// EBinEdges.push_back(380);
|
64 |
|
|
// EBinEdges.push_back(470);
|
65 |
|
|
// EBinEdges.push_back(570);
|
66 |
|
|
// EBinEdges.push_back(680);
|
67 |
|
|
// EBinEdges.push_back(800);
|
68 |
|
|
// EBinEdges.push_back(1000);
|
69 |
|
|
// EBinEdges.push_back(1300);
|
70 |
|
|
// EBinEdges.push_back(1700);
|
71 |
|
|
// EBinEdges.push_back(2200);
|
72 |
csander |
1.3 |
|
73 |
csander |
1.6 |
// PtBinEdges.push_back(0);
|
74 |
|
|
// PtBinEdges.push_back(20);
|
75 |
|
|
// PtBinEdges.push_back(30);
|
76 |
|
|
// PtBinEdges.push_back(50);
|
77 |
|
|
// PtBinEdges.push_back(80);
|
78 |
|
|
// PtBinEdges.push_back(120);
|
79 |
|
|
// PtBinEdges.push_back(170);
|
80 |
|
|
// PtBinEdges.push_back(230);
|
81 |
|
|
// PtBinEdges.push_back(300);
|
82 |
|
|
// PtBinEdges.push_back(380);
|
83 |
|
|
// PtBinEdges.push_back(470);
|
84 |
|
|
// PtBinEdges.push_back(570);
|
85 |
|
|
// PtBinEdges.push_back(680);
|
86 |
|
|
// PtBinEdges.push_back(800);
|
87 |
|
|
// PtBinEdges.push_back(1000);
|
88 |
|
|
// PtBinEdges.push_back(1300);
|
89 |
|
|
// PtBinEdges.push_back(1700);
|
90 |
|
|
// PtBinEdges.push_back(2200);
|
91 |
|
|
|
92 |
csander |
1.9 |
// PtBinEdges.push_back(0);
|
93 |
|
|
// PtBinEdges.push_back(16);
|
94 |
|
|
// PtBinEdges.push_back(30);
|
95 |
|
|
// PtBinEdges.push_back(43);
|
96 |
|
|
// PtBinEdges.push_back(55);
|
97 |
|
|
// PtBinEdges.push_back(70);
|
98 |
|
|
// PtBinEdges.push_back(85);
|
99 |
|
|
// PtBinEdges.push_back(100);
|
100 |
|
|
// PtBinEdges.push_back(115);
|
101 |
|
|
// PtBinEdges.push_back(130);
|
102 |
|
|
// PtBinEdges.push_back(150);
|
103 |
|
|
// PtBinEdges.push_back(170);
|
104 |
|
|
// PtBinEdges.push_back(190);
|
105 |
|
|
// PtBinEdges.push_back(220);
|
106 |
|
|
// PtBinEdges.push_back(250);
|
107 |
|
|
// PtBinEdges.push_back(300);
|
108 |
|
|
// PtBinEdges.push_back(350);
|
109 |
|
|
// PtBinEdges.push_back(400);
|
110 |
|
|
// PtBinEdges.push_back(500);
|
111 |
|
|
// PtBinEdges.push_back(700);
|
112 |
|
|
// PtBinEdges.push_back(1000);
|
113 |
|
|
// PtBinEdges.push_back(1300);
|
114 |
|
|
// PtBinEdges.push_back(1700);
|
115 |
|
|
// PtBinEdges.push_back(2200);
|
116 |
|
|
|
117 |
|
|
// EBinEdges.push_back(0);
|
118 |
|
|
// EBinEdges.push_back(16);
|
119 |
|
|
// EBinEdges.push_back(30);
|
120 |
|
|
// EBinEdges.push_back(43);
|
121 |
|
|
// EBinEdges.push_back(55);
|
122 |
|
|
// EBinEdges.push_back(70);
|
123 |
|
|
// EBinEdges.push_back(85);
|
124 |
|
|
// EBinEdges.push_back(100);
|
125 |
|
|
// EBinEdges.push_back(115);
|
126 |
|
|
// EBinEdges.push_back(130);
|
127 |
|
|
// EBinEdges.push_back(150);
|
128 |
|
|
// EBinEdges.push_back(170);
|
129 |
|
|
// EBinEdges.push_back(190);
|
130 |
|
|
// EBinEdges.push_back(220);
|
131 |
|
|
// EBinEdges.push_back(250);
|
132 |
|
|
// EBinEdges.push_back(300);
|
133 |
|
|
// EBinEdges.push_back(350);
|
134 |
|
|
// EBinEdges.push_back(400);
|
135 |
|
|
// EBinEdges.push_back(500);
|
136 |
|
|
// EBinEdges.push_back(700);
|
137 |
|
|
// EBinEdges.push_back(1000);
|
138 |
|
|
// EBinEdges.push_back(1300);
|
139 |
|
|
// EBinEdges.push_back(1700);
|
140 |
|
|
// EBinEdges.push_back(2200);
|
141 |
|
|
|
142 |
|
|
// EtaBinEdges.push_back(0.0);
|
143 |
|
|
// EtaBinEdges.push_back(0.5);
|
144 |
|
|
// EtaBinEdges.push_back(1.1);
|
145 |
|
|
// EtaBinEdges.push_back(1.7);
|
146 |
|
|
// EtaBinEdges.push_back(2.3);
|
147 |
|
|
// EtaBinEdges.push_back(3.2);
|
148 |
|
|
// EtaBinEdges.push_back(5.0);
|
149 |
|
|
|
150 |
|
|
EBinEdges.push_back(0);
|
151 |
|
|
EBinEdges.push_back(2);
|
152 |
|
|
EBinEdges.push_back(4);
|
153 |
|
|
EBinEdges.push_back(6);
|
154 |
|
|
EBinEdges.push_back(8);
|
155 |
|
|
EBinEdges.push_back(10);
|
156 |
|
|
EBinEdges.push_back(12);
|
157 |
|
|
EBinEdges.push_back(14);
|
158 |
|
|
EBinEdges.push_back(16);
|
159 |
|
|
EBinEdges.push_back(18);
|
160 |
|
|
EBinEdges.push_back(20);
|
161 |
|
|
EBinEdges.push_back(25);
|
162 |
|
|
EBinEdges.push_back(30);
|
163 |
|
|
EBinEdges.push_back(35);
|
164 |
|
|
EBinEdges.push_back(40);
|
165 |
|
|
EBinEdges.push_back(45);
|
166 |
|
|
EBinEdges.push_back(50);
|
167 |
|
|
EBinEdges.push_back(55);
|
168 |
|
|
EBinEdges.push_back(60);
|
169 |
|
|
EBinEdges.push_back(70);
|
170 |
|
|
EBinEdges.push_back(80);
|
171 |
|
|
EBinEdges.push_back(90);
|
172 |
|
|
EBinEdges.push_back(100);
|
173 |
|
|
EBinEdges.push_back(120);
|
174 |
|
|
EBinEdges.push_back(140);
|
175 |
|
|
EBinEdges.push_back(160);
|
176 |
|
|
EBinEdges.push_back(180);
|
177 |
|
|
EBinEdges.push_back(200);
|
178 |
|
|
EBinEdges.push_back(250);
|
179 |
|
|
EBinEdges.push_back(300);
|
180 |
|
|
EBinEdges.push_back(350);
|
181 |
|
|
EBinEdges.push_back(400);
|
182 |
|
|
EBinEdges.push_back(500);
|
183 |
|
|
EBinEdges.push_back(600);
|
184 |
|
|
EBinEdges.push_back(700);
|
185 |
|
|
EBinEdges.push_back(800);
|
186 |
|
|
EBinEdges.push_back(1000);
|
187 |
|
|
EBinEdges.push_back(1400);
|
188 |
|
|
EBinEdges.push_back(1800);
|
189 |
|
|
EBinEdges.push_back(2500);
|
190 |
|
|
|
191 |
csander |
1.3 |
PtBinEdges.push_back(0);
|
192 |
csander |
1.9 |
PtBinEdges.push_back(2);
|
193 |
|
|
PtBinEdges.push_back(4);
|
194 |
|
|
PtBinEdges.push_back(6);
|
195 |
|
|
PtBinEdges.push_back(8);
|
196 |
|
|
PtBinEdges.push_back(10);
|
197 |
|
|
PtBinEdges.push_back(12);
|
198 |
|
|
PtBinEdges.push_back(14);
|
199 |
csander |
1.6 |
PtBinEdges.push_back(16);
|
200 |
csander |
1.9 |
PtBinEdges.push_back(18);
|
201 |
|
|
PtBinEdges.push_back(20);
|
202 |
|
|
PtBinEdges.push_back(25);
|
203 |
csander |
1.3 |
PtBinEdges.push_back(30);
|
204 |
csander |
1.9 |
PtBinEdges.push_back(35);
|
205 |
|
|
PtBinEdges.push_back(40);
|
206 |
|
|
PtBinEdges.push_back(45);
|
207 |
|
|
PtBinEdges.push_back(50);
|
208 |
csander |
1.6 |
PtBinEdges.push_back(55);
|
209 |
csander |
1.9 |
PtBinEdges.push_back(60);
|
210 |
csander |
1.6 |
PtBinEdges.push_back(70);
|
211 |
csander |
1.9 |
PtBinEdges.push_back(80);
|
212 |
|
|
PtBinEdges.push_back(90);
|
213 |
csander |
1.6 |
PtBinEdges.push_back(100);
|
214 |
csander |
1.9 |
PtBinEdges.push_back(120);
|
215 |
|
|
PtBinEdges.push_back(140);
|
216 |
|
|
PtBinEdges.push_back(160);
|
217 |
|
|
PtBinEdges.push_back(180);
|
218 |
|
|
PtBinEdges.push_back(200);
|
219 |
csander |
1.6 |
PtBinEdges.push_back(250);
|
220 |
csander |
1.3 |
PtBinEdges.push_back(300);
|
221 |
csander |
1.6 |
PtBinEdges.push_back(350);
|
222 |
|
|
PtBinEdges.push_back(400);
|
223 |
|
|
PtBinEdges.push_back(500);
|
224 |
csander |
1.9 |
PtBinEdges.push_back(600);
|
225 |
csander |
1.6 |
PtBinEdges.push_back(700);
|
226 |
csander |
1.9 |
PtBinEdges.push_back(800);
|
227 |
csander |
1.3 |
PtBinEdges.push_back(1000);
|
228 |
csander |
1.9 |
PtBinEdges.push_back(1400);
|
229 |
|
|
PtBinEdges.push_back(1800);
|
230 |
|
|
PtBinEdges.push_back(2500);
|
231 |
|
|
|
232 |
|
|
EtaBinEdges.push_back(0.);
|
233 |
|
|
EtaBinEdges.push_back(0.8);
|
234 |
|
|
EtaBinEdges.push_back(1.0);
|
235 |
|
|
EtaBinEdges.push_back(1.2);
|
236 |
|
|
EtaBinEdges.push_back(1.3);
|
237 |
|
|
EtaBinEdges.push_back(1.4);
|
238 |
|
|
EtaBinEdges.push_back(1.6);
|
239 |
|
|
EtaBinEdges.push_back(2.5);
|
240 |
|
|
EtaBinEdges.push_back(3.5);
|
241 |
|
|
EtaBinEdges.push_back(5.2);
|
242 |
csander |
1.3 |
|
243 |
csander |
1.5 |
//// Array of histograms for jet resolutions (all jet multiplicities)
|
244 |
csander |
1.7 |
h_tot_DiJet_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
245 |
|
|
h_b_DiJet_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
246 |
|
|
h_nob_DiJet_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
247 |
|
|
h_dead_DiJet_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
248 |
|
|
h_deadb_DiJet_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
249 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_DiJet_JetResPt_Pt.begin(); it != h_tot_DiJet_JetResPt_Pt.end(); ++it) {
|
250 |
|
|
it->resize(PtBinEdges.size() - 1);
|
251 |
|
|
}
|
252 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_b_DiJet_JetResPt_Pt.begin(); it != h_b_DiJet_JetResPt_Pt.end(); ++it) {
|
253 |
|
|
it->resize(PtBinEdges.size() - 1);
|
254 |
|
|
}
|
255 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_DiJet_JetResPt_Pt.begin(); it != h_nob_DiJet_JetResPt_Pt.end(); ++it) {
|
256 |
|
|
it->resize(PtBinEdges.size() - 1);
|
257 |
|
|
}
|
258 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_DiJet_JetResPt_Pt.begin(); it != h_dead_DiJet_JetResPt_Pt.end(); ++it) {
|
259 |
|
|
it->resize(PtBinEdges.size() - 1);
|
260 |
|
|
}
|
261 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_DiJet_JetResPt_Pt.begin(); it != h_deadb_DiJet_JetResPt_Pt.end(); ++it) {
|
262 |
|
|
it->resize(PtBinEdges.size() - 1);
|
263 |
|
|
}
|
264 |
csander |
1.9 |
// h_tot_DiJet_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
265 |
|
|
// h_b_DiJet_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
266 |
|
|
// h_nob_DiJet_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
267 |
|
|
// h_dead_DiJet_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
268 |
|
|
// h_deadb_DiJet_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
269 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_DiJet_JetResPt_E.begin(); it != h_tot_DiJet_JetResPt_E.end(); ++it) {
|
270 |
|
|
// it->resize(EBinEdges.size() - 1);
|
271 |
|
|
// }
|
272 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_DiJet_JetResPt_E.begin(); it != h_b_DiJet_JetResPt_E.end(); ++it) {
|
273 |
|
|
// it->resize(EBinEdges.size() - 1);
|
274 |
|
|
// }
|
275 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_DiJet_JetResPt_E.begin(); it != h_nob_DiJet_JetResPt_E.end(); ++it) {
|
276 |
|
|
// it->resize(EBinEdges.size() - 1);
|
277 |
|
|
// }
|
278 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_DiJet_JetResPt_E.begin(); it != h_dead_DiJet_JetResPt_E.end(); ++it) {
|
279 |
|
|
// it->resize(EBinEdges.size() - 1);
|
280 |
|
|
// }
|
281 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_DiJet_JetResPt_E.begin(); it != h_deadb_DiJet_JetResPt_E.end(); ++it) {
|
282 |
|
|
// it->resize(EBinEdges.size() - 1);
|
283 |
|
|
// }
|
284 |
csander |
1.7 |
|
285 |
|
|
//// Array of histograms for jet resolutions (all jet multiplicities)
|
286 |
csander |
1.5 |
h_tot_NJetAll_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
287 |
|
|
h_b_NJetAll_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
288 |
csander |
1.6 |
h_nob_NJetAll_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
289 |
csander |
1.5 |
h_dead_NJetAll_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
290 |
|
|
h_deadb_NJetAll_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
291 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJetAll_JetResPt_Pt.begin(); it != h_tot_NJetAll_JetResPt_Pt.end(); ++it) {
|
292 |
|
|
it->resize(PtBinEdges.size() - 1);
|
293 |
|
|
}
|
294 |
|
|
for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJetAll_JetResPt_Pt.begin(); it != h_b_NJetAll_JetResPt_Pt.end(); ++it) {
|
295 |
csander |
1.3 |
it->resize(PtBinEdges.size() - 1);
|
296 |
|
|
}
|
297 |
csander |
1.6 |
for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJetAll_JetResPt_Pt.begin(); it != h_nob_NJetAll_JetResPt_Pt.end(); ++it) {
|
298 |
|
|
it->resize(PtBinEdges.size() - 1);
|
299 |
|
|
}
|
300 |
csander |
1.5 |
for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJetAll_JetResPt_Pt.begin(); it != h_dead_NJetAll_JetResPt_Pt.end(); ++it) {
|
301 |
csander |
1.3 |
it->resize(PtBinEdges.size() - 1);
|
302 |
|
|
}
|
303 |
csander |
1.5 |
for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJetAll_JetResPt_Pt.begin(); it != h_deadb_NJetAll_JetResPt_Pt.end(); ++it) {
|
304 |
csander |
1.3 |
it->resize(PtBinEdges.size() - 1);
|
305 |
|
|
}
|
306 |
csander |
1.9 |
// h_tot_NJetAll_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
307 |
|
|
// h_b_NJetAll_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
308 |
|
|
// h_nob_NJetAll_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
309 |
|
|
// h_dead_NJetAll_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
310 |
|
|
// h_deadb_NJetAll_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
311 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJetAll_JetResPt_E.begin(); it != h_tot_NJetAll_JetResPt_E.end(); ++it) {
|
312 |
|
|
// it->resize(EBinEdges.size() - 1);
|
313 |
|
|
// }
|
314 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJetAll_JetResPt_E.begin(); it != h_b_NJetAll_JetResPt_E.end(); ++it) {
|
315 |
|
|
// it->resize(EBinEdges.size() - 1);
|
316 |
|
|
// }
|
317 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJetAll_JetResPt_E.begin(); it != h_nob_NJetAll_JetResPt_E.end(); ++it) {
|
318 |
|
|
// it->resize(EBinEdges.size() - 1);
|
319 |
|
|
// }
|
320 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJetAll_JetResPt_E.begin(); it != h_dead_NJetAll_JetResPt_E.end(); ++it) {
|
321 |
|
|
// it->resize(EBinEdges.size() - 1);
|
322 |
|
|
// }
|
323 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJetAll_JetResPt_E.begin(); it != h_deadb_NJetAll_JetResPt_E.end(); ++it) {
|
324 |
|
|
// it->resize(EBinEdges.size() - 1);
|
325 |
|
|
// }
|
326 |
csander |
1.3 |
|
327 |
csander |
1.5 |
//// Array of histograms for jet resolutions (jet multiplicities = 2)
|
328 |
csander |
1.9 |
// h_tot_NJet2_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
329 |
|
|
// h_b_NJet2_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
330 |
|
|
// h_nob_NJet2_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
331 |
|
|
// h_dead_NJet2_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
332 |
|
|
// h_deadb_NJet2_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
333 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet2_JetResPt_Pt.begin(); it != h_tot_NJet2_JetResPt_Pt.end(); ++it) {
|
334 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
335 |
|
|
// }
|
336 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet2_JetResPt_Pt.begin(); it != h_b_NJet2_JetResPt_Pt.end(); ++it) {
|
337 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
338 |
|
|
// }
|
339 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet2_JetResPt_Pt.begin(); it != h_nob_NJet2_JetResPt_Pt.end(); ++it) {
|
340 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
341 |
|
|
// }
|
342 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet2_JetResPt_Pt.begin(); it != h_dead_NJet2_JetResPt_Pt.end(); ++it) {
|
343 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
344 |
|
|
// }
|
345 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet2_JetResPt_Pt.begin(); it != h_deadb_NJet2_JetResPt_Pt.end(); ++it) {
|
346 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
347 |
|
|
// }
|
348 |
|
|
// h_tot_NJet2_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
349 |
|
|
// h_b_NJet2_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
350 |
|
|
// h_nob_NJet2_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
351 |
|
|
// h_dead_NJet2_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
352 |
|
|
// h_deadb_NJet2_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
353 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet2_JetResPt_E.begin(); it != h_tot_NJet2_JetResPt_E.end(); ++it) {
|
354 |
|
|
// it->resize(EBinEdges.size() - 1);
|
355 |
|
|
// }
|
356 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet2_JetResPt_E.begin(); it != h_b_NJet2_JetResPt_E.end(); ++it) {
|
357 |
|
|
// it->resize(EBinEdges.size() - 1);
|
358 |
|
|
// }
|
359 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet2_JetResPt_E.begin(); it != h_nob_NJet2_JetResPt_E.end(); ++it) {
|
360 |
|
|
// it->resize(EBinEdges.size() - 1);
|
361 |
|
|
// }
|
362 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet2_JetResPt_E.begin(); it != h_dead_NJet2_JetResPt_E.end(); ++it) {
|
363 |
|
|
// it->resize(EBinEdges.size() - 1);
|
364 |
|
|
// }
|
365 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet2_JetResPt_E.begin(); it != h_deadb_NJet2_JetResPt_E.end(); ++it) {
|
366 |
|
|
// it->resize(EBinEdges.size() - 1);
|
367 |
|
|
// }
|
368 |
csander |
1.3 |
|
369 |
csander |
1.5 |
//// Array of histograms for jet resolutions (jet multiplicities = 3)
|
370 |
csander |
1.9 |
// h_tot_NJet3_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
371 |
|
|
// h_b_NJet3_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
372 |
|
|
// h_nob_NJet3_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
373 |
|
|
// h_dead_NJet3_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
374 |
|
|
// h_deadb_NJet3_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
375 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet3_JetResPt_Pt.begin(); it != h_tot_NJet3_JetResPt_Pt.end(); ++it) {
|
376 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
377 |
|
|
// }
|
378 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet3_JetResPt_Pt.begin(); it != h_b_NJet3_JetResPt_Pt.end(); ++it) {
|
379 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
380 |
|
|
// }
|
381 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet3_JetResPt_Pt.begin(); it != h_nob_NJet3_JetResPt_Pt.end(); ++it) {
|
382 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
383 |
|
|
// }
|
384 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet3_JetResPt_Pt.begin(); it != h_dead_NJet3_JetResPt_Pt.end(); ++it) {
|
385 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
386 |
|
|
// }
|
387 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet3_JetResPt_Pt.begin(); it != h_deadb_NJet3_JetResPt_Pt.end(); ++it) {
|
388 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
389 |
|
|
// }
|
390 |
|
|
// h_tot_NJet3_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
391 |
|
|
// h_b_NJet3_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
392 |
|
|
// h_nob_NJet3_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
393 |
|
|
// h_dead_NJet3_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
394 |
|
|
// h_deadb_NJet3_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
395 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet3_JetResPt_E.begin(); it != h_tot_NJet3_JetResPt_E.end(); ++it) {
|
396 |
|
|
// it->resize(EBinEdges.size() - 1);
|
397 |
|
|
// }
|
398 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet3_JetResPt_E.begin(); it != h_b_NJet3_JetResPt_E.end(); ++it) {
|
399 |
|
|
// it->resize(EBinEdges.size() - 1);
|
400 |
|
|
// }
|
401 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet3_JetResPt_E.begin(); it != h_nob_NJet3_JetResPt_E.end(); ++it) {
|
402 |
|
|
// it->resize(EBinEdges.size() - 1);
|
403 |
|
|
// }
|
404 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet3_JetResPt_E.begin(); it != h_dead_NJet3_JetResPt_E.end(); ++it) {
|
405 |
|
|
// it->resize(EBinEdges.size() - 1);
|
406 |
|
|
// }
|
407 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet3_JetResPt_E.begin(); it != h_deadb_NJet3_JetResPt_E.end(); ++it) {
|
408 |
|
|
// it->resize(EBinEdges.size() - 1);
|
409 |
|
|
// }
|
410 |
csander |
1.5 |
|
411 |
|
|
//// Array of histograms for jet resolutions (jet multiplicities = 4)
|
412 |
csander |
1.9 |
// h_tot_NJet4_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
413 |
|
|
// h_b_NJet4_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
414 |
|
|
// h_nob_NJet4_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
415 |
|
|
// h_dead_NJet4_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
416 |
|
|
// h_deadb_NJet4_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
417 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet4_JetResPt_Pt.begin(); it != h_tot_NJet4_JetResPt_Pt.end(); ++it) {
|
418 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
419 |
|
|
// }
|
420 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet4_JetResPt_Pt.begin(); it != h_b_NJet4_JetResPt_Pt.end(); ++it) {
|
421 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
422 |
|
|
// }
|
423 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet4_JetResPt_Pt.begin(); it != h_nob_NJet4_JetResPt_Pt.end(); ++it) {
|
424 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
425 |
|
|
// }
|
426 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet4_JetResPt_Pt.begin(); it != h_dead_NJet4_JetResPt_Pt.end(); ++it) {
|
427 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
428 |
|
|
// }
|
429 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet4_JetResPt_Pt.begin(); it != h_deadb_NJet4_JetResPt_Pt.end(); ++it) {
|
430 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
431 |
|
|
// }
|
432 |
|
|
// h_tot_NJet4_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
433 |
|
|
// h_b_NJet4_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
434 |
|
|
// h_nob_NJet4_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
435 |
|
|
// h_dead_NJet4_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
436 |
|
|
// h_deadb_NJet4_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
437 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet4_JetResPt_E.begin(); it != h_tot_NJet4_JetResPt_E.end(); ++it) {
|
438 |
|
|
// it->resize(EBinEdges.size() - 1);
|
439 |
|
|
// }
|
440 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet4_JetResPt_E.begin(); it != h_b_NJet4_JetResPt_E.end(); ++it) {
|
441 |
|
|
// it->resize(EBinEdges.size() - 1);
|
442 |
|
|
// }
|
443 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet4_JetResPt_E.begin(); it != h_nob_NJet4_JetResPt_E.end(); ++it) {
|
444 |
|
|
// it->resize(EBinEdges.size() - 1);
|
445 |
|
|
// }
|
446 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet4_JetResPt_E.begin(); it != h_dead_NJet4_JetResPt_E.end(); ++it) {
|
447 |
|
|
// it->resize(EBinEdges.size() - 1);
|
448 |
|
|
// }
|
449 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet4_JetResPt_E.begin(); it != h_deadb_NJet4_JetResPt_E.end(); ++it) {
|
450 |
|
|
// it->resize(EBinEdges.size() - 1);
|
451 |
|
|
// }
|
452 |
csander |
1.5 |
|
453 |
|
|
//// Array of histograms for jet resolutions (jet multiplicities >= 5)
|
454 |
csander |
1.9 |
// h_tot_NJet5p_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
455 |
|
|
// h_b_NJet5p_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
456 |
|
|
// h_nob_NJet5p_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
457 |
|
|
// h_dead_NJet5p_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
458 |
|
|
// h_deadb_NJet5p_JetResPt_Pt.resize(EtaBinEdges.size() - 1);
|
459 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet5p_JetResPt_Pt.begin(); it != h_tot_NJet5p_JetResPt_Pt.end(); ++it) {
|
460 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
461 |
|
|
// }
|
462 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet5p_JetResPt_Pt.begin(); it != h_b_NJet5p_JetResPt_Pt.end(); ++it) {
|
463 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
464 |
|
|
// }
|
465 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet5p_JetResPt_Pt.begin(); it != h_nob_NJet5p_JetResPt_Pt.end(); ++it) {
|
466 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
467 |
|
|
// }
|
468 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet5p_JetResPt_Pt.begin(); it != h_dead_NJet5p_JetResPt_Pt.end(); ++it) {
|
469 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
470 |
|
|
// }
|
471 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet5p_JetResPt_Pt.begin(); it != h_deadb_NJet5p_JetResPt_Pt.end(); ++it) {
|
472 |
|
|
// it->resize(PtBinEdges.size() - 1);
|
473 |
|
|
// }
|
474 |
|
|
// h_tot_NJet5p_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
475 |
|
|
// h_b_NJet5p_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
476 |
|
|
// h_nob_NJet5p_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
477 |
|
|
// h_dead_NJet5p_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
478 |
|
|
// h_deadb_NJet5p_JetResPt_E.resize(EtaBinEdges.size() - 1);
|
479 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_tot_NJet5p_JetResPt_E.begin(); it != h_tot_NJet5p_JetResPt_E.end(); ++it) {
|
480 |
|
|
// it->resize(EBinEdges.size() - 1);
|
481 |
|
|
// }
|
482 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_b_NJet5p_JetResPt_E.begin(); it != h_b_NJet5p_JetResPt_E.end(); ++it) {
|
483 |
|
|
// it->resize(EBinEdges.size() - 1);
|
484 |
|
|
// }
|
485 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_nob_NJet5p_JetResPt_E.begin(); it != h_nob_NJet5p_JetResPt_E.end(); ++it) {
|
486 |
|
|
// it->resize(EBinEdges.size() - 1);
|
487 |
|
|
// }
|
488 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_dead_NJet5p_JetResPt_E.begin(); it != h_dead_NJet5p_JetResPt_E.end(); ++it) {
|
489 |
|
|
// it->resize(EBinEdges.size() - 1);
|
490 |
|
|
// }
|
491 |
|
|
// for (std::vector<std::vector<TH1F*> >::iterator it = h_deadb_NJet5p_JetResPt_E.begin(); it != h_deadb_NJet5p_JetResPt_E.end(); ++it) {
|
492 |
|
|
// it->resize(EBinEdges.size() - 1);
|
493 |
|
|
// }
|
494 |
csander |
1.1 |
|
495 |
|
|
}
|
496 |
|
|
|
497 |
csander |
1.3 |
MCResolutions::~MCResolutions() {
|
498 |
csander |
1.2 |
|
499 |
|
|
// do anything here that needs to be done at desctruction time
|
500 |
|
|
// (e.g. close files, deallocate resources etc.)
|
501 |
csander |
1.1 |
|
502 |
|
|
}
|
503 |
|
|
|
504 |
|
|
//
|
505 |
|
|
// member functions
|
506 |
|
|
//
|
507 |
|
|
|
508 |
|
|
// ------------ method called to for each event ------------
|
509 |
|
|
void
|
510 |
csander |
1.3 |
MCResolutions::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
|
511 |
|
|
using namespace std;
|
512 |
|
|
|
513 |
|
|
// Event setup
|
514 |
|
|
envSet(iSetup);
|
515 |
|
|
|
516 |
|
|
getChannelStatusMaps();
|
517 |
csander |
1.1 |
|
518 |
csander |
1.2 |
//Weight
|
519 |
|
|
edm::Handle<double> event_weight;
|
520 |
csander |
1.5 |
bool findWeight = iEvent.getByLabel(_weightName, event_weight);
|
521 |
csander |
1.2 |
weight = (event_weight.isValid() ? (*event_weight) : 1.0);
|
522 |
csander |
1.5 |
if (!findWeight) {
|
523 |
|
|
cout << "Weight not found!" << endl;
|
524 |
|
|
}
|
525 |
csander |
1.2 |
|
526 |
|
|
//GenJets
|
527 |
|
|
edm::Handle<edm::View<reco::GenJet> > Jets_gen;
|
528 |
csander |
1.3 |
iEvent.getByLabel(_genJetTag, Jets_gen);
|
529 |
csander |
1.2 |
|
530 |
csander |
1.6 |
//RecoJets
|
531 |
csander |
1.9 |
edm::Handle<edm::View<pat::Jet> > Jets_rec;
|
532 |
csander |
1.3 |
iEvent.getByLabel(_jetTag, Jets_rec);
|
533 |
|
|
|
534 |
|
|
//softMuonBJetTags
|
535 |
|
|
edm::Handle<reco::JetTagCollection> bTagHandle;
|
536 |
|
|
iEvent.getByLabel("trackCountingHighPurBJetTags", bTagHandle);
|
537 |
|
|
const reco::JetTagCollection & bTags = *(bTagHandle.product());
|
538 |
|
|
|
539 |
csander |
1.7 |
edm::Handle<reco::GenParticleCollection> genParticles;
|
540 |
|
|
iEvent.getByLabel("genParticles", genParticles);
|
541 |
|
|
|
542 |
|
|
//// Do DiJet selelction
|
543 |
|
|
bool isDiJet = false;
|
544 |
|
|
const reco::GenJet* gj1 = 0;
|
545 |
|
|
const reco::GenJet* gj2 = 0;
|
546 |
|
|
const reco::GenJet* gj3 = 0;
|
547 |
|
|
int k = 0;
|
548 |
|
|
for (edm::View<reco::GenJet>::const_iterator it = Jets_gen->begin(); it != Jets_gen->end(); ++it) {
|
549 |
|
|
++k;
|
550 |
|
|
if (k == 1) gj1 = &(*it);
|
551 |
|
|
if (k == 2) gj2 = &(*it);
|
552 |
|
|
if (k == 3){
|
553 |
|
|
gj3 = &(*it);
|
554 |
|
|
break;
|
555 |
|
|
}
|
556 |
|
|
}
|
557 |
|
|
if (k > 1){
|
558 |
|
|
if (deltaPhi(gj1->phi(), gj2->phi()) > _deltaPhiDiJet){
|
559 |
|
|
if (k==2) isDiJet = true;
|
560 |
|
|
if (k==3) {
|
561 |
|
|
//if (gj3->pt()<(_relCut3rdJet*(gj1->pt()+gj2->pt())/2)){
|
562 |
|
|
if (gj3->pt()<(_relCut3rdJet*gj1->pt())){
|
563 |
|
|
isDiJet = true;
|
564 |
|
|
}
|
565 |
|
|
}
|
566 |
csander |
1.5 |
}
|
567 |
|
|
}
|
568 |
|
|
|
569 |
|
|
//// Get jet multiplicity
|
570 |
|
|
double NGenJet = 0;
|
571 |
csander |
1.3 |
for (edm::View<reco::GenJet>::const_iterator it = Jets_gen->
|
572 |
|
|
begin();
|
573 |
csander |
1.5 |
it != Jets_gen->
|
574 |
|
|
end();
|
575 |
|
|
++it) {
|
576 |
|
|
if (it->pt()>_jetMultPtCut && abs(it->eta()) < _jetMultEtaCut)
|
577 |
|
|
++NGenJet;
|
578 |
|
|
}
|
579 |
|
|
|
580 |
csander |
1.8 |
int JetNo = 0;
|
581 |
|
|
for (edm::View<reco::GenJet>::const_iterator it = Jets_gen->begin(); it != Jets_gen->end(); ++it) {
|
582 |
|
|
++JetNo;
|
583 |
csander |
1.9 |
|
584 |
|
|
//use only two leading jets
|
585 |
|
|
if (JetNo > 2) break;
|
586 |
|
|
|
587 |
csander |
1.4 |
if (it->pt()
|
588 |
|
|
<_GenJetPtCut)
|
589 |
|
|
continue;
|
590 |
|
|
//// First look if there is no significant GenJet near the tested GenJet
|
591 |
|
|
double dRgenjet = 999.;
|
592 |
|
|
double PtdRmin = 0;
|
593 |
|
|
for (edm::View<reco::GenJet>::const_iterator kt = Jets_gen->
|
594 |
|
|
begin();
|
595 |
|
|
kt != Jets_gen->end();
|
596 |
|
|
++kt) {
|
597 |
|
|
if (&(*it) != &(*kt))
|
598 |
|
|
continue;
|
599 |
|
|
double dR = deltaR (*it, *kt);
|
600 |
|
|
if (dR < dRgenjet ) {
|
601 |
|
|
dRgenjet = dR;
|
602 |
|
|
PtdRmin = kt->pt();
|
603 |
|
|
}
|
604 |
|
|
}
|
605 |
|
|
if (dRgenjet < _deltaRMatchVeto && PtdRmin/it->pt()
|
606 |
|
|
< _relPtVeto)
|
607 |
csander |
1.3 |
continue;
|
608 |
csander |
1.9 |
const pat::Jet* matchedJet = 0;
|
609 |
|
|
const pat::Jet* nearestJet = 0;
|
610 |
csander |
1.3 |
double dRmatched = 999.;
|
611 |
|
|
double dRnearest = 999.;
|
612 |
csander |
1.9 |
for (edm::View<pat::Jet>
|
613 |
csander |
1.4 |
::const_iterator jt = Jets_rec->
|
614 |
|
|
begin();
|
615 |
csander |
1.3 |
jt != Jets_rec->end();
|
616 |
|
|
++jt) {
|
617 |
|
|
double dR = deltaR(*it, *jt);
|
618 |
|
|
if (dR < dRmatched) {
|
619 |
|
|
nearestJet = matchedJet;
|
620 |
|
|
dRnearest = dRmatched;
|
621 |
|
|
matchedJet = &(*jt);
|
622 |
|
|
dRmatched = dR;
|
623 |
|
|
} else if (dR < dRnearest) {
|
624 |
|
|
nearestJet = &(*jt);
|
625 |
|
|
dRnearest = dR;
|
626 |
|
|
}
|
627 |
|
|
}
|
628 |
|
|
//// look if there is no further significant CaloJet near the genJet
|
629 |
|
|
if (dRmatched < _deltaRMatch && ( nearestJet == 0 || dRnearest > _deltaRMatchVeto || (nearestJet->pt()
|
630 |
|
|
< _absPtVeto && nearestJet->pt()/matchedJet->pt() < _relPtVeto)
|
631 |
|
|
)
|
632 |
|
|
) {
|
633 |
|
|
//cout << dRmatched << endl;
|
634 |
|
|
double res = matchedJet->pt() / it->pt();
|
635 |
csander |
1.5 |
h_tot_NJetAll_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
636 |
csander |
1.9 |
//h_tot_NJetAll_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
637 |
csander |
1.8 |
if (isDiJet && JetNo < 3) {
|
638 |
csander |
1.7 |
h_tot_DiJet_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
639 |
csander |
1.9 |
//h_tot_DiJet_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
640 |
csander |
1.5 |
}
|
641 |
csander |
1.9 |
// if (NGenJet == 2) {
|
642 |
|
|
// h_tot_NJet2_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
643 |
|
|
// h_tot_NJet2_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
644 |
|
|
// }
|
645 |
|
|
// if (NGenJet == 3) {
|
646 |
|
|
// h_tot_NJet3_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
647 |
|
|
// h_tot_NJet3_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
648 |
|
|
// }
|
649 |
|
|
// if (NGenJet == 4) {
|
650 |
|
|
// h_tot_NJet4_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
651 |
|
|
// h_tot_NJet4_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
652 |
|
|
// }
|
653 |
|
|
// if (NGenJet >= 5) {
|
654 |
|
|
// h_tot_NJet5p_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
655 |
|
|
// h_tot_NJet5p_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
656 |
|
|
// }
|
657 |
csander |
1.3 |
//// look if matched jet can be matched to a b-tagged jet
|
658 |
csander |
1.5 |
bool bTag = false;
|
659 |
csander |
1.9 |
if (_Bid == "btag"){
|
660 |
csander |
1.6 |
//// Use matched parton for heavy flavour ID
|
661 |
|
|
for (size_t j = 0; j < genParticles->size(); ++j) {
|
662 |
|
|
const reco::GenParticle & p = (*genParticles)[j];
|
663 |
csander |
1.8 |
if (p.status() != 2)
|
664 |
csander |
1.6 |
continue;
|
665 |
|
|
int id = abs(p.pdgId());
|
666 |
|
|
if ( id != 4 && id != 5)
|
667 |
|
|
continue;
|
668 |
|
|
float dR = deltaR(p, *it);
|
669 |
csander |
1.8 |
//// This is my own criterion ... should be not that bad but has to be validated/redifined
|
670 |
|
|
if (dR < 0.25 && p.pt()/it->pt() > 0.25) {
|
671 |
csander |
1.6 |
//cout << "Jet pT: " << it->pt() << endl;
|
672 |
|
|
//cout << "Parton pT: " << p.pt() << endl;
|
673 |
|
|
bTag = true;
|
674 |
|
|
break;
|
675 |
csander |
1.5 |
}
|
676 |
csander |
1.6 |
}
|
677 |
csander |
1.9 |
} else if (_Bid == "own") {
|
678 |
csander |
1.6 |
//// Use bTags for heavy flavour ID
|
679 |
|
|
for (int i = 0; i != (int) bTags.size(); ++i) {
|
680 |
|
|
double dR_btag = deltaR(*matchedJet, *(bTags[i].first));
|
681 |
|
|
if (dR_btag < _bTagDeltaR && bTags[i].second > _bTagCut) {
|
682 |
|
|
bTag = true;
|
683 |
csander |
1.9 |
//cout << "Is B_own" << endl;
|
684 |
csander |
1.6 |
break;
|
685 |
csander |
1.5 |
}
|
686 |
csander |
1.3 |
}
|
687 |
csander |
1.9 |
} else if (_Bid == "algo") {
|
688 |
|
|
//// Use algorithmic matching for heavy flavour ID
|
689 |
|
|
if (fabs(matchedJet->partonFlavour()) == 4 || fabs(matchedJet->partonFlavour()) == 5){
|
690 |
|
|
bTag = true;
|
691 |
|
|
//cout << "Is B_algo" << endl;
|
692 |
|
|
}
|
693 |
csander |
1.3 |
}
|
694 |
csander |
1.6 |
|
695 |
|
|
if (bTag){
|
696 |
|
|
//cout << "matched jet has b tag discriminator = "<<bTags[i].second << endl;
|
697 |
|
|
h_b_NJetAll_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
698 |
csander |
1.9 |
//h_b_NJetAll_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
699 |
csander |
1.8 |
if (isDiJet && JetNo < 3) {
|
700 |
csander |
1.7 |
h_b_DiJet_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
701 |
csander |
1.9 |
//h_b_DiJet_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
702 |
csander |
1.6 |
}
|
703 |
csander |
1.9 |
// if (NGenJet == 2) {
|
704 |
|
|
// h_b_NJet2_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
705 |
|
|
// h_b_NJet2_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
706 |
|
|
// }
|
707 |
|
|
// if (NGenJet == 3) {
|
708 |
|
|
// h_b_NJet3_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
709 |
|
|
// h_b_NJet3_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
710 |
|
|
// }
|
711 |
|
|
// if (NGenJet == 4) {
|
712 |
|
|
// h_b_NJet4_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
713 |
|
|
// h_b_NJet4_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
714 |
|
|
// }
|
715 |
|
|
// if (NGenJet >= 5) {
|
716 |
|
|
// h_b_NJet5p_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
717 |
|
|
// h_b_NJet5p_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
718 |
|
|
// }
|
719 |
csander |
1.6 |
} else {
|
720 |
|
|
h_nob_NJetAll_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
721 |
csander |
1.9 |
//h_nob_NJetAll_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
722 |
csander |
1.8 |
if (isDiJet && JetNo < 3) {
|
723 |
csander |
1.7 |
h_nob_DiJet_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
724 |
csander |
1.9 |
//h_nob_DiJet_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
725 |
csander |
1.6 |
}
|
726 |
csander |
1.9 |
// if (NGenJet == 2) {
|
727 |
|
|
// h_nob_NJet2_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
728 |
|
|
// h_nob_NJet2_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
729 |
|
|
// }
|
730 |
|
|
// if (NGenJet == 3) {
|
731 |
|
|
// h_nob_NJet3_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
732 |
|
|
// h_nob_NJet3_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
733 |
|
|
// }
|
734 |
|
|
// if (NGenJet == 4) {
|
735 |
|
|
// h_nob_NJet4_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
736 |
|
|
// h_nob_NJet4_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
737 |
|
|
// }
|
738 |
|
|
// if (NGenJet >= 5) {
|
739 |
|
|
// h_nob_NJet5p_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
740 |
|
|
// h_nob_NJet5p_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
741 |
|
|
// }
|
742 |
csander |
1.6 |
}
|
743 |
|
|
|
744 |
csander |
1.7 |
//// look if matched jet points into direction of masked ECAL cluster
|
745 |
|
|
for (std::map<DetId, std::vector<double> >::iterator kt = EcalAllDeadChannelsValMap.begin(); kt != EcalAllDeadChannelsValMap.end(); ++kt) {
|
746 |
|
|
math::PtEtaPhiMLorentzVectorD Evec(100., kt->second.at(0), kt->second.at(1), 0.);
|
747 |
|
|
double dR_dead = deltaR(*matchedJet, Evec);
|
748 |
|
|
if (dR_dead < _deltaRDeadECal) {
|
749 |
|
|
//cout << "jet is pointing to dead Ecal cluster (eta, phi)= "<< it->eta() << ", " << it->phi() << endl;
|
750 |
csander |
1.5 |
h_dead_NJetAll_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
751 |
csander |
1.9 |
//h_dead_NJetAll_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
752 |
csander |
1.5 |
if (bTag) {
|
753 |
|
|
h_deadb_NJetAll_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
754 |
csander |
1.9 |
//h_deadb_NJetAll_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
755 |
csander |
1.5 |
}
|
756 |
csander |
1.8 |
if (isDiJet && JetNo < 3) {
|
757 |
csander |
1.7 |
h_dead_DiJet_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
758 |
csander |
1.9 |
//h_dead_DiJet_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
759 |
csander |
1.7 |
if (bTag) {
|
760 |
|
|
h_deadb_DiJet_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
761 |
csander |
1.9 |
//h_deadb_DiJet_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
762 |
csander |
1.5 |
}
|
763 |
|
|
}
|
764 |
csander |
1.9 |
// if (NGenJet == 2) {
|
765 |
|
|
// h_dead_NJet2_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
766 |
|
|
// h_dead_NJet2_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
767 |
|
|
// if (bTag) {
|
768 |
|
|
// h_deadb_NJet2_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
769 |
|
|
// h_deadb_NJet2_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
770 |
|
|
// }
|
771 |
|
|
// }
|
772 |
|
|
// if (NGenJet == 3) {
|
773 |
|
|
// h_dead_NJet3_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
774 |
|
|
// h_dead_NJet3_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
775 |
|
|
// if (bTag) {
|
776 |
|
|
// h_deadb_NJet3_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
777 |
|
|
// h_deadb_NJet3_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
778 |
|
|
// }
|
779 |
|
|
// }
|
780 |
|
|
// if (NGenJet == 4) {
|
781 |
|
|
// h_dead_NJet4_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
782 |
|
|
// h_dead_NJet4_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
783 |
|
|
// if (bTag) {
|
784 |
|
|
// h_deadb_NJet4_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
785 |
|
|
// h_deadb_NJet4_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
786 |
|
|
// }
|
787 |
|
|
// }
|
788 |
|
|
// if (NGenJet >= 5) {
|
789 |
|
|
// h_dead_NJet5p_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
790 |
|
|
// h_dead_NJet5p_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
791 |
|
|
// if (bTag) {
|
792 |
|
|
// h_deadb_NJet5p_JetResPt_Pt.at(EtaBin(it->eta())).at(PtBin(it->pt()))->Fill(res, weight);
|
793 |
|
|
// h_deadb_NJet5p_JetResPt_E.at(EtaBin(it->eta())).at(EBin(it->energy()))->Fill(res, weight);
|
794 |
|
|
// }
|
795 |
|
|
// }
|
796 |
csander |
1.7 |
break;
|
797 |
csander |
1.3 |
}
|
798 |
|
|
}
|
799 |
|
|
}
|
800 |
|
|
}
|
801 |
csander |
1.1 |
|
802 |
|
|
}
|
803 |
|
|
|
804 |
|
|
|
805 |
|
|
// ------------ method called once each job just before starting event loop ------------
|
806 |
csander |
1.2 |
void
|
807 |
csander |
1.3 |
MCResolutions::beginJob() {
|
808 |
|
|
|
809 |
|
|
for (unsigned int i_pt = 0; i_pt < PtBinEdges.size() - 1; ++i_pt) {
|
810 |
|
|
for (unsigned int i_eta = 0; i_eta < EtaBinEdges.size() - 1; ++i_eta) {
|
811 |
|
|
char hname[100];
|
812 |
csander |
1.5 |
//// Book histograms (all jet multiplicities)
|
813 |
|
|
sprintf(hname, "h_tot_NJetAll_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
814 |
|
|
h_tot_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
815 |
|
|
h_tot_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
816 |
|
|
sprintf(hname, "h_b_NJetAll_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
817 |
|
|
h_b_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
818 |
|
|
h_b_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
819 |
csander |
1.6 |
sprintf(hname, "h_nob_NJetAll_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
820 |
|
|
h_nob_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
821 |
|
|
h_nob_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
822 |
csander |
1.5 |
sprintf(hname, "h_dead_NJetAll_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
823 |
|
|
h_dead_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
824 |
|
|
h_dead_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
825 |
|
|
sprintf(hname, "h_deadb_NJetAll_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
826 |
|
|
h_deadb_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
827 |
|
|
h_deadb_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
828 |
csander |
1.7 |
//// Book histograms (DiJets)
|
829 |
|
|
sprintf(hname, "h_tot_DiJet_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
830 |
|
|
h_tot_DiJet_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
831 |
|
|
h_tot_DiJet_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
832 |
|
|
sprintf(hname, "h_b_DiJet_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
833 |
|
|
h_b_DiJet_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
834 |
|
|
h_b_DiJet_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
835 |
|
|
sprintf(hname, "h_nob_DiJet_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
836 |
|
|
h_nob_DiJet_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
837 |
|
|
h_nob_DiJet_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
838 |
|
|
sprintf(hname, "h_dead_DiJet_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
839 |
|
|
h_dead_DiJet_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
840 |
|
|
h_dead_DiJet_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
841 |
|
|
sprintf(hname, "h_deadb_DiJet_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
842 |
|
|
h_deadb_DiJet_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
843 |
|
|
h_deadb_DiJet_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
844 |
csander |
1.5 |
//// Book histograms (jet multiplicities = 2)
|
845 |
csander |
1.9 |
// sprintf(hname, "h_tot_NJet2_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
846 |
|
|
// h_tot_NJet2_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
847 |
|
|
// h_tot_NJet2_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
848 |
|
|
// sprintf(hname, "h_b_NJet2_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
849 |
|
|
// h_b_NJet2_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
850 |
|
|
// h_b_NJet2_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
851 |
|
|
// sprintf(hname, "h_nob_NJet2_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
852 |
|
|
// h_nob_NJet2_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
853 |
|
|
// h_nob_NJet2_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
854 |
|
|
// sprintf(hname, "h_dead_NJet2_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
855 |
|
|
// h_dead_NJet2_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
856 |
|
|
// h_dead_NJet2_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
857 |
|
|
// sprintf(hname, "h_deadb_NJet2_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
858 |
|
|
// h_deadb_NJet2_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
859 |
|
|
// h_deadb_NJet2_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
860 |
csander |
1.5 |
//// Book histograms (jet multiplicities = 3)
|
861 |
csander |
1.9 |
// sprintf(hname, "h_tot_NJet3_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
862 |
|
|
// h_tot_NJet3_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
863 |
|
|
// h_tot_NJet3_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
864 |
|
|
// sprintf(hname, "h_b_NJet3_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
865 |
|
|
// h_b_NJet3_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
866 |
|
|
// h_b_NJet3_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
867 |
|
|
// sprintf(hname, "h_nob_NJet3_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
868 |
|
|
// h_nob_NJet3_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
869 |
|
|
// h_nob_NJet3_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
870 |
|
|
// sprintf(hname, "h_dead_NJet3_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
871 |
|
|
// h_dead_NJet3_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
872 |
|
|
// h_dead_NJet3_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
873 |
|
|
// sprintf(hname, "h_deadb_NJet3_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
874 |
|
|
// h_deadb_NJet3_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
875 |
|
|
// h_deadb_NJet3_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
876 |
csander |
1.5 |
//// Book histograms (jet multiplicities = 4)
|
877 |
csander |
1.9 |
// sprintf(hname, "h_tot_NJet4_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
878 |
|
|
// h_tot_NJet4_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
879 |
|
|
// h_tot_NJet4_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
880 |
|
|
// sprintf(hname, "h_b_NJet4_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
881 |
|
|
// h_b_NJet4_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
882 |
|
|
// h_b_NJet4_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
883 |
|
|
// sprintf(hname, "h_nob_NJet4_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
884 |
|
|
// h_nob_NJet4_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
885 |
|
|
// h_nob_NJet4_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
886 |
|
|
// sprintf(hname, "h_dead_NJet4_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
887 |
|
|
// h_dead_NJet4_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
888 |
|
|
// h_dead_NJet4_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
889 |
|
|
// sprintf(hname, "h_deadb_NJet4_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
890 |
|
|
// h_deadb_NJet4_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
891 |
|
|
// h_deadb_NJet4_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
892 |
csander |
1.5 |
//// Book histograms (jet multiplicities >= 5)
|
893 |
csander |
1.9 |
// sprintf(hname, "h_tot_NJet5p_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
894 |
|
|
// h_tot_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
895 |
|
|
// h_tot_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
896 |
|
|
// sprintf(hname, "h_b_NJet5p_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
897 |
|
|
// h_b_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
898 |
|
|
// h_b_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
899 |
|
|
// sprintf(hname, "h_nob_NJet5p_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
900 |
|
|
// h_nob_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
901 |
|
|
// h_nob_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
902 |
|
|
// sprintf(hname, "h_dead_NJet5p_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
903 |
|
|
// h_dead_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
904 |
|
|
// h_dead_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
905 |
|
|
// sprintf(hname, "h_deadb_NJet5p_ResponsePt_Pt%i_Eta%i", i_pt, i_eta);
|
906 |
|
|
// h_deadb_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt) = new TH1F(hname, hname, 300, 0., 3.);
|
907 |
|
|
// h_deadb_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt)->Sumw2();
|
908 |
csander |
1.3 |
}
|
909 |
|
|
}
|
910 |
|
|
|
911 |
csander |
1.9 |
// for (unsigned int i_e = 0; i_e < EBinEdges.size() - 1; ++i_e) {
|
912 |
|
|
// for (unsigned int i_eta = 0; i_eta < EtaBinEdges.size() - 1; ++i_eta) {
|
913 |
|
|
// char hname[100];
|
914 |
|
|
// //// Book histograms (all jet multiplicities)
|
915 |
|
|
// sprintf(hname, "h_tot_NJetAll_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
916 |
|
|
// h_tot_NJetAll_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
917 |
|
|
// h_tot_NJetAll_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
918 |
|
|
// sprintf(hname, "h_b_NJetAll_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
919 |
|
|
// h_b_NJetAll_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
920 |
|
|
// h_b_NJetAll_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
921 |
|
|
// sprintf(hname, "h_nob_NJetAll_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
922 |
|
|
// h_nob_NJetAll_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
923 |
|
|
// h_nob_NJetAll_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
924 |
|
|
// sprintf(hname, "h_dead_NJetAll_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
925 |
|
|
// h_dead_NJetAll_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
926 |
|
|
// h_dead_NJetAll_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
927 |
|
|
// sprintf(hname, "h_deadb_NJetAll_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
928 |
|
|
// h_deadb_NJetAll_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
929 |
|
|
// h_deadb_NJetAll_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
930 |
|
|
// //// Book histograms (DiJets)
|
931 |
|
|
// sprintf(hname, "h_tot_DiJet_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
932 |
|
|
// h_tot_DiJet_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
933 |
|
|
// h_tot_DiJet_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
934 |
|
|
// sprintf(hname, "h_b_DiJet_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
935 |
|
|
// h_b_DiJet_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
936 |
|
|
// h_b_DiJet_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
937 |
|
|
// sprintf(hname, "h_nob_DiJet_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
938 |
|
|
// h_nob_DiJet_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
939 |
|
|
// h_nob_DiJet_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
940 |
|
|
// sprintf(hname, "h_dead_DiJet_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
941 |
|
|
// h_dead_DiJet_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
942 |
|
|
// h_dead_DiJet_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
943 |
|
|
// sprintf(hname, "h_deadb_DiJet_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
944 |
|
|
// h_deadb_DiJet_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
945 |
|
|
// h_deadb_DiJet_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
946 |
|
|
// //// Book histograms (jet multiplicities = 2)
|
947 |
|
|
// sprintf(hname, "h_tot_NJet2_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
948 |
|
|
// h_tot_NJet2_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
949 |
|
|
// h_tot_NJet2_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
950 |
|
|
// sprintf(hname, "h_b_NJet2_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
951 |
|
|
// h_b_NJet2_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
952 |
|
|
// h_b_NJet2_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
953 |
|
|
// sprintf(hname, "h_nob_NJet2_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
954 |
|
|
// h_nob_NJet2_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
955 |
|
|
// h_nob_NJet2_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
956 |
|
|
// sprintf(hname, "h_dead_NJet2_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
957 |
|
|
// h_dead_NJet2_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
958 |
|
|
// h_dead_NJet2_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
959 |
|
|
// sprintf(hname, "h_deadb_NJet2_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
960 |
|
|
// h_deadb_NJet2_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
961 |
|
|
// h_deadb_NJet2_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
962 |
|
|
// //// Book histograms (jet multiplicities = 3)
|
963 |
|
|
// sprintf(hname, "h_tot_NJet3_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
964 |
|
|
// h_tot_NJet3_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
965 |
|
|
// h_tot_NJet3_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
966 |
|
|
// sprintf(hname, "h_b_NJet3_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
967 |
|
|
// h_b_NJet3_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
968 |
|
|
// h_b_NJet3_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
969 |
|
|
// sprintf(hname, "h_nob_NJet3_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
970 |
|
|
// h_nob_NJet3_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
971 |
|
|
// h_nob_NJet3_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
972 |
|
|
// sprintf(hname, "h_dead_NJet3_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
973 |
|
|
// h_dead_NJet3_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
974 |
|
|
// h_dead_NJet3_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
975 |
|
|
// sprintf(hname, "h_deadb_NJet3_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
976 |
|
|
// h_deadb_NJet3_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
977 |
|
|
// h_deadb_NJet3_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
978 |
|
|
// //// Book histograms (jet multiplicities = 4)
|
979 |
|
|
// sprintf(hname, "h_tot_NJet4_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
980 |
|
|
// h_tot_NJet4_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
981 |
|
|
// h_tot_NJet4_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
982 |
|
|
// sprintf(hname, "h_b_NJet4_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
983 |
|
|
// h_b_NJet4_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
984 |
|
|
// h_b_NJet4_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
985 |
|
|
// sprintf(hname, "h_nob_NJet4_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
986 |
|
|
// h_nob_NJet4_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
987 |
|
|
// h_nob_NJet4_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
988 |
|
|
// sprintf(hname, "h_dead_NJet4_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
989 |
|
|
// h_dead_NJet4_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
990 |
|
|
// h_dead_NJet4_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
991 |
|
|
// sprintf(hname, "h_deadb_NJet4_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
992 |
|
|
// h_deadb_NJet4_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
993 |
|
|
// h_deadb_NJet4_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
994 |
|
|
// //// Book histograms (jet multiplicities = 5p)
|
995 |
|
|
// sprintf(hname, "h_tot_NJet5p_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
996 |
|
|
// h_tot_NJet5p_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
997 |
|
|
// h_tot_NJet5p_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
998 |
|
|
// sprintf(hname, "h_b_NJet5p_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
999 |
|
|
// h_b_NJet5p_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
1000 |
|
|
// h_b_NJet5p_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
1001 |
|
|
// sprintf(hname, "h_nob_NJet5p_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
1002 |
|
|
// h_nob_NJet5p_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
1003 |
|
|
// h_nob_NJet5p_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
1004 |
|
|
// sprintf(hname, "h_dead_NJet5p_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
1005 |
|
|
// h_dead_NJet5p_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
1006 |
|
|
// h_dead_NJet5p_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
1007 |
|
|
// sprintf(hname, "h_deadb_NJet5p_ResponsePt_E%i_Eta%i", i_e, i_eta);
|
1008 |
|
|
// h_deadb_NJet5p_JetResPt_E.at(i_eta).at(i_e) = new TH1F(hname, hname, 300, 0., 3.);
|
1009 |
|
|
// h_deadb_NJet5p_JetResPt_E.at(i_eta).at(i_e)->Sumw2();
|
1010 |
|
|
// }
|
1011 |
|
|
// }
|
1012 |
csander |
1.3 |
|
1013 |
|
|
mapsReady = false;
|
1014 |
|
|
}
|
1015 |
csander |
1.1 |
|
1016 |
|
|
// ------------ method called once each job just after ending the event loop ------------
|
1017 |
csander |
1.2 |
void
|
1018 |
csander |
1.5 |
MCResolutions::endJob() {
|
1019 |
|
|
|
1020 |
|
|
hfile->cd();
|
1021 |
csander |
1.6 |
//hfile->cd(_dirName.c_str());
|
1022 |
csander |
1.5 |
// Save all objects in this file
|
1023 |
|
|
for (unsigned int i_pt = 0; i_pt < PtBinEdges.size() - 1; ++i_pt) {
|
1024 |
|
|
for (unsigned int i_eta = 0; i_eta < EtaBinEdges.size() - 1; ++i_eta) {
|
1025 |
|
|
// total
|
1026 |
csander |
1.6 |
hfile->WriteTObject(h_tot_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt));
|
1027 |
csander |
1.7 |
hfile->WriteTObject(h_tot_DiJet_JetResPt_Pt.at(i_eta).at(i_pt));
|
1028 |
csander |
1.9 |
// hfile->WriteTObject(h_tot_NJet2_JetResPt_Pt.at(i_eta).at(i_pt));
|
1029 |
|
|
// hfile->WriteTObject(h_tot_NJet3_JetResPt_Pt.at(i_eta).at(i_pt));
|
1030 |
|
|
// hfile->WriteTObject(h_tot_NJet4_JetResPt_Pt.at(i_eta).at(i_pt));
|
1031 |
|
|
// hfile->WriteTObject(h_tot_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt));
|
1032 |
csander |
1.5 |
// with btag
|
1033 |
csander |
1.6 |
hfile->WriteTObject(h_b_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt));
|
1034 |
csander |
1.7 |
hfile->WriteTObject(h_b_DiJet_JetResPt_Pt.at(i_eta).at(i_pt));
|
1035 |
csander |
1.9 |
// hfile->WriteTObject(h_b_NJet2_JetResPt_Pt.at(i_eta).at(i_pt));
|
1036 |
|
|
// hfile->WriteTObject(h_b_NJet3_JetResPt_Pt.at(i_eta).at(i_pt));
|
1037 |
|
|
// hfile->WriteTObject(h_b_NJet4_JetResPt_Pt.at(i_eta).at(i_pt));
|
1038 |
|
|
// hfile->WriteTObject(h_b_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt));
|
1039 |
csander |
1.6 |
// without btag
|
1040 |
|
|
hfile->WriteTObject(h_nob_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt));
|
1041 |
csander |
1.7 |
hfile->WriteTObject(h_nob_DiJet_JetResPt_Pt.at(i_eta).at(i_pt));
|
1042 |
csander |
1.9 |
// hfile->WriteTObject(h_nob_NJet2_JetResPt_Pt.at(i_eta).at(i_pt));
|
1043 |
|
|
// hfile->WriteTObject(h_nob_NJet3_JetResPt_Pt.at(i_eta).at(i_pt));
|
1044 |
|
|
// hfile->WriteTObject(h_nob_NJet4_JetResPt_Pt.at(i_eta).at(i_pt));
|
1045 |
|
|
// hfile->WriteTObject(h_nob_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt));
|
1046 |
csander |
1.5 |
// in direction of dead ECAL cells
|
1047 |
csander |
1.6 |
hfile->WriteTObject(h_dead_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt));
|
1048 |
csander |
1.7 |
hfile->WriteTObject(h_dead_DiJet_JetResPt_Pt.at(i_eta).at(i_pt));
|
1049 |
csander |
1.9 |
// hfile->WriteTObject(h_dead_NJet2_JetResPt_Pt.at(i_eta).at(i_pt));
|
1050 |
|
|
// hfile->WriteTObject(h_dead_NJet3_JetResPt_Pt.at(i_eta).at(i_pt));
|
1051 |
|
|
// hfile->WriteTObject(h_dead_NJet4_JetResPt_Pt.at(i_eta).at(i_pt));
|
1052 |
|
|
// hfile->WriteTObject(h_dead_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt));
|
1053 |
csander |
1.5 |
// in direction of dead ECAL cells and with b tag
|
1054 |
csander |
1.6 |
hfile->WriteTObject(h_deadb_NJetAll_JetResPt_Pt.at(i_eta).at(i_pt));
|
1055 |
csander |
1.7 |
hfile->WriteTObject(h_deadb_DiJet_JetResPt_Pt.at(i_eta).at(i_pt));
|
1056 |
csander |
1.9 |
// hfile->WriteTObject(h_deadb_NJet2_JetResPt_Pt.at(i_eta).at(i_pt));
|
1057 |
|
|
// hfile->WriteTObject(h_deadb_NJet3_JetResPt_Pt.at(i_eta).at(i_pt));
|
1058 |
|
|
// hfile->WriteTObject(h_deadb_NJet4_JetResPt_Pt.at(i_eta).at(i_pt));
|
1059 |
|
|
// hfile->WriteTObject(h_deadb_NJet5p_JetResPt_Pt.at(i_eta).at(i_pt));
|
1060 |
csander |
1.5 |
}
|
1061 |
|
|
}
|
1062 |
csander |
1.9 |
// for (unsigned int i_e = 0; i_e < EBinEdges.size() - 1; ++i_e) {
|
1063 |
|
|
// for (unsigned int i_eta = 0; i_eta < EtaBinEdges.size() - 1; ++i_eta) {
|
1064 |
|
|
// // total
|
1065 |
|
|
// hfile->WriteTObject(h_tot_NJetAll_JetResPt_E.at(i_eta).at(i_e));
|
1066 |
|
|
// hfile->WriteTObject(h_tot_DiJet_JetResPt_E.at(i_eta).at(i_e));
|
1067 |
|
|
// hfile->WriteTObject(h_tot_NJet2_JetResPt_E.at(i_eta).at(i_e));
|
1068 |
|
|
// hfile->WriteTObject(h_tot_NJet3_JetResPt_E.at(i_eta).at(i_e));
|
1069 |
|
|
// hfile->WriteTObject(h_tot_NJet4_JetResPt_E.at(i_eta).at(i_e));
|
1070 |
|
|
// hfile->WriteTObject(h_tot_NJet5p_JetResPt_E.at(i_eta).at(i_e));
|
1071 |
|
|
// // with btag
|
1072 |
|
|
// hfile->WriteTObject(h_b_NJetAll_JetResPt_E.at(i_eta).at(i_e));
|
1073 |
|
|
// hfile->WriteTObject(h_b_DiJet_JetResPt_E.at(i_eta).at(i_e));
|
1074 |
|
|
// hfile->WriteTObject(h_b_NJet2_JetResPt_E.at(i_eta).at(i_e));
|
1075 |
|
|
// hfile->WriteTObject(h_b_NJet3_JetResPt_E.at(i_eta).at(i_e));
|
1076 |
|
|
// hfile->WriteTObject(h_b_NJet4_JetResPt_E.at(i_eta).at(i_e));
|
1077 |
|
|
// hfile->WriteTObject(h_b_NJet5p_JetResPt_E.at(i_eta).at(i_e));
|
1078 |
|
|
// // without btag
|
1079 |
|
|
// hfile->WriteTObject(h_nob_NJetAll_JetResPt_E.at(i_eta).at(i_e));
|
1080 |
|
|
// hfile->WriteTObject(h_nob_DiJet_JetResPt_E.at(i_eta).at(i_e));
|
1081 |
|
|
// hfile->WriteTObject(h_nob_NJet2_JetResPt_E.at(i_eta).at(i_e));
|
1082 |
|
|
// hfile->WriteTObject(h_nob_NJet3_JetResPt_E.at(i_eta).at(i_e));
|
1083 |
|
|
// hfile->WriteTObject(h_nob_NJet4_JetResPt_E.at(i_eta).at(i_e));
|
1084 |
|
|
// hfile->WriteTObject(h_nob_NJet5p_JetResPt_E.at(i_eta).at(i_e));
|
1085 |
|
|
// // in direction of dead ECAL cells
|
1086 |
|
|
// hfile->WriteTObject(h_dead_NJetAll_JetResPt_E.at(i_eta).at(i_e));
|
1087 |
|
|
// hfile->WriteTObject(h_dead_DiJet_JetResPt_E.at(i_eta).at(i_e));
|
1088 |
|
|
// hfile->WriteTObject(h_dead_NJet2_JetResPt_E.at(i_eta).at(i_e));
|
1089 |
|
|
// hfile->WriteTObject(h_dead_NJet3_JetResPt_E.at(i_eta).at(i_e));
|
1090 |
|
|
// hfile->WriteTObject(h_dead_NJet4_JetResPt_E.at(i_eta).at(i_e));
|
1091 |
|
|
// hfile->WriteTObject(h_dead_NJet5p_JetResPt_E.at(i_eta).at(i_e));
|
1092 |
|
|
// // in direction of dead ECAL cells and with b tag
|
1093 |
|
|
// hfile->WriteTObject(h_deadb_NJetAll_JetResPt_E.at(i_eta).at(i_e));
|
1094 |
|
|
// hfile->WriteTObject(h_deadb_DiJet_JetResPt_E.at(i_eta).at(i_e));
|
1095 |
|
|
// hfile->WriteTObject(h_deadb_NJet2_JetResPt_E.at(i_eta).at(i_e));
|
1096 |
|
|
// hfile->WriteTObject(h_deadb_NJet3_JetResPt_E.at(i_eta).at(i_e));
|
1097 |
|
|
// hfile->WriteTObject(h_deadb_NJet4_JetResPt_E.at(i_eta).at(i_e));
|
1098 |
|
|
// hfile->WriteTObject(h_deadb_NJet5p_JetResPt_E.at(i_eta).at(i_e));
|
1099 |
|
|
// }
|
1100 |
|
|
// }
|
1101 |
csander |
1.5 |
|
1102 |
|
|
hfile->cd();
|
1103 |
csander |
1.9 |
//hfile->WriteObject(&EBinEdges, "EBinEdges");
|
1104 |
csander |
1.5 |
hfile->WriteObject(&PtBinEdges, "PtBinEdges");
|
1105 |
|
|
hfile->WriteObject(&EtaBinEdges, "EtaBinEdges");
|
1106 |
csander |
1.6 |
//hfile->ls();
|
1107 |
csander |
1.5 |
|
1108 |
|
|
// Close the file.
|
1109 |
|
|
hfile->Close();
|
1110 |
|
|
|
1111 |
|
|
}
|
1112 |
csander |
1.3 |
|
1113 |
|
|
int MCResolutions::EBin(const double& e) {
|
1114 |
|
|
int i_e = -1;
|
1115 |
|
|
for (std::vector<double>::const_iterator it = EBinEdges.begin(); it != EBinEdges.end(); ++it) {
|
1116 |
|
|
if ((*it) > e)
|
1117 |
|
|
break;
|
1118 |
|
|
++i_e;
|
1119 |
|
|
}
|
1120 |
|
|
if (i_e < 0)
|
1121 |
|
|
i_e = 0;
|
1122 |
|
|
if (i_e > (int)EBinEdges.size() - 2)
|
1123 |
|
|
i_e = (int)EBinEdges.size() - 2;
|
1124 |
|
|
|
1125 |
|
|
return i_e;
|
1126 |
|
|
}
|
1127 |
|
|
|
1128 |
|
|
int MCResolutions::PtBin(const double& pt) {
|
1129 |
|
|
int i_pt = -1;
|
1130 |
|
|
for (std::vector<double>::const_iterator it = PtBinEdges.begin(); it != PtBinEdges.end(); ++it) {
|
1131 |
|
|
if ((*it) > pt)
|
1132 |
|
|
break;
|
1133 |
|
|
++i_pt;
|
1134 |
|
|
}
|
1135 |
|
|
if (i_pt < 0)
|
1136 |
|
|
i_pt = 0;
|
1137 |
|
|
if (i_pt > (int)PtBinEdges.size() - 2)
|
1138 |
|
|
i_pt = (int)PtBinEdges.size() - 2;
|
1139 |
|
|
|
1140 |
|
|
return i_pt;
|
1141 |
|
|
}
|
1142 |
|
|
|
1143 |
|
|
int MCResolutions::EtaBin(const double& eta) {
|
1144 |
|
|
int i_eta = -1;
|
1145 |
|
|
for (std::vector<double>::const_iterator it = EtaBinEdges.begin(); it != EtaBinEdges.end(); ++it) {
|
1146 |
|
|
if ((*it) > fabs(eta))
|
1147 |
|
|
break;
|
1148 |
|
|
++i_eta;
|
1149 |
|
|
}
|
1150 |
|
|
if (i_eta < 0)
|
1151 |
|
|
i_eta = 0;
|
1152 |
|
|
if (i_eta > (int)EtaBinEdges.size() - 2)
|
1153 |
|
|
i_eta = (int)EtaBinEdges.size() - 2;
|
1154 |
|
|
return i_eta;
|
1155 |
|
|
}
|
1156 |
|
|
|
1157 |
|
|
void MCResolutions::envSet(const edm::EventSetup& iSetup) {
|
1158 |
|
|
|
1159 |
|
|
ecalScale.setEventSetup( iSetup );
|
1160 |
|
|
|
1161 |
|
|
iSetup.get<EcalChannelStatusRcd> ().get(ecalStatus);
|
1162 |
|
|
iSetup.get<CaloGeometryRecord> ().get(geometry);
|
1163 |
|
|
|
1164 |
|
|
if ( !ecalStatus.isValid() )
|
1165 |
|
|
throw "Failed to get ECAL channel status!";
|
1166 |
|
|
if ( !geometry.isValid() )
|
1167 |
|
|
throw "Failed to get the geometry!";
|
1168 |
|
|
|
1169 |
|
|
}
|
1170 |
|
|
|
1171 |
|
|
int MCResolutions::getChannelStatusMaps() {
|
1172 |
|
|
|
1173 |
|
|
if( mapsReady )
|
1174 |
|
|
return -1;
|
1175 |
|
|
|
1176 |
|
|
EcalAllDeadChannelsValMap.clear();
|
1177 |
|
|
|
1178 |
|
|
// Loop over EB ...
|
1179 |
|
|
for( int ieta=-85; ieta<=85; ieta++ ) {
|
1180 |
|
|
for( int iphi=0; iphi<=360; iphi++ ) {
|
1181 |
|
|
if(! EBDetId::validDetId( ieta, iphi ) )
|
1182 |
|
|
continue;
|
1183 |
|
|
|
1184 |
|
|
const EBDetId detid = EBDetId( ieta, iphi, EBDetId::ETAPHIMODE );
|
1185 |
|
|
EcalChannelStatus::const_iterator chit = ecalStatus->find( detid );
|
1186 |
|
|
// refer https://twiki.cern.ch/twiki/bin/viewauth/CMS/EcalChannelStatus
|
1187 |
|
|
int status = ( chit != ecalStatus->end() ) ? chit->getStatusCode() : -1;
|
1188 |
|
|
//std::cout << ieta << " " << iphi << " " << status << std:: endl;
|
1189 |
|
|
const CaloSubdetectorGeometry* subGeom = geometry->getSubdetectorGeometry (detid);
|
1190 |
|
|
const CaloCellGeometry* cellGeom = subGeom->getGeometry (detid);
|
1191 |
|
|
double eta = cellGeom->getPosition ().eta ();
|
1192 |
|
|
double phi = cellGeom->getPosition ().phi ();
|
1193 |
|
|
double theta = cellGeom->getPosition().theta();
|
1194 |
|
|
|
1195 |
|
|
if(status >= _maskedEcalChannelStatusThreshold) {
|
1196 |
|
|
std::vector<double> valVec;
|
1197 |
|
|
valVec.push_back(eta);
|
1198 |
|
|
valVec.push_back(phi);
|
1199 |
|
|
valVec.push_back(theta);
|
1200 |
|
|
//std::cout << eta << " " << phi << std::endl;
|
1201 |
|
|
EcalAllDeadChannelsValMap.insert( std::make_pair(detid, valVec) );
|
1202 |
|
|
}
|
1203 |
|
|
} // end loop iphi
|
1204 |
|
|
} // end loop ieta
|
1205 |
|
|
|
1206 |
|
|
// Loop over EE detid
|
1207 |
|
|
for( int ix=0; ix<=100; ix++ ) {
|
1208 |
|
|
for( int iy=0; iy<=100; iy++ ) {
|
1209 |
|
|
for( int iz=-1; iz<=1; iz++ ) {
|
1210 |
|
|
if(iz==0)
|
1211 |
|
|
continue;
|
1212 |
|
|
if(! EEDetId::validDetId( ix, iy, iz ) )
|
1213 |
|
|
continue;
|
1214 |
|
|
|
1215 |
|
|
const EEDetId detid = EEDetId( ix, iy, iz, EEDetId::XYMODE );
|
1216 |
|
|
EcalChannelStatus::const_iterator chit = ecalStatus->find( detid );
|
1217 |
|
|
int status = ( chit != ecalStatus->end() ) ? chit->getStatusCode() : -1;
|
1218 |
|
|
|
1219 |
|
|
const CaloSubdetectorGeometry* subGeom = geometry->getSubdetectorGeometry (detid);
|
1220 |
|
|
const CaloCellGeometry* cellGeom = subGeom->getGeometry (detid);
|
1221 |
|
|
double eta = cellGeom->getPosition ().eta () ;
|
1222 |
|
|
double phi = cellGeom->getPosition ().phi () ;
|
1223 |
|
|
double theta = cellGeom->getPosition().theta();
|
1224 |
|
|
|
1225 |
|
|
if(status >= _maskedEcalChannelStatusThreshold) {
|
1226 |
|
|
std::vector<double> valVec;
|
1227 |
|
|
valVec.push_back(eta);
|
1228 |
|
|
valVec.push_back(phi);
|
1229 |
|
|
valVec.push_back(theta);
|
1230 |
|
|
//std::cout << eta << " " << phi << std::endl;
|
1231 |
|
|
EcalAllDeadChannelsValMap.insert( std::make_pair(detid, valVec) );
|
1232 |
|
|
}
|
1233 |
|
|
} // end loop iz
|
1234 |
|
|
} // end loop iy
|
1235 |
|
|
} // end loop ix
|
1236 |
|
|
|
1237 |
|
|
mapsReady = true;
|
1238 |
|
|
return 1;
|
1239 |
|
|
}
|
1240 |
csander |
1.1 |
|
1241 |
|
|
//define this as a plug-in
|
1242 |
|
|
DEFINE_FWK_MODULE(MCResolutions);
|