src
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:34
mps_fire.i
i
Definition:
mps_fire.py:429
DummyCfis.c
c
Definition:
DummyCfis.py:86
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition:
AddFourMomenta.cc:6
reco::Candidate
Definition:
Candidate.h:27
reco::charge
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(ConstView const &tracks, int32_t i)
Definition:
TracksSoA.h:73
Candidate.h
ztail.d
d
Definition:
ztail.py:151
AddFourMomenta.h
create_idmaps.n
n
Definition:
create_idmaps.py:21
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition:
Candidate.h:36
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
Generated for CMSSW Reference Manual by
1.8.14