CMS 3D CMS Logo

Public Member Functions | Private Attributes

QTestHandle Class Reference

#include <QTestHandle.h>

List of all members.

Public Member Functions

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

Private Attributes

QTestStatusCheckerqtChecker
QTestConfigureqtConfigurer
QTestConfigurationParserqtParser
bool testsConfigured

Detailed Description

* Handles quality tests (configuring, attaching to ME's,

Date:
2010/01/26 20:56:01
Revision:
1.9
Author:
Ilaria Segoni

Definition at line 22 of file QTestHandle.h.


Constructor & Destructor Documentation

QTestHandle::QTestHandle ( )
QTestHandle::~QTestHandle ( )

Destructor.

Definition at line 30 of file QTestHandle.cc.

References qtChecker, qtConfigurer, and qtParser.

{
  delete qtParser;
  delete qtConfigurer;
  delete qtChecker;
}

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, Association::map, QTestConfigurationParser::meToTestsList(), qtParser, and DQMStore::useQTestByMatch().

Referenced by SiPixelActionExecutor::setupQTests().

{

  std::map<std::string, std::vector<std::string> > mapMeToTests
    = qtParser->meToTestsList();
 
 
  for (std::map<std::string, std::vector<std::string> >::iterator itr = mapMeToTests.begin();
       itr != mapMeToTests.end();
       ++itr)
  {
    const std::string &meName = itr->first;
    const std::vector<std::string> &tests = itr->second;
    
    for (std::vector<std::string>::const_iterator testsItr = tests.begin();
         testsItr != tests.end(); ++testsItr){
      int cases =  bei->useQTestByMatch(meName, *testsItr);
      if (firstTime && verboseQT && cases == 0)
       edm::LogWarning ("QTestHandle::attachTests")
       << " ==>> Invalid qtest xml: Link '"<< meName 
       <<"', QTest '"<< *testsItr << "'  - no matching ME! <<== ";
      }
  }
  firstTime = false;
}
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.

{
  return qtChecker->checkDetailedStatus(bei);
}
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.

{
  return qtChecker->checkGlobalStatus(bei);
}
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().

{
  //In case of UseDB==true the configFile is the content of the xml file itself
  //In case of UseDB==false (default) configFile is just the name of the file
  if (testsConfigured)
    qtParser->getNewDocument(configFile,UseDB);
  else
  {
    qtParser->getDocument(configFile,UseDB);
    testsConfigured=true;
  }

  if (! qtParser->parseQTestsConfiguration())
  {
    std::map<std::string, std::map<std::string, std::string> > testsONList
      = qtParser->testsList();

    if (qtConfigurer->enableTests(testsONList,bei)) 
      return true;
  }
  else
    return true;

  return false;
}

Member Data Documentation

Definition at line 39 of file QTestHandle.h.

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

Definition at line 38 of file QTestHandle.h.

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

Definition at line 41 of file QTestHandle.h.

Referenced by configureTests(), and QTestHandle().