HeterogeneousCore
CUDACore
interface
ConvertingESProducerT.h
Go to the documentation of this file.
1
#ifndef HeterogeneousCore_CUDACore_interface_ConvertingESProducerT_h
2
#define HeterogeneousCore_CUDACore_interface_ConvertingESProducerT_h
3
4
#include "
FWCore/Framework/interface/ESProducer.h
"
5
#include "
FWCore/Framework/interface/ESTransientHandle.h
"
6
#include "
FWCore/Framework/interface/MakerMacros.h
"
7
#include "
FWCore/Framework/interface/ModuleFactory.h
"
8
#include "
FWCore/Framework/interface/eventsetuprecord_registration_macro.h
"
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
#include "
FWCore/Utilities/interface/typelookup.h
"
11
12
/* class template: ConvertingESProducerT
13
*
14
* This class template can be used to simplify the implementation of any ESProducer that reads
15
* conditions data from a record and pushes derived conditions data to the same record.
16
* The current use case is to convert and copy the calibrations from the CPU to the GPUs.
17
*/
18
19
template
<
typename
Record,
typename
Target,
typename
Source>
20
class
ConvertingESProducerT
:
public
edm::ESProducer
{
21
public
:
22
explicit
ConvertingESProducerT
(
edm::ParameterSet
const
& ps) {
23
auto
const
&
label
= ps.
getParameter
<
std::string
>(
"label"
);
24
auto
const
&
name
= ps.
getParameter
<
std::string
>(
"ComponentName"
);
25
auto
cc
=
setWhatProduced
(
this
,
name
);
26
token_
=
cc
.consumes(
edm::ESInputTag
{
""
,
label
});
27
}
28
29
std::unique_ptr<Target>
produce
(
Record
const
&
record
) {
30
// retrieve conditions in the old format and build a product in the new format
31
return
std::make_unique<Target>(
record
.get(
token_
));
32
}
33
34
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& confDesc) {
35
edm::ParameterSetDescription
desc
;
36
37
desc
.add<
std::string
>(
"ComponentName"
,
""
);
38
desc
.add<
std::string
>(
"label"
,
""
)->setComment(
"ESProduct label"
);
39
confDesc.
addWithDefaultLabel
(
desc
);
40
}
41
42
private
:
43
edm::ESGetToken<Source, Record>
token_
;
44
};
45
46
#endif // HeterogeneousCore_CUDACore_interface_ConvertingESProducerT_h
ConvertingESProducerT::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &confDesc)
Definition:
ConvertingESProducerT.h:34
edm::ESInputTag
Definition:
ESInputTag.h:87
ESTransientHandle.h
ConvertingESProducerT
Definition:
ConvertingESProducerT.h:20
eventsetuprecord_registration_macro.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
GlobalPosition_Frontier_DevDB_cff.record
record
Definition:
GlobalPosition_Frontier_DevDB_cff.py:10
typelookup.h
MakerMacros.h
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ConvertingESProducerT::ConvertingESProducerT
ConvertingESProducerT(edm::ParameterSet const &ps)
Definition:
ConvertingESProducerT.h:22
edm::ParameterSet
Definition:
ParameterSet.h:47
cc
edm::ESGetToken< Source, Record >
ConvertingESProducerT::produce
std::unique_ptr< Target > produce(Record const &record)
Definition:
ConvertingESProducerT.h:29
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
ConvertingESProducerT::token_
edm::ESGetToken< Source, Record > token_
Definition:
ConvertingESProducerT.h:43
Record
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
label
const char * label
Definition:
PFTauDecayModeTools.cc:11
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
Generated for CMSSW Reference Manual by
1.8.16