CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CalibMuon/CSCCalibration/plugins/CSCPedestalsDBConditions.cc

Go to the documentation of this file.
00001 #include <memory>
00002 #include "boost/shared_ptr.hpp"
00003 #include <fstream>
00004 
00005 #include "CondFormats/CSCObjects/interface/CSCDBPedestals.h"
00006 #include "CondFormats/DataRecord/interface/CSCDBPedestalsRcd.h"
00007 #include "CalibMuon/CSCCalibration/interface/CSCPedestalsDBConditions.h"
00008 
00009 
00010 CSCPedestalsDBConditions::CSCPedestalsDBConditions(const edm::ParameterSet& iConfig)
00011 {
00012   //the following line is needed to tell the framework what
00013   // data is being produced
00014  cndbPedestals = prefillDBPedestals();
00015   // added by Zhen (changed since 1_2_0)
00016   setWhatProduced(this,&CSCPedestalsDBConditions::produceDBPedestals);
00017   findingRecord<CSCDBPedestalsRcd>();
00018   //now do what ever other initialization is needed
00019 }
00020 
00021 
00022 CSCPedestalsDBConditions::~CSCPedestalsDBConditions()
00023 {
00024  
00025    // do anything here that needs to be done at desctruction time
00026    // (e.g. close files, deallocate resources etc.)
00027   delete cndbPedestals;
00028 }
00029 
00030 
00031 //
00032 // member functions
00033 //
00034 
00035 // ------------ method called to produce the data  ------------
00036 CSCPedestalsDBConditions::ReturnType
00037 CSCPedestalsDBConditions::produceDBPedestals(const CSCDBPedestalsRcd& iRecord)
00038 {
00039   //need a new object so to not be deleted at exit
00040   CSCDBPedestals* mydata=new CSCDBPedestals( *cndbPedestals );
00041   return mydata;
00042   
00043 }
00044 
00045  void CSCPedestalsDBConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&,
00046  edm::ValidityInterval & oValidity)
00047  {
00048  oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime());
00049  
00050  }