CMS 3D CMS Logo

cloneDecayTree.cc
Go to the documentation of this file.
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) return unique_ptr<Candidate>(c.clone());
9  // pass a particle, not a candidate, to avoid cloning daughters
10  const Candidate &p = c;
12  unique_ptr<Candidate> cmpPtr(cmp);
13  for(size_t i = 0; i < n; ++ i)
15  return std::move(cmpPtr);
16 }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual Candidate * clone() const =0
returns a clone of the Candidate object
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
unique_ptr< Candidate > cloneDecayTree(const Candidate &c)
fixed size matrix
virtual size_type numberOfDaughters() const =0
number of daughters
def move(src, dest)
Definition: eostools.py:511