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