22 metData.
phi = atan2(metData.
mey, metData.
mex);
30 const std::vector<reco::Candidate::LorentzVector>&
leptons,
34 for (reco::PUSubMETCandInfoCollection::const_iterator
jet = jets.begin();
jet != jets.end(); ++
jet) {
35 bool isOverlap =
false;
36 for (std::vector<reco::Candidate::LorentzVector>::const_iterator lepton = leptons.begin(); lepton != leptons.end();
38 if (
deltaR2(
jet->p4(), *lepton) < dRoverlap * dRoverlap) {
43 if ((!isOverlap && !invert) || (isOverlap &&
invert))
44 retVal.push_back(*
jet);
57 double retVal_sumAbsPx = 0.;
58 double retVal_sumAbsPy = 0.;
60 for (reco::PUSubMETCandInfoCollection::const_iterator
cand = cands.begin();
cand != cands.end(); ++
cand) {
63 pFrac = (1 -
cand->chargedEnFrac());
65 retVal.
mex +=
cand->p4().px() * pFrac;
66 retVal.
mey +=
cand->p4().py() * pFrac;
72 sumAbsPx = retVal_sumAbsPx;
73 sumAbsPy = retVal_sumAbsPy;
83 const std::vector<reco::Candidate::LorentzVector>&
leptons,
90 for (reco::PUSubMETCandInfoCollection::const_iterator pfCandidate = pfCandidates.begin();
91 pfCandidate != pfCandidates.end();
93 bool isOverlap =
false;
94 for (std::vector<reco::Candidate::LorentzVector>::const_iterator lepton = leptons.begin(); lepton != leptons.end();
96 if (
deltaR2(pfCandidate->p4(), *lepton) < dRoverlap * dRoverlap) {
101 if ((!isOverlap && !invert) || (isOverlap &&
invert))
102 retVal.push_back(*pfCandidate);
114 for (reco::PUSubMETCandInfoCollection::const_iterator
cand = cands.begin();
cand != cands.end(); ++
cand) {
115 if (isCharged &&
cand->charge() == 0)
118 if (jetPt < minPt || jetPt > maxPt)
127 retVal.push_back(*
cand);
171 double retSumAbsPx = 0.;
172 double retSumAbsPy = 0.;
219 sumAbsPx = retSumAbsPx;
220 sumAbsPy = retSumAbsPy;
CommonMETData chHSPfcSum_
CommonMETData computeRecoil(int metType, double &sumAbsPx, double &sumAbsPy)
reco::PUSubMETCandInfoCollection cleanJets(const reco::PUSubMETCandInfoCollection &, const std::vector< reco::Candidate::LorentzVector > &, double, bool)
void computeAllSums(const reco::PUSubMETCandInfoCollection &jets, const reco::PUSubMETCandInfoCollection &pfCandidates)
Abs< T >::type abs(const T &t)
std::vector< reco::PUSubMETCandInfo > PUSubMETCandInfoCollection
Structure containing data common to all types of MET.
CommonMETData nUncPfcSum_
CommonMETData computeCandidateSum(const reco::PUSubMETCandInfoCollection &cands, bool neutralFracOnly, double &sumAbsPx, double &sumAbsPy)
reco::PUSubMETCandInfoCollection cleanPFCandidates(const reco::PUSubMETCandInfoCollection &, const std::vector< reco::Candidate::LorentzVector > &, double, bool)
CommonMETData chPUPfcSum_
reco::PUSubMETCandInfoCollection selectCandidates(const reco::PUSubMETCandInfoCollection &cands, double minPt, double maxPt, int type, bool isCharged, int isWithinJet)
void finalizeMEtData(CommonMETData &)