CMS 3D CMS Logo

SingleElementCollectionRefSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionRefSelector_h
2 #define RecoAlgos_SingleElementCollectionRefSelector_h
3 
21 
22 namespace reco {
23  namespace modules {
24  template <typename S>
26  }
27 } // namespace reco
28 namespace edm {
29  class Event;
30  class EventSetup;
31 } // namespace edm
32 
33 template <typename InputType,
34  typename Selector,
35  typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<edm::View<InputType> >::type,
37  typename RefAdder = typename ::helper::SelectionAdderTrait<edm::View<InputType>, StoreContainer>::type>
41  typedef StoreContainer container;
42  typedef Selector selector;
43  typedef typename container::const_iterator const_iterator;
45  : select_(reco::modules::make<Selector>(cfg, iC)) {}
46  const_iterator begin() const { return selected_.begin(); }
47  const_iterator end() const { return selected_.end(); }
49  selected_.clear();
50  for (size_t idx = 0; idx < c->size(); ++idx) {
51  if (select_(c->refAt(idx)))
53  }
54  }
55 
56 private:
59  RefAdder addRef_;
61 };
62 
64 
65 namespace reco {
66  namespace modules {
67  template <typename S>
68  struct SingleElementCollectionRefSelectorEventSetupInit {
70  void init(S& s, const edm::Event& ev, const edm::EventSetup& es) { esi_.init(s.select_, ev, es); }
73  };
74 
75  template <typename I, typename S, typename O, typename C, typename R>
78  };
79  } // namespace modules
80 } // namespace reco
81 
82 #endif
SingleElementCollectionRefSelectorEventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > > type
InputType
Definition: InputType.h:5
void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
S make(const edm::ParameterSet &cfg)
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
const std::complex< double > I
Definition: I.h:8
Functor that operates on <T>
Definition: Selector.h:22
SingleElementCollectionRefSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
fixed size matrix
HLT enums.