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

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.

15  :
17  }
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 31 of file CandDecaySelector.h.

References EnergyCorrector::c, reco::Candidate::daughter(), i, eostools::move(), gen::n, reco::Candidate::numberOfDaughters(), AlCaHLTBitMon_ParallelJobs::p, and selCands_.

Referenced by cloneAndStore(), and counter.Counter::register().

31  {
32  using namespace reco;
33  using namespace std;
34  auto cmp = std::make_unique<CompositeRefCandidate>( c );
35  CompositeRefCandidate * p = cmp.get();
36  CandidateRef ref( cands, selCands_->size() );
37  selCands_->push_back( std::move(cmp) );
38  size_t n = c.numberOfDaughters();
39  for( size_t i = 0; i < n; ++ i )
40  p->addDaughter( add( cands, * c.daughter( i ) ) );
41  return ref;
42  }
int i
Definition: DBlmapReader.cc:9
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
fixed size matrix
std::unique_ptr< reco::CandidateCollection > selCands_
virtual size_type numberOfDaughters() const =0
number of daughters
def move(src, dest)
Definition: eostools.py:510
template<typename I >
void helper::CandDecayStoreManager::cloneAndStore ( const I &  begin,
const I &  end,
edm::Event evt 
)
inline

Definition at line 19 of file CandDecaySelector.h.

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

19  {
20  using namespace reco;
22  for( I i = begin; i != end; ++ i )
23  add( cands, * * i );
24  }
int i
Definition: DBlmapReader.cc:9
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:37
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
RefProd< PROD > getRefBeforePut()
Definition: Event.h:134
fixed size matrix
#define begin
Definition: vmac.h:30
edm::OrphanHandle<reco::CandidateCollection> helper::CandDecayStoreManager::put ( edm::Event evt)
inline

Definition at line 25 of file CandDecaySelector.h.

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

25  {
26  return evt.put( std::move(selCands_) );
27  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_ptr< reco::CandidateCollection > selCands_
def move(src, dest)
Definition: eostools.py:510
size_t helper::CandDecayStoreManager::size ( void  ) const
inline

Definition at line 28 of file CandDecaySelector.h.

References selCands_.

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

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

Member Data Documentation

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

Definition at line 43 of file CandDecaySelector.h.

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