CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

EcalEndcapMonitorDbModule Class Reference

#include <EcalEndcapMonitorDbModule.h>

Inheritance diagram for EcalEndcapMonitorDbModule:
edm::EDAnalyzer

List of all members.

Public Member Functions

 EcalEndcapMonitorDbModule (const edm::ParameterSet &ps)
 Constructor.
virtual ~EcalEndcapMonitorDbModule ()
 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 EcalEndcapMonitorDbModule.h.


Constructor & Destructor Documentation

EcalEndcapMonitorDbModule::EcalEndcapMonitorDbModule ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file EcalEndcapMonitorDbModule.cc.

References gather_cfg::cout, dqmStore_, edm::ParameterSet::getUntrackedParameter(), htmlDir_, icycle_, ME_Db_, cppFunctionSkipper::operator, prefixME_, session_, DQMStore::showDirStructure(), sleepTime_, AlCaHLTBitMon_QueryRunRegistry::string, 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;

}
EcalEndcapMonitorDbModule::~EcalEndcapMonitorDbModule ( ) [virtual]

Destructor.

Definition at line 61 of file EcalEndcapMonitorDbModule.cc.

References ME_Db_.

                                                     {

  if ( ME_Db_ ) delete ME_Db_;

}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 83 of file EcalEndcapMonitorDbModule.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 << "EcalEndcapMonitorDbModule: 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 EcalEndcapMonitorDbModule::beginJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file EcalEndcapMonitorDbModule.cc.

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

                                            {

  icycle_ = 0;

  if ( ME_Db_ ) ME_Db_->beginJob();

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

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file EcalEndcapMonitorDbModule.cc.

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

                                           {

  if ( ME_Db_ ) ME_Db_->endJob();

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

}

Member Data Documentation

Definition at line 50 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().

std::string EcalEndcapMonitorDbModule::htmlDir_ [private]

Definition at line 54 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

Definition at line 48 of file EcalEndcapMonitorDbModule.h.

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

std::string EcalEndcapMonitorDbModule::prefixME_ [private]

Definition at line 52 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().

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

Definition at line 62 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

unsigned int EcalEndcapMonitorDbModule::sleepTime_ [private]

Definition at line 60 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

std::string EcalEndcapMonitorDbModule::xmlFile_ [private]

Definition at line 56 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().