CMS 3D CMS Logo

List of all members | Public Member Functions
METAlgo Class Reference

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

Public Member Functions

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

Detailed Description

Description: Calculates MET for given input

Implementation: [Notes on implementation]

Definition at line 28 of file METAlgo.h.

Constructor & Destructor Documentation

METAlgo::METAlgo ( )
inline

Definition at line 30 of file METAlgo.h.

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

Definition at line 31 of file METAlgo.h.

References HLT_2018_cff::candidates, distPFMET_cfi::globalThreshold, and run().

31 {}

Member Function Documentation

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

Definition at line 16 of file METAlgo.cc.

References edm::View< T >::begin(), edm::View< T >::end(), EgHLTOffHistBins_cfi::et, distPFMET_cfi::globalThreshold, CommonMETData::met, BTaggingMonitor_cfi::met, CommonMETData::mex, CommonMETData::mey, CommonMETData::mez, p4, runTheMatrix::ret, and CommonMETData::sumet.

Referenced by cms::ElseMETProducer::produce(), cms::PFClusterMETProducer::produce(), cms::CaloMETProducer::produce(), reco::PFMETProducerMVA::produce(), cms::PFMETProducer::produce(), and ~METAlgo().

16  {
18  for (auto cand = candidates.begin(); cand != candidates.end(); ++cand) {
19  if (!(cand->et() > globalThreshold))
20  continue;
21  p4 += cand->p4();
22  }
24 
26  ret.mex = met.Px();
27  ret.mey = met.Py();
28 
29  ret.mez = met.Pz(); // included here since it might be useful
30  // for Data Quality Monitering as it should be
31  // symmetrically distributed about the origin
32 
33  ret.met = met.Pt();
34 
35  double et = 0.0;
36  for (auto cand = candidates.begin(); cand != candidates.end(); ++cand) {
37  if (!(cand->et() > globalThreshold))
38  continue;
39  et += cand->et();
40  }
41 
42  ret.sumet = et;
43 
44  return ret;
45 }
ret
prodAgent to be discontinued
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const_iterator begin() const
double p4[4]
Definition: TauolaWrapper.h:92
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
const_iterator end() const