CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/CondTools/SiStrip/plugins/SiStripDetVOffReader.cc

Go to the documentation of this file.
00001 #include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h"
00002 #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
00003 
00004 #include "CondTools/SiStrip/plugins/SiStripDetVOffReader.h"
00005 
00006 #include <iostream>
00007 #include <stdio.h>
00008 #include <sys/time.h>
00009 
00010 SiStripDetVOffReader::SiStripDetVOffReader( const edm::ParameterSet& iConfig ):
00011   printdebug_(iConfig.getUntrackedParameter<bool>("printDebug",true)){}
00012 
00013 
00014 SiStripDetVOffReader::~SiStripDetVOffReader(){}
00015 
00016 
00017 void SiStripDetVOffReader::analyze( const edm::Event& e, const edm::EventSetup& iSetup){
00018 
00019   edm::ESHandle<SiStripDetVOff> SiStripDetVOff_;
00020   iSetup.get<SiStripDetVOffRcd>().get(SiStripDetVOff_);
00021   edm::LogInfo("SiStripDetVOffReader") << "[SiStripDetVOffReader::analyze] End Reading SiStripDetVOff" << std::endl;
00022   
00023 
00024   // put here a vector of DetIds to compare 
00025   // Here we just take the vector with all modules that have HV OFF
00026   
00027   // replace this code, with Your own detids
00028   std::vector <uint32_t> detid;
00029   SiStripDetVOff_->getDetIds(detid);
00030   //
00031 
00032 
00033   if (printdebug_){
00034     for (uint32_t  id=0;id<=detid.size();id++)
00035       {
00036         bool hvflag=SiStripDetVOff_->IsModuleHVOff(detid[id]);
00037         bool lvflag=SiStripDetVOff_->IsModuleLVOff(detid[id]);
00038         bool vflag =SiStripDetVOff_->IsModuleVOff(detid[id]);
00039         if(hvflag==true) {
00040           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t OFF\n";
00041         }
00042         else {
00043           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t ON\n";
00044         }
00045         if(lvflag==true) {
00046           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t OFF\n";
00047         }
00048         else {
00049           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t ON\n";
00050         }
00051         if(vflag==true) {
00052           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t OFF\n";
00053         }
00054         else {
00055           edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t ON\n";
00056         }
00057       } 
00058   }
00059 
00060 }