CMS 3D CMS Logo

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( std::move(selCands_) );
27  }
28  size_t size() const { return selCands_->size(); }
29 
30  private:
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  }
43  std::unique_ptr<reco::CandidateCollection> selCands_;
44  };
45 
46  template<typename EdmFilter>
50  };
51 
52 }
53 
54 #endif
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
Definition: helper.py:1
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)
const std::complex< double > I
Definition: I.h:8
#define end
Definition: vmac.h:39
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
RefProd< PROD > getRefBeforePut()
Definition: Event.h:156
reco::CandidateCollection collection
fixed size matrix
#define begin
Definition: vmac.h:32
CandDecayStoreManager(const edm::Handle< reco::CandidateCollection > &)
std::unique_ptr< reco::CandidateCollection > selCands_
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21
virtual size_type numberOfDaughters() const =0
number of daughters
def move(src, dest)
Definition: eostools.py:510