CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/DQM/RPCMonitorClient/src/RPCRawDataCountsHistoMaker.cc

Go to the documentation of this file.
00001 #include "DQM/RPCMonitorClient/interface/RPCRawDataCountsHistoMaker.h"
00002 #include "EventFilter/RPCRawToDigi/interface/RPCRawDataCounts.h"
00003 #include "EventFilter/RPCRawToDigi/interface/DataRecord.h"
00004 #include "EventFilter/RPCRawToDigi/interface/ReadoutError.h"
00005 
00006 #include "TH1F.h"
00007 #include "TH2F.h"
00008 
00009 #include <vector>
00010 #include <sstream>
00011 
00012 TH1F * RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(int fedId) {
00013   std::ostringstream str;
00014   str <<"readoutErrors_"<<fedId;
00015   TH1F * result = new TH1F(str.str().c_str(),str.str().c_str(),9, 0.5,9.5);
00016   for (unsigned int i=1; i<=9; ++i) {
00017     rpcrawtodigi::ReadoutError::ReadoutErrorType code =  static_cast<rpcrawtodigi::ReadoutError::ReadoutErrorType>(i);
00018     result->GetXaxis()->SetBinLabel(i,rpcrawtodigi::ReadoutError::name(code).c_str());
00019   }
00020   return result;
00021 }
00022 
00023 TH1F * RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(int fedId) {
00024   std::ostringstream str;
00025   str <<"recordType_"<<fedId;
00026   TH1F * result = new TH1F(str.str().c_str(),str.str().c_str(),9, 0.5,9.5);
00027   result->SetTitleOffset(1.4,"x");
00028   for (unsigned int i=1; i<=9; ++i) {
00029     rpcrawtodigi::DataRecord::DataRecordType code = static_cast<rpcrawtodigi::DataRecord::DataRecordType>(i);
00030     result->GetXaxis()->SetBinLabel(i,rpcrawtodigi::DataRecord::name(code).c_str());
00031   }
00032   return result;
00033 }
00034 
00035 TH2F * RPCRawDataCountsHistoMaker::emptyReadoutErrorMapHisto(int fedId, int type) {
00036   std::ostringstream str;
00037   rpcrawtodigi::ReadoutError::ReadoutErrorType code =  static_cast<rpcrawtodigi::ReadoutError::ReadoutErrorType>(type);
00038   str <<"errors_"<<rpcrawtodigi::ReadoutError::name(code)<<"_"<<fedId;
00039   TH2F * result = new TH2F(str.str().c_str(),str.str().c_str(), 36,-0.5,35.5, 18,-0.5,17.5);
00040   result->GetXaxis()->SetNdivisions(512);
00041   result->GetYaxis()->SetNdivisions(505);
00042   result->SetXTitle("rmb");
00043   result->SetYTitle("link");
00044   result->SetStats(0);
00045   return result;
00046 }