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:
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
EVENTSETUP_STD_INIT
#define EVENTSETUP_STD_INIT(SELECTOR)
Definition: EventSetupInitTrait.h:103
dummy::select
bool select(const T &)
Definition: DummySelector.h:40
DummySelector::DummySelector
DummySelector(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Definition: DummySelector.h:25
funct::false
false
Definition: Factorize.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
EventSetupInitTrait.h
EDMException.h
DummySelector::updated_
bool updated_
Definition: DummySelector.h:35
Event
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
edm::EventSetup
Definition: EventSetup.h:58
DummySelector::operator()
bool operator()(const T &)
Definition: DummySelector.h:28
DummySelector
Definition: DummySelector.h:23
T
long double T
Definition: Basic3DVectorLD.h:48
Exception
Definition: hltDiff.cc:245
DummySelector::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &)
Definition: DummySelector.h:26
ConsumesCollector.h
EventSetup
dummy
Definition: DummySelector.h:38
edm::Event
Definition: Event.h:73
edm::errors::Configuration
Definition: EDMException.h:36
edm::ConsumesCollector
Definition: ConsumesCollector.h:45