CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CalibMuon/CSCCalibration/plugins/CSCBadChambersConditions.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/CSCBadChambers.h"
00006 #include "CondFormats/DataRecord/interface/CSCBadChambersRcd.h"
00007 #include "CalibMuon/CSCCalibration/interface/CSCBadChambersConditions.h"
00008 
00009 
00010 CSCBadChambersConditions::CSCBadChambersConditions(const edm::ParameterSet& iConfig)
00011 {
00012   //the following line is needed to tell the framework what
00013   // data is being produced
00014   cndbBadChambers = prefillBadChambers();
00015   setWhatProduced(this,&CSCBadChambersConditions::produceBadChambers);
00016   findingRecord<CSCBadChambersRcd>();
00017   //now do what ever other initialization is needed
00018 }
00019 
00020 
00021 CSCBadChambersConditions::~CSCBadChambersConditions()
00022 {
00023  
00024    // do anything here that needs to be done at desctruction time
00025    // (e.g. close files, deallocate resources etc.)
00026   delete cndbBadChambers;
00027 }
00028 
00029 
00030 //
00031 // member functions
00032 //
00033 
00034 // ------------ method called to produce the data  ------------
00035 CSCBadChambersConditions::ReturnType
00036 CSCBadChambersConditions::produceBadChambers(const CSCBadChambersRcd& iRecord)
00037 {
00038   //need a new object so to not be deleted at exit
00039   CSCBadChambers* mydata=new CSCBadChambers( *cndbBadChambers );
00040   return mydata;
00041   
00042 }
00043 
00044  void CSCBadChambersConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue&,
00045  edm::ValidityInterval & oValidity)
00046  {
00047  oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(),edm::IOVSyncValue::endOfTime());
00048  
00049  }