Main Page
Namespaces
Classes
Package Documentation
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
auto_ptr<Candidate>
cloneDecayTree
(
const
Candidate
&
c
) {
7
size_t
n
= c.
numberOfDaughters
();
8
if
(n == 1)
return
auto_ptr<Candidate>(c.
clone
());
9
// pass a particle, not a candidate, to avoid cloning daughters
10
const
Candidate
&
p
=
c
;
11
CompositeCandidate
* cmp(
new
CompositeCandidate
(p));
12
auto_ptr<Candidate> cmpPtr(cmp);
13
for
(
size_t
i
= 0;
i
<
n
; ++
i
)
14
cmp->
addDaughter
(
cloneDecayTree
(* c.
daughter
(
i
)));
15
return
cmpPtr;
16
}
mps_fire.i
i
Definition:
mps_fire.py:269
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
reco::Candidate::daughter
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:43
reco::Candidate
Definition:
Candidate.h:28
std
Definition:
JetResolutionObject.h:76
CompositeCandidate.h
reco::CompositeCandidate
Definition:
CompositeCandidate.h:21
cloneDecayTree
auto_ptr< Candidate > cloneDecayTree(const Candidate &c)
Definition:
cloneDecayTree.cc:6
reco::Candidate::clone
virtual Candidate * clone() const =0
returns a clone of the Candidate object
reco::CompositeCandidate::addDaughter
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
Definition:
CompositeCandidate.cc:117
cloneDecayTree.h
gen::n
int n
Definition:
Cascade2Hadronizer.cc:79
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:43
reco::Candidate::numberOfDaughters
virtual size_type numberOfDaughters() const =0
number of daughters
Generated for CMSSW Reference Manual by
1.8.11