CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CondTools/RPC/plugins/PVSSIDReader.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/RPCObPVSSmap.h"
00013 #include "CondFormats/DataRecord/interface/RPCObPVSSmapRcd.h"
00014 
00015 class  PVSSIDReader : public edm::EDAnalyzer {
00016 public:
00017   PVSSIDReader(const edm::ParameterSet& iConfig );
00018   ~PVSSIDReader();
00019   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup);
00020 };
00021 
00022 
00023 PVSSIDReader::PVSSIDReader(const edm::ParameterSet& iConfig ){}
00024   
00025 PVSSIDReader::~PVSSIDReader(){}
00026 
00027 void PVSSIDReader::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup)
00028 {
00029   edm::ESHandle<RPCObPVSSmap> pvssmapRcd;
00030   evtSetup.get<RPCObPVSSmapRcd>().get(pvssmapRcd);
00031   edm::LogInfo("PVSSIDReader") << "[PVSSIDReader::analyze] End Reading Pvssmap" << std::endl;
00032     
00033 
00034   const RPCObPVSSmap* pvssmap = pvssmapRcd.product();
00035   std::vector<RPCObPVSSmap::Item> mypvssmap = pvssmap->ObIDMap_rpc; 
00036   std::vector<RPCObPVSSmap::Item>::iterator ipvssmap;
00037 
00038   std::cout << "************************************" << std::endl;
00039   for(ipvssmap = mypvssmap.begin(); ipvssmap < mypvssmap.end(); ++ipvssmap){
00040     std::cout<<"dpid = " << ipvssmap->dpid << " region = " << ipvssmap->region 
00041              << " ring = " << ipvssmap->ring << " sector = " << ipvssmap->sector 
00042              << " station = " << ipvssmap->station << " layer = " << ipvssmap->layer 
00043              << " subsector = " << ipvssmap->subsector << " suptype = " << ipvssmap->suptype << std::endl;
00044   }
00045 
00046 }
00047 
00048 //define this as a plug-in
00049 DEFINE_FWK_MODULE(PVSSIDReader);
00050