CMS 3D CMS Logo

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

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

Public Member Functions

 METAlgo ()
 
virtual CommonMETData run (edm::Handle< edm::View< reco::Candidate > > candidates, double globalThreshold=0.0)
 
virtual void run (edm::Handle< edm::View< reco::Candidate > > candidates, CommonMETData *met, double globalThreshold=0.0)
 
virtual ~METAlgo ()
 

Detailed Description

Description: Calculates MET for given input

Implementation: [Notes on implementation]

Definition at line 25 of file METAlgo.h.

Constructor & Destructor Documentation

METAlgo::METAlgo ( )
inline

Definition at line 28 of file METAlgo.h.

28 {}
virtual METAlgo::~METAlgo ( )
inlinevirtual

Definition at line 29 of file METAlgo.h.

29 {}

Member Function Documentation

CommonMETData METAlgo::run ( edm::Handle< edm::View< reco::Candidate > >  candidates,
double  globalThreshold = 0.0 
)
virtual

Definition at line 16 of file METAlgo.cc.

References CaloMET_cfi::met.

Referenced by cms::METProducer::produce_CaloMET(), cms::METProducer::produce_else(), cms::METProducer::produce_PFClusterMET(), and cms::METProducer::produce_PFMET().

17 {
19  run(candidates, &met, globalThreshold);
20  return met;
21 }
virtual CommonMETData run(edm::Handle< edm::View< reco::Candidate > > candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
Structure containing data common to all types of MET.
Definition: CommonMETData.h:22
void METAlgo::run ( edm::Handle< edm::View< reco::Candidate > >  candidates,
CommonMETData met,
double  globalThreshold = 0.0 
)
virtual

Definition at line 24 of file METAlgo.cc.

References reco::Candidate::energy(), reco::Candidate::et(), i, CommonMETData::met, CommonMETData::mex, CommonMETData::mey, CommonMETData::mez, CommonMETData::phi, reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), funct::sin(), mathSSE::sqrt(), CommonMETData::sumet, and reco::Candidate::theta().

25 {
26  double px = 0.0;
27  double py = 0.0;
28  double pz = 0.0;
29  double et = 0.0;
30 
31  for (unsigned int i = 0; i < candidates->size(); ++i)
32  {
33  const reco::Candidate &cand = (*candidates)[i];
34  if( !(cand.et() > globalThreshold) ) continue;
35  px += cand.px();
36  py += cand.py();
37  pz += cand.pz();
38  et += cand.energy()*sin(cand.theta());
39  }
40 
41  met->mex = -px;
42  met->mey = -py;
43 
44  met->mez = -pz; // included here since it might be useful
45  // for Data Quality Monitering as it should be
46  // symmetrically distributed about the origin
47 
48  met->met = sqrt( px*px + py*py );
49  met->sumet = et;
50  met->phi = atan2( -py, -px ); // no longer needed as MET is now a candidate
51 }
int i
Definition: DBlmapReader.cc:9
virtual double energy() const =0
energy
virtual double et() const =0
transverse energy
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual double pz() const =0
z coordinate of momentum vector
virtual double theta() const =0
momentum polar angle
T sqrt(T t)
Definition: SSEVec.h:48
virtual double py() const =0
y coordinate of momentum vector
virtual double px() const =0
x coordinate of momentum vector