CMS 3D CMS Logo

helper::CandDecayStoreManager Class Reference

#include <PhysicsTools/CandAlgos/interface/CandDecaySelector.h>

List of all members.

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

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.

00015                                                                         :
00016       selCands_( new reco::CandidateCollection ) {
00017     }


Member Function Documentation

reco::CandidateRef helper::CandDecayStoreManager::add ( reco::CandidateRefProd  cands,
const reco::Candidate c 
) [inline, private]

Definition at line 31 of file CandDecaySelector.h.

References c, i, n, p, HcalSimpleRecAlgoImpl::reco(), selCands_, and std.

00031                                                                                 {
00032       using namespace reco;
00033       using namespace std;
00034       std::auto_ptr<CompositeRefCandidate> cmp( new CompositeRefCandidate( c ) );
00035       CompositeRefCandidate * p = cmp.get();
00036       CandidateRef ref( cands, selCands_->size() );
00037       selCands_->push_back( cmp );
00038       size_t n = c.numberOfDaughters(); 
00039       for( size_t i = 0; i < n; ++ i )
00040         p->addDaughter( add( cands, * c.daughter( i ) ) );
00041       return ref;
00042     }

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 edm::Event::getRefBeforePut(), I, i, and HcalSimpleRecAlgoImpl::reco().

00019                                                                          {
00020       using namespace reco;
00021       CandidateRefProd cands = evt.getRefBeforePut<CandidateCollection>();
00022       for( I i = begin; i != end; ++ i )
00023         add( cands, * * i );
00024     }

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_.

00025                                                                    {
00026       return evt.put( selCands_ );
00027     }

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

Definition at line 28 of file CandDecaySelector.h.

References selCands_.

00028 { return selCands_->size(); }


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().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:47:26 2009 for CMSSW by  doxygen 1.5.4