CMS 3D CMS Logo

METAlgo Class Reference

Calculates MET for given input CaloTower collection. More...

#include <RecoMET/METAlgorithms/interface/METAlgo.h>

List of all members.

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 ()


Detailed Description

Calculates MET for given input CaloTower collection.

Does corrections based on supplied parameters.

Author:
M. Schmitt, R. Cavanaugh, The University of Florida
Version:
1st Version May 14, 2005

Definition at line 21 of file METAlgo.h.


Member Typedef Documentation

typedef std::vector<const reco::Candidate> METAlgo::InputCollection

Definition at line 25 of file METAlgo.h.


Constructor & Destructor Documentation

METAlgo::METAlgo (  ) 

Definition at line 20 of file METAlgo.cc.

00020 {}

METAlgo::~METAlgo (  )  [virtual]

Definition at line 26 of file METAlgo.cc.

00026 {}


Member Function Documentation

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:14 2009 for CMSSW by  doxygen 1.5.4