CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
helper::CandDecayStoreManager Class Reference

#include <CandDecaySelector.h>

Public Types

typedef reco::CandidateCollection collection
 

Public Member Functions

 CandDecayStoreManager (const edm::Handle< reco::CandidateCollection > &)
 
template<typename I >
void cloneAndStore (const I &begin, const I &end, edm::Event &evt)
 
edm::OrphanHandle< reco::CandidateCollectionput (edm::Event &evt)
 
size_t size () const
 

Private Member Functions

reco::CandidateRef add (reco::CandidateRefProd cands, const reco::Candidate &c)
 

Private Attributes

std::unique_ptr< reco::CandidateCollectionselCands_
 

Detailed Description

Definition at line 12 of file CandDecaySelector.h.

Member Typedef Documentation

◆ collection

typedef reco::CandidateCollection helper::CandDecayStoreManager::collection

Definition at line 14 of file CandDecaySelector.h.

Constructor & Destructor Documentation

◆ CandDecayStoreManager()

helper::CandDecayStoreManager::CandDecayStoreManager ( const edm::Handle< reco::CandidateCollection > &  )
inline

Definition at line 15 of file CandDecaySelector.h.

Member Function Documentation

◆ add()

reco::CandidateRef helper::CandDecayStoreManager::add ( reco::CandidateRefProd  cands,
const reco::Candidate c 
)
inlineprivate

Definition at line 27 of file CandDecaySelector.h.

27  {
28  using namespace reco;
29  using namespace std;
30  auto cmp = std::make_unique<CompositeRefCandidate>(c);
31  CompositeRefCandidate* p = cmp.get();
32  CandidateRef ref(cands, selCands_->size());
33  selCands_->push_back(std::move(cmp));
34  size_t n = c.numberOfDaughters();
35  for (size_t i = 0; i < n; ++i)
36  p->addDaughter(add(cands, *c.daughter(i)));
37  return ref;
38  }

References c, HLT_FULL_cff::cands, fileCollector::cmp, mps_fire::i, eostools::move(), dqmiodumpmetadata::n, AlCaHLTBitMon_ParallelJobs::p, and selCands_.

Referenced by cloneAndStore(), counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ cloneAndStore()

template<typename I >
void helper::CandDecayStoreManager::cloneAndStore ( const I &  begin,
const I &  end,
edm::Event evt 
)
inline

Definition at line 17 of file CandDecaySelector.h.

17  {
18  using namespace reco;
20  for (I i = begin; i != end; ++i)
21  add(cands, **i);
22  }

References add(), HLT_FULL_cff::cands, mps_fire::end, edm::Event::getRefBeforePut(), Exhume::I, and mps_fire::i.

◆ put()

edm::OrphanHandle<reco::CandidateCollection> helper::CandDecayStoreManager::put ( edm::Event evt)
inline

Definition at line 23 of file CandDecaySelector.h.

23 { return evt.put(std::move(selCands_)); }

References eostools::move(), edm::Event::put(), and selCands_.

◆ size()

size_t helper::CandDecayStoreManager::size ( void  ) const
inline

Definition at line 24 of file CandDecaySelector.h.

24 { return selCands_->size(); }

References selCands_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Member Data Documentation

◆ selCands_

std::unique_ptr<reco::CandidateCollection> helper::CandDecayStoreManager::selCands_
private

Definition at line 39 of file CandDecaySelector.h.

Referenced by add(), put(), and size().

edm::RefProd
Definition: EDProductfwd.h:25
edm::Event::getRefBeforePut
RefProd< PROD > getRefBeforePut()
Definition: Event.h:158
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ref
Definition: AssociativeIterator.h:58
reco::CompositeRefCandidate
Definition: CompositeRefCandidate.h:17
Exhume::I
const std::complex< double > I
Definition: I.h:8
mps_fire.end
end
Definition: mps_fire.py:242
helper::CandDecayStoreManager::add
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
Definition: CandDecaySelector.h:27
HLT_FULL_cff.cands
cands
Definition: HLT_FULL_cff.py:15144
helper::CandDecayStoreManager::selCands_
std::unique_ptr< reco::CandidateCollection > selCands_
Definition: CandDecaySelector.h:39
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
fileCollector.cmp
cmp
Definition: fileCollector.py:125
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::OwnVector
Definition: OwnVector.h:24