64 std::unordered_set<reco::CandidatePtr, ptr_hash> footprint;
67 for (
const auto& lep_i :
leptons) {
68 for (
const auto& lep : *lep_i) {
70 for (
unsigned int n = 0;
n < lep.numberOfSourceCandidatePtrs();
n++) {
71 if (lep.sourceCandidatePtr(
n).isNonnull() and lep.sourceCandidatePtr(
n).isAvailable()) {
72 footprint.insert(lep.sourceCandidatePtr(
n));
79 for (
const auto&
jet : jets) {
83 for (
unsigned int n = 0;
n <
jet.numberOfSourceCandidatePtrs();
n++) {
84 if (
jet.sourceCandidatePtr(
n).isNonnull() and
jet.sourceCandidatePtr(
n).isAvailable()) {
85 footprint.insert(
jet.sourceCandidatePtr(
n));
91 for (
size_t i = 0;
i < pfCandidates->
size(); ++
i) {
93 bool cleancand =
true;
94 if (footprint.find(pfCandidates->
ptrAt(
i)) == footprint.end()) {
96 for (
const auto& it : footprint) {
97 if ((it->p4() - (*pfCandidates)[
i].p4()).Et2() < 0.000025) {
104 sumPtUnclustered += (*pfCandidates)[
i].pt();
110 for (
const auto&
jet : jets) {
118 double c =
jet.px() /
jet.pt();
119 double s =
jet.py() /
jet.pt();
147 double dpt = scale * jpt * sigmapt;
148 double dph = jpt * sigmaphi;
150 cov_xx += dpt * dpt * c * c + dph * dph * s *
s;
151 cov_xy += (dpt * dpt - dph * dph) * c * s;
152 cov_yy += dph * dph * c * c + dpt * dpt * s *
s;
156 sumPtUnclustered += jpt;
161 if (sumPtUnclustered < 0)
162 sumPtUnclustered = 0;
bool cleanJet(const reco::Jet &jet, const std::vector< edm::Handle< reco::CandidateView > > &leptons)
float getResolution(const JetParameters ¶meters) const
JetParameters & setJetEta(float eta)
JetParameters & setRho(float rho)
Ptr< value_type > ptrAt(size_type i) const
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_
T const * product() const
JetParameters & setJetPt(float pt)