24 double dRmatch = cfgParams.
getParameter<
double>(
"dRMatch");
54 std::vector<reco::CandidatePtr> footprint;
58 lep_i !=
leptons.end(); ++lep_i ) {
61 for(
unsigned int n=0;
n < lep->numberOfSourceCandidatePtrs();
n++ ){
62 if( lep->sourceCandidatePtr(
n).isNonnull() and lep->sourceCandidatePtr(
n).isAvailable() ){
63 footprint.push_back(lep->sourceCandidatePtr(
n));
75 for(
unsigned int n=0;
n <
jet->numberOfSourceCandidatePtrs();
n++){
76 if(
jet->sourceCandidatePtr(
n).isNonnull() and
jet->sourceCandidatePtr(
n).isAvailable() ){
77 footprint.push_back(
jet->sourceCandidatePtr(
n));
86 cand != pfCandidates.
end(); ++cand){
89 bool cleancand =
true;
90 for(
unsigned int i=0;
i < footprint.size();
i++){
91 if( footprint[
i]->
p4() == cand->p4() ){
108 double jpt =
jet->pt();
109 double jeta =
jet->eta();
111 double c =
jet->px()/
jet->pt();
112 double s =
jet->py()/
jet->pt();
124 if( jpt > jetThreshold_ ){
128 if(feta<jetEtas_[0]) scale = jetParams_[0];
129 else if(feta<jetEtas_[1]) scale = jetParams_[1];
130 else if(feta<jetEtas_[2]) scale = jetParams_[2];
131 else if(feta<jetEtas_[3]) scale = jetParams_[3];
132 else scale = jetParams_[4];
135 double dpt = scale*jpt*sigmapt;
136 double dph = jpt*sigmaphi;
138 cov_xx += dpt*dpt*c*c + dph*dph*s*
s;
139 cov_xy += (dpt*dpt-dph*dph)*c*s;
140 cov_yy += dph*dph*c*c + dpt*dpt*s*
s;
156 cov_xx += pjetParams_[0]*pjetParams_[0] + pjetParams_[1]*pjetParams_[1]*sumPt;
157 cov_yy += pjetParams_[0]*pjetParams_[0] + pjetParams_[1]*pjetParams_[1]*sumPt;
172 double det = cov(0,0)*cov(1,1) - cov(0,1)*cov(1,0);
175 double ncov_xx = cov(1,1) / det;
176 double ncov_xy = -cov(0,1) / det;
177 double ncov_yy = cov(0,0) / det;
180 double sig = met.
px()*met.
px()*ncov_xx + 2*met.
px()*met.
py()*ncov_xy + met.
py()*met.
py()*ncov_yy;
190 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)
JetParameters & setRho(float rho)
Base class for all types of Jets.
ROOT::Math::SMatrix< double, 2 > METCovMatrix
std::vector< double > jetEtas_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
const_iterator begin() const
Abs< T >::type abs(const T &t)
virtual double py() const final
y coordinate of momentum vector
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
virtual double px() const final
x coordinate of momentum vector
const_iterator end() const
double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met) const
JetParameters & setJetPt(float pt)
reco::METCovMatrix getCovariance(const edm::View< reco::Jet > &jets, const std::vector< edm::Handle< reco::CandidateView > > &leptons, const edm::View< reco::Candidate > &pfCandidates, double rho, JME::JetResolution &resPtObj, JME::JetResolution &resPhiObj, JME::JetResolutionScaleFactor &resSFObj, bool isRealData)