CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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:
16  template <typename I>
17  void cloneAndStore(const I& begin, const I& end, edm::Event& evt) {
18  using namespace reco;
20  for (I i = begin; i != end; ++i)
21  add(cands, **i);
22  }
24  size_t size() const { return selCands_->size(); }
25 
26  private:
28  using namespace reco;
29  using namespace std;
30  auto cmp = std::make_unique<CompositeRefCandidate>(c);
31  CompositeRefCandidate* p = cmp.get();
32  CandidateRef ref(cands, selCands_->size());
33  selCands_->push_back(std::move(cmp));
34  size_t n = c.numberOfDaughters();
35  for (size_t i = 0; i < n; ++i)
36  p->addDaughter(add(cands, *c.daughter(i)));
37  return ref;
38  }
39  std::unique_ptr<reco::CandidateCollection> selCands_;
40  };
41 
42  template <typename EdmFilter>
46  };
47 
48 } // namespace helper
49 
50 #endif
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
const edm::EventSetup & c
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
def move
Definition: eostools.py:511
const std::complex< double > I
Definition: I.h:8
reco::CandidateRef add(reco::CandidateRefProd cands, const reco::Candidate &c)
RefProd< PROD > getRefBeforePut()
Definition: Event.h:158
reco::CandidateCollection collection
CandDecayStoreManager(const edm::Handle< reco::CandidateCollection > &)
string end
Definition: dataset.py:937
std::unique_ptr< reco::CandidateCollection > selCands_
edm::OwnVector< Candidate > CandidateCollection
collection of Candidate objects
Definition: CandidateFwd.h:21