Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:30:36

0001 #include <array>
0002 #include <iostream>
0003 #include <tuple>
0004 #include <utility>
0005 
0006 #include "FWCore/Framework/interface/ESProducer.h"
0007 #include "FWCore/Framework/interface/ESProductHost.h"
0008 #include "FWCore/Framework/interface/ESTransientHandle.h"
0009 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 #include "FWCore/Framework/interface/ModuleFactory.h"
0012 #include "FWCore/Framework/interface/SourceFactory.h"
0013 #include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0015 #include "FWCore/Utilities/interface/ReusableObjectHolder.h"
0016 #include "FWCore/Utilities/interface/typelookup.h"
0017 #include "HeterogeneousCore/CUDACore/interface/JobConfigurationGPURecord.h"
0018 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalMahiPulseOffsetsGPU.h"
0019 
0020 class HcalMahiPulseOffsetsGPUESProducer : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
0021 public:
0022   HcalMahiPulseOffsetsGPUESProducer(edm::ParameterSet const&);
0023   ~HcalMahiPulseOffsetsGPUESProducer() override = default;
0024 
0025   static void fillDescriptions(edm::ConfigurationDescriptions&);
0026   std::unique_ptr<HcalMahiPulseOffsetsGPU> produce(JobConfigurationGPURecord const&);
0027 
0028 protected:
0029   void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0030                       const edm::IOVSyncValue&,
0031                       edm::ValidityInterval&) override;
0032 
0033 private:
0034   edm::ParameterSet const& pset_;
0035 };
0036 
0037 HcalMahiPulseOffsetsGPUESProducer::HcalMahiPulseOffsetsGPUESProducer(edm::ParameterSet const& pset) : pset_{pset} {
0038   setWhatProduced(this);
0039   findingRecord<JobConfigurationGPURecord>();
0040 }
0041 
0042 void HcalMahiPulseOffsetsGPUESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey& iKey,
0043                                                        const edm::IOVSyncValue& iTime,
0044                                                        edm::ValidityInterval& oInterval) {
0045   oInterval = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime());
0046 }
0047 
0048 void HcalMahiPulseOffsetsGPUESProducer::fillDescriptions(edm::ConfigurationDescriptions& desc) {
0049   edm::ParameterSetDescription d;
0050   d.add<std::vector<int>>("pulseOffsets", {-3, -2, -1, 0, 1, 2, 3, 4});
0051   desc.addWithDefaultLabel(d);
0052 }
0053 
0054 std::unique_ptr<HcalMahiPulseOffsetsGPU> HcalMahiPulseOffsetsGPUESProducer::produce(JobConfigurationGPURecord const&) {
0055   return std::make_unique<HcalMahiPulseOffsetsGPU>(pset_);
0056 }
0057 
0058 DEFINE_FWK_EVENTSETUP_SOURCE(HcalMahiPulseOffsetsGPUESProducer);