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 
19 namespace reco {
20  namespace modules {
21  template<typename S> struct SingleElementCollectionSelectorEventSetupInit;
22  }
23 }
24 template<typename InputCollection, typename Selector,
30  typedef StoreContainer container;
31  typedef Selector selector;
32  typedef typename container::const_iterator const_iterator;
34  select_(reco::modules::make<Selector>(cfg, iC)) { }
35  const_iterator begin() const { return selected_.begin(); }
36  const_iterator end() const { return selected_.end(); }
38  selected_.clear();
39  for(size_t idx = 0; idx < c->size(); ++ idx) {
40  if(select_((*c)[idx]))
41  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 SingleElementCollectionSelectorEventSetupInit {
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
71 
type
Definition: HCALResponse.h:21
tuple cfg
Definition: looper.py:293
int init
Definition: HydjetWrapper.h:67
S make(const edm::ParameterSet &cfg)
bool ev
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
Functor that operates on &lt;T&gt;
Definition: Selector.h:24
SingleElementCollectionSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
tuple InputCollection
SingleElementCollectionSelectorEventSetupInit< SingleElementCollectionSelector< I, S, O, C, R > > type
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)