CMS 3D CMS Logo

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

#include <EcalEndcapMonitorDbModule.h>

Inheritance diagram for EcalEndcapMonitorDbModule:
edm::EDAnalyzer

Public Member Functions

 EcalEndcapMonitorDbModule (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EcalEndcapMonitorDbModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

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_, ME_Db_, cmsCodeRules.cppFunctionSkipper::operator, prefixME_, DQMStore::showDirStructure(), sleepTime_, and xmlFile_.

28  {
29 
31 
32  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
33 
34  xmlFile_ = ps.getUntrackedParameter<std::string>( "xmlFile", "" );
35  if ( xmlFile_.size() != 0 ) {
36  std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ << std::endl;
37  }
38 
39  sleepTime_ = ps.getUntrackedParameter<int>( "sleepTime", 0 );
40  std::cout << "Sleep time is " << sleepTime_ << " second(s)." << std::endl;
41 
42  // html output directory
43  htmlDir_ = ps.getUntrackedParameter<std::string>("htmlDir", ".");
44 
45  if ( htmlDir_.size() != 0 ) {
46  std::cout << " HTML output will go to"
47  << " htmlDir = " << htmlDir_ << std::endl;
48  } else {
49  std::cout << " HTML output is disabled" << std::endl;
50  }
51 
52  ME_Db_ = new MonitorElementsDb( ps, xmlFile_ );
53 
55 
56 }
T getUntrackedParameter(std::string const &, T const &) const
tuple cout
Definition: gather_cfg.py:41
void showDirStructure(void) const
Definition: DQMStore.cc:2539
EcalEndcapMonitorDbModule::~EcalEndcapMonitorDbModule ( )
virtual

Destructor.

Definition at line 58 of file EcalEndcapMonitorDbModule.cc.

References ME_Db_.

58  {
59 
60  if ( ME_Db_ ) delete ME_Db_;
61 
62 }

Member Function Documentation

void EcalEndcapMonitorDbModule::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 80 of file EcalEndcapMonitorDbModule.cc.

References MonitorElementsDb::analyze(), ExpressReco_HICollisions_FallBack::cerr, cmsDriver::config, gather_cfg::cout, cmsCodeRules.cppFunctionSkipper::exception, edm::hlt::Exception, htmlDir_, MonitorElementsDb::htmlOutput(), icycle_, ME_Db_, session_, stor::utils::sleep(), and sleepTime_.

80  {
81 
82  icycle_++;
83 
84  std::cout << "EcalEndcapMonitorDbModule: icycle = " << icycle_ << std::endl;
85 
86  try {
87  coral::Context& context = coral::Context::instance();
88  context.loadComponent("CORAL/Services/ConnectionService");
89  context.loadComponent("CORAL/Services/EnvironmentAuthenticationService");
90  coral::IHandle<coral::IConnectionService> connectionService = context.query<coral::IConnectionService>("CORAL/Services/ConnectionService");
91  context.loadComponent("CORAL/RelationalPlugins/oracle");
92 
93  // Set configuration parameters
94  coral::IConnectionServiceConfiguration& config = connectionService->configuration();
95  config.setConnectionRetrialPeriod(1);
96  config.setConnectionRetrialTimeOut(10);
97 
98  session_ = connectionService->connect("ECAL CondDB", coral::ReadOnly);
99 
100  if ( ME_Db_ ) ME_Db_->analyze(e, c, session_ );
101 
102  } catch (coral::Exception& e) {
103  std::cerr << "CORAL Exception : " << e.what() << std::endl;
104  } catch (std::exception& e) {
105  std::cerr << "Standard C++ exception : " << e.what() << std::endl;
106  }
107 
108  if ( htmlDir_.size() != 0 ) {
109 
111 
112  }
113 
114  delete session_;
115 
116  sleep( sleepTime_ );
117 
118 }
void sleep(Duration_t)
Definition: Utils.h:163
void analyze(const edm::Event &e, const edm::EventSetup &c, coral::ISessionProxy *s)
Analyze.
tuple config
Definition: cmsDriver.py:17
tuple cout
Definition: gather_cfg.py:41
void htmlOutput(std::string &htmlDir)
void EcalEndcapMonitorDbModule::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file EcalEndcapMonitorDbModule.cc.

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

64  {
65 
66  icycle_ = 0;
67 
68  if ( ME_Db_ ) ME_Db_->beginJob();
69 
70 }
void EcalEndcapMonitorDbModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file EcalEndcapMonitorDbModule.cc.

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

72  {
73 
74  if ( ME_Db_ ) ME_Db_->endJob();
75 
76  std::cout << "EcalEndcapMonitorDbModule: endJob, icycle = " << icycle_ << std::endl;
77 
78 }
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

DQMStore* EcalEndcapMonitorDbModule::dqmStore_
private

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().

int EcalEndcapMonitorDbModule::icycle_
private

Definition at line 48 of file EcalEndcapMonitorDbModule.h.

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

MonitorElementsDb* EcalEndcapMonitorDbModule::ME_Db_
private
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().

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().