CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
14 namespace edm {
15  class ParameterSet;
16  class Event;
17  class EventSetup;
18 }
19 
21 public:
23  void newEvent(const edm::Event&, const edm::EventSetup&) { updated_ = true; }
24  template<typename T>
25  bool operator()(const T&) {
26  if(!updated_)
28  << "DummySelector: forgot to call newEvent\n";
29  return true;
30  }
31 private:
32  bool updated_;
33 };
34 
35 namespace dummy {
36  template<typename T>
37  inline bool select(const T&) { return true; }
38 }
39 
41 
42 #endif
#define EVENTSETUP_STD_INIT(SELECTOR)
bool select(const T &)
Definition: DummySelector.h:37
bool operator()(const T &)
Definition: DummySelector.h:25
void newEvent(const edm::Event &, const edm::EventSetup &)
Definition: DummySelector.h:23
DummySelector(const edm::ParameterSet &)
Definition: DummySelector.h:22