#include <PFMETAlgo.h>
Public Member Functions | |
PFMETAlgo (const edm::ParameterSet &) | |
reco::MET | produce (const reco::PFCandidateCollection &pfCandidates) |
~PFMETAlgo () | |
Private Attributes | |
double | hfCalibFactor_ |
HF calibration factor (in 31X applied by PFProducer) | |
bool | verbose_ |
verbose ? |
Definition at line 31 of file PFMETAlgo.h.
PFMETAlgo::PFMETAlgo | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 18 of file PFMETAlgo.cc.
References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().
{ verbose_ = iConfig.getUntrackedParameter<bool>("verbose",false); hfCalibFactor_ = iConfig.getParameter<double>("hfCalibFactor"); }
PFMETAlgo::~PFMETAlgo | ( | ) |
Definition at line 31 of file PFMETAlgo.cc.
{ }
reco::MET PFMETAlgo::produce | ( | const reco::PFCandidateCollection & | pfCandidates | ) |
HF calibration factor (in 31X applied by PFProducer)
Definition at line 33 of file PFMETAlgo.cc.
References funct::cos(), gather_cfg::cout, reco::LeafCandidate::energy(), ExpressReco_HICollisions_FallBack::et, i, reco::PFCandidate::particleId(), reco::LeafCandidate::phi(), phi, funct::sin(), mathSSE::sqrt(), theta(), and reco::LeafCandidate::theta().
{ double sumEx = 0; double sumEy = 0; double sumEt = 0; for( unsigned i=0; i<pfCandidates.size(); i++ ) { const reco::PFCandidate& cand = pfCandidates[i]; double E = cand.energy(); if( cand.particleId()==PFCandidate::h_HF || cand.particleId()==PFCandidate::egamma_HF ) E *= hfCalibFactor_; double phi = cand.phi(); double cosphi = cos(phi); double sinphi = sin(phi); double theta = cand.theta(); double sintheta = sin(theta); double et = E*sintheta; double ex = et*cosphi; double ey = et*sinphi; sumEx += ex; sumEy += ey; sumEt += et; } double Et = sqrt( sumEx*sumEx + sumEy*sumEy); XYZTLorentzVector missingEt( -sumEx, -sumEy, 0, Et); if(verbose_) { cout<<"PFMETAlgo: mEx, mEy, mEt = " << missingEt.X() <<", " << missingEt.Y() <<", " << missingEt.T() <<endl; } XYZPoint vertex; // dummy vertex return MET(sumEt, missingEt, vertex); }
double pf2pat::PFMETAlgo::hfCalibFactor_ [private] |
HF calibration factor (in 31X applied by PFProducer)
Definition at line 43 of file PFMETAlgo.h.
bool pf2pat::PFMETAlgo::verbose_ [private] |
verbose ?
Definition at line 46 of file PFMETAlgo.h.