CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/CalibTracker/SiStripESProducers/src/SiStripBaseDelayGenerator.cc

Go to the documentation of this file.
00001 #include "CalibTracker/SiStripESProducers/interface/SiStripBaseDelayGenerator.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include <boost/cstdint.hpp>
00004 #include "CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h"
00005 #include "FWCore/ParameterSet/interface/FileInPath.h"
00006 
00007 #include "CLHEP/Random/RandFlat.h"
00008 #include "CLHEP/Random/RandGauss.h"
00009 
00010 SiStripBaseDelayGenerator::SiStripBaseDelayGenerator(const edm::ParameterSet& iConfig,const edm::ActivityRegistry& aReg):
00011   SiStripCondObjBuilderBase<SiStripBaseDelay>::SiStripCondObjBuilderBase(iConfig)
00012 {
00013   edm::LogInfo("SiStripBaseDelayGenerator") << "[SiStripBaseDelayGenerator::SiStripBaseDelayGenerator]";
00014 }
00015 
00016 SiStripBaseDelayGenerator::~SiStripBaseDelayGenerator()
00017 {
00018   edm::LogInfo("SiStripBaseDelayGenerator") << "[SiStripBaseDelayGenerator::~SiStripBaseDelayGenerator]";
00019 }
00020 
00021 void SiStripBaseDelayGenerator::createObject()
00022 {
00023   obj_ = new SiStripBaseDelay();
00024 
00025   // Read the full list of detIds
00026   edm::FileInPath fp_ = _pset.getParameter<edm::FileInPath>("file");
00027   uint16_t coarseDelay = _pset.getParameter<uint32_t>("CoarseDelay");
00028   uint16_t fineDelay = _pset.getParameter<uint32_t>("FineDelay");
00029   SiStripDetInfoFileReader reader(fp_.fullPath());
00030   const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo > detInfos = reader.getAllData();
00031   if( !detInfos.empty() ) {
00032     std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = detInfos.begin();
00033     for( ; it != detInfos.end(); ++it ) {
00034       obj_->put(it->first, coarseDelay, fineDelay);
00035     }
00036   }
00037   else {
00038     edm::LogError("SiStripBaseDelayGenerator") << "Error: detInfo map is empty." << std::endl;
00039   }
00040 }