25 metData.
phi = atan2(metData.
mey, metData.
mex);
33 const std::vector<reco::Candidate::LorentzVector>&
leptons,
34 double dRoverlap,
bool invert) {
36 for ( reco::PUSubMETCandInfoCollection::const_iterator
jet = jets.begin();
37 jet != jets.end(); ++
jet ) {
38 bool isOverlap =
false;
39 for ( std::vector<reco::Candidate::LorentzVector>::const_iterator lepton = leptons.begin();
40 lepton != leptons.end(); ++lepton ) {
41 if (
deltaR2(
jet->p4(), *lepton) < dRoverlap*dRoverlap ) {
46 if ( (!isOverlap && !invert) || (isOverlap &&
invert) ) retVal.push_back(*
jet);
54 bool neutralFracOnly,
double& sumAbsPx,
double& sumAbsPy) {
60 double retVal_sumAbsPx = 0.;
61 double retVal_sumAbsPy = 0.;
63 for ( reco::PUSubMETCandInfoCollection::const_iterator cand = cands.begin();
64 cand != cands.end(); ++cand ) {
67 if(neutralFracOnly) pFrac = (1-cand->chargedEnFrac() );
69 retVal.
mex += cand->p4().px()*pFrac;
70 retVal.
mey += cand->p4().py()*pFrac;
71 retVal.
sumet += cand->p4().pt()*pFrac;
72 retVal_sumAbsPx +=
std::abs(cand->p4().px());
73 retVal_sumAbsPy +=
std::abs(cand->p4().py());
76 sumAbsPx = retVal_sumAbsPx;
77 sumAbsPy = retVal_sumAbsPy;
87 const std::vector<reco::Candidate::LorentzVector>&
leptons,
88 double dRoverlap,
bool invert) {
93 for ( reco::PUSubMETCandInfoCollection::const_iterator pfCandidate = pfCandidates.begin();
94 pfCandidate != pfCandidates.end(); ++pfCandidate ) {
95 bool isOverlap =
false;
96 for ( std::vector<reco::Candidate::LorentzVector>::const_iterator lepton = leptons.begin();
97 lepton != leptons.end(); ++lepton ) {
98 if (
deltaR2(pfCandidate->p4(), *lepton) < dRoverlap*dRoverlap ) {
103 if ( (!isOverlap && !invert) || (isOverlap &&
invert) ) retVal.push_back(*pfCandidate);
112 bool isCharged,
int isWithinJet) {
114 for ( reco::PUSubMETCandInfoCollection::const_iterator cand = cands.begin();
115 cand != cands.end(); ++cand ) {
117 if( isCharged && cand->charge()==0)
continue;
118 double jetPt = cand->p4().pt();
119 if( jetPt < minPt || jetPt > maxPt )
continue;
125 retVal.push_back(*cand);
177 double retSumAbsPx = 0.;
178 double retSumAbsPy = 0.;
225 sumAbsPx = retSumAbsPx;
226 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)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
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)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
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 &)