CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CondTools/SiStrip/plugins/SiStripSummaryReader.cc

Go to the documentation of this file.
00001 #include "CondFormats/SiStripObjects/interface/SiStripSummary.h"
00002 #include "CondFormats/DataRecord/interface/SiStripSummaryRcd.h"
00003 
00004 #include "CondTools/SiStrip/plugins/SiStripSummaryReader.h"
00005 
00006 #include <iostream>
00007 #include <string>
00008 #include <sstream>
00009 #include <stdio.h>
00010 #include <sys/time.h>
00011 
00012 SiStripSummaryReader::SiStripSummaryReader( const edm::ParameterSet& iConfig ):
00013   printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug",1)){}
00014 
00015 SiStripSummaryReader::~SiStripSummaryReader(){}
00016 
00017 void SiStripSummaryReader::analyze( const edm::Event& e, const edm::EventSetup& iSetup){
00018   
00019   edm::ESHandle<SiStripSummary> SiStripSummary_;
00020   iSetup.get<SiStripSummaryRcd>().get(SiStripSummary_);
00021   edm::LogInfo("SiStripSummaryReader") << "[SiStripSummaryReader::analyze] End Reading SiStripSummary" << std::endl;
00022   
00023   std::vector<uint32_t> detid=SiStripSummary_->getDetIds();
00024   
00025   
00026   std::vector<std::string> userDB=SiStripSummary_->getUserDBContent();
00027   std::stringstream ss;
00028   for(size_t i=0;i<userDB.size();++i)
00029     ss<< userDB[i] << " \n";   
00030 
00031  
00032   if (printdebug_)
00033     for (size_t id=0;id<detid.size();id++)
00034       {
00035         ss<< "\n\tdetid " << detid[id];
00036         SiStripSummary::Range range=SiStripSummary_->getRange(detid[id]);
00037         
00038         size_t c=0;
00039         for(SiStripSummary::ContainerIterator it =range.first;it!=range.second;++it){
00040           ss << "\n\t\t " << userDB[c++] << " "  << *it;
00041         } 
00042       }
00043   edm::LogInfo("SiStripSummaryReader") << ss.str();
00044 }