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 } // namespace edm
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_)
30  throw edm::Exception(edm::errors::Configuration) << "DummySelector: forgot to call newEvent\n";
31  return true;
32  }
33 
34 private:
35  bool updated_;
36 };
37 
38 namespace dummy {
39  template <typename T>
40  inline bool select(const T&) {
41  return true;
42  }
43 } // namespace dummy
44 
46 
47 #endif
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
#define EVENTSETUP_STD_INIT(SELECTOR)
HLT enums.
DummySelector(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Definition: DummySelector.h:25
long double T