88 if (jetP4.pt() >= 10. && jetP4.pt() < 20.)
90 if (jetP4.pt() >= 20. && jetP4.pt() < 30.)
92 if (jetP4.pt() >= 30.)
103 return (mvaJetId >
mvaCut_[2][ptBin][etaBin]);
107 return jetP4(jets, 0);
111 return jetP4(jets, 1);
116 if (idx < jets.size()) {
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) {
126 if (
jet->p4().pt() > ptThreshold)
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)
144 if (
jet->p4().pt() > ptThreshold && !isOverlap)
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();
158 pfCandidate != pfCandidates.end();
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)
166 if ((!isOverlap && !invert) || (isOverlap &&
invert))
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();
217 bool passesMVAjetId =
passesMVA(object->p4(),
object->mva());
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_
const std::vector< reco::PUSubMETCandInfo > & getCleanedJets() const
double getLeptonsChSumMEX() const
double getLeptonsChSumMEY() const
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_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
CommonMETData neutralJetPUSum_
CommonMETData pfCandChPUSum_
reco::Candidate::LorentzVector subleadJetP4(const std::vector< reco::PUSubMETCandInfo > &)
double getLeptonsSumMEX() const
Abs< T >::type abs(const T &t)
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)
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)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double getLeptonsSumMEY() const
CommonMETData computeRecoil(int metType)
T getParameter(std::string const &) const
CommonMETData computeCandSum(int compKey, double dZmax, int dZflag, bool iCharged, bool mvaPassFlag, const std::vector< reco::PUSubMETCandInfo > &objects)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
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_
int etaBin(const l1t::HGCalMulticluster *cl)