#include <DQMServices/ClientConfig/interface/QTestStatusChecker.h>
Public Member Functions | |
std::map< std::string, std::vector< std::string > > | checkDetailedStatus (DQMStore *bei) |
Check status of quality tests for individual ME's. | |
std::pair< std::string, std::string > | checkGlobalStatus (DQMStore *bei) |
Check global status of Quality tests, returns a pair of string: message and color relative to global status. | |
std::vector< std::string > | fullPathNames (DQMStore *bei) |
void | processAlarms (std::vector< std::string > allPathNames, DQMStore *bei) |
QTestStatusChecker () | |
Creator. | |
~QTestStatusChecker () | |
Destructor. | |
Private Attributes | |
std::map< std::string, std::vector< std::string > > | detailedWarnings |
Definition at line 20 of file QTestStatusChecker.h.
QTestStatusChecker::QTestStatusChecker | ( | ) |
QTestStatusChecker::~QTestStatusChecker | ( | ) |
std::map< std::string, std::vector< std::string > > QTestStatusChecker::checkDetailedStatus | ( | DQMStore * | bei | ) |
Check status of quality tests for individual ME's.
Definition at line 45 of file QTestStatusChecker.cc.
References detailedWarnings, fullPathNames(), and processAlarms().
Referenced by QTestHandle::checkDetailedQTStatus().
00045 { 00046 00047 std::vector<std::string> allPathNames=this->fullPathNames(bei); 00048 detailedWarnings.clear(); 00049 00050 this->processAlarms(allPathNames,bei); 00051 return detailedWarnings; 00052 }
std::pair< std::string, std::string > QTestStatusChecker::checkGlobalStatus | ( | DQMStore * | bei | ) |
Check global status of Quality tests, returns a pair of string: message and color relative to global status.
Definition at line 21 of file QTestStatusChecker.cc.
References dqm::qstatus::ERROR, DQMStore::getStatus(), dqm::qstatus::OTHER, StDecayID::status, and dqm::qstatus::WARNING.
Referenced by QTestHandle::checkGlobalQTStatus().
00021 { 00022 std::pair<std::string,std::string> statement; 00023 int status= bei->getStatus(); 00024 switch(status){ 00025 case dqm::qstatus::ERROR: 00026 statement.first ="Errors detected in quality tests"; 00027 statement.second="red"; 00028 break; 00029 case dqm::qstatus::WARNING: 00030 statement.first ="Warnings detected in quality tests"; 00031 statement.second="orange"; 00032 break; 00033 case dqm::qstatus::OTHER: 00034 statement.first="Some tests did not run"; 00035 statement.second="black"; 00036 break; 00037 default: 00038 statement.first="No problems detected in quality tests "; 00039 statement.second="green"; 00040 } 00041 00042 return statement; 00043 }
std::vector< std::string > QTestStatusChecker::fullPathNames | ( | DQMStore * | bei | ) |
Definition at line 102 of file QTestStatusChecker.cc.
References test_cfg::dirName, DQMStore::getContents(), and it.
Referenced by checkDetailedStatus().
00102 { 00103 00104 00105 std::vector<std::string> contents; 00106 std::vector<std::string> contentVec; 00107 bei->getContents(contentVec); 00108 for (std::vector<std::string>::iterator it = contentVec.begin(); 00109 it != contentVec.end(); it++) { 00110 00111 std::string::size_type dirCharNumber = it->find( ":", 0 ); 00112 std::string dirName=it->substr(0 , dirCharNumber); 00113 dirName+= "/"; 00114 std::string meCollectionName=it->substr(dirCharNumber+1); 00115 00116 std::string reminingNames=meCollectionName; 00117 bool anotherME=true; 00118 while(anotherME){ 00119 if(reminingNames.find(",") == std::string::npos) anotherME =false; 00120 std::string::size_type singleMeNameCharNumber= reminingNames.find( ",", 0 ); 00121 std::string singleMeName=reminingNames.substr(0 , singleMeNameCharNumber ); 00122 std::string fullpath=dirName + singleMeName; 00123 contents.push_back(fullpath); 00124 reminingNames=reminingNames.substr(singleMeNameCharNumber+1); 00125 } 00126 } 00127 00128 return contents; 00129 00130 }
Definition at line 55 of file QTestStatusChecker.cc.
References detailedWarnings, DQMStore::get(), MonitorElement::getQErrors(), MonitorElement::getQOthers(), MonitorElement::getQWarnings(), MonitorElement::hasError(), MonitorElement::hasOtherReport(), MonitorElement::hasWarning(), me, and WenuSkim_TriggerBit_cff::report.
Referenced by checkDetailedStatus().
00055 { 00056 00057 for(std::vector<std::string>::iterator fullMePath=allPathNames.begin();fullMePath!=allPathNames.end(); ++fullMePath ){ 00058 00059 MonitorElement * me=0; 00060 me= bei->get(*fullMePath); 00061 00062 if(me){ 00063 std::vector<QReport *> report; 00064 std::string colour; 00065 00066 if (me->hasError()){ 00067 colour="red"; 00068 report= me->getQErrors(); 00069 } 00070 if( me->hasWarning()){ 00071 colour="orange"; 00072 report= me->getQWarnings(); 00073 } 00074 if(me->hasOtherReport()){ 00075 colour="black"; 00076 report= me->getQOthers(); 00077 } 00078 for(std::vector<QReport *>::iterator itr=report.begin(); itr!=report.end();++itr ){ 00079 std::string text= (*fullMePath) + (*itr)->getMessage(); 00080 std::vector<std::string> messageList; 00081 00082 if( detailedWarnings.find(colour) == detailedWarnings.end()){ 00083 00084 messageList.push_back(text); 00085 detailedWarnings[colour]=messageList; 00086 00087 }else{ 00088 00089 messageList=detailedWarnings[colour]; 00090 messageList.push_back(text); 00091 detailedWarnings[colour]=messageList; 00092 00093 } 00094 } 00095 00096 } 00097 } 00098 00099 }
std::map< std::string, std::vector<std::string> > QTestStatusChecker::detailedWarnings [private] |
Definition at line 37 of file QTestStatusChecker.h.
Referenced by checkDetailedStatus(), and processAlarms().