CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
QTestHandle Class Reference

#include <QTestHandle.h>

Public Member Functions

void attachTests (DQMStore *bei, bool verboseQT=true)
 Attaches the quality tests to the MonitorElement. More...
 
std::map< std::string,
std::vector< std::string > > 
checkDetailedQTStatus (DQMStore *bei) const
 Checks alarms for single MonitorElements. More...
 
std::pair< std::string,
std::string > 
checkGlobalQTStatus (DQMStore *bei) const
 Checks global status of Quality Tests. More...
 
bool configureTests (const std::string &configFile, DQMStore *bei, bool UseDB=false)
 Parses Config File and configures the quality tests. More...
 
 QTestHandle ()
 Creator. More...
 
 ~QTestHandle ()
 Destructor. More...
 

Private Attributes

QTestStatusCheckerqtChecker
 
QTestConfigureqtConfigurer
 
QTestConfigurationParserqtParser
 
bool testsConfigured
 

Detailed Description

Definition at line 22 of file QTestHandle.h.

Constructor & Destructor Documentation

QTestHandle::QTestHandle ( )

Creator.

Definition at line 20 of file QTestHandle.cc.

References qtChecker, qtConfigurer, qtParser, and testsConfigured.

21 {
25 
26  testsConfigured = false;
27 
28 }
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:38
QTestConfigure * qtConfigurer
Definition: QTestHandle.h:39
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:40
bool testsConfigured
Definition: QTestHandle.h:41
QTestHandle::~QTestHandle ( )

Destructor.

Definition at line 30 of file QTestHandle.cc.

References qtChecker, qtConfigurer, and qtParser.

31 {
32  delete qtParser;
33  delete qtConfigurer;
34  delete qtChecker;
35 }
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:38
QTestConfigure * qtConfigurer
Definition: QTestHandle.h:39
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:40

Member Function Documentation

void QTestHandle::attachTests ( DQMStore bei,
bool  verboseQT = true 
)

Attaches the quality tests to the MonitorElement.

Definition at line 64 of file QTestHandle.cc.

References firstTime, python.multivaluedict::map(), QTestConfigurationParser::meToTestsList(), qtParser, utils_v2::tests, and DQMStore::useQTestByMatch().

Referenced by SiPixelActionExecutor::setupQTests().

65 {
66 
67  std::map<std::string, std::vector<std::string> > mapMeToTests
69 
70 
71  for (std::map<std::string, std::vector<std::string> >::iterator itr = mapMeToTests.begin();
72  itr != mapMeToTests.end();
73  ++itr)
74  {
75  const std::string &meName = itr->first;
76  const std::vector<std::string> &tests = itr->second;
77 
78  for (std::vector<std::string>::const_iterator testsItr = tests.begin();
79  testsItr != tests.end(); ++testsItr){
80  int cases = bei->useQTestByMatch(meName, *testsItr);
81  if (firstTime && verboseQT && cases == 0)
82  edm::LogWarning ("QTestHandle::attachTests")
83  << " ==>> Invalid qtest xml: Link '"<< meName
84  <<"', QTest '"<< *testsItr << "' - no matching ME! <<== ";
85  }
86  }
87  firstTime = false;
88 }
dictionary tests
Definition: utils_v2.py:385
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:38
bool firstTime
Definition: QTestHandle.cc:18
std::map< std::string, std::vector< std::string > > meToTestsList() const
Returns the map between the MonitoElemnt and the list of tests requested for it.
int useQTestByMatch(const std::string &pattern, const std::string &qtname)
attach quality test &lt;qc&gt; to monitor elements matching &lt;pattern&gt;.
Definition: DQMStore.cc:2647
std::map< std::string, std::vector< std::string > > QTestHandle::checkDetailedQTStatus ( DQMStore bei) const

Checks alarms for single MonitorElements.

Definition at line 97 of file QTestHandle.cc.

References QTestStatusChecker::checkDetailedStatus(), and qtChecker.

98 {
99  return qtChecker->checkDetailedStatus(bei);
100 }
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:40
std::map< std::string, std::vector< std::string > > checkDetailedStatus(DQMStore *bei)
Check status of quality tests for individual ME&#39;s.
std::pair< std::string, std::string > QTestHandle::checkGlobalQTStatus ( DQMStore bei) const

Checks global status of Quality Tests.

Definition at line 91 of file QTestHandle.cc.

References QTestStatusChecker::checkGlobalStatus(), and qtChecker.

92 {
93  return qtChecker->checkGlobalStatus(bei);
94 }
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:40
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 ...
bool QTestHandle::configureTests ( const std::string &  configFile,
DQMStore bei,
bool  UseDB = false 
)

Parses Config File and configures the quality tests.

Definition at line 37 of file QTestHandle.cc.

References QTestConfigure::enableTests(), DQMParserBase::getDocument(), DQMParserBase::getNewDocument(), QTestConfigurationParser::parseQTestsConfiguration(), qtConfigurer, qtParser, testsConfigured, and QTestConfigurationParser::testsList().

Referenced by SiPixelActionExecutor::setupQTests().

38 {
39  //In case of UseDB==true the configFile is the content of the xml file itself
40  //In case of UseDB==false (default) configFile is just the name of the file
41  if (testsConfigured)
43  else
44  {
46  testsConfigured=true;
47  }
48 
50  {
51  std::map<std::string, std::map<std::string, std::string> > testsONList
52  = qtParser->testsList();
53 
54  if (qtConfigurer->enableTests(testsONList,bei))
55  return true;
56  }
57  else
58  return true;
59 
60  return false;
61 }
bool enableTests(std::map< std::string, std::map< std::string, std::string > > tests, DQMStore *bei)
Creates and defines quality tests.
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
bool parseQTestsConfiguration()
Methor that parses the xml file configFile, returns false if no errors are encountered.
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:38
std::map< std::string, std::map< std::string, std::string > > testsList() const
Returns the Quality Tests list with their parameters obtained from the xml file.
QTestConfigure * qtConfigurer
Definition: QTestHandle.h:39
void getNewDocument(std::string configFile, bool UseDB=false)
Parses a new Document.
bool testsConfigured
Definition: QTestHandle.h:41

Member Data Documentation

QTestStatusChecker* QTestHandle::qtChecker
private
QTestConfigure* QTestHandle::qtConfigurer
private

Definition at line 39 of file QTestHandle.h.

Referenced by configureTests(), QTestHandle(), and ~QTestHandle().

QTestConfigurationParser* QTestHandle::qtParser
private

Definition at line 38 of file QTestHandle.h.

Referenced by attachTests(), configureTests(), QTestHandle(), and ~QTestHandle().

bool QTestHandle::testsConfigured
private

Definition at line 41 of file QTestHandle.h.

Referenced by configureTests(), and QTestHandle().