CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CandDecaySelector.h
Go to the documentation of this file.
1 #ifndef CandAlgos_CandDecaySelector_h
2 #define CandAlgos_CandDecaySelector_h
3 /* \class helper::CandDecayStoreManager
4  *
5  * \author: Luca Lista, INFN
6  *
7  */
10 
11 namespace helper {
13  public:
17  }
18  template<typename I>
19  void cloneAndStore( const I & begin, const I & end, edm::Event & evt ) {
20  using namespace reco;
22  for( I i = begin; i != end; ++ i )
23  add( cands, * * i );
24  }
26  return evt.put( selCands_ );
27  }
28  size_t size() const { return selCands_->size(); }
29 
30  private:
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  }
43  std::auto_ptr<reco::CandidateCollection> selCands_;
44  };
45 
46  template<typename EdmFilter>
50  };
51 
52 }
53 
54 #endif
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) ...
ObjectSelectorBase< reco::CandidateCollection, EdmFilter > base
edm::OrphanHandle< reco::CandidateCollection > put(edm::Event &evt)
void cloneAndStore(const I &begin, const I &end, edm::Event &evt)
virtual size_type numberOfDaughters() const =0
number of daughters
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
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:133
reco::CandidateCollection collection
#define begin
Definition: vmac.h:30
CandDecayStoreManager(const edm::Handle< reco::CandidateCollection > &)
std::auto_ptr< reco::CandidateCollection > selCands_
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21