CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

EcalBarrelMonitorDbModule Class Reference

#include <EcalBarrelMonitorDbModule.h>

Inheritance diagram for EcalBarrelMonitorDbModule:
edm::EDAnalyzer

List of all members.

Public Member Functions

 EcalBarrelMonitorDbModule (const edm::ParameterSet &ps)
 Constructor.
virtual ~EcalBarrelMonitorDbModule ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob (void)
void endJob (void)

Private Attributes

DQMStoredqmStore_
std::string htmlDir_
int icycle_
MonitorElementsDbME_Db_
std::string prefixME_
coral::ISessionProxy * session_
unsigned int sleepTime_
std::string xmlFile_

Detailed Description

Definition at line 25 of file EcalBarrelMonitorDbModule.h.


Constructor & Destructor Documentation

EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file EcalBarrelMonitorDbModule.cc.

References gather_cfg::cout, dqmStore_, edm::ParameterSet::getUntrackedParameter(), htmlDir_, icycle_, ME_Db_, cmsCodeRules::cppFunctionSkipper::operator, prefixME_, session_, DQMStore::showDirStructure(), sleepTime_, and xmlFile_.

                                                                             {

  dqmStore_ = edm::Service<DQMStore>().operator->();

  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");

  xmlFile_ = ps.getUntrackedParameter<std::string>( "xmlFile", "" );
  if ( xmlFile_.size() != 0 ) {
    std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ << std::endl;
  }

  sleepTime_ = ps.getUntrackedParameter<int>( "sleepTime", 0 );
  std::cout << "Sleep time is " << sleepTime_ << " second(s)." << std::endl;

  // html output directory
  htmlDir_ = ps.getUntrackedParameter<std::string>("htmlDir", ".");

  if ( htmlDir_.size() != 0 ) {
    std::cout << " HTML output will go to"
              << " htmlDir = " << htmlDir_ << std::endl;
  } else {
    std::cout << " HTML output is disabled" << std::endl;
  }

  ME_Db_ = new MonitorElementsDb( ps, xmlFile_ );

  if ( dqmStore_ ) dqmStore_->showDirStructure();

  icycle_ = 0;
  session_ = 0;
}
EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule ( ) [virtual]

Destructor.

Definition at line 60 of file EcalBarrelMonitorDbModule.cc.

References ME_Db_.

                                                     {

  if ( ME_Db_ ) delete ME_Db_;

}

Member Function Documentation

void EcalBarrelMonitorDbModule::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Analyze.

Implements edm::EDAnalyzer.

Definition at line 82 of file EcalBarrelMonitorDbModule.cc.

References MonitorElementsDb::analyze(), dtNoiseDBValidation_cfg::cerr, HDQMDatabaseProducer::config, gather_cfg::cout, exception, Exception, htmlDir_, MonitorElementsDb::htmlOutput(), icycle_, instance, ME_Db_, session_, stor::utils::sleep(), and sleepTime_.

                                                                                {

  icycle_++;

  std::cout << "EcalBarrelMonitorDbModule: icycle = " << icycle_ << std::endl;

  try {
    coral::Context& context = coral::Context::instance();
    context.loadComponent("CORAL/Services/ConnectionService");
    context.loadComponent("CORAL/Services/EnvironmentAuthenticationService");
    coral::IHandle<coral::IConnectionService> connectionService = context.query<coral::IConnectionService>("CORAL/Services/ConnectionService");
    context.loadComponent("CORAL/RelationalPlugins/oracle");

    // Set configuration parameters
    coral::IConnectionServiceConfiguration& config = connectionService->configuration();
    config.setConnectionRetrialPeriod(1);
    config.setConnectionRetrialTimeOut(10);

    session_ = connectionService->connect("ECAL CondDB", coral::ReadOnly);

    if ( ME_Db_ ) ME_Db_->analyze(e, c, session_ );

  } catch (coral::Exception& e) {
    std::cerr << "CORAL Exception : " << e.what() << std::endl;
  } catch (std::exception& e) {
    std::cerr << "Standard C++ exception : " << e.what() << std::endl;
  }

  if ( htmlDir_.size() != 0 ) {

    ME_Db_->htmlOutput( htmlDir_ );

  }

  delete session_;

  sleep( sleepTime_ );

}
void EcalBarrelMonitorDbModule::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file EcalBarrelMonitorDbModule.cc.

References MonitorElementsDb::beginJob(), icycle_, and ME_Db_.

                                            {

  icycle_ = 0;

  if ( ME_Db_ ) ME_Db_->beginJob();

}
void EcalBarrelMonitorDbModule::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file EcalBarrelMonitorDbModule.cc.

References gather_cfg::cout, MonitorElementsDb::endJob(), icycle_, and ME_Db_.

                                           {

  if ( ME_Db_ ) ME_Db_->endJob();

  std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ << std::endl;

}

Member Data Documentation

Definition at line 50 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

std::string EcalBarrelMonitorDbModule::htmlDir_ [private]

Definition at line 54 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

Definition at line 48 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), beginJob(), EcalBarrelMonitorDbModule(), and endJob().

std::string EcalBarrelMonitorDbModule::prefixME_ [private]

Definition at line 52 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

coral::ISessionProxy* EcalBarrelMonitorDbModule::session_ [private]

Definition at line 62 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

unsigned int EcalBarrelMonitorDbModule::sleepTime_ [private]

Definition at line 60 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

std::string EcalBarrelMonitorDbModule::xmlFile_ [private]

Definition at line 56 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().