Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "CalibTracker/SiStripESProducers/interface/SiStripGainESSource.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0004 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
0005 #include "CondFormats/DataRecord/interface/SiStripApvGainRcd.h"
0006 #include <iostream>
0007 
0008 using namespace sistrip;
0009 
0010 // -----------------------------------------------------------------------------
0011 //
0012 SiStripGainESSource::SiStripGainESSource(const edm::ParameterSet& pset) {
0013   setWhatProduced(this);
0014   findingRecord<SiStripApvGainRcd>();
0015 }
0016 
0017 // -----------------------------------------------------------------------------
0018 //
0019 std::unique_ptr<SiStripApvGain> SiStripGainESSource::produce(const SiStripApvGainRcd&) {
0020   SiStripApvGain* gain = makeGain();
0021 
0022   if (!gain) {
0023     edm::LogWarning(mlESSources_) << "[SiStripGainESSource::" << __func__ << "]"
0024                                   << " Null pointer to SiStripApvGain object!";
0025   }
0026 
0027   std::unique_ptr<SiStripApvGain> ptr(gain);
0028   return ptr;
0029 }
0030 
0031 // -----------------------------------------------------------------------------
0032 //
0033 void SiStripGainESSource::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 }