CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFMETProducerMVA.cc
Go to the documentation of this file.
2 
5 
24 #include "TLorentzVector.h"
25 
26 
28 
29 #include <algorithm>
30 
31 using namespace reco;
32 
33 const double dR2Min = 0.01*0.01;
34 const double dR2Max = 0.5*0.5;
35 const double dPtMatch = 0.1;
36 
37 namespace
38 {
39  template <typename T>
40  std::string format_vT(const std::vector<T>& vT)
41  {
42  std::ostringstream os;
43 
44  os << "{ ";
45 
46  unsigned numEntries = vT.size();
47  for ( unsigned iEntry = 0; iEntry < numEntries; ++iEntry ) {
48  os << vT[iEntry];
49  if ( iEntry < (numEntries - 1) ) os << ", ";
50  }
51 
52  os << " }";
53 
54  return os.str();
55  }
56 
57 }
58 
60  : mvaMEtAlgo_(cfg),
61  mvaMEtAlgo_isInitialized_(false),
62  mvaJetIdAlgo_(cfg)
63 {
64  srcCorrJets_ = consumes<reco::PFJetCollection>(cfg.getParameter<edm::InputTag>("srcCorrJets"));
65  srcUncorrJets_ = consumes<reco::PFJetCollection>(cfg.getParameter<edm::InputTag>("srcUncorrJets"));
66  srcPFCandidates_ = consumes<reco::PFCandidateCollection>(cfg.getParameter<edm::InputTag>("srcPFCandidates"));
67  srcPFCandidatesView_ = consumes<edm::View<reco::Candidate> >(cfg.getParameter<edm::InputTag>("srcPFCandidates"));
68  srcVertices_ = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("srcVertices"));
69  vInputTag srcLeptonsTags = cfg.getParameter<vInputTag>("srcLeptons");
70  for(vInputTag::const_iterator it=srcLeptonsTags.begin();it!=srcLeptonsTags.end();it++) {
71  srcLeptons_.push_back( consumes<edm::View<reco::Candidate> >( *it ) );
72  }
73 
74  minNumLeptons_ = cfg.getParameter<int>("minNumLeptons");
75  srcRho_ = consumes<edm::Handle<double> >(cfg.getParameter<edm::InputTag>("srcRho"));
76 
77  globalThreshold_ = cfg.getParameter<double>("globalThreshold");
78 
79  minCorrJetPt_ = cfg.getParameter<double> ("minCorrJetPt");
80  useType1_ = cfg.getParameter<bool> ("useType1");
81  correctorLabel_ = cfg.getParameter<std::string>("corrector");
82  isOld42_ = cfg.getParameter<bool> ("useOld42");
83 
84  verbosity_ = ( cfg.exists("verbosity") ) ?
85  cfg.getParameter<int>("verbosity") : 0;
86 
87  //if ( verbosity_ ) {
88  LogDebug( "PFMETProducerMVA" )
89  << "<PFMETProducerMVA::PFMETProducerMVA>:" << std::endl;
90  // std::cout << " srcCorrJets = " << srcCorrJets_.label() << std::endl;
91  // std::cout << " srcUncorrJets = " << srcUncorrJets_.label() << std::endl;
92  // std::cout << " srcPFCandidates = " << srcPFCandidates_.label() << std::endl;
93  // std::cout << " srcVertices = " << srcVertices_.label() << std::endl;
94  // std::cout << " srcLeptons = " << format_vInputTag(srcLeptons_) << std::endl;
95  // std::cout << " srcRho = " << srcVertices_.label() << std::endl;
96 
97  produces<reco::PFMETCollection>();
98 }
99 
101 
103 {
104  // CV: check if the event is to be skipped
105  if ( minNumLeptons_ > 0 ) {
106  int numLeptons = 0;
107  for ( std::vector<edm::EDGetTokenT<edm::View<reco::Candidate> > >::const_iterator srcLeptons_i = srcLeptons_.begin();
108  srcLeptons_i != srcLeptons_.end(); ++srcLeptons_i ) {
110  evt.getByToken(*srcLeptons_i, leptons);
111  numLeptons += leptons->size();
112  }
113  if ( !(numLeptons >= minNumLeptons_) ) {
114  LogDebug( "produce" )
115  << "<PFMETProducerMVA::produce>:" << std::endl
116  << "Run: " << evt.id().run() << ", LS: " << evt.luminosityBlock() << ", Event: " << evt.id().event() << std::endl
117  << " numLeptons = " << numLeptons << ", minNumLeptons = " << minNumLeptons_ << " --> skipping !!" << std::endl;
118 
119  reco::PFMET pfMEt;
120  std::auto_ptr<reco::PFMETCollection> pfMEtCollection(new reco::PFMETCollection());
121  pfMEtCollection->push_back(pfMEt);
122  evt.put(pfMEtCollection);
123  return;
124  }
125  }
126 
127  // get jets (corrected and uncorrected)
129  evt.getByToken(srcCorrJets_, corrJets);
130 
132  evt.getByToken(srcUncorrJets_, uncorrJets);
133 
134  const JetCorrector* corrector = nullptr;
136 
137  // get PFCandidates
139  evt.getByToken(srcPFCandidates_, pfCandidates);
140 
141  edm::Handle<CandidateView> pfCandidates_view;
142  evt.getByToken(srcPFCandidatesView_, pfCandidates_view);
143 
144  // get vertices
146  evt.getByToken(srcVertices_, vertices);
147  // take vertex with highest sum(trackPt) as the vertex of the "hard scatter" interaction
148  // (= first entry in vertex collection)
149  const reco::Vertex* hardScatterVertex = ( vertices->size() >= 1 ) ?
150  &(vertices->front()) : 0;
151 
152  // get leptons
153  // (excluded from sum over PFCandidates when computing hadronic recoil)
154  int lId = 0;
155  bool lHasPhotons = false;
156  std::vector<mvaMEtUtilities::leptonInfo> leptonInfo;
157  for ( std::vector<edm::EDGetTokenT<edm::View<reco::Candidate> > >::const_iterator srcLeptons_i = srcLeptons_.begin();
158  srcLeptons_i != srcLeptons_.end(); ++srcLeptons_i ) {
160  evt.getByToken(*srcLeptons_i, leptons);
161  for ( CandidateView::const_iterator lepton1 = leptons->begin();
162  lepton1 != leptons->end(); ++lepton1 ) {
163  bool pMatch = false;
164  for ( std::vector<edm::EDGetTokenT<edm::View<reco::Candidate> > >::const_iterator srcLeptons_j = srcLeptons_.begin();
165  srcLeptons_j != srcLeptons_.end(); ++srcLeptons_j ) {
167  evt.getByToken(*srcLeptons_j, leptons2);
168  for ( CandidateView::const_iterator lepton2 = leptons2->begin();
169  lepton2 != leptons2->end(); ++lepton2 ) {
170  if(&(*lepton1) == &(*lepton2)) { continue; }
171  if(deltaR2(lepton1->p4(),lepton2->p4()) < dR2Max) { pMatch = true; }
172  if(pMatch && !istau(&(*lepton1)) && istau(&(*lepton2))) { pMatch = false; }
173  if(pMatch && ( (istau(&(*lepton1)) && istau(&(*lepton2))) || (!istau(&(*lepton1)) && !istau(&(*lepton2))))
174  && lepton1->pt() > lepton2->pt()) { pMatch = false; }
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) { pMatch = true; break; }
179  }
180  }
181  if(pMatch) break;
182  }
183  if(pMatch) break;
184  }
185  if(pMatch) continue;
186  mvaMEtUtilities::leptonInfo pLeptonInfo;
187  pLeptonInfo.p4_ = lepton1->p4();
188  pLeptonInfo.chargedFrac_ = chargedFrac(&(*lepton1),*pfCandidates,hardScatterVertex);
189  leptonInfo.push_back(pLeptonInfo);
190  if(lepton1->isPhoton()) { lHasPhotons = true; }
191  }
192  lId++;
193  }
194  //if(lNMu == 2) std::cout << "=====> Di Muon Cand =======>" << leptonInfo[0].p4_.pt() << " -- " << leptonInfo[1].p4_.pt() << std::endl;
195 
196  // get average energy density in the event
197  //edm::Handle<double> rho;
198  //evt.getByToken(srcRho_, rho);
199 
200  // initialize MVA MET algorithm
201  // (this will load the BDTs, stored as GBRForrest objects;
202  // either in input ROOT files or in SQL-lite files/the Conditions Database)
203  if ( !mvaMEtAlgo_isInitialized_ ) {
206  }
207 
208  // reconstruct "standard" particle-flow missing Et
209  // MM cahnged needed in 72X, need to check resutls are consistent with 53X
210  //53X
211  //CommonMETData pfMEt_data = metAlgo_.run(pfCandidates_view, globalThreshold_);
212  //reco::PFMET pfMEt = pfMEtSpecificAlgo_.addInfo(pfCandidates_view, pfMEt_data);
213 
214  //72X
215  CommonMETData pfMEt_data = metAlgo_.run( (*pfCandidates_view), globalThreshold_);
216  SpecificPFMETData specificPfMET = pfMEtSpecificAlgo_.run( (*pfCandidates_view) );
217  const reco::Candidate::LorentzVector p4( pfMEt_data.mex, pfMEt_data.mey, 0.0, pfMEt_data.met);
218  const reco::Candidate::Point vtx(0.0, 0.0, 0.0 );
219  reco::PFMET pfMEt(specificPfMET,pfMEt_data.sumet, p4, vtx);
220  reco::Candidate::LorentzVector pfMEtP4_original = pfMEt.p4();
221 
222  // compute objects specific to MVA based MET reconstruction
223  std::vector<mvaMEtUtilities::pfCandInfo> pfCandidateInfo = computePFCandidateInfo(*pfCandidates, hardScatterVertex);
224  std::vector<mvaMEtUtilities::JetInfo> jetInfo = computeJetInfo(*uncorrJets, *corrJets, *vertices, hardScatterVertex, *corrector,evt,es,leptonInfo,pfCandidateInfo);
225  std::vector<reco::Vertex::Point> vertexInfo = computeVertexInfo(*vertices);
226 
227  // compute MVA based MET and estimate of its uncertainty
228  mvaMEtAlgo_.setInput(leptonInfo, jetInfo, pfCandidateInfo, vertexInfo);
229  mvaMEtAlgo_.setHasPhotons(lHasPhotons);
231  pfMEt.setP4(mvaMEtAlgo_.getMEt());
233 
234 
235  LogDebug("produce")
236  << "<PFMETProducerMVA::produce>:" << std::endl
237  << "Run: " << evt.id().run() << ", LS: " << evt.luminosityBlock() << ", Event: " << evt.id().event() << std::endl
238  << " PFMET: Pt = " << pfMEtP4_original.pt() << ", phi = " << pfMEtP4_original.phi() << " "
239  << "(Px = " << pfMEtP4_original.px() << ", Py = " << pfMEtP4_original.py() << ")" << std::endl
240  << " MVA MET: Pt = " << pfMEt.pt() << " phi = " << pfMEt.phi() << " (Px = " << pfMEt.px() << ", Py = " << pfMEt.py() << ")" << std::endl
241  << " Cov:" << std::endl
242  <<(mvaMEtAlgo_.getMEtCov())(0,0)<<" "<<(mvaMEtAlgo_.getMEtCov())(0,1)<<std::endl
243  <<(mvaMEtAlgo_.getMEtCov())(1,0)<<" "<<(mvaMEtAlgo_.getMEtCov())(1,1)<<std::endl << std::endl;
244  //mvaMEtAlgo_.print(std::cout);
245 
246  // add PFMET object to the event
247  std::auto_ptr<reco::PFMETCollection> pfMEtCollection(new reco::PFMETCollection());
248  pfMEtCollection->push_back(pfMEt);
249  evt.put(pfMEtCollection);
250 }
251 
252 std::vector<mvaMEtUtilities::JetInfo> PFMETProducerMVA::computeJetInfo(const reco::PFJetCollection& uncorrJets,
253  const reco::PFJetCollection& corrJets,
254  const reco::VertexCollection& vertices,
255  const reco::Vertex* hardScatterVertex,
256  const JetCorrector &iCorrector,edm::Event &iEvent,const edm::EventSetup &iSetup,
257  std::vector<mvaMEtUtilities::leptonInfo> &iLeptons,std::vector<mvaMEtUtilities::pfCandInfo> &iCands)
258 {
259 
260  const L1FastjetCorrector* lCorrector = dynamic_cast<const L1FastjetCorrector*>(&iCorrector);
261  std::vector<mvaMEtUtilities::JetInfo> retVal;
262  for ( reco::PFJetCollection::const_iterator uncorrJet = uncorrJets.begin();
263  uncorrJet != uncorrJets.end(); ++uncorrJet ) {
264  //int pIndex = uncorrJet-uncorrJets.begin();
265  //edm::RefToBase<reco::Jet> jetRef(edm::Ref<PFJetCollection>(&uncorrJets,pIndex));
266  for ( reco::PFJetCollection::const_iterator corrJet = corrJets.begin();
267  corrJet != corrJets.end(); ++corrJet ) {
268  // match corrected and uncorrected jets
269  if ( uncorrJet->jetArea() != corrJet->jetArea() ) continue;
270  if ( deltaR2(corrJet->p4(),uncorrJet->p4()) > dR2Min ) continue;
271 
272  // check that jet passes loose PFJet id.
273  //bool passesLooseJetId = (*looseJetIdAlgo_)(*corrJet);
274  //if ( !passesLooseJetId ) continue;
275  if(!passPFLooseId(&(*uncorrJet))) continue;
276 
277  // compute jet energy correction factor
278  // (= ratio of corrected/uncorrected jet Pt)
279  double jetEnCorrFactor = corrJet->pt()/uncorrJet->pt();
280  mvaMEtUtilities::JetInfo jetInfo;
281 
282  // PH: apply jet energy corrections for all Jets ignoring recommendations
283  jetInfo.p4_ = corrJet->p4();
284  double lType1Corr = 0;
285  if(useType1_) { //Compute the type 1 correction ===> This code is crap
286  double pCorr = lCorrector->correction(*uncorrJet,iEvent,iSetup); //Does not work in 42X
287  lType1Corr = (corrJet->pt()-pCorr*uncorrJet->pt());
288  TLorentzVector pVec; pVec.SetPtEtaPhiM(lType1Corr,0,corrJet->phi(),0);
289  reco::Candidate::LorentzVector pType1Corr; pType1Corr.SetCoordinates(pVec.Px(),pVec.Py(),pVec.Pz(),pVec.E());
290  //Filter to leptons
291  bool pOnLepton = false;
292  for(unsigned int i0 = 0; i0 < iLeptons.size(); i0++) if(deltaR2(iLeptons[i0].p4_,corrJet->p4()) < dR2Max) {pOnLepton = true; break;}
293  //Add it to PF Collection
294  if(corrJet->pt() > 10 && !pOnLepton) {
295  mvaMEtUtilities::pfCandInfo pfCandidateInfo;
296  pfCandidateInfo.p4_ = pType1Corr;
297  pfCandidateInfo.dZ_ = -999;
298  iCands.push_back(pfCandidateInfo);
299  }
300  //Scale
301  lType1Corr = (pCorr*uncorrJet->pt()-uncorrJet->pt());
302  lType1Corr /=corrJet->pt();
303  }
304 
305  // check that jet Pt used to compute MVA based jet id. is above threshold
306  if ( !(jetInfo.p4_.pt() > minCorrJetPt_) ) continue;
307  jetInfo.mva_ = mvaJetIdAlgo_.computeIdVariables(&(*corrJet), jetEnCorrFactor, hardScatterVertex, vertices, true).mva();
308  jetInfo.neutralEnFrac_ = (uncorrJet->neutralEmEnergy() + uncorrJet->neutralHadronEnergy())/uncorrJet->energy();
309  if(useType1_) jetInfo.neutralEnFrac_ -= lType1Corr*jetInfo.neutralEnFrac_;
310  retVal.push_back(jetInfo);
311  break;
312  }
313  }
314  return retVal;
315 }
316 
318  const reco::Vertex* hardScatterVertex)
319 {
320  std::vector<mvaMEtUtilities::pfCandInfo> retVal;
321  for ( reco::PFCandidateCollection::const_iterator pfCandidate = pfCandidates.begin();
322  pfCandidate != pfCandidates.end(); ++pfCandidate ) {
323  double dZ = -999.; // PH: If no vertex is reconstructed in the event
324  // or PFCandidate has no track, set dZ to -999
325  if ( hardScatterVertex ) {
326  if ( pfCandidate->trackRef().isNonnull() ) dZ = std::abs(pfCandidate->trackRef()->dz(hardScatterVertex->position()));
327  else if ( pfCandidate->gsfTrackRef().isNonnull() ) dZ = std::abs(pfCandidate->gsfTrackRef()->dz(hardScatterVertex->position()));
328  }
329  mvaMEtUtilities::pfCandInfo pfCandidateInfo;
330  pfCandidateInfo.p4_ = pfCandidate->p4();
331  pfCandidateInfo.dZ_ = dZ;
332  retVal.push_back(pfCandidateInfo);
333  }
334  return retVal;
335 }
336 
337 std::vector<reco::Vertex::Point> PFMETProducerMVA::computeVertexInfo(const reco::VertexCollection& vertices)
338 {
339  std::vector<reco::Vertex::Point> retVal;
340  for ( reco::VertexCollection::const_iterator vertex = vertices.begin();
341  vertex != vertices.end(); ++vertex ) {
342  if(std::abs(vertex->z()) > 24.) continue;
343  if(vertex->ndof() < 4.) continue;
344  if(vertex->position().Rho() > 2.) continue;
345  retVal.push_back(vertex->position());
346  }
347  return retVal;
348 }
350  const reco::PFCandidateCollection& pfCandidates,const reco::Vertex* hardScatterVertex) {
351  if(iCand->isMuon()) {
352  return 1;
353  }
354  if(iCand->isElectron()) {
355  return 1.;
356  }
357  if(iCand->isPhoton() ) {return chargedFracInCone(iCand, pfCandidates,hardScatterVertex);}
358  double lPtTot = 0; double lPtCharged = 0;
359  const reco::PFTau *lPFTau = 0;
360  lPFTau = dynamic_cast<const reco::PFTau*>(iCand);//}
361  if(lPFTau != 0) {
362  for (UInt_t i0 = 0; i0 < lPFTau->signalPFCands().size(); i0++) {
363  lPtTot += (lPFTau->signalPFCands())[i0]->pt();
364  if((lPFTau->signalPFCands())[i0]->charge() == 0) continue;
365  lPtCharged += (lPFTau->signalPFCands())[i0]->pt();
366  }
367  }
368  else {
369  const pat::Tau *lPatPFTau = nullptr;
370  lPatPFTau = dynamic_cast<const pat::Tau*>(iCand);//}
371  if(lPatPFTau != nullptr) {
372  for (UInt_t i0 = 0; i0 < lPatPFTau->signalPFCands().size(); i0++) {
373  lPtTot += (lPatPFTau->signalPFCands())[i0]->pt();
374  if((lPatPFTau->signalPFCands())[i0]->charge() == 0) continue;
375  lPtCharged += (lPatPFTau->signalPFCands())[i0]->pt();
376  }
377  }
378  }
379  if(lPtTot == 0) lPtTot = 1.;
380  return lPtCharged/lPtTot;
381 }
382 //Return tau id by process of elimination
384  if(iCand->isMuon()) return false;
385  if(iCand->isElectron()) return false;
386  if(iCand->isPhoton()) return false;
387  return true;
388 }
390  if(iJet->energy()== 0) return false;
391  if(iJet->neutralHadronEnergy()/iJet->energy() > 0.99) return false;
392  if(iJet->neutralEmEnergy()/iJet->energy() > 0.99) return false;
393  if(iJet->nConstituents() < 2) return false;
394  if(iJet->chargedHadronEnergy()/iJet->energy() <= 0 && std::abs(iJet->eta()) < 2.4 ) return false;
395  if(iJet->chargedEmEnergy()/iJet->energy() > 0.99 && std::abs(iJet->eta()) < 2.4 ) return false;
396  if(iJet->chargedMultiplicity() < 1 && std::abs(iJet->eta()) < 2.4 ) return false;
397  return true;
398 }
399 
402  const reco::Vertex* hardScatterVertex,double iDRMax)
403 {
404 
405  double iDR2Max = iDRMax*iDRMax;
406  reco::Candidate::LorentzVector lVis(0,0,0,0);
407  for ( reco::PFCandidateCollection::const_iterator pfCandidate = pfCandidates.begin();
408  pfCandidate != pfCandidates.end(); ++pfCandidate ) {
409  if(deltaR2(iCand->p4(),pfCandidate->p4()) > iDR2Max) continue;
410  double dZ = -999.; // PH: If no vertex is reconstructed in the event
411  // or PFCandidate has no track, set dZ to -999
412  if ( hardScatterVertex ) {
413  if ( pfCandidate->trackRef().isNonnull() ) dZ = std::abs(pfCandidate->trackRef()->dz(hardScatterVertex->position()));
414  else if ( pfCandidate->gsfTrackRef().isNonnull() ) dZ = std::abs(pfCandidate->gsfTrackRef()->dz(hardScatterVertex->position()));
415  }
416  if(std::abs(dZ) > 0.1) continue;
417  lVis += pfCandidate->p4();
418  }
419  return lVis.pt()/iCand->pt();
420 }
421 
423 
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
PFMETAlgorithmMVA mvaMEtAlgo_
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
const double dR2Max
virtual double correction(const LorentzVector &fJet) const
apply correction using Jet information only
PFMETProducerMVA(const edm::ParameterSet &)
float chargedEmEnergy() const
chargedEmEnergy
Definition: PFJet.h:142
virtual float pt() const
transverse momentum
PFSpecificAlgo pfMEtSpecificAlgo_
void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
const float & mva() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual float phi() const
momentum azimuthal angle
std::vector< reco::Vertex::Point > computeVertexInfo(const reco::VertexCollection &)
PileupJetIdAlgo mvaJetIdAlgo_
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
Definition: MET.cc:157
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
virtual void setP4(const LorentzVector &p4)
set 4-momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
reco::Candidate::LorentzVector getMEt() const
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:155
const Point & position() const
position
Definition: Vertex.h:106
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
Definition: PFTau.cc:74
Jets made from PFObjects.
Definition: PFJet.h:21
float neutralEmEnergy() const
neutralEmEnergy
Definition: PFJet.h:150
const reco::METCovMatrix & getMEtCov() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
virtual bool isPhoton() const =0
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
virtual double energy() const
energy
reco::Candidate::LorentzVector p4_
bool istau(const reco::Candidate *iCand)
virtual float pt() const =0
transverse momentum
reco::Candidate::LorentzVector p4_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::View< reco::Candidate > > srcPFCandidatesView_
std::vector< mvaMEtUtilities::pfCandInfo > computePFCandidateInfo(const reco::PFCandidateCollection &, const reco::Vertex *)
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
reco::Candidate::LorentzVector p4_
bool passPFLooseId(const reco::PFJet *iJet)
tuple corrector
Definition: mvaPFMET_cff.py:50
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
edm::EDGetTokenT< reco::PFJetCollection > srcCorrJets_
std::vector< edm::InputTag > vInputTag
virtual float eta() const
momentum pseudorapidity
double p4[4]
Definition: TauolaWrapper.h:92
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::VertexCollection > srcVertices_
const double dPtMatch
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, bool calculateMva=false)
void initialize(const edm::EventSetup &)
MET made from Particle Flow Candidates.
Analysis-level tau class.
Definition: Tau.h:56
void setHasPhotons(bool hasPhotons)
SpecificPFMETData run(const edm::View< reco::Candidate > &pfCands)
double chargedFrac(const reco::Candidate *iCand, const reco::PFCandidateCollection &pfCandidates, const reco::Vertex *hardScatterVertex)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
virtual bool isMuon() const =0
double chargedFracInCone(const reco::Candidate *iCand, const reco::PFCandidateCollection &pfCandidates, const reco::Vertex *hardScatterVertex, double iDRMax=0.2)
virtual double px() const
x coordinate of momentum vector
const double dR2Min
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
edm::EDGetTokenT< edm::Handle< double > > srcRho_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
edm::EventID id() const
Definition: EventBase.h:56
std::vector< PFJet > PFJetCollection
collection of PFJet objects
virtual int nConstituents() const
of constituents
Definition: Jet.h:65
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
void setInput(const std::vector< mvaMEtUtilities::leptonInfo > &, const std::vector< mvaMEtUtilities::JetInfo > &, const std::vector< mvaMEtUtilities::pfCandInfo > &, const std::vector< reco::Vertex::Point > &)
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: PFJet.h:102
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
volatile std::atomic< bool > shutdown_flag false
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > srcLeptons_
edm::EDGetTokenT< reco::PFJetCollection > srcUncorrJets_
virtual bool isElectron() const =0
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
std::vector< mvaMEtUtilities::JetInfo > computeJetInfo(const reco::PFJetCollection &, const reco::PFJetCollection &, const reco::VertexCollection &, const reco::Vertex *, const JetCorrector &iCorr, edm::Event &iEvent, const edm::EventSetup &iSetup, std::vector< mvaMEtUtilities::leptonInfo > &iLeptons, std::vector< mvaMEtUtilities::pfCandInfo > &iCands)
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: PFJet.h:98
virtual double py() const
y coordinate of momentum vector
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector