78 dzCut_ =
cfg.getParameter<
double>(
"dZcut");
79 ptThreshold_ = (
cfg.exists(
"ptThreshold")) ?
cfg.getParameter<
int>(
"ptThreshold") : -1000;
92 if (
jetP4.pt() >= 30.)
117 std::vector<reco::PUSubMETCandInfo> jets_sorted =
jets;
118 std::sort(jets_sorted.rbegin(), jets_sorted.rend());
119 retVal = jets_sorted[
idx].p4();
125 for (std::vector<reco::PUSubMETCandInfo>::const_iterator
jet =
jets.begin();
jet !=
jets.end(); ++
jet) {
132 const std::vector<reco::PUSubMETCandInfo>&
leptons,
135 double dR2match = dRmatch * dRmatch;
136 std::vector<reco::PUSubMETCandInfo> retVal;
137 for (std::vector<reco::PUSubMETCandInfo>::const_iterator
jet =
jets.begin();
jet !=
jets.end(); ++
jet) {
138 bool isOverlap =
false;
139 for (std::vector<reco::PUSubMETCandInfo>::const_iterator lepton =
leptons.begin(); lepton !=
leptons.end();
141 if (
deltaR2(
jet->p4(), lepton->p4()) < dR2match)
145 retVal.push_back(*
jet);
151 const std::vector<reco::PUSubMETCandInfo>&
pfCandidates,
152 const std::vector<reco::PUSubMETCandInfo>&
leptons,
155 double dR2match = dRmatch * dRmatch;
156 std::vector<reco::PUSubMETCandInfo> retVal;
157 for (std::vector<reco::PUSubMETCandInfo>::const_iterator pfCandidate =
pfCandidates.begin();
160 bool isOverlap =
false;
161 for (std::vector<reco::PUSubMETCandInfo>::const_iterator lepton =
leptons.begin(); lepton !=
leptons.end();
163 if (
deltaR2(pfCandidate->p4(), lepton->p4()) < dR2match)
167 retVal.push_back(*pfCandidate);
174 metData.
phi = atan2(metData.
mey, metData.
mex);
182 const std::vector<reco::PUSubMETCandInfo>&
objects) {
188 for (std::vector<reco::PUSubMETCandInfo>::const_iterator
object =
objects.begin();
object !=
objects.end();
201 if (
object->dZ() < 0. && dZflag != 2)
203 if (
object->dZ() > dZmax && dZflag == 0)
205 if (
object->dZ() < dZmax && dZflag == 1)
212 pFrac =
object->chargedEnFrac();
219 if (passesMVAjetId && !mvaPassFlag)
221 if (!passesMVAjetId && mvaPassFlag)
224 pFrac = 1 -
object->chargedEnFrac();
227 retVal.
mex +=
object->p4().px() * pFrac;
228 retVal.
mey +=
object->p4().py() * pFrac;
229 retVal.
sumet +=
object->p4().pt() * pFrac;
283 const std::vector<reco::PUSubMETCandInfo>&
leptons,
284 const std::vector<reco::PUSubMETCandInfo>&
pfCandidates) {
virtual ~MvaMEtUtilities()
CommonMETData leptonsChSum_
void finalize(CommonMETData &metData)
unsigned numJetsAboveThreshold(const std::vector< reco::PUSubMETCandInfo > &, double)
std::vector< reco::PUSubMETCandInfo > cleanedJets_
CommonMETData neutralJetHSSum_
bool passesMVA(const reco::Candidate::LorentzVector &, double)
CommonMETData leptonsSum_
double getLeptonsChSumMEX() const
CommonMETData neutralJetPUSum_
CommonMETData pfCandChPUSum_
reco::Candidate::LorentzVector subleadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
Abs< T >::type abs(const T &t)
double getLeptonsSumMEY() const
Structure containing data common to all types of MET.
void computeAllSums(const std::vector< reco::PUSubMETCandInfo > &jets, const std::vector< reco::PUSubMETCandInfo > &leptons, const std::vector< reco::PUSubMETCandInfo > &pfCandidates)
MvaMEtUtilities(const edm::ParameterSet &cfg)
const std::vector< reco::PUSubMETCandInfo > & getCleanedJets() const
reco::Candidate::LorentzVector leadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
std::vector< reco::PUSubMETCandInfo > cleanPFCands(const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, double, bool)
double getLeptonsSumMEX() const
CommonMETData computeRecoil(int metType)
CommonMETData computeCandSum(int compKey, double dZmax, int dZflag, bool iCharged, bool mvaPassFlag, const std::vector< reco::PUSubMETCandInfo > &objects)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double getLeptonsChSumMEY() const
std::vector< reco::PUSubMETCandInfo > cleanJets(const std::vector< reco::PUSubMETCandInfo > &, const std::vector< reco::PUSubMETCandInfo > &, double, double)
reco::Candidate::LorentzVector jetP4(const std::vector< reco::PUSubMETCandInfo > &, unsigned)
CommonMETData pfCandChHSSum_