src
HeterogeneousCore
AlpakaTest
plugins
TestESProducers.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/Framework/interface/ModuleFactory.h
"
3
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
6
#include "
HeterogeneousCore/AlpakaTest/interface/AlpakaESTestRecords.h
"
7
#include "
HeterogeneousCore/AlpakaTest/interface/ESTestData.h
"
8
9
namespace
cms::alpakatest
{
10
template
<
typename
TProduct,
typename
TRecord>
11
class
TestESProducerT
:
public
edm::ESProducer
{
12
public
:
13
TestESProducerT
(
edm::ParameterSet
const
& iConfig) :
value_
(iConfig.getParameter<
int
>(
"value"
)) {
14
setWhatProduced
(
this
);
15
}
16
17
std::optional<TProduct>
produce
(TRecord
const
& iRecord) {
return
TProduct(
value_
); }
18
19
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
20
edm::ParameterSetDescription
desc
;
21
desc
.add<
int
>(
"value"
);
22
descriptions.
addWithDefaultLabel
(
desc
);
23
}
24
25
private
:
26
int
const
value_
;
27
};
28
29
using
TestESProducerA
=
TestESProducerT<cms::alpakatest::ESTestDataA, AlpakaESTestRecordA>
;
30
using
TestESProducerB
=
TestESProducerT<cms::alpakatest::ESTestDataB, AlpakaESTestRecordB>
;
31
using
TestESProducerC
=
TestESProducerT<cms::alpakatest::ESTestDataC, AlpakaESTestRecordC>
;
32
}
// namespace cms::alpakatest
33
34
DEFINE_FWK_EVENTSETUP_MODULE
(
cms::alpakatest::TestESProducerA
);
35
DEFINE_FWK_EVENTSETUP_MODULE
(
cms::alpakatest::TestESProducerB
);
36
DEFINE_FWK_EVENTSETUP_MODULE
(
cms::alpakatest::TestESProducerC
);
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
ModuleFactory.h
ESTestData.h
cms::alpakatest::TestESProducerT::TestESProducerT
TestESProducerT(edm::ParameterSet const &iConfig)
Definition:
TestESProducers.cc:13
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
cms::alpakatest
Definition:
AlpakaESTestData.h:10
AlpakaESTestRecords.h
createfilelist.int
int
Definition:
createfilelist.py:10
ParameterSetDescription.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:61
cms::alpakatest::TestESProducerT::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TestESProducers.cc:19
edm::ParameterSet
Definition:
ParameterSet.h:47
cms::alpakatest::TestESProducerT::value_
int const value_
Definition:
TestESProducers.cc:26
ConfigurationDescriptions.h
cms::alpakatest::TestESProducerT::produce
std::optional< TProduct > produce(TRecord const &iRecord)
Definition:
TestESProducers.cc:17
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
cms::alpakatest::TestESProducerT
Definition:
TestESProducers.cc:11
Generated for CMSSW Reference Manual by
1.8.14