CMS 3D CMS Logo

DummySelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_DummySelector_h
2 #define CommonTools_UtilAlgos_DummySelector_h
3 /* \class DummySelector
4  *
5  * Dummy generic selector following the
6  * interface proposed in the document:
7  *
8  * https://twiki.cern.ch/twiki/bin/view/CMS/SelectorInterface
9  *
10  * \author Luca Lista, INFN
11  */
13 
16 
17 namespace edm {
18  class ParameterSet;
19  class Event;
20  class EventSetup;
21 }
22 
24 public:
25  explicit DummySelector(const edm::ParameterSet&, edm::ConsumesCollector & iC) : updated_(false) { }
26  void newEvent(const edm::Event&, const edm::EventSetup&) { updated_ = true; }
27  template<typename T>
28  bool operator()(const T&) {
29  if(!updated_)
31  << "DummySelector: forgot to call newEvent\n";
32  return true;
33  }
34 private:
35  bool updated_;
36 };
37 
38 namespace dummy {
39  template<typename T>
40  inline bool select(const T&) { return true; }
41 }
42 
44 
45 #endif
#define EVENTSETUP_STD_INIT(SELECTOR)
bool select(const T &)
Definition: DummySelector.h:40
bool operator()(const T &)
Definition: DummySelector.h:28
void newEvent(const edm::Event &, const edm::EventSetup &)
Definition: DummySelector.h:26
HLT enums.
DummySelector(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Definition: DummySelector.h:25
long double T