CMS 3D CMS Logo

SingleElementCollectionSelectorPlusEvent.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionSelectorPlusEvent_h
2 #define RecoAlgos_SingleElementCollectionSelectorPlusEvent_h
3 
20 
21 namespace edm {
22  class Event;
23  class EventSetup;
24 } // namespace edm
25 
26 template <typename InputCollection,
27  typename Selector,
29  typename StoreContainer = typename helper::StoreContainerTrait<OutputCollection>::type,
33  typedef StoreContainer container;
34  typedef typename container::const_iterator const_iterator;
36  : select_(reco::modules::make<Selector>(cfg, iC)) {}
37  const_iterator begin() const { return selected_.begin(); }
38  const_iterator end() const { return selected_.end(); }
40  selected_.clear();
41  for (size_t idx = 0; idx < c->size(); ++idx) {
42  if (select_(edm::Ref<InputCollection>(c, idx), ev)) //(*c)[idx]
44  }
45  }
46 
47 private:
48  StoreContainer selected_;
50  RefAdder addRef_;
51 };
52 
53 #endif
S make(const edm::ParameterSet &cfg)
void select(const edm::Handle< InputCollection > &c, const edm::Event &ev, const edm::EventSetup &)
SingleElementCollectionSelectorPlusEvent(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Functor that operates on <T>
Definition: Selector.h:22
fixed size matrix
HLT enums.