test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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::auto_ptr
< reco::CandidateCollection
selCands_
 

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::auto_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 reco::Candidate::daughter(), i, gen::n, reco::Candidate::numberOfDaughters(), AlCaHLTBitMon_ParallelJobs::p, dt_dqm_sourceclient_common_cff::reco, and selCands_.

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

31  {
32  using namespace reco;
33  using namespace std;
34  std::auto_ptr<CompositeRefCandidate> cmp( new CompositeRefCandidate( c ) );
35  CompositeRefCandidate * p = cmp.get();
36  CandidateRef ref( cands, selCands_->size() );
37  selCands_->push_back( 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) ...
virtual size_type numberOfDaughters() const =0
number of daughters
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
std::auto_ptr< reco::CandidateCollection > selCands_
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, i, and dt_dqm_sourceclient_common_cff::reco.

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:141
#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 edm::Event::put(), and selCands_.

25  {
26  return evt.put( selCands_ );
27  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::auto_ptr< reco::CandidateCollection > selCands_
size_t helper::CandDecayStoreManager::size ( void  ) const
inline

Definition at line 28 of file CandDecaySelector.h.

References selCands_.

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

Member Data Documentation

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

Definition at line 43 of file CandDecaySelector.h.

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