58 std::set<reco::CandidatePtr> footprint;
62 lep_i !=
leptons.end(); ++lep_i ) {
65 for(
unsigned int n=0;
n < lep->numberOfSourceCandidatePtrs();
n++ ){
66 if( lep->sourceCandidatePtr(
n).isNonnull() and lep->sourceCandidatePtr(
n).isAvailable() ){
67 footprint.insert(lep->sourceCandidatePtr(
n));
78 for(
unsigned int n=0;
n <
jet->numberOfSourceCandidatePtrs();
n++){
79 if(
jet->sourceCandidatePtr(
n).isNonnull() and
jet->sourceCandidatePtr(
n).isAvailable() ){
81 footprint.insert(
jet->sourceCandidatePtr(
n));
89 for(
size_t i = 0;
i< pfCandidates->
size(); ++
i) {
92 bool cleancand =
true;
93 if(footprint.find( pfCandidates->
ptrAt(
i) )==footprint.end()) {
96 for( std::set<reco::CandidatePtr>::const_iterator it=footprint.begin();it!=footprint.end();it++) {
97 if( ((*it)->p4()-(*pfCandidates)[
i].p4()).Et2()<0.000025 ){
104 sumPt += (*pfCandidates)[
i].pt();
118 double c =
jet->px()/
jet->pt();
119 double s =
jet->py()/
jet->pt();
142 double dpt = scale*jpt*sigmapt;
143 double dph = jpt*sigmaphi;
145 cov_xx += dpt*dpt*c*c + dph*dph*s*
s;
146 cov_xy += (dpt*dpt-dph*dph)*c*s;
147 cov_yy += dph*dph*c*c + dpt*dpt*s*
s;
178 double det = cov(0,0)*cov(1,1) - cov(0,1)*cov(1,0);
181 double ncov_xx = cov(1,1) / det;
182 double ncov_xy = -cov(0,1) / det;
183 double ncov_yy = cov(0,0) / det;
186 double sig = met.
px()*met.
px()*ncov_xx + 2*met.
px()*met.
py()*ncov_xy + met.
py()*met.
py()*ncov_yy;
196 lep_i !=
leptons.end(); ++lep_i ) {
T getParameter(std::string const &) const
bool cleanJet(const reco::Jet &jet, const std::vector< edm::Handle< reco::CandidateView > > &leptons)
float getResolution(const JetParameters ¶meters) const
JetParameters & setJetEta(float eta)
static double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met)
JetParameters & setRho(float rho)
Ptr< value_type > ptrAt(size_type i) const
Base class for all types of Jets.
ROOT::Math::SMatrix< double, 2 > METCovMatrix
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)
std::vector< double > jetEtas_
const_iterator begin() const
virtual double px() const final
x coordinate of momentum vector
Abs< T >::type abs(const T &t)
std::vector< double > pjetParams_
std::vector< double > jetParams_
METSignificance(const edm::ParameterSet &iConfig)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
JetParameters & setJetPt(float pt)
virtual double py() const final
y coordinate of momentum vector