CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CalibTracker/SiStripESProducers/src/SiStripConfObjectGenerator.cc

Go to the documentation of this file.
00001 #include "CalibTracker/SiStripESProducers/interface/SiStripConfObjectGenerator.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 
00004 SiStripConfObjectGenerator::SiStripConfObjectGenerator(const edm::ParameterSet& iConfig,const edm::ActivityRegistry& aReg):
00005   SiStripCondObjBuilderBase<SiStripConfObject>::SiStripCondObjBuilderBase(iConfig)
00006 {
00007   edm::LogInfo("SiStripConfObjectGenerator") << "[SiStripConfObjectGenerator::SiStripConfObjectGenerator]";
00008 }
00009 
00010 SiStripConfObjectGenerator::~SiStripConfObjectGenerator()
00011 {
00012   edm::LogInfo("SiStripConfObjectGenerator") << "[SiStripConfObjectGenerator::~SiStripConfObjectGenerator]";
00013 }
00014 
00015 void SiStripConfObjectGenerator::createObject()
00016 {
00017   parameters_ = _pset.getParameter<std::vector<edm::ParameterSet> >("Parameters");
00018   std::vector<edm::ParameterSet>::const_iterator parIt = parameters_.begin();
00019   obj_ = new SiStripConfObject();
00020   for( ; parIt != parameters_.end(); ++parIt ) {
00021     if( parIt->getParameter<std::string>("ParameterType") == "int" ) {
00022       obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<int32_t>("ParameterValue"));
00023     }
00024     else if( parIt->getParameter<std::string>("ParameterType") == "double" ) {
00025       obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<double>("ParameterValue"));
00026     }
00027     if( parIt->getParameter<std::string>("ParameterType") == "string" ) {
00028       obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<std::string>("ParameterValue"));
00029     }
00030   }
00031 }