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