CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleElementCollectionRefSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionRefSelector_h
2 #define RecoAlgos_SingleElementCollectionRefSelector_h
3 
19 namespace reco {
20  namespace modules {
22  }
23 }
24 template<typename InputType, typename Selector,
25  typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<edm::View<InputType> >::type,
27  typename RefAdder = typename ::helper::SelectionAdderTrait<edm::View<InputType>, StoreContainer>::type>
31  typedef StoreContainer container;
32  typedef Selector selector;
33  typedef typename container::const_iterator const_iterator;
35  select_(reco::modules::make<Selector>(cfg)) { }
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_(c->refAt(idx))) addRef_(selected_, c, idx);
42  }
43  }
44 private:
47  RefAdder addRef_;
49 };
50 
52 
53 namespace reco {
54  namespace modules {
55  template<typename S>
56  struct SingleElementCollectionRefSelectorEventSetupInit {
57  static void init(S & s, const edm::Event & ev, const edm::EventSetup& es) {
58  typedef typename EventSetupInit<typename S::selector>::type ESI;
59  ESI::init(s.select_, ev, es);
60  }
61  };
62 
63  template<typename I, typename S, typename O, typename C, typename R>
66  };
67  }
68 }
69 
70 #endif
type
Definition: HCALResponse.h:22
SingleElementCollectionRefSelectorEventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > > type
std::vector< ProtoJet > OutputCollection
Definition: JetRecoTypes.h:63
int init
Definition: HydjetWrapper.h:63
S make(const edm::ParameterSet &cfg)
take no action (default)
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 &lt;T&gt;
Definition: Selector.h:25
SingleElementCollectionRefSelector(const edm::ParameterSet &cfg)
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)