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
);
ConfigurationDescriptions.h
edm::StreamID
Definition:
StreamID.h:30
electrons_cff.bool
bool
Definition:
electrons_cff.py:372
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:95
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::EDPutTokenT< bool >
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
edm::BooleanProducer::produce
void produce(StreamID sid, Event &event, EventSetup const &setup) const final
Definition:
BooleanProducer.cc:14
singleTopDQM_cfi.setup
setup
Definition:
singleTopDQM_cfi.py:37
edm::BooleanProducer
Definition:
BooleanProducer.cc:9
config
Definition:
config.py:1
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
edm::BooleanProducer::BooleanProducer
BooleanProducer(ParameterSet const &config)
Definition:
BooleanProducer.cc:11
ParameterSetDescription.h
edm::global::EDProducer
Definition:
EDProducer.h:32
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
edm::BooleanProducer::value_
const bool value_
Definition:
BooleanProducer.cc:19
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition:
ConfigurationDescriptions.cc:48
edm::EventSetup
Definition:
EventSetup.h:57
edm::ProductRegistryHelper::produces
BranchAliasSetterT< ProductType > produces()
declare what type of product will make and with which optional label
Definition:
ProductRegistryHelper.h:108
edm::BooleanProducer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition:
BooleanProducer.cc:23
EventSetup.h
ParameterSet.h
EDProducer.h
edm::BooleanProducer::token_
const edm::EDPutTokenT< bool > token_
Definition:
BooleanProducer.cc:20
event
Definition:
event.py:1
edm::Event
Definition:
Event.h:73
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
Generated for CMSSW Reference Manual by
1.8.16