CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/CalibTracker/SiStripESProducers/plugins/fake/SiStripTemplateEmptyFakeESSource.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripESProducers_SiStripTemplateEmptyFakeESSource
00002 #define CalibTracker_SiStripESProducers_SiStripTemplateEmptyFakeESSource
00003 
00004 // system include files
00005 #include <memory>
00006 #include "boost/shared_ptr.hpp"
00007 
00008 // user include files
00009 #include "FWCore/Framework/interface/ModuleFactory.h"
00010 #include "FWCore/Framework/interface/ESProducer.h"
00011 
00012 #include "FWCore/Framework/interface/ESHandle.h"
00013 
00014 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00017 
00018 //
00019 // class declaration
00020 //
00021 
00022 template< typename TObject , typename TRecord>
00023 class SiStripTemplateEmptyFakeESSource : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder  {
00024  public:
00025   SiStripTemplateEmptyFakeESSource(const edm::ParameterSet&);
00026   ~SiStripTemplateEmptyFakeESSource(){};
00027   
00028   
00029   std::auto_ptr<TObject> produce(const TRecord&);
00030   
00031 private:
00032   
00033   void setIntervalFor( const edm::eventsetup::EventSetupRecordKey&,
00034                        const edm::IOVSyncValue& iov,
00035                        edm::ValidityInterval& iValidity);
00036   
00037   SiStripTemplateEmptyFakeESSource( const SiStripTemplateEmptyFakeESSource& );
00038   const SiStripTemplateEmptyFakeESSource& operator=( const SiStripTemplateEmptyFakeESSource& );
00039 };
00040 
00041 template< typename TObject , typename TRecord>
00042 SiStripTemplateEmptyFakeESSource<TObject,TRecord>::SiStripTemplateEmptyFakeESSource(const edm::ParameterSet& iConfig)
00043 {
00044   setWhatProduced(this);
00045   findingRecord<TRecord>();
00046 }
00047 
00048 template< typename TObject , typename TRecord>
00049 std::auto_ptr<TObject> SiStripTemplateEmptyFakeESSource<TObject,TRecord>::produce(const TRecord& iRecord)
00050 {
00051   std::auto_ptr<TObject> ptr(new TObject);
00052   return ptr;
00053 }
00054 
00055 template< typename TObject , typename TRecord>
00056 void SiStripTemplateEmptyFakeESSource<TObject,TRecord>::setIntervalFor( const edm::eventsetup::EventSetupRecordKey&,
00057                                                          const edm::IOVSyncValue& iov,
00058                                                          edm::ValidityInterval& iValidity){
00059   edm::ValidityInterval infinity( iov.beginOfTime(), iov.endOfTime() );
00060   iValidity = infinity;
00061 }
00062 
00063 
00064 #endif