19 #include <unordered_set> 24 if (
k.refCore().isTransient())
25 return (
unsigned long)
k.refCore().productPtr() ^
k.key();
27 return k.refCore().id().processIndex() ^
k.refCore().id().productIndex() ^
k.key();
35 double dRmatch = cfgParams.
getParameter<
double>(
"dRMatch");
65 std::unordered_set<reco::CandidatePtr, ptr_hash> footprint;
68 for (
const auto& lep_i :
leptons) {
69 for (
const auto& lep : lep_i->ptrs()) {
71 for (
unsigned int n = 0;
n < lep->numberOfSourceCandidatePtrs();
n++)
72 footprint.insert(lep->sourceCandidatePtr(
n));
77 std::vector<bool> cleanedJets(
jets.size(),
false);
82 auto iCleaned = cleanedJets.begin();
87 for (
unsigned int n = 0;
n <
jet.numberOfSourceCandidatePtrs();
n++) {
88 footprint.insert(
jet.sourceCandidatePtr(
n));
95 bool cleancand =
true;
96 if (footprint.find(
pfCandidates.ptrAt(
i)) == footprint.end()) {
99 for (
const auto& it : footprint) {
113 iCleaned = cleanedJets.begin();
122 if (
jpt > jetThreshold_) {
140 if (
feta < jetEtas_[0])
141 scale = jetParams_[0];
142 else if (
feta < jetEtas_[1])
143 scale = jetParams_[1];
144 else if (
feta < jetEtas_[2])
145 scale = jetParams_[2];
146 else if (
feta < jetEtas_[3])
147 scale = jetParams_[3];
149 scale = jetParams_[4];
153 double dph =
jpt * sigmaphi;
155 cov_xx += dpt * dpt *
c *
c + dph * dph *
s *
s;
156 cov_xy += (dpt * dpt - dph * dph) *
c *
s;
157 cov_yy += dph * dph *
c *
c + dpt * dpt *
s *
s;
170 double pseudoJetCov = pjetParams_[0] * pjetParams_[0] + pjetParams_[1] * pjetParams_[1] *
sumPtUnclustered;
171 cov_xx += pseudoJetCov;
172 cov_yy += pseudoJetCov;
185 double det = cov(0, 0) * cov(1, 1) - cov(0, 1) * cov(1, 0);
188 double ncov_xx = cov(1, 1) / det;
189 double ncov_xy = -cov(0, 1) / det;
190 double ncov_yy = cov(0, 0) / det;
193 double sig =
met.px() *
met.px() * ncov_xx + 2 *
met.px() *
met.py() * ncov_xy +
met.py() *
met.py() * ncov_yy;
200 for (
const auto& lep_i :
leptons) {
201 for (
const auto& lep : *lep_i) {
bool cleanJet(const reco::Jet &jet, const std::vector< edm::Handle< reco::CandidateView > > &leptons)
T getParameter(std::string const &) const
reco::METCovMatrix getCovariance(const edm::View< reco::Jet > &jets, const std::vector< edm::Handle< reco::CandidateView > > &leptons, const edm::Handle< edm::View< reco::Candidate > > &pfCandidates, double rho, JME::JetResolution &resPtObj, JME::JetResolution &resPhiObj, JME::JetResolutionScaleFactor &resSFObj, bool isRealData, double &sumPtUnclustered, edm::ValueMap< float > const *weights=nullptr)
static double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met)
Base class for all types of Jets.
ROOT::Math::SMatrix< double, 2 > METCovMatrix
std::vector< double > jetEtas_
Abs< T >::type abs(const T &t)
std::vector< double > pjetParams_
std::vector< double > jetParams_
METSignificance(const edm::ParameterSet &iConfig)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
float getResolution(const JetParameters ¶meters) const