CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CondTools/SiStrip/plugins/SiStripApvGainReader.cc

Go to the documentation of this file.
00001 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
00002 #include "CondFormats/DataRecord/interface/SiStripApvGainRcd.h"
00003 
00004 #include "CondTools/SiStrip/plugins/SiStripApvGainReader.h"
00005 
00006 #include <iostream>
00007 #include <stdio.h>
00008 #include <sys/time.h>
00009 
00010 
00011 using namespace cms;
00012 
00013 SiStripApvGainReader::SiStripApvGainReader( const edm::ParameterSet& iConfig ):
00014   printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug",1)){}
00015 
00016 SiStripApvGainReader::~SiStripApvGainReader(){}
00017 
00018 void SiStripApvGainReader::analyze( const edm::Event& e, const edm::EventSetup& iSetup){
00019 
00020   edm::ESHandle<SiStripApvGain> SiStripApvGain_;
00021   iSetup.get<SiStripApvGainRcd>().get(SiStripApvGain_);
00022   edm::LogInfo("SiStripApvGainReader") << "[SiStripApvGainReader::analyze] End Reading SiStripApvGain" << std::endl;
00023   
00024   std::vector<uint32_t> detid;
00025   SiStripApvGain_->getDetIds(detid);
00026   edm::LogInfo("Number of detids ")  << detid.size() << std::endl;
00027 
00028   if (printdebug_)
00029     for (size_t id=0;id<detid.size() && id<printdebug_;id++)
00030       {
00031         SiStripApvGain::Range range=SiStripApvGain_->getRange(detid[id]);
00032         
00033         int apv=0;
00034         for(int it=0;it<range.second-range.first;it++){
00035           edm::LogInfo("SiStripApvGainReader")  << "detid " << detid[id] << " \t"
00036                                              << " apv " << apv++ << " \t"
00037                                              << SiStripApvGain_->getApvGain(it,range)     << " \t" 
00038                                              << std::endl;          
00039         } 
00040       }
00041 }