src
FWCore
Modules
src
BooleanProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Event.h
"
2
#include "
FWCore/Framework/interface/EventSetup.h
"
3
#include "
FWCore/Framework/interface/global/EDProducer.h
"
4
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
7
8
namespace
edm
{
9
class
BooleanProducer
:
public
global::EDProducer
<> {
10
public
:
11
explicit
BooleanProducer
(
ParameterSet
const
&
config
)
12
:
value_
(
config
.getParameter<
bool
>(
"value"
)),
token_
(
produces
<
bool
>()) {}
13
14
void
produce
(
StreamID
sid,
Event
&
event
,
EventSetup
const
&
setup
)
const
final
{
event
.emplace(
token_
,
value_
); }
15
16
static
void
fillDescriptions
(
ConfigurationDescriptions
& descriptions);
17
18
private
:
19
const
bool
value_
;
20
const
edm::EDPutTokenT<bool>
token_
;
21
};
22
23
void
BooleanProducer::fillDescriptions
(
ConfigurationDescriptions
& descriptions) {
24
edm::ParameterSetDescription
desc
;
25
desc
.add<
bool
>(
"value"
,
false
);
26
descriptions.
addWithDefaultLabel
(
desc
);
27
descriptions.
setComment
(
"This EDProducer produces a boolean value according to the \"value\" parameter."
);
28
}
29
}
// namespace edm
30
31
#include "
FWCore/Framework/interface/MakerMacros.h
"
32
using
edm::BooleanProducer
;
33
DEFINE_FWK_MODULE
(
BooleanProducer
);
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
EDProducer.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::ProductRegistryHelper::produces
auto produces() noexcept
Definition:
ProductRegistryHelper.h:121
edm::StreamID
Definition:
StreamID.h:30
Event.h
MakerMacros.h
EventSetup.h
edm::BooleanProducer
Definition:
BooleanProducer.cc:9
edm::BooleanProducer::token_
const edm::EDPutTokenT< bool > token_
Definition:
BooleanProducer.cc:20
config
Definition:
config.py:1
edm::EDPutTokenT< bool >
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ParameterSet.h
ParameterSetDescription.h
edm::BooleanProducer::BooleanProducer
BooleanProducer(ParameterSet const &config)
Definition:
BooleanProducer.cc:11
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
edm::EventSetup
Definition:
EventSetup.h:59
edm::global::EDProducer
Definition:
EDProducer.h:32
singleTopDQM_cfi.setup
setup
SETUP
Definition:
singleTopDQM_cfi.py:37
edm::BooleanProducer::produce
void produce(StreamID sid, Event &event, EventSetup const &setup) const final
Definition:
BooleanProducer.cc:14
electrons_cff.bool
bool
Definition:
electrons_cff.py:381
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition:
ConfigurationDescriptions.cc:48
edm::BooleanProducer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition:
BooleanProducer.cc:23
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::BooleanProducer::value_
const bool value_
Definition:
BooleanProducer.cc:19
edm::ParameterSet
Definition:
ParameterSet.h:47
ConfigurationDescriptions.h
edm::Event
Definition:
Event.h:73
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
event
Definition:
event.py:1
Generated for CMSSW Reference Manual by
1.8.14