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 }
25 
26 template<typename InputCollection, typename Selector,
27  typename OutputCollection = typename helper::SelectedOutputCollectionTrait<InputCollection>::type,
28  typename StoreContainer = typename helper::StoreContainerTrait<OutputCollection>::type,
32  typedef StoreContainer container;
33  typedef typename container::const_iterator const_iterator;
35  select_( reco::modules::make<Selector>( cfg, iC ) ) { }
36  const_iterator begin() const { return selected_.begin(); }
37  const_iterator end() const { return selected_.end(); }
39  selected_.clear();
40  for(size_t idx = 0; idx < c->size(); ++ idx) {
41  if(select_( edm::Ref<InputCollection>(c,idx), ev) ) //(*c)[idx]
42  addRef_(selected_, c, idx);
43  }
44  }
45 private:
46  StoreContainer selected_;
48  RefAdder addRef_;
49 };
50 
51 #endif
52 
std::vector< const typename OutputCollection::value_type * > type
S make(const edm::ParameterSet &cfg)
void select(const edm::Handle< InputCollection > &c, const edm::Event &ev, const edm::EventSetup &)
bool ev
SingleElementCollectionSelectorPlusEvent(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Functor that operates on <T>
Definition: Selector.h:23
fixed size matrix
HLT enums.