27 refCollectionInputTagToken_ = consumes<edm::View<reco::Candidate> >(iConfig.
getParameter<
InputTag>(
"RefCollection"));
28 extensionName_ = iConfig.
getParameter<
string>(
"ExtensionName");
29 discriminators_ = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"discriminators");
37 MonitorElement *ptTemp, *etaTemp, *phiTemp, *massTemp, *decayModeFindingTemp, *decayModeTemp,
38 *byDeepTau2017v2p1VSerawTemp, *byDeepTau2017v2p1VSjetrawTemp, *byDeepTau2017v2p1VSmurawTemp, *summaryTemp;
42 histoInfo summaryHinfo = (histoSettings_.exists(
"summary"))
46 ibooker.
book1D(
"summaryPlotNum",
"summaryPlotNum", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
47 summaryMap.insert(std::make_pair(
"Num", summaryTemp));
49 ibooker.
book1D(
"summaryPlotDen",
"summaryPlotDen", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
50 summaryMap.insert(std::make_pair(
"Den", summaryTemp));
51 summaryTemp = ibooker.
book1D(
"summaryPlot",
"summaryPlot", summaryHinfo.
nbins, summaryHinfo.
min, summaryHinfo.
max);
52 summaryMap.insert(std::make_pair(
"", summaryTemp));
55 for (
const auto& it : discriminators_) {
56 string DiscriminatorLabel = it.getParameter<
string>(
"discriminator");
57 summaryMap.find(
"Den")->second->setBinLabel(j + 1, DiscriminatorLabel);
58 summaryMap.find(
"Num")->second->setBinLabel(j + 1, DiscriminatorLabel);
59 summaryMap.find(
"")->second->setBinLabel(j + 1, DiscriminatorLabel);
70 histoInfo massHinfo = (histoSettings_.exists(
"mass"))
73 histoInfo decayModeFindingHinfo = (histoSettings_.exists(
"decayModeFinding"))
76 histoInfo decayModeHinfo = (histoSettings_.exists(
"decayMode"))
80 (histoSettings_.exists(
"byDeepTau2017v2p1VSeraw"))
83 histoInfo byDeepTau2017v2p1VSjetrawHinfo =
84 (histoSettings_.exists(
"byDeepTau2017v2p1VSjetraw"))
88 (histoSettings_.exists(
"byDeepTau2017v2p1VSmuraw"))
91 ptTemp = ibooker.
book1D(
"tau_pt",
"tau_pt", ptHinfo.
nbins, ptHinfo.
min, ptHinfo.
max);
92 etaTemp = ibooker.
book1D(
"tau_eta",
"tau_eta", etaHinfo.
nbins, etaHinfo.
min, etaHinfo.
max);
93 phiTemp = ibooker.
book1D(
"tau_phi",
"tau_phi", phiHinfo.
nbins, phiHinfo.
min, phiHinfo.
max);
94 massTemp = ibooker.
book1D(
"tau_mass",
"tau_mass", massHinfo.
nbins, massHinfo.
min, massHinfo.
max);
95 decayModeFindingTemp = ibooker.
book1D(
"tau_decayModeFinding",
96 "tau_decayModeFinding",
97 decayModeFindingHinfo.
nbins,
98 decayModeFindingHinfo.
min,
99 decayModeFindingHinfo.
max);
101 ibooker.
book1D(
"tau_decayMode",
"tau_decayMode", decayModeHinfo.
nbins, decayModeHinfo.
min, decayModeHinfo.
max);
102 byDeepTau2017v2p1VSerawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSeraw",
103 "tau_byDeepTau2017v2p1VSeraw",
104 byDeepTau2017v2p1VSerawHinfo.
nbins,
105 byDeepTau2017v2p1VSerawHinfo.
min,
106 byDeepTau2017v2p1VSerawHinfo.
max);
107 byDeepTau2017v2p1VSjetrawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSjetraw",
108 "tau_byDeepTau2017v2p1VSjetraw",
109 byDeepTau2017v2p1VSjetrawHinfo.
nbins,
110 byDeepTau2017v2p1VSjetrawHinfo.
min,
111 byDeepTau2017v2p1VSjetrawHinfo.
max);
112 byDeepTau2017v2p1VSmurawTemp = ibooker.
book1D(
"tau_byDeepTau2017v2p1VSmuraw",
113 "tau_byDeepTau2017v2p1VSmuraw",
114 byDeepTau2017v2p1VSmurawHinfo.
nbins,
115 byDeepTau2017v2p1VSmurawHinfo.
min,
116 byDeepTau2017v2p1VSmurawHinfo.
max);
117 ptMap.insert(std::make_pair(
"", ptTemp));
118 etaMap.insert(std::make_pair(
"", etaTemp));
119 phiMap.insert(std::make_pair(
"", phiTemp));
120 massMap.insert(std::make_pair(
"", massTemp));
121 decayModeFindingMap.insert(std::make_pair(
"", decayModeFindingTemp));
122 decayModeMap.insert(std::make_pair(
"", decayModeTemp));
123 byDeepTau2017v2p1VSerawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSerawTemp));
124 byDeepTau2017v2p1VSjetrawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSjetrawTemp));
125 byDeepTau2017v2p1VSmurawMap.insert(std::make_pair(
"", byDeepTau2017v2p1VSmurawTemp));
132 std::cerr <<
" Tau collection not found while running TauValidationMiniAOD.cc " << std::endl;
137 bool isRef = iEvent.
getByToken(refCollectionInputTagToken_, ReferenceCollection);
139 std::cerr <<
" Reference collection not found while running TauValidationMiniAOD.cc " << std::endl;
142 for (refCandidateCollection::const_iterator RefJet = ReferenceCollection->begin();
143 RefJet != ReferenceCollection->end();
146 unsigned matchedTauIndex = -99;
147 for (
unsigned iTau = 0; iTau < taus->size(); iTau++) {
151 float dR =
deltaR(tau->eta(), tau->phi(), RefJet->eta(), RefJet->phi());
154 matchedTauIndex = iTau;
159 ptMap.find(
"")->second->Fill(matchedTau->pt());
160 etaMap.find(
"")->second->Fill(matchedTau->eta());
161 phiMap.find(
"")->second->Fill(matchedTau->phi());
162 massMap.find(
"")->second->Fill(matchedTau->mass());
163 decayModeMap.find(
"")->second->Fill(matchedTau->decayMode());
164 if (matchedTau->isTauIDAvailable(
"decayModeFinding"))
165 decayModeFindingMap.find(
"")->second->Fill(matchedTau->tauID(
"decayModeFinding"));
166 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSeraw"))
167 byDeepTau2017v2p1VSerawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSeraw"));
168 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSjetraw"))
169 byDeepTau2017v2p1VSjetrawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSjetraw"));
170 if (matchedTau->isTauIDAvailable(
"byDeepTau2017v2p1VSmuraw"))
171 byDeepTau2017v2p1VSmurawMap.find(
"")->second->Fill(matchedTau->tauID(
"byDeepTau2017v2p1VSmuraw"));
173 for (
const auto& it : discriminators_) {
174 string currentDiscriminator = it.getParameter<
string>(
"discriminator");
175 double selectionCut = it.getParameter<
double>(
"selectionCut");
176 summaryMap.find(
"Den")->second->Fill(j);
177 if (matchedTau->tauID(currentDiscriminator) >=
selectionCut)
178 summaryMap.find(
"Num")->second->Fill(j);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
TauValidationMiniAOD(const edm::ParameterSet &)
~TauValidationMiniAOD() override
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool isTau(const Candidate &part)