5 const double dR2Min = 0.01 * 0.01;
16 for (vInputTag::const_iterator it = srcLeptonsTags.begin(); it != srcLeptonsTags.end(); it++) {
17 srcLeptons_.push_back(consumes<reco::CandidateView>(*it));
27 verbosity_ = (
cfg.exists(
"verbosity")) ?
cfg.getParameter<
int>(
"verbosity") : 0;
29 produces<reco::PFMETCollection>();
46 LogDebug(
"produce") <<
"<PFMETProducerMVA::produce>:" << std::endl
48 <<
", Event: " << evt.
id().
event() << std::endl
50 <<
" --> skipping !!" << std::endl;
53 auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
54 pfMEtCollection->push_back(pfMEt);
89 bool lHasPhotons =
false;
90 std::vector<reco::PUSubMETCandInfo>
leptonInfo =
110 std::vector<reco::PUSubMETCandInfo> pfCandidateInfo =
computePFCandidateInfo(*pfCandidates_view, hardScatterVertex);
122 <<
", Event: " << evt.
id().
event() << std::endl
123 <<
" PFMET: Pt = " << pfMEtP4_original.pt() <<
", phi = " << pfMEtP4_original.phi() <<
" "
124 <<
"(Px = " << pfMEtP4_original.px() <<
", Py = " << pfMEtP4_original.py() <<
")" << std::endl
125 <<
" MVA MET: Pt = " << pfMEt.
pt() <<
" phi = " << pfMEt.
phi() <<
" (Px = " << pfMEt.
px()
126 <<
", Py = " << pfMEt.
py() <<
")" << std::endl
127 <<
" Cov:" << std::endl
133 auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
134 pfMEtCollection->push_back(pfMEt);
145 std::vector<reco::PUSubMETCandInfo>
leptonInfo;
160 if (&(*lepton1) == &(*lepton2)) {
166 if (pMatch && !
istau(&(*lepton1)) &&
istau(&(*lepton2))) {
169 if (pMatch && ((
istau(&(*lepton1)) &&
istau(&(*lepton2))) || (!
istau(&(*lepton1)) && !
istau(&(*lepton2)))) &&
170 lepton1->pt() > lepton2->pt()) {
173 if (pMatch && lepton1->pt() == lepton2->pt()) {
175 for (
unsigned int i0 = 0; i0 <
leptonInfo.size(); i0++) {
191 pLeptonInfo.
setP4(lepton1->p4());
194 if (lepton1->isPhoton()) {
212 std::vector<reco::PUSubMETCandInfo>& iLeptons,
213 std::vector<reco::PUSubMETCandInfo>& iCands) {
214 std::vector<reco::PUSubMETCandInfo> retVal;
215 for (reco::PFJetCollection::const_iterator uncorrJet = uncorrJets.begin(); uncorrJet != uncorrJets.end();
219 auto corrJet = corrJets->begin();
220 for (
size_t cjIdx = 0; cjIdx < corrJets->size(); ++cjIdx, ++corrJet) {
224 if (uncorrJet->jetArea() != corrJet->jetArea())
239 jetInfo.
setP4(corrJet->p4());
240 double lType1Corr = 0;
242 double pCorr = iCorrector.
correction(*uncorrJet);
243 lType1Corr =
std::abs(corrJet->pt() - pCorr * uncorrJet->pt());
245 pVec.SetPtEtaPhiM(lType1Corr, 0, corrJet->phi(), 0);
247 pType1Corr.SetCoordinates(pVec.Px(), pVec.Py(), pVec.Pz(), pVec.E());
249 bool pOnLepton =
false;
250 for (
unsigned int i0 = 0; i0 < iLeptons.size(); i0++) {
257 if (corrJet->pt() > 10 && !pOnLepton) {
259 pfCandidateInfo.
setP4(pType1Corr);
260 pfCandidateInfo.
setDZ(-999);
261 iCands.push_back(pfCandidateInfo);
264 lType1Corr = (pCorr * uncorrJet->pt() - uncorrJet->pt());
265 lType1Corr /= corrJet->pt();
273 float chEnF = (uncorrJet->chargedEmEnergy() + uncorrJet->chargedHadronEnergy() + uncorrJet->chargedMuEnergy()) /
278 retVal.push_back(jetInfo);
284 std::sort(retVal.begin(), retVal.end());
291 std::vector<reco::PUSubMETCandInfo> retVal;
296 if (hardScatterVertex) {
297 const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>(&(*pfCandidate));
298 if (pfc !=
nullptr) {
313 pfCandidateInfo.
setP4(pfCandidate->p4());
314 pfCandidateInfo.
setDZ(dZ);
315 retVal.push_back(pfCandidateInfo);
321 std::vector<reco::Vertex::Point> retVal;
327 if (
vertex->position().Rho() > 2.)
329 retVal.push_back(
vertex->position());
346 double lPtCharged = 0;
348 lPFTau = dynamic_cast<const reco::PFTau*>(iCand);
349 if (lPFTau !=
nullptr) {
350 for (UInt_t i0 = 0; i0 < lPFTau->
signalCands().size(); i0++) {
357 const pat::Tau* lPatPFTau =
nullptr;
358 lPatPFTau = dynamic_cast<const pat::Tau*>(iCand);
359 if (lPatPFTau !=
nullptr) {
370 return lPtCharged / lPtTot;
404 double iDR2Max = iDRMax * iDRMax;
408 if (
deltaR2(iCand->
p4(), pfCandidate->p4()) > iDR2Max)
412 if (hardScatterVertex) {
413 const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>((&(*pfCandidate)));
414 if (pfc !=
nullptr) {
426 lVis += pfCandidate->p4();
428 return lVis.pt() / iCand->
pt();