Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CommonTools
CandUtils
src
AddFourMomenta.cc
Go to the documentation of this file.
1
// $Id: AddFourMomenta.cc,v 1.2 2009/09/29 12:24:45 llista Exp $
2
#include "
CommonTools/CandUtils/interface/AddFourMomenta.h
"
3
#include "
DataFormats/Candidate/interface/Candidate.h
"
4
using namespace
reco
;
5
6
void
AddFourMomenta::set
(
Candidate
&
c
)
const
{
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
}
reco::Candidate::Charge
int Charge
electric charge type
Definition:
Candidate.h:35
mps_fire.i
i
Definition:
mps_fire.py:341
reco::Candidate::setP4
virtual void setP4(const LorentzVector &p4)=0
set 4-momentum
reco::Candidate
Definition:
Candidate.h:28
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
Candidate.h
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
p4
double p4[4]
Definition:
TauolaWrapper.h:92
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
ztail.d
d
Definition:
ztail.py:151
AddFourMomenta.h
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:37
reco::Candidate::charge
virtual int charge() const =0
electric charge
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition:
AddFourMomenta.cc:6
reco::Candidate::numberOfDaughters
virtual size_type numberOfDaughters() const =0
number of daughters
reco::Candidate::setCharge
virtual void setCharge(Charge q)=0
set electric charge
Generated for CMSSW Reference Manual by
1.8.11