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 20 of file QTestHandle.h.

Constructor & Destructor Documentation

QTestHandle::QTestHandle ( )

Creator.

Definition at line 18 of file QTestHandle.cc.

References qtChecker, qtConfigurer, qtParser, and testsConfigured.

19 {
23 
24  testsConfigured = false;
25 
26 }
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:36
QTestConfigure * qtConfigurer
Definition: QTestHandle.h:37
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:38
bool testsConfigured
Definition: QTestHandle.h:39
QTestHandle::~QTestHandle ( )

Destructor.

Definition at line 28 of file QTestHandle.cc.

References qtChecker, qtConfigurer, and qtParser.

29 {
30  delete qtParser;
31  delete qtConfigurer;
32  delete qtChecker;
33 }
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:36
QTestConfigure * qtConfigurer
Definition: QTestHandle.h:37
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:38

Member Function Documentation

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

Attaches the quality tests to the MonitorElement.

Definition at line 62 of file QTestHandle.cc.

References firstTime, QTestConfigurationParser::meToTestsList(), qtParser, AlCaHLTBitMon_QueryRunRegistry::string, utils_v2::tests, and DQMStore::useQTestByMatch().

63 {
64 
65  std::map<std::string, std::vector<std::string> > mapMeToTests
67 
68 
69  for (std::map<std::string, std::vector<std::string> >::iterator itr = mapMeToTests.begin();
70  itr != mapMeToTests.end();
71  ++itr)
72  {
73  const std::string &meName = itr->first;
74  const std::vector<std::string> &tests = itr->second;
75 
76  for (std::vector<std::string>::const_iterator testsItr = tests.begin();
77  testsItr != tests.end(); ++testsItr){
78  int cases = bei->useQTestByMatch(meName, *testsItr);
79  if (firstTime && verboseQT && cases == 0)
80  edm::LogWarning ("QTestHandle::attachTests")
81  << " ==>> Invalid qtest xml: Link '"<< meName
82  <<"', QTest '"<< *testsItr << "' - no matching ME! <<== ";
83  }
84  }
85  firstTime = false;
86 }
dictionary tests
Definition: utils_v2.py:385
QTestConfigurationParser * qtParser
Definition: QTestHandle.h:36
bool firstTime
Definition: QTestHandle.cc:16
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:3317
std::map< std::string, std::vector< std::string > > QTestHandle::checkDetailedQTStatus ( DQMStore bei) const

Checks alarms for single MonitorElements.

Definition at line 95 of file QTestHandle.cc.

References QTestStatusChecker::checkDetailedStatus(), and qtChecker.

96 {
97  return qtChecker->checkDetailedStatus(bei);
98 }
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:38
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 89 of file QTestHandle.cc.

References QTestStatusChecker::checkGlobalStatus(), and qtChecker.

90 {
91  return qtChecker->checkGlobalStatus(bei);
92 }
QTestStatusChecker * qtChecker
Definition: QTestHandle.h:38
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 35 of file QTestHandle.cc.

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

36 {
37  //In case of UseDB==true the configFile is the content of the xml file itself
38  //In case of UseDB==false (default) configFile is just the name of the file
39  if (testsConfigured)
41  else
42  {
44  testsConfigured=true;
45  }
46 
48  {
49  std::map<std::string, std::map<std::string, std::string> > testsONList
50  = qtParser->testsList();
51 
52  if (qtConfigurer->enableTests(testsONList,bei))
53  return true;
54  }
55  else
56  return true;
57 
58  return false;
59 }
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:36
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:37
void getNewDocument(std::string configFile, bool UseDB=false)
Parses a new Document.
bool testsConfigured
Definition: QTestHandle.h:39
bool enableTests(const std::map< std::string, std::map< std::string, std::string > > &tests, DQMStore *bei)
Creates and defines quality tests.

Member Data Documentation

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

Definition at line 37 of file QTestHandle.h.

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

QTestConfigurationParser* QTestHandle::qtParser
private

Definition at line 36 of file QTestHandle.h.

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

bool QTestHandle::testsConfigured
private

Definition at line 39 of file QTestHandle.h.

Referenced by configureTests(), and QTestHandle().