CMS 3D CMS Logo

Functions
cloneDecayTree.h File Reference
#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include <memory>

Go to the source code of this file.

Functions

std::unique_ptr< reco::CandidatecloneDecayTree (const reco::Candidate &)
 

Function Documentation

◆ cloneDecayTree()

std::unique_ptr<reco::Candidate> cloneDecayTree ( const reco::Candidate )

Definition at line 6 of file cloneDecayTree.cc.

6  {
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 }

References c, fileCollector::cmp, mps_fire::i, dqmiodumpmetadata::n, and AlCaHLTBitMon_ParallelJobs::p.

mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
cloneDecayTree
unique_ptr< Candidate > cloneDecayTree(const Candidate &c)
Definition: cloneDecayTree.cc:6
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::Candidate
Definition: Candidate.h:27
fileCollector.cmp
cmp
Definition: fileCollector.py:125
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56