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 30 of file PFMETAlgo.h.

Constructor & Destructor Documentation

◆ PFMETAlgo()

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

Definition at line 17 of file PFMETAlgo.cc.

17  {
18  verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
19 
20  hfCalibFactor_ = iConfig.getParameter<double>("hfCalibFactor");
21 }

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

◆ ~PFMETAlgo()

PFMETAlgo::~PFMETAlgo ( )

Definition at line 23 of file PFMETAlgo.cc.

23 {}

Member Function Documentation

◆ produce()

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

HF calibration factor (in 31X applied by PFProducer)

Definition at line 25 of file PFMETAlgo.cc.

25  {
26  double sumEx = 0;
27  double sumEy = 0;
28  double sumEt = 0;
29 
30  for (unsigned i = 0; i < pfCandidates.size(); i++) {
32 
33  double E = cand.energy();
34 
36  if (cand.particleId() == PFCandidate::h_HF || cand.particleId() == PFCandidate::egamma_HF)
37  E *= hfCalibFactor_;
38 
39  double phi = cand.phi();
40  double cosphi = cos(phi);
41  double sinphi = sin(phi);
42 
43  double theta = cand.theta();
44  double sintheta = sin(theta);
45 
46  double et = E * sintheta;
47  double ex = et * cosphi;
48  double ey = et * sinphi;
49 
50  sumEx += ex;
51  sumEy += ey;
52  sumEt += et;
53  }
54 
55  double Et = sqrt(sumEx * sumEx + sumEy * sumEy);
56  XYZTLorentzVector missingEt(-sumEx, -sumEy, 0, Et);
57 
58  if (verbose_) {
59  cout << "PFMETAlgo: mEx, mEy, mEt = " << missingEt.X() << ", " << missingEt.Y() << ", " << missingEt.T() << endl;
60  }
61 
62  XYZPoint vertex; // dummy vertex
63  return MET(sumEt, missingEt, vertex);
64 }

References funct::cos(), gather_cfg::cout, EgHLTOffHistBins_cfi::et, mps_fire::i, HLTTauDQMOffline_cfi::MET, zmumugammaAnalyzer_cfi::pfCandidates, funct::sin(), mathSSE::sqrt(), objects.METAnalyzer::sumEt, theta(), and bphysicsOniaDQM_cfi::vertex.

Member Data Documentation

◆ hfCalibFactor_

double pf2pat::PFMETAlgo::hfCalibFactor_
private

HF calibration factor (in 31X applied by PFProducer)

Definition at line 40 of file PFMETAlgo.h.

◆ verbose_

bool pf2pat::PFMETAlgo::verbose_
private

verbose ?

Definition at line 43 of file PFMETAlgo.h.

zmumugammaAnalyzer_cfi.pfCandidates
pfCandidates
Definition: zmumugammaAnalyzer_cfi.py:11
mps_fire.i
i
Definition: mps_fire.py:355
gather_cfg.cout
cout
Definition: gather_cfg.py:144
objects.METAnalyzer.sumEt
sumEt
Definition: METAnalyzer.py:97
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
XYZTLorentzVector
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
pf2pat::PFMETAlgo::verbose_
bool verbose_
verbose ?
Definition: PFMETAlgo.h:43
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
cand
Definition: decayParser.h:34
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
HLTTauDQMOffline_cfi.MET
MET
Definition: HLTTauDQMOffline_cfi.py:70
pf2pat::PFMETAlgo::hfCalibFactor_
double hfCalibFactor_
HF calibration factor (in 31X applied by PFProducer)
Definition: PFMETAlgo.h:40