CMS 3D CMS Logo

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

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

Public Member Functions

reco::PFMET addInfo (edm::Handle< edm::View< reco::Candidate > > PFCandidates, CommonMETData met)
 
 PFSpecificAlgo ()
 
void runSignificance (metsig::SignAlgoResolutions &resolutions, edm::Handle< edm::View< reco::PFJet > > jets)
 

Private Types

typedef math::XYZTLorentzVector LorentzVector
 
typedef math::XYZPoint Point
 

Private Member Functions

void initializeSpecificPFMETData (SpecificPFMETData &specific)
 
TMatrixD mkSignifMatrix (edm::Handle< edm::View< reco::Candidate > > &PFCandidates)
 
SpecificPFMETData mkSpecificPFMETData (edm::Handle< edm::View< reco::Candidate > > &PFCandidates)
 

Private Attributes

bool doSignificance
 
metsig::SignPFSpecificAlgo pfsignalgo_
 

Detailed Description

Description: Adds Particle Flow specific information to MET

Implementation: [Notes on implementation]

Definition at line 40 of file PFSpecificAlgo.h.

Member Typedef Documentation

Definition at line 49 of file PFSpecificAlgo.h.

Definition at line 50 of file PFSpecificAlgo.h.

Constructor & Destructor Documentation

PFSpecificAlgo::PFSpecificAlgo ( )
inline

Definition at line 43 of file PFSpecificAlgo.h.

43 : doSignificance(false) { }

Member Function Documentation

reco::PFMET PFSpecificAlgo::addInfo ( edm::Handle< edm::View< reco::Candidate > >  PFCandidates,
CommonMETData  met 
)

Definition at line 20 of file PFSpecificAlgo.cc.

References CommonMETData::met, CommonMETData::mex, CommonMETData::mey, p4, benchmark_cfg::PFCandidates, pfMET_cfi::pfMET, reco::MET::setSignificanceMatrix(), timingPdfMaker::specific, and CommonMETData::sumet.

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

21 {
23 
24  const LorentzVector p4(met.mex , met.mey, 0.0, met.met);
25  const Point vtx(0.0,0.0,0.0);
26  PFMET pfMET(specific, met.sumet, p4, vtx );
27 
28  if(doSignificance) pfMET.setSignificanceMatrix(mkSignifMatrix(PFCandidates));
29 
30  return pfMET;
31 }
dictionary specific
math::XYZTLorentzVector LorentzVector
tuple pfMET
Definition: pfMET_cfi.py:7
double p4[4]
Definition: TauolaWrapper.h:92
math::XYZPoint Point
MET made from Particle Flow Candidates.
TMatrixD mkSignifMatrix(edm::Handle< edm::View< reco::Candidate > > &PFCandidates)
SpecificPFMETData mkSpecificPFMETData(edm::Handle< edm::View< reco::Candidate > > &PFCandidates)
void PFSpecificAlgo::initializeSpecificPFMETData ( SpecificPFMETData specific)
private
TMatrixD PFSpecificAlgo::mkSignifMatrix ( edm::Handle< edm::View< reco::Candidate > > &  PFCandidates)
private

Definition at line 107 of file PFSpecificAlgo.cc.

References begin, end, and benchmark_cfg::PFCandidates.

108 {
109  pfsignalgo_.useOriginalPtrs(PFCandidates.id());
110  for(edm::View<reco::Candidate>::const_iterator iParticle = (PFCandidates.product())->begin(); iParticle != (PFCandidates.product())->end(); ++iParticle )
111  {
112  const PFCandidate* pfCandidate = dynamic_cast<const PFCandidate*> (&(*iParticle));
113  if (!pfCandidate) continue;
114  reco::CandidatePtr dau(PFCandidates, iParticle - PFCandidates->begin());
115  if(dau.isNull()) continue;
116  if(!dau.isAvailable()) continue;
117  reco::PFCandidatePtr pf(dau.id(), pfCandidate, dau.key());
119  }
120  return pfsignalgo_.getSignifMatrix();
121 }
void addPFCandidate(reco::PFCandidatePtr pf)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
TMatrixD getSignifMatrix() const
ProductID id() const
Definition: HandleBase.cc:15
metsig::SignPFSpecificAlgo pfsignalgo_
#define end
Definition: vmac.h:38
T const * product() const
Definition: Handle.h:74
void useOriginalPtrs(const edm::ProductID &productID)
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
#define begin
Definition: vmac.h:31
SpecificPFMETData PFSpecificAlgo::mkSpecificPFMETData ( edm::Handle< edm::View< reco::Candidate > > &  PFCandidates)
private

Definition at line 54 of file PFSpecificAlgo.cc.

References begin, SpecificPFMETData::ChargedEMFraction, SpecificPFMETData::ChargedHadFraction, alignCSCRings::e, end, reco::LeafCandidate::energy(), SpecificPFMETData::MuonFraction, SpecificPFMETData::NeutralEMFraction, SpecificPFMETData::NeutralHadFraction, reco::PFCandidate::particleId(), benchmark_cfg::PFCandidates, funct::sin(), timingPdfMaker::specific, reco::LeafCandidate::theta(), theta(), SpecificPFMETData::Type6Fraction, and SpecificPFMETData::Type7Fraction.

55 {
56  if(!PFCandidates->size())
57  {
60  return specific;
61  }
62 
63  double NeutralEMEt = 0.0;
64  double NeutralHadEt = 0.0;
65  double ChargedEMEt = 0.0;
66  double ChargedHadEt = 0.0;
67  double MuonEt = 0.0;
68  double type6Et = 0.0;
69  double type7Et = 0.0;
70 
71  for( edm::View<reco::Candidate>::const_iterator iParticle = (PFCandidates.product())->begin(); iParticle != (PFCandidates.product())->end(); ++iParticle )
72  {
73  const PFCandidate* pfCandidate = dynamic_cast<const PFCandidate*> (&(*iParticle));
74  if (!pfCandidate) continue;
75  const double theta = pfCandidate->theta();
76  const double e = pfCandidate->energy();
77  const double et = e*sin(theta);
78 
79  if (pfCandidate->particleId() == 1) ChargedHadEt += et;
80  if (pfCandidate->particleId() == 2) ChargedEMEt += et;
81  if (pfCandidate->particleId() == 3) MuonEt += et;
82  if (pfCandidate->particleId() == 4) NeutralEMEt += et;
83  if (pfCandidate->particleId() == 5) NeutralHadEt += et;
84  if (pfCandidate->particleId() == 6) type6Et += et;
85  if (pfCandidate->particleId() == 7) type7Et += et;
86 
87 
88  }
89 
90  const double Et_total = NeutralEMEt + NeutralHadEt + ChargedEMEt + ChargedHadEt + MuonEt + type6Et + type7Et;
93  if (Et_total!=0.0)
94  {
95  specific.NeutralEMFraction = NeutralEMEt/Et_total;
96  specific.NeutralHadFraction = NeutralHadEt/Et_total;
97  specific.ChargedEMFraction = ChargedEMEt/Et_total;
98  specific.ChargedHadFraction = ChargedHadEt/Et_total;
99  specific.MuonFraction = MuonEt/Et_total;
100  specific.Type6Fraction = type6Et/Et_total;
101  specific.Type7Fraction = type7Et/Et_total;
102  }
103  return specific;
104 }
virtual double energy() const GCC11_FINAL
energy
dictionary specific
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void initializeSpecificPFMETData(SpecificPFMETData &specific)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
virtual double theta() const GCC11_FINAL
momentum polar angle
#define end
Definition: vmac.h:38
MET made from Particle Flow Candidates.
T const * product() const
Definition: Handle.h:74
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:35
#define begin
Definition: vmac.h:31
virtual ParticleType particleId() const
Definition: PFCandidate.h:347
void PFSpecificAlgo::runSignificance ( metsig::SignAlgoResolutions resolutions,
edm::Handle< edm::View< reco::PFJet > >  jets 
)

Definition at line 34 of file PFSpecificAlgo.cc.

References fwrapper::jets.

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

35 {
36  doSignificance = true;
37  pfsignalgo_.setResolutions( &resolutions );
38  pfsignalgo_.addPFJets(jets);
39 }
metsig::SignPFSpecificAlgo pfsignalgo_
void setResolutions(metsig::SignAlgoResolutions *resolutions)
void addPFJets(edm::Handle< edm::View< reco::PFJet > > PFJets)

Member Data Documentation

bool PFSpecificAlgo::doSignificance
private

Definition at line 55 of file PFSpecificAlgo.h.

metsig::SignPFSpecificAlgo PFSpecificAlgo::pfsignalgo_
private

Definition at line 56 of file PFSpecificAlgo.h.