Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:13

0001 #ifndef CalibTracker_SiStripESProducers_SiStripTemplateEmptyFakeESSource
0002 #define CalibTracker_SiStripESProducers_SiStripTemplateEmptyFakeESSource
0003 
0004 // system include files
0005 #include <memory>
0006 
0007 // user include files
0008 #include "FWCore/Framework/interface/ModuleFactory.h"
0009 #include "FWCore/Framework/interface/ESProducer.h"
0010 
0011 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 
0015 //
0016 // class declaration
0017 //
0018 
0019 template <typename TObject, typename TRecord>
0020 class SiStripTemplateEmptyFakeESSource : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
0021 public:
0022   SiStripTemplateEmptyFakeESSource(const edm::ParameterSet&);
0023   SiStripTemplateEmptyFakeESSource(const SiStripTemplateEmptyFakeESSource&) = delete;
0024   const SiStripTemplateEmptyFakeESSource& operator=(const SiStripTemplateEmptyFakeESSource&) = delete;
0025   ~SiStripTemplateEmptyFakeESSource() override{};
0026 
0027   std::unique_ptr<TObject> produce(const TRecord&);
0028 
0029 private:
0030   void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0031                       const edm::IOVSyncValue& iov,
0032                       edm::ValidityInterval& iValidity) override;
0033 };
0034 
0035 template <typename TObject, typename TRecord>
0036 SiStripTemplateEmptyFakeESSource<TObject, TRecord>::SiStripTemplateEmptyFakeESSource(const edm::ParameterSet& iConfig) {
0037   setWhatProduced(this);
0038   findingRecord<TRecord>();
0039 }
0040 
0041 template <typename TObject, typename TRecord>
0042 std::unique_ptr<TObject> SiStripTemplateEmptyFakeESSource<TObject, TRecord>::produce(const TRecord& iRecord) {
0043   return std::make_unique<TObject>();
0044 }
0045 
0046 template <typename TObject, typename TRecord>
0047 void SiStripTemplateEmptyFakeESSource<TObject, TRecord>::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0048                                                                         const edm::IOVSyncValue& iov,
0049                                                                         edm::ValidityInterval& iValidity) {
0050   edm::ValidityInterval infinity(iov.beginOfTime(), iov.endOfTime());
0051   iValidity = infinity;
0052 }
0053 
0054 #endif