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 double c =
jet.px() /
jet.pt();
123 double s =
jet.py() /
jet.pt();
135 if (
jpt > jetThreshold_) {
139 if (
feta < jetEtas_[0])
140 scale = jetParams_[0];
141 else if (
feta < jetEtas_[1])
142 scale = jetParams_[1];
143 else if (
feta < jetEtas_[2])
144 scale = jetParams_[2];
145 else if (
feta < jetEtas_[3])
146 scale = jetParams_[3];
148 scale = jetParams_[4];
152 double dph =
jpt * sigmaphi;
154 cov_xx += dpt * dpt *
c *
c + dph * dph *
s *
s;
155 cov_xy += (dpt * dpt - dph * dph) *
c *
s;
156 cov_yy += dph * dph *
c *
c + dpt * dpt *
s *
s;
169 cov_xx += pjetParams_[0] * pjetParams_[0] + pjetParams_[1] * pjetParams_[1] *
sumPtUnclustered;
170 cov_yy += pjetParams_[0] * pjetParams_[0] + pjetParams_[1] * pjetParams_[1] *
sumPtUnclustered;
183 double det = cov(0, 0) * cov(1, 1) - cov(0, 1) * cov(1, 0);
186 double ncov_xx = cov(1, 1) / det;
187 double ncov_xy = -cov(0, 1) / det;
188 double ncov_yy = cov(0, 0) / det;
191 double sig =
met.px() *
met.px() * ncov_xx + 2 *
met.px() *
met.py() * ncov_xy +
met.py() *
met.py() * ncov_yy;
198 for (
const auto& lep_i :
leptons) {
199 for (
const auto& lep : *lep_i) {