Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:14

0001 #include "DQM/RPCMonitorDigi/interface/RPCRawDataCountsHistoMaker.h"
0002 #include "EventFilter/RPCRawToDigi/interface/RPCRawDataCounts.h"
0003 #include "EventFilter/RPCRawToDigi/interface/DataRecord.h"
0004 #include "EventFilter/RPCRawToDigi/interface/ReadoutError.h"
0005 
0006 #include <vector>
0007 #include <fmt/format.h>
0008 
0009 TH1F* RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(int fedId) {
0010   const std::string str = fmt::format("readoutErrors_{}", fedId);
0011   TH1F* result = new TH1F(str.c_str(), str.c_str(), 9, 0.5, 9.5);
0012   for (unsigned int i = 1; i <= 9; ++i) {
0013     rpcrawtodigi::ReadoutError::ReadoutErrorType code = static_cast<rpcrawtodigi::ReadoutError::ReadoutErrorType>(i);
0014     result->GetXaxis()->SetBinLabel(i, rpcrawtodigi::ReadoutError::name(code).c_str());
0015   }
0016   return result;
0017 }
0018 
0019 TH1F* RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(int fedId) {
0020   const std::string str = fmt::format("recordType_{}", fedId);
0021   TH1F* result = new TH1F(str.c_str(), str.c_str(), 9, 0.5, 9.5);
0022   result->SetTitleOffset(1.4, "x");
0023   for (unsigned int i = 1; i <= 9; ++i) {
0024     rpcrawtodigi::DataRecord::DataRecordType code = static_cast<rpcrawtodigi::DataRecord::DataRecordType>(i);
0025     result->GetXaxis()->SetBinLabel(i, rpcrawtodigi::DataRecord::name(code).c_str());
0026   }
0027   return result;
0028 }
0029 
0030 TH2F* RPCRawDataCountsHistoMaker::emptyReadoutErrorMapHisto(int fedId, int type) {
0031   rpcrawtodigi::ReadoutError::ReadoutErrorType code = static_cast<rpcrawtodigi::ReadoutError::ReadoutErrorType>(type);
0032   const std::string str = fmt::format("errors_{}_{}", rpcrawtodigi::ReadoutError::name(code), fedId);
0033   TH2F* result = new TH2F(str.c_str(), str.c_str(), 36, -0.5, 35.5, 18, -0.5, 17.5);
0034   result->GetXaxis()->SetNdivisions(512);
0035   result->GetYaxis()->SetNdivisions(505);
0036   result->SetXTitle("rmb");
0037   result->SetYTitle("link");
0038   result->SetStats(false);
0039   return result;
0040 }