src
CommonTools
CandUtils
src
cloneDecayTree.cc
Go to the documentation of this file.
1
#include "
CommonTools/CandUtils/interface/cloneDecayTree.h
"
2
#include "
DataFormats/Candidate/interface/CompositeCandidate.h
"
3
using namespace
std
;
4
using namespace
reco
;
5
6
unique_ptr<Candidate>
cloneDecayTree
(
const
Candidate
&
c
) {
7
size_t
n
=
c
.numberOfDaughters();
8
if
(
n
== 1)
9
return
unique_ptr<Candidate>(
c
.clone());
10
// pass a particle, not a candidate, to avoid cloning daughters
11
const
Candidate
&
p
=
c
;
12
auto
cmp
= std::make_unique<CompositeCandidate>(
p
);
13
for
(
size_t
i
= 0;
i
<
n
; ++
i
)
14
cmp
->addDaughter(
cloneDecayTree
(*
c
.daughter(
i
)));
15
return
cmp
;
16
}
mps_fire.i
i
Definition:
mps_fire.py:429
reco::Candidate
Definition:
Candidate.h:27
std
Definition:
JetResolutionObject.h:76
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:35
CompositeCandidate.h
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
cloneDecayTree.h
cloneDecayTree
unique_ptr< Candidate > cloneDecayTree(const Candidate &c)
Definition:
cloneDecayTree.cc:6
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
fileCollector.cmp
cmp
Definition:
fileCollector.py:125
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
Generated for CMSSW Reference Manual by
1.8.14