00001 #include "CondTools/SiStrip/plugins/SiStripThresholdReader.h" 00002 #include "CondFormats/DataRecord/interface/SiStripThresholdRcd.h" 00003 00004 using namespace std; 00005 using namespace cms; 00006 00007 SiStripThresholdReader::SiStripThresholdReader( const edm::ParameterSet& iConfig ): 00008 printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug",3)){} 00009 00010 SiStripThresholdReader::~SiStripThresholdReader(){} 00011 00012 void SiStripThresholdReader::analyze( const edm::Event& e, const edm::EventSetup& iSetup){ 00013 00014 edm::ESHandle<SiStripThreshold> SiStripThreshold_; 00015 iSetup.get<SiStripThresholdRcd>().get(SiStripThreshold_); 00016 edm::LogInfo("SiStripThresholdReader") << "[SiStripThresholdReader::analyze] End Reading SiStripThreshold" << std::endl; 00017 00018 std::vector<uint32_t> detid; 00019 SiStripThreshold_->getDetIds(detid); 00020 edm::LogInfo("Number of detids ") << detid.size() << std::endl; 00021 if (printdebug_) 00022 for (size_t id=0;id<detid.size() && id<printdebug_;id++) 00023 { 00024 SiStripThreshold::Range range=SiStripThreshold_->getRange(detid[id]); 00025 00026 //int strip=0; 00027 float old_clusTh=-1,old_lowTh=-1, old_highTh=-1, old_FirstStrip=-1; 00028 for(int it=0;it<768;it++){ 00029 SiStripThreshold::Data data=SiStripThreshold_->getData(it,range); 00030 std::stringstream ss; 00031 data.print(ss); 00032 if (old_clusTh!=data.getClusth() || old_lowTh!=data.getLth() || old_highTh!=data.getHth() || old_FirstStrip!=data.getFirstStrip()){ 00033 edm::LogInfo("SiStripThresholdReader") << "detid: " << detid[id] << " \t" 00034 << "strip: " << it << " \t" 00035 << ss.str() 00036 << "FirstStrip_and_Hth: " << data.FirstStrip_and_Hth << " \n" 00037 << std::endl; 00038 old_lowTh=data.getLth(); 00039 old_highTh=data.getHth(); 00040 old_clusTh=data.getClusth(); 00041 old_FirstStrip=data.getFirstStrip(); 00042 } 00043 } 00044 } 00045 } 00046