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