CMS 3D CMS Logo

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.

References EnergyCorrector::c.

22 { }

Member Function Documentation

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

set up a candidate

Definition at line 6 of file AddFourMomenta.cc.

References EnergyCorrector::c, ALCARECOTkAlJpsiMuMu_cff::charge, reco::Candidate::charge(), edmIntegrityCheck::d, mps_fire::i, gen::n, reco::Candidate::numberOfDaughters(), reco::Candidate::p4(), 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::RecoTauPiZeroCombinatoricPlugin::operator()(), reco::tau::xclean::CrossCleanPiZeros< PtrIter >::operator()(), reco::tau::RecoTauPiZeroStripPlugin::operator()(), reco::tau::RecoTauPiZeroStripPlugin2::operator()(), reco::tau::RecoTauPiZeroStripPlugin3::operator()(), RecoTauPiZeroProducer::produce(), TruthTauDecayModeProducer::produce(), PatJPsiProducer::produce(), BoostedTopProducer::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:35
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
double p4[4]
Definition: TauolaWrapper.h:92
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual int charge() const =0
electric charge
virtual size_type numberOfDaughters() const =0
number of daughters
virtual void setCharge(Charge q)=0
set electric charge