CMS 3D CMS Logo

ConvertingESProducerT.h
Go to the documentation of this file.
1 #ifndef HeterogeneousCore_CUDACore_interface_ConvertingESProducerT_h
2 #define HeterogeneousCore_CUDACore_interface_ConvertingESProducerT_h
3 
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>
21 public:
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 
36 
37  desc.add<std::string>("ComponentName", "");
38  desc.add<std::string>("label", "")->setComment("ESProduct label");
39  confDesc.addWithDefaultLabel(desc);
40  }
41 
42 private:
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