CMS 3D CMS Logo

PFMETProducerMVA.cc
Go to the documentation of this file.
3 
4 using namespace reco;
5 
6 const double dR2Min = 0.01 * 0.01;
7 const double dR2Max = 0.5 * 0.5;
8 const double dPtMatch = 0.1;
9 
10 PFMETProducerMVA::PFMETProducerMVA(const edm::ParameterSet& cfg) : mvaMEtAlgo_(cfg), mvaMEtAlgo_isInitialized_(false) {
11  srcCorrJets_ = consumes<reco::PFJetCollection>(cfg.getParameter<edm::InputTag>("srcCorrJets"));
12  srcUncorrJets_ = consumes<reco::PFJetCollection>(cfg.getParameter<edm::InputTag>("srcUncorrJets"));
13  srcJetIds_ = consumes<edm::ValueMap<float> >(cfg.getParameter<edm::InputTag>("srcMVAPileupJetId"));
14  srcPFCandidatesView_ = consumes<reco::CandidateView>(cfg.getParameter<edm::InputTag>("srcPFCandidates"));
15  srcVertices_ = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("srcVertices"));
16  vInputTag srcLeptonsTags = cfg.getParameter<vInputTag>("srcLeptons");
17  for (vInputTag::const_iterator it = srcLeptonsTags.begin(); it != srcLeptonsTags.end(); it++) {
18  srcLeptons_.push_back(consumes<reco::CandidateView>(*it));
19  }
20  mJetCorrector_ = consumes<reco::JetCorrector>(cfg.getParameter<edm::InputTag>("corrector"));
21  minNumLeptons_ = cfg.getParameter<int>("minNumLeptons");
22 
23  globalThreshold_ = cfg.getParameter<double>("globalThreshold");
24 
25  minCorrJetPt_ = cfg.getParameter<double>("minCorrJetPt");
26  useType1_ = cfg.getParameter<bool>("useType1");
27 
28  verbosity_ = (cfg.exists("verbosity")) ? cfg.getParameter<int>("verbosity") : 0;
29 
30  produces<reco::PFMETCollection>();
31 }
32 
34 
36  // CV: check if the event is to be skipped
37  if (minNumLeptons_ > 0) {
38  int numLeptons = 0;
39  for (std::vector<edm::EDGetTokenT<reco::CandidateView> >::const_iterator srcLeptons_i = srcLeptons_.begin();
40  srcLeptons_i != srcLeptons_.end();
41  ++srcLeptons_i) {
43  evt.getByToken(*srcLeptons_i, leptons);
44  numLeptons += leptons->size();
45  }
46  if (!(numLeptons >= minNumLeptons_)) {
47  LogDebug("produce") << "<PFMETProducerMVA::produce>:" << std::endl
48  << "Run: " << evt.id().run() << ", LS: " << evt.luminosityBlock()
49  << ", Event: " << evt.id().event() << std::endl
50  << " numLeptons = " << numLeptons << ", minNumLeptons = " << minNumLeptons_
51  << " --> skipping !!" << std::endl;
52 
53  reco::PFMET pfMEt;
54  auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
55  pfMEtCollection->push_back(pfMEt);
56  evt.put(std::move(pfMEtCollection));
57  return;
58  }
59  }
60 
61  //get jet IDs
63  evt.getByToken(srcJetIds_, jetIds);
64 
65  // get jets (corrected and uncorrected)
67  evt.getByToken(srcCorrJets_, corrJets);
68 
70  evt.getByToken(srcUncorrJets_, uncorrJets);
71 
73  if (useType1_) {
75  }
76 
77  edm::Handle<reco::CandidateView> pfCandidates_view;
78  evt.getByToken(srcPFCandidatesView_, pfCandidates_view);
79 
80  // get vertices
83  // take vertex with highest sum(trackPt) as the vertex of the "hard scatter" interaction
84  // (= first entry in vertex collection)
85  const reco::Vertex* hardScatterVertex = (!vertices->empty()) ? &(vertices->front()) : nullptr;
86 
87  // get leptons
88  // (excluded from sum over PFCandidates when computing hadronic recoil)
89  int lId = 0;
90  bool lHasPhotons = false;
91  std::vector<reco::PUSubMETCandInfo> leptonInfo =
92  computeLeptonInfo(srcLeptons_, *pfCandidates_view, hardScatterVertex, lId, lHasPhotons, evt);
93 
94  // initialize MVA MET algorithm
95  // (this will load the BDTs, stored as GBRForrest objects;
96  // either in input ROOT files or in SQL-lite files/the Conditions Database)
100  }
101 
102  // reconstruct "standard" particle-flow missing Et
103  CommonMETData pfMEt_data = metAlgo_.run((*pfCandidates_view), globalThreshold_);
104  SpecificPFMETData specificPfMET = pfMEtSpecificAlgo_.run((*pfCandidates_view));
105  const reco::Candidate::LorentzVector p4(pfMEt_data.mex, pfMEt_data.mey, 0.0, pfMEt_data.met);
106  const reco::Candidate::Point vtx(0.0, 0.0, 0.0);
107  reco::PFMET pfMEt(specificPfMET, pfMEt_data.sumet, p4, vtx);
108  reco::Candidate::LorentzVector pfMEtP4_original = pfMEt.p4();
109 
110  // compute objects specific to MVA based MET reconstruction
111  std::vector<reco::PUSubMETCandInfo> pfCandidateInfo = computePFCandidateInfo(*pfCandidates_view, hardScatterVertex);
112  std::vector<reco::PUSubMETCandInfo> jetInfo = computeJetInfo(
113  *uncorrJets, corrJets, *jetIds, *vertices, hardScatterVertex, *corrector, evt, es, leptonInfo, pfCandidateInfo);
114  std::vector<reco::Vertex::Point> vertexInfo = computeVertexInfo(*vertices);
115  // compute MVA based MET and estimate of its uncertainty
116  mvaMEtAlgo_.setInput(leptonInfo, jetInfo, pfCandidateInfo, vertexInfo);
117  mvaMEtAlgo_.setHasPhotons(lHasPhotons);
119  pfMEt.setP4(mvaMEtAlgo_.getMEt());
121 
122  LogDebug("produce") << "Run: " << evt.id().run() << ", LS: " << evt.luminosityBlock()
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
129  << (mvaMEtAlgo_.getMEtCov())(0, 0) << " " << (mvaMEtAlgo_.getMEtCov())(0, 1) << std::endl
130  << (mvaMEtAlgo_.getMEtCov())(1, 0) << " " << (mvaMEtAlgo_.getMEtCov())(1, 1) << std::endl
131  << std::endl;
132 
133  // add PFMET object to the event
134  auto pfMEtCollection = std::make_unique<reco::PFMETCollection>();
135  pfMEtCollection->push_back(pfMEt);
136  evt.put(std::move(pfMEtCollection));
137 }
138 
139 std::vector<reco::PUSubMETCandInfo> PFMETProducerMVA::computeLeptonInfo(
141  const reco::CandidateView& pfCandidates_view,
142  const reco::Vertex* hardScatterVertex,
143  int& lId,
144  bool& lHasPhotons,
145  edm::Event& evt) {
146  std::vector<reco::PUSubMETCandInfo> leptonInfo;
147 
148  for (std::vector<edm::EDGetTokenT<reco::CandidateView> >::const_iterator srcLeptons_i = srcLeptons_.begin();
149  srcLeptons_i != srcLeptons_.end();
150  ++srcLeptons_i) {
152  evt.getByToken(*srcLeptons_i, leptons);
153  for (reco::CandidateView::const_iterator lepton1 = leptons->begin(); lepton1 != leptons->end(); ++lepton1) {
154  bool pMatch = false;
155  for (std::vector<edm::EDGetTokenT<reco::CandidateView> >::const_iterator srcLeptons_j = srcLeptons_.begin();
156  srcLeptons_j != srcLeptons_.end();
157  ++srcLeptons_j) {
159  evt.getByToken(*srcLeptons_j, leptons2);
160  for (reco::CandidateView::const_iterator lepton2 = leptons2->begin(); lepton2 != leptons2->end(); ++lepton2) {
161  if (&(*lepton1) == &(*lepton2)) {
162  continue;
163  }
164  if (deltaR2(lepton1->p4(), lepton2->p4()) < dR2Max) {
165  pMatch = true;
166  }
167  if (pMatch && !istau(&(*lepton1)) && istau(&(*lepton2))) {
168  pMatch = false;
169  }
170  if (pMatch && ((istau(&(*lepton1)) && istau(&(*lepton2))) || (!istau(&(*lepton1)) && !istau(&(*lepton2)))) &&
171  lepton1->pt() > lepton2->pt()) {
172  pMatch = false;
173  }
174  if (pMatch && lepton1->pt() == lepton2->pt()) {
175  pMatch = false;
176  for (unsigned int i0 = 0; i0 < leptonInfo.size(); i0++) {
177  if (std::abs(lepton1->pt() - leptonInfo[i0].p4().pt()) < dPtMatch) {
178  pMatch = true;
179  break;
180  }
181  }
182  }
183  if (pMatch)
184  break;
185  }
186  if (pMatch)
187  break;
188  }
189  if (pMatch)
190  continue;
191  reco::PUSubMETCandInfo pLeptonInfo;
192  pLeptonInfo.setP4(lepton1->p4());
193  pLeptonInfo.setChargedEnFrac(chargedEnFrac(&(*lepton1), pfCandidates_view, hardScatterVertex));
194  leptonInfo.push_back(pLeptonInfo);
195  if (lepton1->isPhoton()) {
196  lHasPhotons = true;
197  }
198  }
199  lId++;
200  }
201 
202  return leptonInfo;
203 }
204 
205 std::vector<reco::PUSubMETCandInfo> PFMETProducerMVA::computeJetInfo(const reco::PFJetCollection& uncorrJets,
206  const edm::Handle<reco::PFJetCollection>& corrJets,
207  const edm::ValueMap<float>& jetIds,
209  const reco::Vertex* hardScatterVertex,
210  const reco::JetCorrector& iCorrector,
212  const edm::EventSetup& iSetup,
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();
217  ++uncorrJet) {
218  // for ( reco::PFJetCollection::const_iterator corrJet = corrJets.begin();
219  // corrJet != corrJets.end(); ++corrJet ) {
220  auto corrJet = corrJets->begin();
221  for (size_t cjIdx = 0; cjIdx < corrJets->size(); ++cjIdx, ++corrJet) {
222  reco::PFJetRef corrJetRef(corrJets, cjIdx);
223 
224  // match corrected and uncorrected jets
225  if (uncorrJet->jetArea() != corrJet->jetArea())
226  continue;
227  if (deltaR2(corrJet->p4(), uncorrJet->p4()) > dR2Min)
228  continue;
229 
230  // check that jet passes loose PFJet id.
231  if (!passPFLooseId(&(*uncorrJet)))
232  continue;
233 
234  // compute jet energy correction factor
235  // (= ratio of corrected/uncorrected jet Pt)
236  //double jetEnCorrFactor = corrJet->pt()/uncorrJet->pt();
237  reco::PUSubMETCandInfo jetInfo;
238 
239  // PH: apply jet energy corrections for all Jets ignoring recommendations
240  jetInfo.setP4(corrJet->p4());
241  double lType1Corr = 0;
242  if (useType1_) { //Compute the type 1 correction ===> This code is crap
243  double pCorr = iCorrector.correction(*uncorrJet);
244  lType1Corr = std::abs(corrJet->pt() - pCorr * uncorrJet->pt());
245  TLorentzVector pVec;
246  pVec.SetPtEtaPhiM(lType1Corr, 0, corrJet->phi(), 0);
248  pType1Corr.SetCoordinates(pVec.Px(), pVec.Py(), pVec.Pz(), pVec.E());
249  //Filter to leptons
250  bool pOnLepton = false;
251  for (unsigned int i0 = 0; i0 < iLeptons.size(); i0++) {
252  if (deltaR2(iLeptons[i0].p4(), corrJet->p4()) < dR2Max) {
253  pOnLepton = true;
254  break;
255  }
256  }
257  //Add it to PF Collection
258  if (corrJet->pt() > 10 && !pOnLepton) {
259  reco::PUSubMETCandInfo pfCandidateInfo;
260  pfCandidateInfo.setP4(pType1Corr);
261  pfCandidateInfo.setDZ(-999);
262  iCands.push_back(pfCandidateInfo);
263  }
264  //Scale
265  lType1Corr = (pCorr * uncorrJet->pt() - uncorrJet->pt());
266  lType1Corr /= corrJet->pt();
267  }
268 
269  // check that jet Pt used to compute MVA based jet id. is above threshold
270  if (!(jetInfo.p4().pt() > minCorrJetPt_))
271  continue;
272 
273  jetInfo.setMvaVal(jetIds[corrJetRef]);
274  float chEnF = (uncorrJet->chargedEmEnergy() + uncorrJet->chargedHadronEnergy() + uncorrJet->chargedMuEnergy()) /
275  uncorrJet->energy();
276  if (useType1_)
277  chEnF += lType1Corr * (1 - jetInfo.chargedEnFrac());
278  jetInfo.setChargedEnFrac(chEnF);
279  retVal.push_back(jetInfo);
280  break;
281  }
282  }
283 
284  //order jets per pt
285  std::sort(retVal.begin(), retVal.end());
286 
287  return retVal;
288 }
289 
291  const reco::Vertex* hardScatterVertex) {
292  std::vector<reco::PUSubMETCandInfo> retVal;
293  for (reco::CandidateView::const_iterator pfCandidate = pfCandidates.begin(); pfCandidate != pfCandidates.end();
294  ++pfCandidate) {
295  double dZ = -999.; // PH: If no vertex is reconstructed in the event
296  // or PFCandidate has no track, set dZ to -999
297  if (hardScatterVertex) {
298  const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>(&(*pfCandidate));
299  if (pfc != nullptr) { //PF candidate for RECO and PAT levels
300  if (pfc->trackRef().isNonnull())
301  dZ = std::abs(pfc->trackRef()->dz(hardScatterVertex->position()));
302  else if (pfc->gsfTrackRef().isNonnull())
303  dZ = std::abs(pfc->gsfTrackRef()->dz(hardScatterVertex->position()));
304  } else { //if not, then packedCandidate for miniAOD level
305  const pat::PackedCandidate* pfc = dynamic_cast<const pat::PackedCandidate*>(&(*pfCandidate));
306  dZ = std::abs(pfc->dz(hardScatterVertex->position()));
307  //exact dz=zero corresponds to the -999 case for pfcandidate
308  if (dZ == 0) {
309  dZ = -999;
310  }
311  }
312  }
313  reco::PUSubMETCandInfo pfCandidateInfo;
314  pfCandidateInfo.setP4(pfCandidate->p4());
315  pfCandidateInfo.setDZ(dZ);
316  retVal.push_back(pfCandidateInfo);
317  }
318  return retVal;
319 }
320 
321 std::vector<reco::Vertex::Point> PFMETProducerMVA::computeVertexInfo(const reco::VertexCollection& vertices) {
322  std::vector<reco::Vertex::Point> retVal;
323  for (reco::VertexCollection::const_iterator vertex = vertices.begin(); vertex != vertices.end(); ++vertex) {
324  if (std::abs(vertex->z()) > 24.)
325  continue;
326  if (vertex->ndof() < 4.)
327  continue;
328  if (vertex->position().Rho() > 2.)
329  continue;
330  retVal.push_back(vertex->position());
331  }
332  return retVal;
333 }
336  const reco::Vertex* hardScatterVertex) {
337  if (iCand->isMuon()) {
338  return 1;
339  }
340  if (iCand->isElectron()) {
341  return 1.;
342  }
343  if (iCand->isPhoton()) {
344  return chargedFracInCone(iCand, pfCandidates, hardScatterVertex);
345  }
346  double lPtTot = 0;
347  double lPtCharged = 0;
348  const reco::PFTau* lPFTau = nullptr;
349  lPFTau = dynamic_cast<const reco::PFTau*>(iCand);
350  if (lPFTau != nullptr) {
351  for (UInt_t i0 = 0; i0 < lPFTau->signalCands().size(); i0++) {
352  lPtTot += (lPFTau->signalCands())[i0]->pt();
353  if ((lPFTau->signalCands())[i0]->charge() == 0)
354  continue;
355  lPtCharged += (lPFTau->signalCands())[i0]->pt();
356  }
357  } else {
358  const pat::Tau* lPatPFTau = nullptr;
359  lPatPFTau = dynamic_cast<const pat::Tau*>(iCand);
360  if (lPatPFTau != nullptr) {
361  for (UInt_t i0 = 0; i0 < lPatPFTau->signalCands().size(); i0++) {
362  lPtTot += (lPatPFTau->signalCands())[i0]->pt();
363  if ((lPatPFTau->signalCands())[i0]->charge() == 0)
364  continue;
365  lPtCharged += (lPatPFTau->signalCands())[i0]->pt();
366  }
367  }
368  }
369  if (lPtTot == 0)
370  lPtTot = 1.;
371  return lPtCharged / lPtTot;
372 }
373 //Return tau id by process of elimination
375  if (iCand->isMuon())
376  return false;
377  if (iCand->isElectron())
378  return false;
379  if (iCand->isPhoton())
380  return false;
381  return true;
382 }
384  if (iJet->energy() == 0)
385  return false;
386  if (iJet->neutralHadronEnergy() / iJet->energy() > 0.99)
387  return false;
388  if (iJet->neutralEmEnergy() / iJet->energy() > 0.99)
389  return false;
390  if (iJet->nConstituents() < 2)
391  return false;
392  if (iJet->chargedHadronEnergy() / iJet->energy() <= 0 && std::abs(iJet->eta()) < 2.4)
393  return false;
394  if (iJet->chargedEmEnergy() / iJet->energy() > 0.99 && std::abs(iJet->eta()) < 2.4)
395  return false;
396  if (iJet->chargedMultiplicity() < 1 && std::abs(iJet->eta()) < 2.4)
397  return false;
398  return true;
399 }
400 
403  const reco::Vertex* hardScatterVertex,
404  double iDRMax) {
405  double iDR2Max = iDRMax * iDRMax;
406  reco::Candidate::LorentzVector lVis(0, 0, 0, 0);
407  for (reco::CandidateView::const_iterator pfCandidate = pfCandidates.begin(); pfCandidate != pfCandidates.end();
408  ++pfCandidate) {
409  if (deltaR2(iCand->p4(), pfCandidate->p4()) > iDR2Max)
410  continue;
411  double dZ = -999.; // PH: If no vertex is reconstructed in the event
412  // or PFCandidate has no track, set dZ to -999
413  if (hardScatterVertex) {
414  const reco::PFCandidate* pfc = dynamic_cast<const reco::PFCandidate*>((&(*pfCandidate)));
415  if (pfc != nullptr) { //PF candidate for RECO and PAT levels
416  if (pfc->trackRef().isNonnull())
417  dZ = std::abs(pfc->trackRef()->dz(hardScatterVertex->position()));
418  else if (pfc->gsfTrackRef().isNonnull())
419  dZ = std::abs(pfc->gsfTrackRef()->dz(hardScatterVertex->position()));
420  } else { //if not, then packedCandidate for miniAOD level
421  const pat::PackedCandidate* pfc = dynamic_cast<const pat::PackedCandidate*>(&(*pfCandidate));
422  dZ = std::abs(pfc->dz(hardScatterVertex->position()));
423  }
424  }
425  if (std::abs(dZ) > 0.1)
426  continue;
427  lVis += pfCandidate->p4();
428  }
429  return lVis.pt() / iCand->pt();
430 }
431 
433 
reco::PFCandidate::trackRef
reco::TrackRef trackRef() const
Definition: PFCandidate.cc:408
reco::PFMETProducerMVA::computeLeptonInfo
std::vector< reco::PUSubMETCandInfo > computeLeptonInfo(const std::vector< edm::EDGetTokenT< reco::CandidateView > > &srcLeptons_, const reco::CandidateView &pfCandidates, const reco::Vertex *hardScatterVertex, int &lId, bool &lHasPhotons, edm::Event &iEvent)
Definition: PFMETProducerMVA.cc:139
CommonMETData::met
double met
Definition: CommonMETData.h:14
edm::View::begin
const_iterator begin() const
zmumugammaAnalyzer_cfi.pfCandidates
pfCandidates
Definition: zmumugammaAnalyzer_cfi.py:11
reco::PFTau::signalCands
const std::vector< reco::CandidatePtr > & signalCands() const
Candidates in signal region.
Definition: PFTau.cc:74
edm::PtrVectorBase::size
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:73
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
reco::PFMETProducerMVA::mJetCorrector_
edm::EDGetTokenT< reco::JetCorrector > mJetCorrector_
Definition: PFMETProducerMVA.h:91
METAlgo::run
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0, edm::ValueMap< float > const *weights=nullptr)
Definition: METAlgo.cc:16
SpecificPFMETData
MET made from Particle Flow Candidates.
Definition: SpecificPFMETData.h:12
HLT_FULL_cff.leptons
leptons
Definition: HLT_FULL_cff.py:26281
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::EDGetTokenT
Definition: EDGetToken.h:33
reco::PUSubMETCandInfo::setDZ
void setDZ(float dZ)
Definition: PUSubMETData.h:47
pat::Tau
Analysis-level tau class.
Definition: Tau.h:53
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
reco::JetCorrector
Definition: JetCorrector.h:33
PFMETAlgorithmMVA::initialize
void initialize(const edm::EventSetup &)
Definition: PFMETAlgorithmMVA.cc:143
PFSpecificAlgo::run
SpecificPFMETData run(const edm::View< reco::Candidate > &pfCands, edm::ValueMap< float > const *weights=nullptr)
Definition: PFSpecificAlgo.cc:15
reco::Candidate::pt
virtual double pt() const =0
transverse momentum
reco::Candidate::isPhoton
virtual bool isPhoton() const =0
reco::PFTau
Definition: PFTau.h:36
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
reco::PUSubMETCandInfo::setP4
void setP4(const reco::Candidate::LorentzVector p4)
Definition: PUSubMETData.h:46
reco::JetCorrector::correction
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:44
reco::PFMETProducerMVA::PFMETProducerMVA
PFMETProducerMVA(const edm::ParameterSet &)
Definition: PFMETProducerMVA.cc:10
CommonMETData
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::PFMETProducerMVA::srcPFCandidatesView_
edm::EDGetTokenT< edm::View< reco::Candidate > > srcPFCandidatesView_
Definition: PFMETProducerMVA.h:89
edm::Handle
Definition: AssociativeIterator.h:50
reco::PUSubMETCandInfo::chargedEnFrac
float chargedEnFrac() const
Definition: PUSubMETData.h:41
reco::PUSubMETCandInfo::setChargedEnFrac
void setChargedEnFrac(float chEnF)
Definition: PUSubMETData.h:57
reco::PFMETProducerMVA
Definition: PFMETProducerMVA.h:43
edm::Ref< PFJetCollection >
PFMETAlgorithmMVA::getMEtCov
const reco::METCovMatrix & getMEtCov() const
Definition: PFMETAlgorithmMVA.h:47
reco::PFMETProducerMVA::globalThreshold_
double globalThreshold_
Definition: PFMETProducerMVA.h:98
reco::PFMETProducerMVA::minCorrJetPt_
double minCorrJetPt_
Definition: PFMETProducerMVA.h:100
reco::PFMETProducerMVA::srcUncorrJets_
edm::EDGetTokenT< reco::PFJetCollection > srcUncorrJets_
Definition: PFMETProducerMVA.h:86
pfClustersFromHGC3DClusters_cfi.corrector
corrector
Definition: pfClustersFromHGC3DClusters_cfi.py:5
reco::PFJet::chargedHadronEnergy
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: PFJet.h:95
reco::PFMETProducerMVA::chargedEnFrac
double chargedEnFrac(const reco::Candidate *iCand, const reco::CandidateView &pfCandidates, const reco::Vertex *hardScatterVertex)
Definition: PFMETProducerMVA.cc:334
pat::Tau::signalCands
reco::CandidatePtrVector signalCands() const
reco::PFMETProducerMVA::computeVertexInfo
std::vector< reco::Vertex::Point > computeVertexInfo(const reco::VertexCollection &)
Definition: PFMETProducerMVA.cc:321
reco::MET::setSignificanceMatrix
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
Definition: MET.cc:142
MakerMacros.h
reco::PUSubMETCandInfo
Definition: PUSubMETData.h:21
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CommonMETData::mex
double mex
Definition: CommonMETData.h:15
reco::PUSubMETCandInfo::p4
const reco::Candidate::LorentzVector & p4() const
Definition: PUSubMETData.h:30
PFMETProducerMVA.h
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
reco::PFMETProducerMVA::verbosity_
int verbosity_
Definition: PFMETProducerMVA.h:108
reco::PFMETProducerMVA::useType1_
bool useType1_
Definition: PFMETProducerMVA.h:96
reco::PFJet::chargedMultiplicity
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:152
reco::Jet::nConstituents
virtual int nConstituents() const
Definition: Jet.h:65
pat::PackedCandidate::dz
virtual float dz(size_t ipv=0) const
dz with respect to the PV[ipv]
Definition: PackedCandidate.h:746
reco::PFMETProducerMVA::mvaMEtAlgo_
PFMETAlgorithmMVA mvaMEtAlgo_
Definition: PFMETProducerMVA.h:104
reco::PFJet::chargedEmEnergy
float chargedEmEnergy() const
chargedEmEnergy
Definition: PFJet.h:139
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
reco::PFMETProducerMVA::minNumLeptons_
int minNumLeptons_
Definition: PFMETProducerMVA.h:94
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
reco::Candidate::isMuon
virtual bool isMuon() const =0
CommonMETData::sumet
double sumet
Definition: CommonMETData.h:18
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
PFMETAlgorithmMVA::setHasPhotons
void setHasPhotons(bool hasPhotons)
Definition: PFMETAlgorithmMVA.h:37
edm::View
Definition: CaloClusterFwd.h:14
reco::PFMET
Definition: PFMET.h:18
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
reco::PFCandidate::gsfTrackRef
reco::GsfTrackRef gsfTrackRef() const
Definition: PFCandidate.cc:440
reco::PFMETProducerMVA::srcJetIds_
edm::EDGetTokenT< edm::ValueMap< float > > srcJetIds_
Definition: PFMETProducerMVA.h:87
reco::PFMETProducerMVA::pfMEtSpecificAlgo_
PFSpecificAlgo pfMEtSpecificAlgo_
Definition: PFMETProducerMVA.h:103
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
edm::EventBase::luminosityBlock
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
pat::PackedCandidate
Definition: PackedCandidate.h:22
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
AK4CaloJetsMCFlavour_cff.leptonInfo
leptonInfo
Definition: AK4CaloJetsMCFlavour_cff.py:14
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::PFMETProducerMVA::vInputTag
std::vector< edm::InputTag > vInputTag
Definition: PFMETProducerMVA.h:92
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
reco::PFMETProducerMVA::srcLeptons_
std::vector< edm::EDGetTokenT< reco::CandidateView > > srcLeptons_
Definition: PFMETProducerMVA.h:93
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::PFMETProducerMVA::passPFLooseId
bool passPFLooseId(const reco::PFJet *iJet)
Definition: PFMETProducerMVA.cc:383
edm::EventSetup
Definition: EventSetup.h:58
dR2Max
const double dR2Max
Definition: PFMETProducerMVA.cc:7
reco::PFMETProducerMVA::srcVertices_
edm::EDGetTokenT< reco::VertexCollection > srcVertices_
Definition: PFMETProducerMVA.h:90
PFMETAlgorithmMVA::setInput
void setInput(const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::Vertex::Point > &)
Definition: PFMETAlgorithmMVA.cc:170
looper.cfg
cfg
Definition: looper.py:297
reco::Candidate
Definition: Candidate.h:27
dR2Min
const double dR2Min
Definition: PFMETProducerMVA.cc:6
PFMETAlgorithmMVA::getMEt
reco::Candidate::LorentzVector getMEt() const
Definition: PFMETAlgorithmMVA.h:46
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::PUSubMETCandInfo::setMvaVal
void setMvaVal(float mva)
Definition: PUSubMETData.h:56
reco::Candidate::isElectron
virtual bool isElectron() const =0
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::PFJetCollection
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Definition: PFJetCollection.h:14
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::PFJet::neutralHadronEnergy
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: PFJet.h:99
edm::ValueMap< float >
reco::PFMETProducerMVA::mvaMEtAlgo_isInitialized_
bool mvaMEtAlgo_isInitialized_
Definition: PFMETProducerMVA.h:105
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
reco::PFJet::neutralEmEnergy
float neutralEmEnergy() const
neutralEmEnergy
Definition: PFJet.h:147
reco::PFMETProducerMVA::computePFCandidateInfo
std::vector< reco::PUSubMETCandInfo > computePFCandidateInfo(const reco::CandidateView &, const reco::Vertex *)
Definition: PFMETProducerMVA.cc:290
reco::PFMETProducerMVA::chargedFracInCone
double chargedFracInCone(const reco::Candidate *iCand, const reco::CandidateView &pfCandidates, const reco::Vertex *hardScatterVertex, double iDRMax=0.2)
Definition: PFMETProducerMVA.cc:401
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
HLT_FULL_cff.numLeptons
numLeptons
Definition: HLT_FULL_cff.py:26280
reco::PFMETProducerMVA::computeJetInfo
std::vector< reco::PUSubMETCandInfo > computeJetInfo(const reco::PFJetCollection &, const edm::Handle< reco::PFJetCollection > &, const edm::ValueMap< float > &, const reco::VertexCollection &, const reco::Vertex *, const reco::JetCorrector &iCorr, edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< reco::PUSubMETCandInfo > &iLeptons, std::vector< reco::PUSubMETCandInfo > &iCands)
Definition: PFMETProducerMVA.cc:205
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
PFMETAlgorithmMVA::evaluateMVA
void evaluateMVA()
Definition: PFMETAlgorithmMVA.cc:236
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dPtMatch
const double dPtMatch
Definition: PFMETProducerMVA.cc:8
edm::View::end
const_iterator end() const
reco::PFMETProducerMVA::srcCorrJets_
edm::EDGetTokenT< reco::PFJetCollection > srcCorrJets_
Definition: PFMETProducerMVA.h:85
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
edm::Event
Definition: Event.h:73
reco::PFMETProducerMVA::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFMETProducerMVA.cc:35
reco::PFMETProducerMVA::metAlgo_
METAlgo metAlgo_
Definition: PFMETProducerMVA.h:102
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140
CommonMETData::mey
double mey
Definition: CommonMETData.h:16
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
reco::PFMETProducerMVA::istau
bool istau(const reco::Candidate *iCand)
Definition: PFMETProducerMVA.cc:374
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
reco::PFMETProducerMVA::~PFMETProducerMVA
~PFMETProducerMVA() override
Definition: PFMETProducerMVA.cc:33