CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CalibTracker/SiStripESProducers/src/SiStripPedestalsESSource.cc

Go to the documentation of this file.
00001 #include "CalibTracker/SiStripESProducers/interface/SiStripPedestalsESSource.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00004 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
00005 #include "CondFormats/DataRecord/interface/SiStripPedestalsRcd.h"
00006 #include <iostream>
00007 
00008 using namespace sistrip;
00009 
00010 // -----------------------------------------------------------------------------
00011 //
00012 SiStripPedestalsESSource::SiStripPedestalsESSource( const edm::ParameterSet& pset ) {
00013   setWhatProduced( this );
00014   findingRecord<SiStripPedestalsRcd>();
00015 }
00016 
00017 // -----------------------------------------------------------------------------
00018 //
00019 std::auto_ptr<SiStripPedestals> SiStripPedestalsESSource::produce( const SiStripPedestalsRcd& ) { 
00020   
00021   SiStripPedestals* peds = makePedestals();
00022   
00023   if ( !peds ) {
00024     edm::LogWarning(mlESSources_)
00025       << "[SiStripPedestalsESSource::" << __func__ << "]"
00026       << " Null pointer to SiStripPedestals object!";
00027   }
00028   
00029   std::auto_ptr<SiStripPedestals> ptr(peds);
00030   return ptr;
00031 
00032 }
00033 
00034 // -----------------------------------------------------------------------------
00035 //
00036 void SiStripPedestalsESSource::setIntervalFor( const edm::eventsetup::EventSetupRecordKey&, 
00037                                                 const edm::IOVSyncValue& iosv, 
00038                                                 edm::ValidityInterval& oValidity ) {
00039 
00040   edm::ValidityInterval infinity( iosv.beginOfTime(), iosv.endOfTime() );
00041   oValidity = infinity;
00042   
00043 }