28 double dRmatch = cfgParams.
getParameter<
double>(
"dRMatch");
62 std::vector<reco::CandidatePtr> footprint;
66 lep_i !=
leptons.end(); ++lep_i ) {
69 for(
unsigned int n=0;
n < lep->numberOfSourceCandidatePtrs();
n++ ){
70 if( lep->sourceCandidatePtr(
n).isNonnull() and lep->sourceCandidatePtr(
n).isAvailable() ){
71 footprint.push_back(lep->sourceCandidatePtr(
n));
83 for(
unsigned int n=0;
n <
jet->numberOfSourceCandidatePtrs();
n++){
84 if(
jet->sourceCandidatePtr(
n).isNonnull() and
jet->sourceCandidatePtr(
n).isAvailable() ){
85 footprint.push_back(
jet->sourceCandidatePtr(
n));
94 cand != pfCandidates.
end(); ++cand){
97 bool cleancand =
true;
98 for(
unsigned int i=0;
i < footprint.size();
i++){
99 if( footprint[
i]->
p4() == cand->p4() ){
116 double jpt =
jet->pt();
117 double jeta =
jet->eta();
119 double c =
jet->px()/
jet->pt();
120 double s =
jet->py()/
jet->pt();
123 double jeta_res = (
std::abs(jeta) < 9.9) ? jeta : 9.89;
124 double sigmapt = ptRes_->parameterEtaEval(
"sigma",jeta_res,jpt);
125 double sigmaphi = phiRes_->parameterEtaEval(
"sigma",jeta_res,jpt);
128 if( jpt > jetThreshold_ ){
132 if(feta<jetEtas_[0]) scale = jetParams_[0];
133 else if(feta<jetEtas_[1]) scale = jetParams_[1];
134 else if(feta<jetEtas_[2]) scale = jetParams_[2];
135 else if(feta<jetEtas_[3]) scale = jetParams_[3];
136 else scale = jetParams_[4];
138 double dpt = scale*jpt*sigmapt;
139 double dph = jpt*sigmaphi;
141 cov_xx += dpt*dpt*c*c + dph*dph*s*
s;
142 cov_xy += (dpt*dpt-dph*dph)*c*s;
143 cov_yy += dph*dph*c*c + dpt*dpt*s*
s;
159 cov_xx += pjetParams_[0]*pjetParams_[0] + pjetParams_[1]*pjetParams_[1]*sumPt;
160 cov_yy += pjetParams_[0]*pjetParams_[0] + pjetParams_[1]*pjetParams_[1]*sumPt;
175 double det = cov(0,0)*cov(1,1) - cov(0,1)*cov(1,0);
178 double ncov_xx = cov(1,1) / det;
179 double ncov_xy = -cov(0,1) / det;
180 double ncov_yy = cov(0,0) / det;
183 double sig = met.
px()*met.
px()*ncov_xx + 2*met.
px()*met.
py()*ncov_xy + met.
py()*met.
py()*ncov_yy;
193 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)
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)
double deltaR2(const T1 &t1, const T2 &t2)
std::vector< double > pjetParams_
std::vector< double > jetParams_
METSignificance(const edm::ParameterSet &iConfig)
reco::METCovMatrix getCovariance(const edm::View< reco::Jet > &jets, const std::vector< edm::Handle< reco::CandidateView > > &leptons, const edm::View< reco::Candidate > &pfCandidates)
virtual double px() const
x coordinate of momentum vector
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met) const
std::string fullPath() const
virtual double py() const
y coordinate of momentum vector