CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::CandidateCollection
put (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::CandidateCollection
selCands_
 

Detailed Description

Definition at line 12 of file CandDecaySelector.h.

Member Typedef Documentation

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

Definition at line 14 of file CandDecaySelector.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file CandDecaySelector.h.

std::unique_ptr< reco::CandidateCollection > selCands_

Member Function Documentation

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

Definition at line 27 of file CandDecaySelector.h.

References c, reco::Candidate::daughter(), mps_fire::i, eostools::move(), dqmiodumpmetadata::n, reco::Candidate::numberOfDaughters(), AlCaHLTBitMon_ParallelJobs::p, dt_dqm_sourceclient_common_cff::reco, and selCands_.

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

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  }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
const edm::EventSetup & c
virtual size_type numberOfDaughters() const =0
number of daughters
def move
Definition: eostools.py:511
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
std::unique_ptr< reco::CandidateCollection > selCands_
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.

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

17  {
18  using namespace reco;
20  for (I i = begin; i != end; ++i)
21  add(cands, **i);
22  }
const std::complex< double > I
Definition: I.h:8
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
RefProd< PROD > getRefBeforePut()
Definition: Event.h:158
string end
Definition: dataset.py:937
edm::OrphanHandle<reco::CandidateCollection> helper::CandDecayStoreManager::put ( edm::Event evt)
inline

Definition at line 23 of file CandDecaySelector.h.

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

23 { return evt.put(std::move(selCands_)); }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
def move
Definition: eostools.py:511
std::unique_ptr< reco::CandidateCollection > selCands_
size_t helper::CandDecayStoreManager::size ( void  ) const
inline

Definition at line 24 of file CandDecaySelector.h.

References selCands_.

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

24 { return selCands_->size(); }
std::unique_ptr< reco::CandidateCollection > selCands_

Member Data Documentation

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

Definition at line 39 of file CandDecaySelector.h.

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