src
CommonTools
UtilAlgos
interface
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
*/
12
#include "
CommonTools/UtilAlgos/interface/EventSetupInitTrait.h
"
13
14
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
15
#include "
FWCore/Utilities/interface/EDMException.h
"
16
17
namespace
edm
{
18
class
ParameterSet
;
19
class
Event
;
20
class
EventSetup
;
21
}
// namespace edm
22
23
class
DummySelector
{
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
45
EVENTSETUP_STD_INIT
(
DummySelector
);
46
47
#endif
dummy
Definition:
DummySelector.h:38
DummySelector::updated_
bool updated_
Definition:
DummySelector.h:35
Exception
Definition:
hltDiff.cc:245
ParameterSet
Definition:
Functions.h:16
funct::false
false
Definition:
Factorize.h:29
EVENTSETUP_STD_INIT
#define EVENTSETUP_STD_INIT(SELECTOR)
Definition:
EventSetupInitTrait.h:125
dummy::select
bool select(const T &)
Definition:
DummySelector.h:40
edm::errors::Configuration
Definition:
EDMException.h:36
DummySelector::operator()
bool operator()(const T &)
Definition:
DummySelector.h:28
EventSetup
EDMException.h
DummySelector::newEvent
void newEvent(const edm::Event &, const edm::EventSetup &)
Definition:
DummySelector.h:26
edm::EventSetup
Definition:
EventSetup.h:59
DummySelector
Definition:
DummySelector.h:23
Event
edm
HLT enums.
Definition:
AlignableModifier.h:19
DummySelector::DummySelector
DummySelector(const edm::ParameterSet &, edm::ConsumesCollector &iC)
Definition:
DummySelector.h:25
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Event
Definition:
Event.h:73
T
long double T
Definition:
Basic3DVectorLD.h:48
ConsumesCollector.h
EventSetupInitTrait.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.14