CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pf2pat::PFMETAlgo Class Reference

#include <PFMETAlgo.h>

Public Member Functions

 PFMETAlgo (const edm::ParameterSet &)
 
reco::MET produce (const reco::PFCandidateCollection &pfCandidates)
 
 ~PFMETAlgo ()
 

Private Attributes

double hfCalibFactor_
 HF calibration factor (in 31X applied by PFProducer) More...
 
bool verbose_
 verbose ? More...
 

Detailed Description

Definition at line 31 of file PFMETAlgo.h.

Constructor & Destructor Documentation

PFMETAlgo::PFMETAlgo ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file PFMETAlgo.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

18  {
19 
20 
21  verbose_ =
22  iConfig.getUntrackedParameter<bool>("verbose",false);
23 
25  iConfig.getParameter<double>("hfCalibFactor");
26 
27 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double hfCalibFactor_
HF calibration factor (in 31X applied by PFProducer)
Definition: PFMETAlgo.h:43
bool verbose_
verbose ?
Definition: PFMETAlgo.h:46
PFMETAlgo::~PFMETAlgo ( )

Definition at line 31 of file PFMETAlgo.cc.

31 { }

Member Function Documentation

reco::MET PFMETAlgo::produce ( const reco::PFCandidateCollection pfCandidates)

HF calibration factor (in 31X applied by PFProducer)

Definition at line 33 of file PFMETAlgo.cc.

References funct::cos(), gather_cfg::cout, reco::LeafCandidate::energy(), stringResolutionProvider_cfi::et, mps_fire::i, configurableAnalysis::MET, reco::PFCandidate::particleId(), reco::LeafCandidate::phi(), funct::sin(), mathSSE::sqrt(), objects.METAnalyzer::sumEt, reco::LeafCandidate::theta(), and theta().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

33  {
34 
35  double sumEx = 0;
36  double sumEy = 0;
37  double sumEt = 0;
38 
39  for( unsigned i=0; i<pfCandidates.size(); i++ ) {
40 
42 
43  double E = cand.energy();
44 
46  if( cand.particleId()==PFCandidate::h_HF ||
47  cand.particleId()==PFCandidate::egamma_HF )
48  E *= hfCalibFactor_;
49 
50  double phi = cand.phi();
51  double cosphi = cos(phi);
52  double sinphi = sin(phi);
53 
54  double theta = cand.theta();
55  double sintheta = sin(theta);
56 
57  double et = E*sintheta;
58  double ex = et*cosphi;
59  double ey = et*sinphi;
60 
61  sumEx += ex;
62  sumEy += ey;
63  sumEt += et;
64  }
65 
66  double Et = sqrt( sumEx*sumEx + sumEy*sumEy);
67  XYZTLorentzVector missingEt( -sumEx, -sumEy, 0, Et);
68 
69  if(verbose_) {
70  cout<<"PFMETAlgo: mEx, mEy, mEt = "
71  << missingEt.X() <<", "
72  << missingEt.Y() <<", "
73  << missingEt.T() <<endl;
74  }
75 
76  XYZPoint vertex; // dummy vertex
77  return MET(sumEt, missingEt, vertex);
78 
79 
80 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
double hfCalibFactor_
HF calibration factor (in 31X applied by PFProducer)
Definition: PFMETAlgo.h:43
virtual double phi() const final
momentum azimuthal angle
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual double theta() const final
momentum polar angle
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual double energy() const final
energy
bool verbose_
verbose ?
Definition: PFMETAlgo.h:46
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
et
define resolution functions of each parameter
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
virtual ParticleType particleId() const
Definition: PFCandidate.h:373

Member Data Documentation

double pf2pat::PFMETAlgo::hfCalibFactor_
private

HF calibration factor (in 31X applied by PFProducer)

Definition at line 43 of file PFMETAlgo.h.

bool pf2pat::PFMETAlgo::verbose_
private

verbose ?

Definition at line 46 of file PFMETAlgo.h.