28 refCollectionInputTagToken_ = consumes<edm::View<reco::Candidate> >(iConfig.
getParameter<
InputTag>(
"RefCollection"));
29 extensionName_ = iConfig.
getParameter<
string>(
"ExtensionName");
30 discriminators_ = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"discriminators");
38 MonitorElement *ptTemp, *etaTemp, *phiTemp, *massTemp, *decayModeFindingTemp, *decayModeTemp,
39 *byDeepTau2017v2p1VSerawTemp, *byDeepTau2017v2p1VSjetrawTemp, *byDeepTau2017v2p1VSmurawTemp, *summaryTemp;
43 histoInfo summaryHinfo = (histoSettings_.exists(
"summary"))
47 ibooker.
book1D(
"summaryPlotNum",
"summaryPlotNum", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
48 summaryMap.insert(std::make_pair(
"Num", summaryTemp));
50 ibooker.
book1D(
"summaryPlotDen",
"summaryPlotDen", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
51 summaryMap.insert(std::make_pair(
"Den", summaryTemp));
52 summaryTemp = ibooker.
book1D(
"summaryPlot",
"summaryPlot", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
53 summaryMap.insert(std::make_pair(
"", summaryTemp));
56 for (
const auto& it : discriminators_) {
57 string DiscriminatorLabel = it.getParameter<
string>(
"discriminator");
58 summaryMap.find(
"Den")->second->setBinLabel(
j + 1, DiscriminatorLabel);
59 summaryMap.find(
"Num")->second->setBinLabel(
j + 1, DiscriminatorLabel);
60 summaryMap.find(
"")->second->setBinLabel(
j + 1, DiscriminatorLabel);
71 histoInfo massHinfo = (histoSettings_.exists(
"mass"))
74 histoInfo decayModeFindingHinfo = (histoSettings_.exists(
"decayModeFinding"))
77 histoInfo decayModeHinfo = (histoSettings_.exists(
"decayMode"))
81 (histoSettings_.exists(
"byDeepTau2017v2p1VSeraw"))
84 histoInfo byDeepTau2017v2p1VSjetrawHinfo =
85 (histoSettings_.exists(
"byDeepTau2017v2p1VSjetraw"))
89 (histoSettings_.exists(
"byDeepTau2017v2p1VSmuraw"))
92 ptTemp = ibooker.
book1D(
"tau_pt",
"tau_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
93 etaTemp = ibooker.
book1D(
"tau_eta",
"tau_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
94 phiTemp = ibooker.
book1D(
"tau_phi",
"tau_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
95 massTemp = ibooker.
book1D(
"tau_mass",
"tau_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
96 decayModeFindingTemp = ibooker.
book1D(
"tau_decayModeFinding",
97 "tau_decayModeFinding",
98 decayModeFindingHinfo.
nbins,
99 decayModeFindingHinfo.
min,
100 decayModeFindingHinfo.
max);
102 ibooker.
book1D(
"tau_decayMode",
"tau_decayMode", decayModeHinfo.
nbins, decayModeHinfo.
min, decayModeHinfo.
max);
103 byDeepTau2017v2p1VSerawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSeraw",
104 "tau_byDeepTau2017v2p1VSeraw",
105 byDeepTau2017v2p1VSerawHinfo.
nbins,
106 byDeepTau2017v2p1VSerawHinfo.
min,
107 byDeepTau2017v2p1VSerawHinfo.
max);
108 byDeepTau2017v2p1VSjetrawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSjetraw",
109 "tau_byDeepTau2017v2p1VSjetraw",
110 byDeepTau2017v2p1VSjetrawHinfo.
nbins,
111 byDeepTau2017v2p1VSjetrawHinfo.
min,
112 byDeepTau2017v2p1VSjetrawHinfo.
max);
113 byDeepTau2017v2p1VSmurawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSmuraw",
114 "tau_byDeepTau2017v2p1VSmuraw",
115 byDeepTau2017v2p1VSmurawHinfo.
nbins,
116 byDeepTau2017v2p1VSmurawHinfo.
min,
117 byDeepTau2017v2p1VSmurawHinfo.
max);
118 ptMap.insert(std::make_pair(
"", ptTemp));
119 etaMap.insert(std::make_pair(
"", etaTemp));
120 phiMap.insert(std::make_pair(
"", phiTemp));
121 massMap.insert(std::make_pair(
"", massTemp));
122 decayModeFindingMap.insert(std::make_pair(
"", decayModeFindingTemp));
123 decayModeMap.insert(std::make_pair(
"", decayModeTemp));
124 byDeepTau2017v2p1VSerawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSerawTemp));
125 byDeepTau2017v2p1VSjetrawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSjetrawTemp));
126 byDeepTau2017v2p1VSmurawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSmurawTemp));
133 edm::LogWarning(
"TauValidationMiniAOD") <<
" Tau collection not found while running TauValidationMiniAOD.cc ";
138 bool isRef =
iEvent.getByToken(refCollectionInputTagToken_, ReferenceCollection);
140 edm::LogWarning(
"TauValidationMiniAOD") <<
" Reference collection not found while running TauValidationMiniAOD.cc ";
143 for (refCandidateCollection::const_iterator RefJet = ReferenceCollection->begin();
144 RefJet != ReferenceCollection->end();
147 unsigned matchedTauIndex = -99;
148 for (
unsigned iTau = 0; iTau <
taus->size(); iTau++) {
152 float dR =
deltaR(
tau->eta(),
tau->phi(), RefJet->eta(), RefJet->phi());
155 matchedTauIndex = iTau;
160 ptMap.find(
"")->second->Fill(matchedTau->pt());
161 etaMap.find(
"")->second->Fill(matchedTau->eta());
162 phiMap.find(
"")->second->Fill(matchedTau->phi());
163 massMap.find(
"")->second->Fill(matchedTau->mass());
164 decayModeMap.find(
"")->second->Fill(matchedTau->decayMode());
165 if (matchedTau->isTauIDAvailable(
"decayModeFinding"))
166 decayModeFindingMap.find(
"")->second->Fill(matchedTau->tauID(
"decayModeFinding"));
167 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSeraw"))
168 byDeepTau2017v2p1VSerawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSeraw"));
169 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSjetraw"))
170 byDeepTau2017v2p1VSjetrawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSjetraw"));
171 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSmuraw"))
172 byDeepTau2017v2p1VSmurawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSmuraw"));
174 for (
const auto& it : discriminators_) {
175 string currentDiscriminator = it.getParameter<
string>(
"discriminator");
176 double selectionCut = it.getParameter<
double>(
"selectionCut");
177 summaryMap.find(
"Den")->second->Fill(
j);
178 if (matchedTau->tauID(currentDiscriminator) >=
selectionCut)
179 summaryMap.find(
"Num")->second->Fill(
j);