CMS 3D CMS Logo

AddFourMomenta.cc
Go to the documentation of this file.
1 // $Id: AddFourMomenta.cc,v 1.2 2009/09/29 12:24:45 llista Exp $
4 using namespace reco;
5 
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 }
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
AddFourMomenta.h
p4
double p4[4]
Definition: TauolaWrapper.h:92
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
reco::Candidate
Definition: Candidate.h:27
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition: AddFourMomenta.cc:6
ztail.d
d
Definition: ztail.py:151
Candidate.h
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36