6 const double dR2Min = 0.01 * 0.01;
17 for (vInputTag::const_iterator it = srcLeptonsTags.begin(); it != srcLeptonsTags.end(); it++) {
18 srcLeptons_.push_back(consumes<reco::CandidateView>(*it));
28 verbosity_ = (
cfg.exists(
"verbosity")) ?
cfg.getParameter<
int>(
"verbosity") : 0;
30 produces<reco::PFMETCollection>();
47 LogDebug(
"produce") <<
"<PFMETProducerMVA::produce>:" << std::endl
49 <<
", Event: " << evt.
id().
event() << std::endl
51 <<
" --> skipping !!" << std::endl;
54 auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
55 pfMEtCollection->push_back(pfMEt);
90 bool lHasPhotons =
false;
91 std::vector<reco::PUSubMETCandInfo>
leptonInfo =
111 std::vector<reco::PUSubMETCandInfo> pfCandidateInfo =
computePFCandidateInfo(*pfCandidates_view, hardScatterVertex);
123 <<
", Event: " << evt.
id().
event() << std::endl
124 <<
" PFMET: Pt = " << pfMEtP4_original.pt() <<
", phi = " << pfMEtP4_original.phi() <<
" "
125 <<
"(Px = " << pfMEtP4_original.px() <<
", Py = " << pfMEtP4_original.py() <<
")" << std::endl
126 <<
" MVA MET: Pt = " << pfMEt.
pt() <<
" phi = " << pfMEt.
phi() <<
" (Px = " << pfMEt.
px()
127 <<
", Py = " << pfMEt.
py() <<
")" << std::endl
128 <<
" Cov:" << std::endl
134 auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
135 pfMEtCollection->push_back(pfMEt);
146 std::vector<reco::PUSubMETCandInfo>
leptonInfo;
161 if (&(*lepton1) == &(*lepton2)) {
167 if (pMatch && !
istau(&(*lepton1)) &&
istau(&(*lepton2))) {
170 if (pMatch && ((
istau(&(*lepton1)) &&
istau(&(*lepton2))) || (!
istau(&(*lepton1)) && !
istau(&(*lepton2)))) &&
171 lepton1->pt() > lepton2->pt()) {
174 if (pMatch && lepton1->pt() == lepton2->pt()) {
176 for (
unsigned int i0 = 0; i0 <
leptonInfo.size(); i0++) {
192 pLeptonInfo.
setP4(lepton1->p4());
195 if (lepton1->isPhoton()) {
213 std::vector<reco::PUSubMETCandInfo>& iLeptons,
214 std::vector<reco::PUSubMETCandInfo>& iCands) {
215 std::vector<reco::PUSubMETCandInfo> retVal;
216 for (reco::PFJetCollection::const_iterator uncorrJet = uncorrJets.begin(); uncorrJet != uncorrJets.end();
220 auto corrJet = corrJets->begin();
221 for (
size_t cjIdx = 0; cjIdx < corrJets->size(); ++cjIdx, ++corrJet) {
225 if (uncorrJet->jetArea() != corrJet->jetArea())
240 jetInfo.
setP4(corrJet->p4());
241 double lType1Corr = 0;
243 double pCorr = iCorrector.
correction(*uncorrJet);
244 lType1Corr =
std::abs(corrJet->pt() - pCorr * uncorrJet->pt());
246 pVec.SetPtEtaPhiM(lType1Corr, 0, corrJet->phi(), 0);
248 pType1Corr.SetCoordinates(pVec.Px(), pVec.Py(), pVec.Pz(), pVec.E());
250 bool pOnLepton =
false;
251 for (
unsigned int i0 = 0; i0 < iLeptons.size(); i0++) {
258 if (corrJet->pt() > 10 && !pOnLepton) {
260 pfCandidateInfo.
setP4(pType1Corr);
261 pfCandidateInfo.
setDZ(-999);
262 iCands.push_back(pfCandidateInfo);
265 lType1Corr = (pCorr * uncorrJet->pt() - uncorrJet->pt());
266 lType1Corr /= corrJet->pt();
274 float chEnF = (uncorrJet->chargedEmEnergy() + uncorrJet->chargedHadronEnergy() + uncorrJet->chargedMuEnergy()) /
279 retVal.push_back(jetInfo);
292 std::vector<reco::PUSubMETCandInfo> retVal;
297 if (hardScatterVertex) {
298 const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>(&(*pfCandidate));
299 if (pfc !=
nullptr) {
314 pfCandidateInfo.
setP4(pfCandidate->p4());
315 pfCandidateInfo.
setDZ(dZ);
316 retVal.push_back(pfCandidateInfo);
322 std::vector<reco::Vertex::Point> retVal;
328 if (
vertex->position().Rho() > 2.)
330 retVal.push_back(
vertex->position());
347 double lPtCharged = 0;
349 lPFTau = dynamic_cast<const reco::PFTau*>(iCand);
350 if (lPFTau !=
nullptr) {
351 for (UInt_t i0 = 0; i0 < lPFTau->
signalCands().size(); i0++) {
358 const pat::Tau* lPatPFTau =
nullptr;
359 lPatPFTau = dynamic_cast<const pat::Tau*>(iCand);
360 if (lPatPFTau !=
nullptr) {
371 return lPtCharged / lPtTot;
405 double iDR2Max = iDRMax * iDRMax;
409 if (
deltaR2(iCand->
p4(), pfCandidate->p4()) > iDR2Max)
413 if (hardScatterVertex) {
414 const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>((&(*pfCandidate)));
415 if (pfc !=
nullptr) {
427 lVis += pfCandidate->p4();
429 return lVis.pt() / iCand->
pt();