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() [1/2]

AddFourMomenta::AddFourMomenta ( )
inline

default constructor

Definition at line 20 of file AddFourMomenta.h.

20 {}

◆ AddFourMomenta() [2/2]

AddFourMomenta::AddFourMomenta ( const edm::ParameterSet )
inlineexplicit

constructor

Definition at line 22 of file AddFourMomenta.h.

22 {}

Member Function Documentation

◆ set()

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

set up a candidate

Definition at line 6 of file AddFourMomenta.cc.

References DummyCfis::c, reco::charge(), ztail::d, mps_fire::i, and create_idmaps::n.

Referenced by reco::tau::RecoTauPiZeroStripPlugin2::addCandsToStrip(), reco::tau::RecoTauPiZeroStripPlugin3::addCandsToStrip(), ParticleNetJetTagMonitor::analyze(), 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(), and TtSemiEvtSolution::setupHyp().

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
d
Definition: ztail.py:151
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36