CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
METAlgo Class Reference

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

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.

20 {}
METAlgo::~METAlgo ( )
virtual

Definition at line 26 of file METAlgo.cc.

26 {}

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(), alignCSCRings::e, reco::Candidate::energy(), reco::Candidate::et(), LaserDQM_cfg::input, CommonMETData::met, CommonMETData::mex, CommonMETData::mey, CommonMETData::mez, phi, CommonMETData::phi, reco::Candidate::phi(), funct::sin(), mathSSE::sqrt(), CommonMETData::sumet, reco::Candidate::theta(), and theta().

Referenced by cms::METProducer::produce().

42 {
43  double sum_et = 0.0;
44  double sum_ex = 0.0;
45  double sum_ey = 0.0;
46  double sum_ez = 0.0;
47  // Loop over Candidate Objects and calculate MET and related quantities
48  /*
49  CandidateCollection::const_iterator candidate;
50  for( candidate = input->begin(); candidate != input->end(); candidate++ )
51  */
52  for (unsigned int candidate_i = 0; candidate_i < input->size(); candidate_i++)
53  {
54  const Candidate *candidate = &((*input)[candidate_i]);
55  if( candidate->et() > globalThreshold )
56  {
57  double phi = candidate->phi();
58  double theta = candidate->theta();
59  double e = candidate->energy();
60  double et = e*sin(theta);
61  sum_ez += e*cos(theta);
62  sum_et += et;
63  sum_ex += et*cos(phi);
64  sum_ey += et*sin(phi);
65  }
66  }
67  met->mex = -sum_ex;
68  met->mey = -sum_ey;
69  met->mez = -sum_ez;
70  met->met = sqrt( sum_ex*sum_ex + sum_ey*sum_ey );
71  // cout << "MET = " << met->met << endl;
72  met->sumet = sum_et;
73  met->phi = atan2( -sum_ey, -sum_ex ); // since MET is now a candidate,
74 } // this is no longer needed
virtual double energy() const =0
energy
virtual double et() const =0
transverse energy
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
virtual double theta() const =0
momentum polar angle
T sqrt(T t)
Definition: SSEVec.h:46
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual double phi() const =0
momentum azimuthal angle
Definition: DDAxes.h:10