Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:52

0001 #include "CalibTracker/SiStripESProducers/interface/SiStripPedestalsESSource.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0004 #include "CondFormats/SiStripObjects/interface/SiStripPedestals.h"
0005 #include "CondFormats/DataRecord/interface/SiStripPedestalsRcd.h"
0006 #include <iostream>
0007 
0008 using namespace sistrip;
0009 
0010 // -----------------------------------------------------------------------------
0011 //
0012 SiStripPedestalsESSource::SiStripPedestalsESSource(const edm::ParameterSet& pset) {
0013   setWhatProduced(this);
0014   findingRecord<SiStripPedestalsRcd>();
0015 }
0016 
0017 // -----------------------------------------------------------------------------
0018 //
0019 std::unique_ptr<SiStripPedestals> SiStripPedestalsESSource::produce(const SiStripPedestalsRcd&) {
0020   SiStripPedestals* peds = makePedestals();
0021 
0022   if (!peds) {
0023     edm::LogWarning(mlESSources_) << "[SiStripPedestalsESSource::" << __func__ << "]"
0024                                   << " Null pointer to SiStripPedestals object!";
0025   }
0026 
0027   std::unique_ptr<SiStripPedestals> ptr(peds);
0028   return ptr;
0029 }
0030 
0031 // -----------------------------------------------------------------------------
0032 //
0033 void SiStripPedestalsESSource::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0034                                               const edm::IOVSyncValue& iosv,
0035                                               edm::ValidityInterval& oValidity) {
0036   edm::ValidityInterval infinity(iosv.beginOfTime(), iosv.endOfTime());
0037   oValidity = infinity;
0038 }