CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

SiStripConfObjectGenerator Class Reference

#include <SiStripConfObjectGenerator.h>

Inheritance diagram for SiStripConfObjectGenerator:
SiStripCondObjBuilderBase< SiStripConfObject >

List of all members.

Public Member Functions

void getObj (SiStripConfObject *&obj)
 SiStripConfObjectGenerator (const edm::ParameterSet &, const edm::ActivityRegistry &)
 ~SiStripConfObjectGenerator ()

Private Member Functions

void createObject ()

Private Attributes

std::vector< edm::ParameterSetparameters_

Detailed Description

Fake generator for configuration parameters stored in the SiStripConfObject object.

Definition at line 15 of file SiStripConfObjectGenerator.h.


Constructor & Destructor Documentation

SiStripConfObjectGenerator::SiStripConfObjectGenerator ( const edm::ParameterSet iConfig,
const edm::ActivityRegistry aReg 
) [explicit]

Definition at line 4 of file SiStripConfObjectGenerator.cc.

                                                                                                                    :
  SiStripCondObjBuilderBase<SiStripConfObject>::SiStripCondObjBuilderBase(iConfig)
{
  edm::LogInfo("SiStripConfObjectGenerator") << "[SiStripConfObjectGenerator::SiStripConfObjectGenerator]";
}
SiStripConfObjectGenerator::~SiStripConfObjectGenerator ( )

Definition at line 10 of file SiStripConfObjectGenerator.cc.

{
  edm::LogInfo("SiStripConfObjectGenerator") << "[SiStripConfObjectGenerator::~SiStripConfObjectGenerator]";
}

Member Function Documentation

void SiStripConfObjectGenerator::createObject ( ) [private]

Definition at line 15 of file SiStripConfObjectGenerator.cc.

References SiStripCondObjBuilderBase< SiStripConfObject >::_pset, edm::ParameterSet::getParameter(), SiStripCondObjBuilderBase< SiStripConfObject >::obj_, parameters_, and SiStripConfObject::put().

Referenced by getObj().

{
  parameters_ = _pset.getParameter<std::vector<edm::ParameterSet> >("Parameters");
  std::vector<edm::ParameterSet>::const_iterator parIt = parameters_.begin();
  obj_ = new SiStripConfObject();
  for( ; parIt != parameters_.end(); ++parIt ) {
    if( parIt->getParameter<std::string>("ParameterType") == "int" ) {
      obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<int32_t>("ParameterValue"));
    }
    else if( parIt->getParameter<std::string>("ParameterType") == "double" ) {
      obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<double>("ParameterValue"));
    }
    if( parIt->getParameter<std::string>("ParameterType") == "string" ) {
      obj_->put(parIt->getParameter<std::string>("ParameterName"), parIt->getParameter<std::string>("ParameterValue"));
    }
  }
}
void SiStripConfObjectGenerator::getObj ( SiStripConfObject *&  obj) [inline, virtual]

Member Data Documentation

Definition at line 27 of file SiStripConfObjectGenerator.h.

Referenced by createObject().