66 std::unordered_set<reco::CandidatePtr,ptr_hash> footprint;
69 for (
const auto& lep_i :
leptons ) {
70 for (
const auto& lep : lep_i->ptrs()) {
72 for (
unsigned int n = 0;
n < lep->numberOfSourceCandidatePtrs();
n++)
73 footprint.insert(lep->sourceCandidatePtr(
n));
78 std::vector<bool> cleanedJets(jets.
size(),
false);
83 auto iCleaned = cleanedJets.begin();
84 for (
const auto&
jet : jets) {
88 for (
unsigned int n = 0;
n <
jet.numberOfSourceCandidatePtrs();
n++) {
89 footprint.insert(
jet.sourceCandidatePtr(
n));
95 for(
size_t i = 0;
i< pfCandidates.
size(); ++
i) {
98 bool cleancand =
true;
99 if(footprint.find( pfCandidates.
ptrAt(
i) )==footprint.end()) {
102 for(
const auto& it : footprint) {
105 if((it.isNonnull()) && (it.isAvailable()) &&
120 iCleaned = cleanedJets.
begin();
121 for(
const auto&
jet : jets) {
124 if(!(*iCleaned++) )
continue;
153 double dpt = scale*jpt*sigmapt;
154 double dph = jpt*sigmaphi;
156 cov_xx += dpt*dpt*c*c + dph*dph*s*
s;
157 cov_xy += (dpt*dpt-dph*dph)*c*s;
158 cov_yy += dph*dph*c*c + dpt*dpt*s*
s;
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_
const_iterator begin() const
Abs< T >::type abs(const T &t)
std::vector< double > pjetParams_
std::vector< double > jetParams_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const_iterator end() const
JetParameters & setJetPt(float pt)
bool useDeltaRforFootprint_