CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibTracker/SiStripESProducers/plugins/real/SiStripDelayESProducer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    SiStripDelayESProducer
00004 // Class:      SiStripDelayESProducer
00005 // 
00013 //
00014 // Original Author:  M. De Mattia
00015 //         Created:  26/10/2010
00016 // $Id: SiStripDelayESProducer.cc,v 1.1 2010/10/26 14:55:59 demattia Exp $
00017 //
00018 //
00019 
00020 
00021 
00022 #include "CalibTracker/SiStripESProducers/plugins/real/SiStripDelayESProducer.h"
00023 
00024 
00025 
00026 SiStripDelayESProducer::SiStripDelayESProducer(const edm::ParameterSet& iConfig):
00027   pset_(iConfig),
00028   toGet(iConfig.getParameter<Parameters>("ListOfRecordToMerge"))
00029 {  
00030   setWhatProduced(this);
00031   
00032   edm::LogInfo("SiStripDelayESProducer") << "ctor" << std::endl;
00033 
00034   delay.reset(new SiStripDelay());
00035 }
00036 
00037 
00038 boost::shared_ptr<SiStripDelay> SiStripDelayESProducer::produce(const SiStripDelayRcd& iRecord)
00039 {
00040   edm::LogInfo("SiStripDelayESProducer") << "produce called" << std::endl;
00041 
00042   delay->clear();
00043 
00044   edm::ESHandle<SiStripBaseDelay> baseDelay;
00045 
00046   std::string label;  
00047   std::string recordName;
00048   int sumSign = 0;
00049 
00050   for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {
00051     recordName = itToGet->getParameter<std::string>("Record");
00052     label = itToGet->getParameter<std::string>("Label");
00053     sumSign = itToGet->getParameter<int>("SumSign");
00054     
00055     edm::LogInfo("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Getting data from record " << recordName << " with label " << label << std::endl;
00056 
00057     if( recordName=="SiStripBaseDelayRcd" ) {
00058       iRecord.getRecord<SiStripBaseDelayRcd>().get(label, baseDelay);
00059       delay->fillNewDelay( *(baseDelay.product()), sumSign, std::make_pair(recordName, label) );
00060     } else {
00061       edm::LogError("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Skipping the requested data for unexisting record " << recordName << " with tag " << label << std::endl;
00062       continue;
00063     }
00064   }
00065 
00066   delay->makeDelay();
00067   
00068   return delay;
00069 }
00070