CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondTools/RPC/src/RPCStripNoisesRcdRead.cc

Go to the documentation of this file.
00001 #include <string>
00002 #include <map>
00003 #include <vector>
00004 
00005 #include "FWCore/Framework/interface/EventSetup.h"
00006 #include "FWCore/Framework/interface/EDAnalyzer.h"
00007 #include "FWCore/Framework/interface/MakerMacros.h"
00008 #include "FWCore/Framework/interface/Event.h"
00009 #include "FWCore/Framework/interface/ESHandle.h"
00010 #include "CondTools/RPC/interface/RPCDBSimSetUp.h"
00011 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00012 #include "CondFormats/RPCObjects/interface/RPCStripNoises.h"
00013 #include "CondFormats/DataRecord/interface/RPCStripNoisesRcd.h"
00014 
00015 class  RPCStripNoisesRcdRead : public edm::EDAnalyzer {
00016 public:
00017   RPCStripNoisesRcdRead(const edm::ParameterSet& iConfig );
00018   ~RPCStripNoisesRcdRead();
00019   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup);
00020 };
00021 
00022 
00023 RPCStripNoisesRcdRead::RPCStripNoisesRcdRead(const edm::ParameterSet& iConfig ){}
00024   
00025 RPCStripNoisesRcdRead::~RPCStripNoisesRcdRead(){}
00026 
00027 void RPCStripNoisesRcdRead::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup)
00028 {
00029   edm::ESHandle<RPCStripNoises> noiseRcd;
00030   evtSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
00031   edm::LogInfo("RPCStripNoisesReader") << "[RPCStripNoisesReader::analyze] End Reading RPCStripNoises" << std::endl;
00032     
00033   std::vector<RPCStripNoises::NoiseItem>  vnoise = noiseRcd->getVNoise();
00034   std::vector<float>  vcls = noiseRcd->getCls();
00035 
00036   for(unsigned int n = 0; n < vcls.size(); ++n){
00037     std::cout<<"Cls Value: "<<vcls[n]<<std::endl;
00038   }
00039 
00040   int i= 1;
00041   for(std::vector<RPCStripNoises::NoiseItem>::iterator it = vnoise.begin(); it != vnoise.end(); ++it){
00042     if(i%96 == 0)    std::cout<<"DetId:  "<<it->dpid<<"  "<<it->time<<"  "<<std::endl;
00043     std::cout<<"                                    Noise Value: "<<(it->noise)<<"  "<<(it->eff)<<std::endl;
00044     i++;
00045   }
00046 }
00047 
00048 //define this as a plug-in
00049 DEFINE_FWK_MODULE(RPCStripNoisesRcdRead);