CMS 3D CMS Logo

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

#include <AddFourMomenta.h>

Public Member Functions

 AddFourMomenta ()
 default constructor More...
 
 AddFourMomenta (const edm::ParameterSet &)
 constructor More...
 
void set (reco::Candidate &c) const
 set up a candidate More...
 

Detailed Description

set up a composite reco::Candidate adding its daughters four-momenta and electric charge

Author
Luca Lista, INFN
Version
Revision:
1.9
Id:
AddFourMomenta.h,v 1.9 2007/01/09 09:14:42 llista Exp

Definition at line 18 of file AddFourMomenta.h.

Constructor & Destructor Documentation

AddFourMomenta::AddFourMomenta ( )
inline

default constructor

Definition at line 20 of file AddFourMomenta.h.

20 {}
AddFourMomenta::AddFourMomenta ( const edm::ParameterSet )
inlineexplicit

constructor

Definition at line 22 of file AddFourMomenta.h.

22 {}

Member Function Documentation

void AddFourMomenta::set ( reco::Candidate c) const

set up a candidate

Definition at line 6 of file AddFourMomenta.cc.

References c, RecoTauCleanerPlugins::charge, reco::Candidate::charge(), ztail::d, mps_fire::i, dqmiodumpmetadata::n, reco::Candidate::numberOfDaughters(), reco::Candidate::p4(), reco::Candidate::setCharge(), and reco::Candidate::setP4().

Referenced by reco::tau::RecoTauPiZeroStripPlugin2::addCandsToStrip(), reco::tau::RecoTauPiZeroStripPlugin3::addCandsToStrip(), BPHDecayMomentum::computeMomentum(), V0Fitter::fitAll(), TtFullHadHypothesis::hypo(), TtFullLepHypothesis::hypo(), TtSemiLepHypothesis::hypo(), reco::tau::xclean::CrossCleanPiZeros< PtrIter >::operator()(), reco::tau::RecoTauPiZeroCombinatoricPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), RecoTauPiZeroProducer::produce(), PatJPsiProducer::produce(), TtSemiEvtSolution::setupHyp(), reco::WMuNuCandidate::WMuNuCandidate(), and reco::WMuNuCandidatePtr::WMuNuCandidatePtr().

6  {
7  Candidate::LorentzVector p4(0, 0, 0, 0);
9  size_t n = c.numberOfDaughters();
10  for (size_t i = 0; i < n; ++i) {
11  const Candidate *d = (const_cast<const Candidate &>(c)).daughter(i);
12  p4 += d->p4();
13  charge += d->charge();
14  }
15  c.setP4(p4);
16  c.setCharge(charge);
17 }
int Charge
electric charge type
Definition: Candidate.h:34
const edm::EventSetup & c
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
tuple d
Definition: ztail.py:151
virtual size_type numberOfDaughters() const =0
number of daughters
virtual int charge() const =0
electric charge
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
virtual void setCharge(Charge q)=0
set electric charge
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector