33 refCollectionInputTagToken_ = consumes<edm::View<reco::Candidate>>(iConfig.
getParameter<
InputTag>(
"RefCollection"));
35 extensionName_ = iConfig.
getParameter<
string>(
"ExtensionName");
37 discriminators_ = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"discriminators");
39 primaryVertexCollectionToken_ = consumes<std::vector<reco::Vertex>>(iConfig.
getParameter<
InputTag>(
"PVCollection"));
41 prunedGenToken_ = consumes<std::vector<reco::GenParticle>>(iConfig.
getParameter<
InputTag>(
"GenCollection"));
49 MonitorElement *ptTightvsJet, *etaTightvsJet, *phiTightvsJet, *massTightvsJet, *puTightvsJet;
50 MonitorElement *ptTightvsEle, *etaTightvsEle, *phiTightvsEle, *massTightvsEle, *puTightvsEle;
51 MonitorElement *ptTightvsMuo, *etaTightvsMuo, *phiTightvsMuo, *massTightvsMuo, *puTightvsMuo;
52 MonitorElement *ptMediumvsJet, *etaMediumvsJet, *phiMediumvsJet, *massMediumvsJet, *puMediumvsJet;
53 MonitorElement *ptMediumvsEle, *etaMediumvsEle, *phiMediumvsEle, *massMediumvsEle, *puMediumvsEle;
54 MonitorElement *ptMediumvsMuo, *etaMediumvsMuo, *phiMediumvsMuo, *massMediumvsMuo, *puMediumvsMuo;
55 MonitorElement *ptLoosevsJet, *etaLoosevsJet, *phiLoosevsJet, *massLoosevsJet, *puLoosevsJet;
56 MonitorElement *ptLoosevsEle, *etaLoosevsEle, *phiLoosevsEle, *massLoosevsEle, *puLoosevsEle;
57 MonitorElement *ptLoosevsMuo, *etaLoosevsMuo, *phiLoosevsMuo, *massLoosevsMuo, *puLoosevsMuo;
59 MonitorElement *decayModeFindingTemp, *decayModeTemp, *byDeepTau2018v2p5VSerawTemp;
60 MonitorElement *byDeepTau2018v2p5VSjetrawTemp, *byDeepTau2018v2p5VSmurawTemp, *summaryTemp;
61 MonitorElement *mtau_dm0, *mtau_dm1p2, *mtau_dm5, *mtau_dm6, *mtau_dm10, *mtau_dm11;
63 MonitorElement *pTOverProng_dm0, *pTOverProng_dm1p2, *pTOverProng_dm5, *pTOverProng_dm6, *pTOverProng_dm10,
68 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/Summary");
69 histoInfo summaryHinfo = (histoSettings_.exists(
"summary"))
73 summaryTemp = ibooker.
book1D(
74 "summaryPlotNum",
"Summary Plot: Numerator", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
75 summaryTemp->
setYTitle(
"nTaus passing discriminants");
76 summaryMap.insert(std::make_pair(
"Num", summaryTemp));
78 summaryTemp = ibooker.
book1D(
79 "summaryPlotDen",
"Summary Plot: Denominator", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
80 summaryTemp->
setYTitle(
"nTaus passing discriminants");
81 summaryMap.insert(std::make_pair(
"Den", summaryTemp));
84 ibooker.
book1D(
"summaryPlot",
"Summary Plot: Efficiency", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
85 summaryTemp->
setYTitle(
"Efficiency of discriminants");
86 summaryMap.insert(std::make_pair(
"", summaryTemp));
90 mtau_dm0 = ibooker.
book1D(
"mtau_dm0",
"mtau: DM = 0", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
91 mtau_dm0Map.insert(std::make_pair(
"", mtau_dm0));
93 mtau_dm1p2 = ibooker.
book1D(
"mtau_dm1p2",
"mtau: DM = 1+2", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
94 mtau_dm1p2Map.insert(std::make_pair(
"", mtau_dm1p2));
96 mtau_dm5 = ibooker.
book1D(
"mtau_dm5",
"mtau: DM = 5", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
97 mtau_dm5Map.insert(std::make_pair(
"", mtau_dm5));
99 mtau_dm6 = ibooker.
book1D(
"mtau_dm6",
"mtau: DM = 6", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
100 mtau_dm6Map.insert(std::make_pair(
"", mtau_dm6));
102 mtau_dm10 = ibooker.
book1D(
"mtau_dm10",
"mtau: DM = 10", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
103 mtau_dm10Map.insert(std::make_pair(
"", mtau_dm10));
105 mtau_dm11 = ibooker.
book1D(
"mtau_dm11",
"mtau: DM = 11", mtauHinfo.
nbins, mtauHinfo.
min, mtauHinfo.
max);
106 mtau_dm11Map.insert(std::make_pair(
"", mtau_dm11));
108 dmMigration = ibooker.
book2D(
"dmMigration",
"DM Migration", 15, -0.5, 14.5, 15, -0.5, 14.5);
109 dmMigration->
setXTitle(
"Generated tau DM");
110 dmMigration->
setYTitle(
"Reconstructed tau DM");
111 dmMigrationMap.insert(std::make_pair(
"", dmMigration));
113 histoInfo pTOverProngHinfo = (histoSettings_.exists(
"pTOverProng"))
117 pTOverProng_dm0 = ibooker.
book2D(
"pTOverProng_dm0",
118 "pTOverProng: DM = 0",
119 pTOverProngHinfo.
nbins,
120 pTOverProngHinfo.
min,
121 pTOverProngHinfo.
max,
122 pTOverProngHinfo.
nbins,
123 pTOverProngHinfo.
min,
124 pTOverProngHinfo.
max);
125 pTOverProng_dm0->
setXTitle(
"pT of reconstructed tau");
126 pTOverProng_dm0->
setYTitle(
"pT of lead charged cand");
127 pTOverProng_dm0Map.insert(std::make_pair(
"", pTOverProng_dm0));
129 pTOverProng_dm1p2 = ibooker.
book2D(
"pTOverProng_dm1p2",
130 "pTOverProng: DM = 1+2",
131 pTOverProngHinfo.
nbins,
132 pTOverProngHinfo.
min,
133 pTOverProngHinfo.
max,
134 pTOverProngHinfo.
nbins,
135 pTOverProngHinfo.
min,
136 pTOverProngHinfo.
max);
137 pTOverProng_dm1p2->
setXTitle(
"pT of reconstructed tau");
138 pTOverProng_dm1p2->
setYTitle(
"pT of lead charged cand");
139 pTOverProng_dm1p2Map.insert(std::make_pair(
"", pTOverProng_dm1p2));
141 pTOverProng_dm5 = ibooker.
book2D(
"pTOverProng_dm5",
142 "pTOverProng: DM = 5",
143 pTOverProngHinfo.
nbins,
144 pTOverProngHinfo.
min,
145 pTOverProngHinfo.
max,
146 pTOverProngHinfo.
nbins,
147 pTOverProngHinfo.
min,
148 pTOverProngHinfo.
max);
149 pTOverProng_dm5->
setXTitle(
"pT of reconstructed tau");
150 pTOverProng_dm5->
setYTitle(
"pT of lead charged cand");
151 pTOverProng_dm5Map.insert(std::make_pair(
"", pTOverProng_dm5));
153 pTOverProng_dm6 = ibooker.
book2D(
"pTOverProng_dm6",
154 "pTOverProng: DM = 6",
155 pTOverProngHinfo.
nbins,
156 pTOverProngHinfo.
min,
157 pTOverProngHinfo.
max,
158 pTOverProngHinfo.
nbins,
159 pTOverProngHinfo.
min,
160 pTOverProngHinfo.
max);
161 pTOverProng_dm6->
setXTitle(
"pT of reconstructed tau");
162 pTOverProng_dm6->
setYTitle(
"pT of lead charged cand");
163 pTOverProng_dm6Map.insert(std::make_pair(
"", pTOverProng_dm6));
165 pTOverProng_dm10 = ibooker.
book2D(
"pTOverProng_dm10",
166 "pTOverProng: DM = 10",
167 pTOverProngHinfo.
nbins,
168 pTOverProngHinfo.
min,
169 pTOverProngHinfo.
max,
170 pTOverProngHinfo.
nbins,
171 pTOverProngHinfo.
min,
172 pTOverProngHinfo.
max);
173 pTOverProng_dm10->
setXTitle(
"pT of reconstructed tau");
174 pTOverProng_dm10->
setYTitle(
"pT of lead charged cand");
175 pTOverProng_dm10Map.insert(std::make_pair(
"", pTOverProng_dm10));
177 pTOverProng_dm11 = ibooker.
book2D(
"pTOverProng_dm11",
178 "pTOverProng: DM = 11",
179 pTOverProngHinfo.
nbins,
180 pTOverProngHinfo.
min,
181 pTOverProngHinfo.
max,
182 pTOverProngHinfo.
nbins,
183 pTOverProngHinfo.
min,
184 pTOverProngHinfo.
max);
185 pTOverProng_dm11->
setXTitle(
"pT of reconstructed tau");
186 pTOverProng_dm11->
setYTitle(
"pT of lead charged cand");
187 pTOverProng_dm11Map.insert(std::make_pair(
"", pTOverProng_dm11));
189 ntau_vs_dm = ibooker.
book2D(
"ntau_vs_dm",
"DM vs nTau", 15, 0, 15, 15, 0, 15);
192 ntau_vs_dmMap.insert(std::make_pair(
"", ntau_vs_dm));
196 for (
const auto &it : discriminators_) {
197 string DiscriminatorLabel = it.getParameter<
string>(
"discriminator");
198 summaryMap.find(
"Den")->second->setBinLabel(
j + 1, DiscriminatorLabel);
199 summaryMap.find(
"Num")->second->setBinLabel(
j + 1, DiscriminatorLabel);
200 summaryMap.find(
"")->second->setBinLabel(
j + 1, DiscriminatorLabel);
213 histoInfo massHinfo = (histoSettings_.exists(
"mass"))
216 histoInfo puHinfo = (histoSettings_.exists(
"pileup"))
221 histoInfo decayModeFindingHinfo = (histoSettings_.exists(
"decayModeFinding"))
224 histoInfo decayModeHinfo = (histoSettings_.exists(
"decayMode"))
230 (histoSettings_.exists(
"byDeepTau2018v2p5VSeraw"))
233 histoInfo byDeepTau2018v2p5VSjetrawHinfo =
234 (histoSettings_.exists(
"byDeepTau2018v2p5VSjetraw"))
237 histoInfo byDeepTau2018v2p5VSmurawHinfo =
238 (histoSettings_.exists(
"byDeepTau2018v2p5VSmuraw"))
243 ptTemp = ibooker.
book1D(
"tau_pt",
"tau pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
244 etaTemp = ibooker.
book1D(
"tau_eta",
"tau eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
245 phiTemp = ibooker.
book1D(
"tau_phi",
"tau phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
246 massTemp = ibooker.
book1D(
"tau_mass",
"tau mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
247 puTemp = ibooker.
book1D(
"tau_pu",
"tau pileup", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
250 ptMap.insert(std::make_pair(
"", ptTemp));
251 etaMap.insert(std::make_pair(
"", etaTemp));
252 phiMap.insert(std::make_pair(
"", phiTemp));
253 massMap.insert(std::make_pair(
"", massTemp));
254 puMap.insert(std::make_pair(
"", puTemp));
257 decayModeFindingTemp = ibooker.
book1D(
"tau_decayModeFinding",
258 "tau decayModeFinding",
259 decayModeFindingHinfo.
nbins,
260 decayModeFindingHinfo.
min,
261 decayModeFindingHinfo.
max);
262 decayModeFindingMap.insert(std::make_pair(
"", decayModeFindingTemp));
264 decayModeTemp = ibooker.
book1D(
"tau_decayMode_reco",
265 "DecayMode: Reconstructed tau",
266 decayModeHinfo.
nbins,
269 decayModeMap.insert(std::make_pair(
"pftau", decayModeTemp));
271 decayModeTemp = ibooker.
book1D(
272 "tau_decayMode_gen",
"DecayMode: Generated tau", decayModeHinfo.
nbins, decayModeHinfo.
min, decayModeHinfo.
max);
273 decayModeMap.insert(std::make_pair(
"gentau", decayModeTemp));
276 byDeepTau2018v2p5VSerawTemp = ibooker.
book1D(
"tau_byDeepTau2018v2p5VSeraw",
277 "byDeepTau2018v2p5VSeraw",
278 byDeepTau2018v2p5VSerawHinfo.
nbins,
279 byDeepTau2018v2p5VSerawHinfo.
min,
280 byDeepTau2018v2p5VSerawHinfo.
max);
281 byDeepTau2018v2p5VSjetrawTemp = ibooker.
book1D(
"tau_byDeepTau2018v2p5VSjetraw",
282 "byDeepTau2018v2p5VSjetraw",
283 byDeepTau2018v2p5VSjetrawHinfo.
nbins,
284 byDeepTau2018v2p5VSjetrawHinfo.
min,
285 byDeepTau2018v2p5VSjetrawHinfo.
max);
286 byDeepTau2018v2p5VSmurawTemp = ibooker.
book1D(
"tau_byDeepTau2018v2p5VSmuraw",
287 "byDeepTau2018v2p5VSmuraw",
288 byDeepTau2018v2p5VSmurawHinfo.
nbins,
289 byDeepTau2018v2p5VSmurawHinfo.
min,
290 byDeepTau2018v2p5VSmurawHinfo.
max);
293 byDeepTau2018v2p5VSerawMap.insert(std::make_pair(
"", byDeepTau2018v2p5VSerawTemp));
294 byDeepTau2018v2p5VSjetrawMap.insert(std::make_pair(
"", byDeepTau2018v2p5VSjetrawTemp));
295 byDeepTau2018v2p5VSmurawMap.insert(std::make_pair(
"", byDeepTau2018v2p5VSmurawTemp));
298 real_data =
"RealData";
299 real_eledata =
"RealElectronsData";
300 real_mudata =
"RealMuonsData";
306 if (extensionName_.compare(qcd) == 0 || extensionName_.compare(real_data) == 0 || extensionName_.compare(ztt) == 0) {
308 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsJet/tight");
310 ptTightvsJet = ibooker.
book1D(
"tau_tightvsJet_pt",
"tau_tightvsJet_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
312 ibooker.
book1D(
"tau_tightvsJet_eta",
"tau_tightvsJet_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
314 ibooker.
book1D(
"tau_tightvsJet_phi",
"tau_tightvsJet_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
316 ibooker.
book1D(
"tau_tightvsJet_mass",
"tau_tightvsJet_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
317 puTightvsJet = ibooker.
book1D(
"tau_tightvsJet_pu",
"tau_tightvsJet_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
319 ptTightvsJetMap.insert(std::make_pair(
"", ptTightvsJet));
320 etaTightvsJetMap.insert(std::make_pair(
"", etaTightvsJet));
321 phiTightvsJetMap.insert(std::make_pair(
"", phiTightvsJet));
322 massTightvsJetMap.insert(std::make_pair(
"", massTightvsJet));
323 puTightvsJetMap.insert(std::make_pair(
"", puTightvsJet));
326 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsJet/medium");
328 ptMediumvsJet = ibooker.
book1D(
"tau_mediumvsJet_pt",
"tau_mediumvsJet_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
330 ibooker.
book1D(
"tau_mediumvsJet_eta",
"tau_mediumvsJet_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
332 ibooker.
book1D(
"tau_mediumvsJet_phi",
"tau_mediumvsJet_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
334 ibooker.
book1D(
"tau_mediumvsJet_mass",
"tau_mediumvsJet_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
335 puMediumvsJet = ibooker.
book1D(
"tau_mediumvsJet_pu",
"tau_mediumvsJet_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
337 ptMediumvsJetMap.insert(std::make_pair(
"", ptMediumvsJet));
338 etaMediumvsJetMap.insert(std::make_pair(
"", etaMediumvsJet));
339 phiMediumvsJetMap.insert(std::make_pair(
"", phiMediumvsJet));
340 massMediumvsJetMap.insert(std::make_pair(
"", massMediumvsJet));
341 puMediumvsJetMap.insert(std::make_pair(
"", puMediumvsJet));
344 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsJet/loose");
346 ptLoosevsJet = ibooker.
book1D(
"tau_loosevsJet_pt",
"tau_loosevsJet_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
348 ibooker.
book1D(
"tau_loosevsJet_eta",
"tau_loosevsJet_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
350 ibooker.
book1D(
"tau_loosevsJet_phi",
"tau_loosevsJet_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
352 ibooker.
book1D(
"tau_loosevsJet_mass",
"tau_loosevsJet_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
353 puLoosevsJet = ibooker.
book1D(
"tau_loosevsJet_pu",
"tau_loosevsJet_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
355 ptLoosevsJetMap.insert(std::make_pair(
"", ptLoosevsJet));
356 etaLoosevsJetMap.insert(std::make_pair(
"", etaLoosevsJet));
357 phiLoosevsJetMap.insert(std::make_pair(
"", phiLoosevsJet));
358 massLoosevsJetMap.insert(std::make_pair(
"", massLoosevsJet));
359 puLoosevsJetMap.insert(std::make_pair(
"", puLoosevsJet));
363 if (extensionName_.compare(real_eledata) == 0 || extensionName_.compare(zee) == 0 ||
364 extensionName_.compare(ztt) == 0) {
366 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsEle/tight");
368 ptTightvsEle = ibooker.
book1D(
"tau_tightvsEle_pt",
"tau_tightvsEle_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
370 ibooker.
book1D(
"tau_tightvsEle_eta",
"tau_tightvsEle_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
372 ibooker.
book1D(
"tau_tightvsEle_phi",
"tau_tightvsEle_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
374 ibooker.
book1D(
"tau_tightvsEle_mass",
"tau_tightvsEle_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
375 puTightvsEle = ibooker.
book1D(
"tau_tightvsEle_pu",
"tau_tightvsEle_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
377 ptTightvsEleMap.insert(std::make_pair(
"", ptTightvsEle));
378 etaTightvsEleMap.insert(std::make_pair(
"", etaTightvsEle));
379 phiTightvsEleMap.insert(std::make_pair(
"", phiTightvsEle));
380 massTightvsEleMap.insert(std::make_pair(
"", massTightvsEle));
381 puTightvsEleMap.insert(std::make_pair(
"", puTightvsEle));
384 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsEle/medium");
386 ptMediumvsEle = ibooker.
book1D(
"tau_mediumvsEle_pt",
"tau_mediumvsEle_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
388 ibooker.
book1D(
"tau_mediumvsEle_eta",
"tau_mediumvsEle_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
390 ibooker.
book1D(
"tau_mediumvsEle_phi",
"tau_mediumvsEle_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
392 ibooker.
book1D(
"tau_mediumvsEle_mass",
"tau_mediumvsEle_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
393 puMediumvsEle = ibooker.
book1D(
"tau_mediumvsEle_pu",
"tau_mediumvsEle_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
395 ptMediumvsEleMap.insert(std::make_pair(
"", ptMediumvsEle));
396 etaMediumvsEleMap.insert(std::make_pair(
"", etaMediumvsEle));
397 phiMediumvsEleMap.insert(std::make_pair(
"", phiMediumvsEle));
398 massMediumvsEleMap.insert(std::make_pair(
"", massMediumvsEle));
399 puMediumvsEleMap.insert(std::make_pair(
"", puMediumvsEle));
402 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsEle/loose");
404 ptLoosevsEle = ibooker.
book1D(
"tau_loosevsEle_pt",
"tau_loosevsEle_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
406 ibooker.
book1D(
"tau_loosevsEle_eta",
"tau_loosevsEle_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
408 ibooker.
book1D(
"tau_loosevsEle_phi",
"tau_loosevsEle_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
410 ibooker.
book1D(
"tau_loosevsEle_mass",
"tau_loosevsEle_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
411 puLoosevsEle = ibooker.
book1D(
"tau_loosevsEle_pu",
"tau_loosevsEle_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
413 ptLoosevsEleMap.insert(std::make_pair(
"", ptLoosevsEle));
414 etaLoosevsEleMap.insert(std::make_pair(
"", etaLoosevsEle));
415 phiLoosevsEleMap.insert(std::make_pair(
"", phiLoosevsEle));
416 massLoosevsEleMap.insert(std::make_pair(
"", massLoosevsEle));
417 puLoosevsEleMap.insert(std::make_pair(
"", puLoosevsEle));
421 if (extensionName_.compare(real_mudata) == 0 || extensionName_.compare(zmm) == 0 ||
422 extensionName_.compare(ztt) == 0) {
424 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsMuo/tight");
426 ptTightvsMuo = ibooker.
book1D(
"tau_tightvsMuo_pt",
"tau_tightvsMuo_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
428 ibooker.
book1D(
"tau_tightvsMuo_eta",
"tau_tightvsMuo_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
430 ibooker.
book1D(
"tau_tightvsMuo_phi",
"tau_tightvsMuo_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
432 ibooker.
book1D(
"tau_tightvsMuo_mass",
"tau_tightvsMuo_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
433 puTightvsMuo = ibooker.
book1D(
"tau_tightvsMuo_pu",
"tau_tightvsMuo_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
435 ptTightvsMuoMap.insert(std::make_pair(
"", ptTightvsMuo));
436 etaTightvsMuoMap.insert(std::make_pair(
"", etaTightvsMuo));
437 phiTightvsMuoMap.insert(std::make_pair(
"", phiTightvsMuo));
438 massTightvsMuoMap.insert(std::make_pair(
"", massTightvsMuo));
439 puTightvsMuoMap.insert(std::make_pair(
"", puTightvsMuo));
442 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsMuo/medium");
444 ptMediumvsMuo = ibooker.
book1D(
"tau_mediumvsMuo_pt",
"tau_mediumvsMuo_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
446 ibooker.
book1D(
"tau_mediumvsMuo_eta",
"tau_mediumvsMuo_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
448 ibooker.
book1D(
"tau_mediumvsMuo_phi",
"tau_mediumvsMuo_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
450 ibooker.
book1D(
"tau_mediumvsMuo_mass",
"tau_mediumvsMuo_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
451 puMediumvsMuo = ibooker.
book1D(
"tau_mediumvsMuo_pu",
"tau_mediumvsMuo_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
453 ptMediumvsMuoMap.insert(std::make_pair(
"", ptMediumvsMuo));
454 etaMediumvsMuoMap.insert(std::make_pair(
"", etaMediumvsMuo));
455 phiMediumvsMuoMap.insert(std::make_pair(
"", phiMediumvsMuo));
456 massMediumvsMuoMap.insert(std::make_pair(
"", massMediumvsMuo));
457 puMediumvsMuoMap.insert(std::make_pair(
"", puMediumvsMuo));
460 ibooker.
setCurrentFolder(
"RecoTauV/miniAODValidation/" + extensionName_ +
"/vsMuo/loose");
462 ptLoosevsMuo = ibooker.
book1D(
"tau_loosevsMuo_pt",
"tau_loosevsMuo_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
464 ibooker.
book1D(
"tau_loosevsMuo_eta",
"tau_loosevsMuo_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
466 ibooker.
book1D(
"tau_loosevsMuo_phi",
"tau_loosevsMuo_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
468 ibooker.
book1D(
"tau_loosevsMuo_mass",
"tau_loosevsMuo_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
469 puLoosevsMuo = ibooker.
book1D(
"tau_loosevsMuo_pu",
"tau_loosevsMuo_pu", puHinfo.
nbins, puHinfo.
min, puHinfo.
max);
471 ptLoosevsMuoMap.insert(std::make_pair(
"", ptLoosevsMuo));
472 etaLoosevsMuoMap.insert(std::make_pair(
"", etaLoosevsMuo));
473 phiLoosevsMuoMap.insert(std::make_pair(
"", phiLoosevsMuo));
474 massLoosevsMuoMap.insert(std::make_pair(
"", massLoosevsMuo));
475 puLoosevsMuoMap.insert(std::make_pair(
"", puLoosevsMuo));
483 edm::LogWarning(
"TauValidationMiniAOD") <<
" Tau collection not found while running TauValidationMiniAOD.cc ";
494 bool isRef =
iEvent.getByToken(refCollectionInputTagToken_, ReferenceCollection);
496 std::cerr <<
"ERROR: Reference collection not found while running TauValidationMiniAOD.cc \n " << std::endl;
502 bool isPV =
iEvent.getByToken(primaryVertexCollectionToken_, pvHandle);
504 edm::LogWarning(
"TauValidationMiniAOD") <<
" PV collection not found while running TauValidationMiniAOD.cc ";
506 std::vector<const reco::GenParticle *> GenTaus;
509 for (refCandidateCollection::const_iterator RefJet = ReferenceCollection->begin();
510 RefJet != ReferenceCollection->end();
513 int matchedTauIndex = -99;
514 float gendRmin = 0.15;
515 int genmatchedTauIndex = -99;
518 for (
unsigned iTau = 0; iTau <
taus->size(); iTau++) {
521 float dR =
deltaR2(
tau->eta(),
tau->phi(), RefJet->eta(), RefJet->phi());
524 matchedTauIndex = iTau;
531 ptMap.find(
"")->second->Fill(matchedTau->pt());
532 etaMap.find(
"")->second->Fill(matchedTau->eta());
533 phiMap.find(
"")->second->Fill(matchedTau->phi());
534 massMap.find(
"")->second->Fill(matchedTau->mass());
535 puMap.find(
"")->second->Fill(pvHandle->size());
536 decayModeMap.find(
"pftau")->second->Fill(matchedTau->decayMode());
539 if (matchedTau->isTauIDAvailable(
"decayModeFindingNewDMs"))
540 decayModeFindingMap.find(
"")->second->Fill(matchedTau->tauID(
"decayModeFindingNewDMs"));
541 if (matchedTau->isTauIDAvailable(
"byDeepTau2018v2p5VSeraw"))
542 byDeepTau2018v2p5VSerawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2018v2p5VSeraw"));
543 if (matchedTau->isTauIDAvailable(
"byDeepTau2018v2p5VSjetraw"))
544 byDeepTau2018v2p5VSjetrawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2018v2p5VSjetraw"));
545 if (matchedTau->isTauIDAvailable(
"byDeepTau2018v2p5VSmuraw"))
546 byDeepTau2018v2p5VSmurawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2018v2p5VSmuraw"));
549 if (matchedTau->decayMode() == 0) {
550 mtau_dm0Map.find(
"")->second->Fill(matchedTau->mass());
551 pTOverProng_dm0Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
552 }
else if (matchedTau->decayMode() == 1 || matchedTau->decayMode() == 2) {
553 mtau_dm1p2Map.find(
"")->second->Fill(matchedTau->mass());
554 pTOverProng_dm1p2Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
555 }
else if (matchedTau->decayMode() == 5) {
556 mtau_dm5Map.find(
"")->second->Fill(matchedTau->mass());
557 pTOverProng_dm5Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
558 }
else if (matchedTau->decayMode() == 6) {
559 mtau_dm6Map.find(
"")->second->Fill(matchedTau->mass());
560 pTOverProng_dm6Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
561 }
else if (matchedTau->decayMode() == 10) {
562 mtau_dm10Map.find(
"")->second->Fill(matchedTau->mass());
563 pTOverProng_dm10Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
564 }
else if (matchedTau->decayMode() == 11) {
565 mtau_dm11Map.find(
"")->second->Fill(matchedTau->mass());
566 pTOverProng_dm11Map.find(
"")->second->Fill(matchedTau->pt(), matchedTau->ptLeadChargedCand());
570 ntau_vs_dmMap.find(
"")->second->Fill(
taus->size(), matchedTau->decayMode());
574 unsigned genindex = 0;
576 if (
abs(genParticle.pdgId()) == 15) {
577 float gendR =
deltaR2(matchedTau->eta(), matchedTau->phi(), genParticle.eta(), genParticle.phi());
578 if (gendR < gendRmin) {
580 genmatchedTauIndex = genindex;
583 genindex = genindex + 1;
586 if (gendRmin < 0.15) {
590 for (
unsigned idtr = 0; idtr < gentau.numberOfDaughters(); idtr++) {
593 int dtrstatus = dtr->
status();
594 if (dtrpdgID == 12 || dtrpdgID == 14 || dtrpdgID == 16)
596 if (dtrpdgID == 111 || dtrpdgID == 311)
598 else if (dtrpdgID == 211 || dtrpdgID == 321)
600 else if (dtrpdgID == 15 && dtrstatus == 2 ) {
604 if (dtr2pdgID == 12 || dtr2pdgID == 14 || dtr2pdgID == 16)
606 if (dtr2pdgID == 111 || dtr2pdgID == 311)
608 else if (dtr2pdgID == 211 || dtr2pdgID == 321)
613 int genTau_dm = findDecayMode(nPis, nPi0s);
614 decayModeMap.find(
"gentau")->second->Fill(genTau_dm);
615 dmMigrationMap.find(
"")->second->Fill(genTau_dm, matchedTau->decayMode());
620 for (
const auto &it : discriminators_) {
621 string currentDiscriminator = it.getParameter<
string>(
"discriminator");
622 double selectionCut = it.getParameter<
double>(
"selectionCut");
623 summaryMap.find(
"Den")->second->Fill(
j);
624 if (matchedTau->tauID(currentDiscriminator) >=
selectionCut)
625 summaryMap.find(
"Num")->second->Fill(
j);
631 if (extensionName_.compare(qcd) == 0 || extensionName_.compare(real_data) == 0 ||
632 extensionName_.compare(ztt) == 0) {
634 if (matchedTau->tauID(
"byTightDeepTau2018v2p5VSjet") >= 0.5) {
635 ptTightvsJetMap.find(
"")->second->Fill(matchedTau->pt());
636 etaTightvsJetMap.find(
"")->second->Fill(matchedTau->eta());
637 phiTightvsJetMap.find(
"")->second->Fill(matchedTau->phi());
638 massTightvsJetMap.find(
"")->second->Fill(matchedTau->mass());
639 puTightvsJetMap.find(
"")->second->Fill(pvHandle->size());
642 if (matchedTau->tauID(
"byMediumDeepTau2018v2p5VSjet") >= 0.5) {
643 ptMediumvsJetMap.find(
"")->second->Fill(matchedTau->pt());
644 etaMediumvsJetMap.find(
"")->second->Fill(matchedTau->eta());
645 phiMediumvsJetMap.find(
"")->second->Fill(matchedTau->phi());
646 massMediumvsJetMap.find(
"")->second->Fill(matchedTau->mass());
647 puMediumvsJetMap.find(
"")->second->Fill(pvHandle->size());
650 if (matchedTau->tauID(
"byLooseDeepTau2018v2p5VSjet") >= 0.5) {
651 ptLoosevsJetMap.find(
"")->second->Fill(matchedTau->pt());
652 etaLoosevsJetMap.find(
"")->second->Fill(matchedTau->eta());
653 phiLoosevsJetMap.find(
"")->second->Fill(matchedTau->phi());
654 massLoosevsJetMap.find(
"")->second->Fill(matchedTau->mass());
655 puLoosevsJetMap.find(
"")->second->Fill(pvHandle->size());
659 if (extensionName_.compare(real_eledata) == 0 || extensionName_.compare(zee) == 0 ||
660 extensionName_.compare(ztt) == 0) {
662 if (matchedTau->tauID(
"byTightDeepTau2018v2p5VSe") >= 0.5) {
663 ptTightvsEleMap.find(
"")->second->Fill(matchedTau->pt());
664 etaTightvsEleMap.find(
"")->second->Fill(matchedTau->eta());
665 phiTightvsEleMap.find(
"")->second->Fill(matchedTau->phi());
666 massTightvsEleMap.find(
"")->second->Fill(matchedTau->mass());
667 puTightvsEleMap.find(
"")->second->Fill(pvHandle->size());
670 if (matchedTau->tauID(
"byMediumDeepTau2018v2p5VSe") >= 0.5) {
671 ptMediumvsEleMap.find(
"")->second->Fill(matchedTau->pt());
672 etaMediumvsEleMap.find(
"")->second->Fill(matchedTau->eta());
673 phiMediumvsEleMap.find(
"")->second->Fill(matchedTau->phi());
674 massMediumvsEleMap.find(
"")->second->Fill(matchedTau->mass());
675 puMediumvsEleMap.find(
"")->second->Fill(pvHandle->size());
678 if (matchedTau->tauID(
"byLooseDeepTau2018v2p5VSe") >= 0.5) {
679 ptLoosevsEleMap.find(
"")->second->Fill(matchedTau->pt());
680 etaLoosevsEleMap.find(
"")->second->Fill(matchedTau->eta());
681 phiLoosevsEleMap.find(
"")->second->Fill(matchedTau->phi());
682 massLoosevsEleMap.find(
"")->second->Fill(matchedTau->mass());
683 puLoosevsEleMap.find(
"")->second->Fill(pvHandle->size());
687 if (extensionName_.compare(real_mudata) == 0 || extensionName_.compare(zmm) == 0 ||
688 extensionName_.compare(ztt) == 0) {
690 if (matchedTau->tauID(
"byTightDeepTau2018v2p5VSmu") >= 0.5) {
691 ptTightvsMuoMap.find(
"")->second->Fill(matchedTau->pt());
692 etaTightvsMuoMap.find(
"")->second->Fill(matchedTau->eta());
693 phiTightvsMuoMap.find(
"")->second->Fill(matchedTau->phi());
694 massTightvsMuoMap.find(
"")->second->Fill(matchedTau->mass());
695 puTightvsMuoMap.find(
"")->second->Fill(pvHandle->size());
698 if (matchedTau->tauID(
"byMediumDeepTau2018v2p5VSmu") >= 0.5) {
699 ptMediumvsMuoMap.find(
"")->second->Fill(matchedTau->pt());
700 etaMediumvsMuoMap.find(
"")->second->Fill(matchedTau->eta());
701 phiMediumvsMuoMap.find(
"")->second->Fill(matchedTau->phi());
702 massMediumvsMuoMap.find(
"")->second->Fill(matchedTau->mass());
703 puMediumvsMuoMap.find(
"")->second->Fill(pvHandle->size());
706 if (matchedTau->tauID(
"byLooseDeepTau2018v2p5VSmu") >= 0.5) {
707 ptLoosevsMuoMap.find(
"")->second->Fill(matchedTau->pt());
708 etaLoosevsMuoMap.find(
"")->second->Fill(matchedTau->eta());
709 phiLoosevsMuoMap.find(
"")->second->Fill(matchedTau->phi());
710 massLoosevsMuoMap.find(
"")->second->Fill(matchedTau->mass());
711 puLoosevsMuoMap.find(
"")->second->Fill(pvHandle->size());
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
virtual void setCurrentFolder(std::string const &fullpath)
tuple isPV
JSON lumifiles checks.
size_t numberOfDaughters() const override
number of daughters
int status() const final
status word
int pdgId() const final
PDG identifier.
TauValidationMiniAOD(const edm::ParameterSet &)
virtual void setXTitle(std::string const &title)
Abs< T >::type abs(const T &t)
virtual void setYTitle(std::string const &title)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
~TauValidationMiniAOD() override
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool isTau(const Candidate &part)