CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleElementCollectionSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionSelector_h
2 #define RecoAlgos_SingleElementCollectionSelector_h
3 
18 namespace reco {
19  namespace modules {
20  template<typename S> struct SingleElementCollectionSelectorEventSetupInit;
21  }
22 }
23 template<typename InputCollection, typename Selector,
29  typedef StoreContainer container;
30  typedef Selector selector;
31  typedef typename container::const_iterator const_iterator;
33  select_(reco::modules::make<Selector>(cfg)) { }
34  const_iterator begin() const { return selected_.begin(); }
35  const_iterator end() const { return selected_.end(); }
37  selected_.clear();
38  for(size_t idx = 0; idx < c->size(); ++ idx) {
39  if(select_((*c)[idx]))
40  addRef_(selected_, c, idx);
41  }
42  }
43 private:
46  RefAdder addRef_;
48 };
49 
51 
52 namespace reco {
53  namespace modules {
54  template<typename S>
55  struct SingleElementCollectionSelectorEventSetupInit {
56  static void init(S & s, const edm::Event & ev, const edm::EventSetup& es) {
57  typedef typename EventSetupInit<typename S::selector>::type ESI;
58  ESI::init(s.select_, ev, es);
59  }
60  };
61 
62  template<typename I, typename S, typename O, typename C, typename R>
65  };
66  }
67 }
68 
69 #endif
70 
type
Definition: HCALResponse.h:21
std::vector< ProtoJet > OutputCollection
Definition: JetRecoTypes.h:63
std::vector< InputItem > InputCollection
Definition: JetRecoTypes.h:62
int init
Definition: HydjetWrapper.h:63
S make(const edm::ParameterSet &cfg)
take no action (default)
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
const std::complex< double > I
Definition: I.h:8
SingleElementCollectionSelector(const edm::ParameterSet &cfg)
Functor that operates on &lt;T&gt;
Definition: Selector.h:25
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > > type
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)