CMS 3D CMS Logo

AddFourMomenta Class Reference

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

#include <PhysicsTools/CandUtils/interface/AddFourMomenta.h>

List of all members.

Public Member Functions

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


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.

00020 { }

AddFourMomenta::AddFourMomenta ( const edm::ParameterSet  )  [inline, explicit]

constructor

Definition at line 22 of file AddFourMomenta.h.

00022 { }


Member Function Documentation

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

set up a candidate

Definition at line 7 of file AddFourMomenta.cc.

References b, reco::Candidate::begin(), d, e, reco::Candidate::end(), p4, reco::Particle::setCharge(), and reco::Particle::setP4().

Referenced by V0Fitter::fitAll(), TtSemiLepHypothesis::hypo(), PFRecoTauDecayModeDeterminator::mergePiZeroes(), PFRecoTauDecayModeDeterminator::produce(), TruthTauDecayModeProducer::produce(), and TtSemiEvtSolution::setupHyp().

00007                                               {
00008   Candidate::LorentzVector p4( 0, 0, 0, 0 );
00009   Candidate::Charge charge = 0;
00010   Candidate::iterator b = c.begin(), e = c.end(); 
00011   for(  Candidate::iterator d = b; d != e; ++ d ) {
00012     p4 += d->p4();
00013     charge += d->charge();
00014   }
00015   c.setP4( p4 );
00016   c.setCharge( charge );
00017 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:13:53 2009 for CMSSW by  doxygen 1.5.4