CMS 3D CMS Logo

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

#include <AddFourMomenta.h>

Public Member Functions

 AddFourMomenta ()
 default constructor More...
 
 AddFourMomenta ()
 default constructor More...
 
 AddFourMomenta (const edm::ParameterSet &)
 constructor More...
 
 AddFourMomenta (const edm::ParameterSet &)
 constructor More...
 
void set (reco::Candidate &c) const
 set up a candidate 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

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

Author
Luca Lista, INFN

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 { }
AddFourMomenta::AddFourMomenta ( )
inline

default constructor

Definition at line 18 of file AddFourMomenta.h.

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

constructor

Definition at line 20 of file AddFourMomenta.h.

20 { }

Member Function Documentation

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

set up a candidate

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

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

set up a candidate

Definition at line 6 of file AddFourMomenta.cc.

References trackerHits::c, reco::Candidate::charge(), reco::Candidate::daughter(), i, n, reco::Candidate::numberOfDaughters(), reco::Candidate::p4(), p4, reco::Candidate::setCharge(), and reco::Candidate::setP4().

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

6  {
7  Candidate::LorentzVector p4( 0, 0, 0, 0 );
8  Candidate::Charge charge = 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:39
int i
Definition: DBlmapReader.cc:9
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
virtual size_type numberOfDaughters() const =0
number of daughters
double p4[4]
Definition: TauolaWrapper.h:92
virtual int charge() const =0
electric charge
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
virtual void setCharge(Charge q)=0
set electric charge
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector