00001 /* 00002 * \author Anna Cimmino 00003 */ 00004 #include <DQM/RPCMonitorClient/interface/ReadMeFromFile.h> 00005 00006 // Framework 00007 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00008 00009 //DataFormats 00010 #include <DataFormats/MuonDetId/interface/RPCDetId.h> 00011 #include "DataFormats/RPCDigi/interface/RPCDigi.h" 00012 #include "DataFormats/RPCDigi/interface/RPCDigiCollection.h" 00013 00014 // Geometry 00015 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h" 00016 #include "Geometry/Records/interface/MuonGeometryRecord.h" 00017 00018 // DQM 00019 #include "DQMServices/Core/interface/MonitorElement.h" 00020 00021 #include <map> 00022 #include <sstream> 00023 //#include <math.h> 00024 00025 using namespace edm; 00026 using namespace std; 00027 00028 ReadMeFromFile::ReadMeFromFile(const ParameterSet& ps ){ 00029 00030 LogVerbatim ("readFile") << "[ReadMeFromFile]: Constructor"; 00031 00032 myFile_= ps.getUntrackedParameter<string>("InputFile", "uffa.root"); 00033 } 00034 00035 ReadMeFromFile::~ReadMeFromFile(){ 00036 dbe_ = 0; 00037 } 00038 00039 void ReadMeFromFile::beginJob(){} 00040 00041 void ReadMeFromFile::beginRun(const Run& r, const EventSetup& iSetup){ 00042 LogVerbatim ("readfile") << "[ReadMeFromFile]: Begin run"; 00043 dbe_ = Service<DQMStore>().operator->(); 00044 dbe_->setVerbose(0); 00045 dbe_->load(myFile_); 00046 } 00047 00048 void ReadMeFromFile::beginLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& context) {} 00049 00050 //called at each event 00051 void ReadMeFromFile::analyze(const edm::Event& iEvent, const edm::EventSetup& c){} 00052 00053 00054 void ReadMeFromFile::endLuminosityBlock(LuminosityBlock const& lumiSeg, EventSetup const& iSetup) { 00055 00056 // // vector<string> prova = dbe_->getMEs(); 00057 // // for(unsigned int i=0; i<prova.size(); i++ ){ 00058 // // cout<<prova[i]<<endl; 00059 // // } 00060 00061 // cout<<"End lumi block "<<endl; 00062 00063 // dbe_->setCurrentFolder("RPC/RecHits/Barrel/Wheel_0/sector_1/station_2"); 00064 // // std::vector<MonitorElement *> mes = dbe_->getAllContents("RPC/RecHits/Barrel/Wheel_0/sector_1/station_2"); 00065 // MonitorElement * me = dbe_->get("RPC/RecHits/Barrel/Wheel_0/sector_1/station_2/Occupancy_W+0_RB2out_S01_Backward"); 00066 // if(me) cout<<"FOUD "<<endl; 00067 // // if (not mes.empty()) { 00068 // // std::cout << "found " << mes.size() << " MonitorElements inside 'RPC/RecHits/Barrel/Wheel_0/sector_1/station_2':" << std::endl; 00069 // // for (size_t i = 0; i < mes.size(); ++i) { 00070 // // MonitorElement * me = mes[i]; 00071 // // std::cout << '\t' << me->getName() << std::endl; 00072 // // } 00073 // // } 00074 } 00075 00076 void ReadMeFromFile::endRun(const Run& r, const EventSetup& c){} 00077 00078 void ReadMeFromFile::endJob(){} 00079