#include <RecoMET/METAlgorithms/interface/METAlgo.h>
Public Types | |
typedef std::vector< const reco::Candidate > | InputCollection |
Public Member Functions | |
METAlgo () | |
virtual void | run (edm::Handle< edm::View< reco::Candidate > >, CommonMETData *, double) |
virtual | ~METAlgo () |
Does corrections based on supplied parameters.
Definition at line 21 of file METAlgo.h.
typedef std::vector<const reco::Candidate> METAlgo::InputCollection |
METAlgo::METAlgo | ( | ) |
METAlgo::~METAlgo | ( | ) | [virtual] |
void METAlgo::run | ( | edm::Handle< edm::View< reco::Candidate > > | input, | |
CommonMETData * | met, | |||
double | globalThreshold | |||
) | [virtual] |
Definition at line 41 of file METAlgo.cc.
References funct::cos(), e, reco::Particle::energy(), reco::Particle::et(), iggi_31X_cfg::input, CommonMETData::met, CommonMETData::mex, CommonMETData::mey, CommonMETData::mez, phi, reco::Particle::phi(), CommonMETData::phi, funct::sin(), funct::sqrt(), CommonMETData::sumet, theta, and reco::Particle::theta().
00042 { 00043 double sum_et = 0.0; 00044 double sum_ex = 0.0; 00045 double sum_ey = 0.0; 00046 double sum_ez = 0.0; 00047 // Loop over Candidate Objects and calculate MET and related quantities 00048 /* 00049 CandidateCollection::const_iterator candidate; 00050 for( candidate = input->begin(); candidate != input->end(); candidate++ ) 00051 */ 00052 for (unsigned int candidate_i = 0; candidate_i < input->size(); candidate_i++) 00053 { 00054 const Candidate *candidate = &((*input)[candidate_i]); 00055 if( candidate->et() > globalThreshold ) 00056 { 00057 double phi = candidate->phi(); 00058 double theta = candidate->theta(); 00059 double e = candidate->energy(); 00060 double et = e*sin(theta); 00061 sum_ez += e*cos(theta); 00062 sum_et += et; 00063 sum_ex += et*cos(phi); 00064 sum_ey += et*sin(phi); 00065 } 00066 } 00067 met->mex = -sum_ex; 00068 met->mey = -sum_ey; 00069 met->mez = -sum_ez; 00070 met->met = sqrt( sum_ex*sum_ex + sum_ey*sum_ey ); 00071 // cout << "MET = " << met->met << endl; 00072 met->sumet = sum_et; 00073 met->phi = atan2( -sum_ey, -sum_ex ); // since MET is now a candidate, 00074 } // this is no longer needed