CMS 3D CMS Logo

EcalBarrelMonitorDbModule Class Reference

#include <DQM/EcalBarrelMonitorDbModule/interface/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 (const edm::EventSetup &c)
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 27 of file EcalBarrelMonitorDbModule.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 31 of file EcalBarrelMonitorDbModule.cc.

References GenMuonPlsPt100GeV_cfg::cout, dqmStore_, lat::endl(), edm::ParameterSet::getUntrackedParameter(), htmlDir_, ME_Db_, prefixME_, DQMStore::showDirStructure(), sleepTime_, and xmlFile_.

00031                                                                              {
00032 
00033   dqmStore_ = edm::Service<DQMStore>().operator->();
00034 
00035   prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
00036 
00037   xmlFile_ = ps.getUntrackedParameter<std::string>( "xmlFile", "" );
00038   if ( xmlFile_.size() != 0 ) {
00039     std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ << std::endl;
00040   }
00041 
00042   sleepTime_ = ps.getUntrackedParameter<int>( "sleepTime", 0 );
00043   std::cout << "Sleep time is " << sleepTime_ << " second(s)." << std::endl;
00044 
00045   // html output directory
00046   htmlDir_ = ps.getUntrackedParameter<std::string>("htmlDir", ".");
00047 
00048   if ( htmlDir_.size() != 0 ) {
00049     std::cout << " HTML output will go to"
00050               << " htmlDir = " << htmlDir_ << std::endl;
00051   } else {
00052     std::cout << " HTML output is disabled" << std::endl;
00053   }
00054 
00055   ME_Db_ = new MonitorElementsDb( ps, xmlFile_ );
00056 
00057   if ( dqmStore_ ) dqmStore_->showDirStructure();
00058 
00059 }

EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule (  )  [virtual]

Destructor.

Definition at line 61 of file EcalBarrelMonitorDbModule.cc.

References ME_Db_.

00061                                                      {
00062 
00063   if ( ME_Db_ ) delete ME_Db_;
00064 
00065 }


Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 83 of file EcalBarrelMonitorDbModule.cc.

References MonitorElementsDb::analyze(), TestMuL1L2Filter_cff::cerr, edmplugin::standard::config(), python::TagTree::context, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), cond::Error, exception, Exception, DBSPlugin::get(), htmlDir_, MonitorElementsDb::htmlOutput(), icycle_, ME_Db_, session_, and sleepTime_.

00083                                                                                 {
00084 
00085   icycle_++;
00086 
00087   std::cout << "EcalBarrelMonitorDbModule: icycle = " << icycle_ << std::endl;
00088 
00089   try {
00090     seal::Handle<seal::Context> context = new seal::Context;
00091     seal::PluginManager* pm = seal::PluginManager::get();
00092     pm->initialise ();
00093     seal::Handle<seal::ComponentLoader> loader = new seal::ComponentLoader(context.get());
00094 
00095     loader->load("SEAL/Services/MessageService");
00096 
00097     std::vector<seal::Handle<seal::IMessageService> > v_msgSvc;
00098     context->query(v_msgSvc);
00099     if ( ! v_msgSvc.empty() ) {
00100       seal::Handle<seal::IMessageService>& msgSvc = v_msgSvc.front();
00101       msgSvc->setOutputLevel(seal::Msg::Error);
00102       //msgSvc->setOutputLevel(seal::Msg::Debug);
00103     }
00104 
00105     loader->load("CORAL/Services/ConnectionService");
00106 
00107     loader->load("CORAL/Services/EnvironmentAuthenticationService");
00108 
00109     seal::IHandle<coral::IConnectionService> connectionService = context->query<coral::IConnectionService>("CORAL/Services/ConnectionService");
00110 
00111     loader->load("CORAL/RelationalPlugins/oracle");
00112 
00113     // Set configuration parameters
00114     coral::IConnectionServiceConfiguration& config = connectionService->configuration();
00115     config.setConnectionRetrialPeriod(1);
00116     config.setConnectionRetrialTimeOut(10);
00117 
00118     session_ = connectionService->connect("ECAL CondDB", coral::ReadOnly);
00119 
00120     if ( ME_Db_ ) ME_Db_->analyze(e, c, session_ );
00121 
00122   } catch (coral::Exception& e) {
00123     std::cerr << "CORAL Exception : " << e.what() << std::endl;
00124   } catch (std::exception& e) {
00125     std::cerr << "Standard C++ exception : " << e.what() << std::endl;
00126   }
00127 
00128   if ( htmlDir_.size() != 0 ) {
00129 
00130     ME_Db_->htmlOutput( htmlDir_ );
00131 
00132   }
00133 
00134   delete session_;
00135 
00136   sleep( sleepTime_ );
00137 
00138 }

void EcalBarrelMonitorDbModule::beginJob ( const edm::EventSetup c  )  [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file EcalBarrelMonitorDbModule.cc.

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

00067                                                               {
00068 
00069   icycle_ = 0;
00070 
00071   if ( ME_Db_ ) ME_Db_->beginJob(c);
00072 
00073 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file EcalBarrelMonitorDbModule.cc.

References GenMuonPlsPt100GeV_cfg::cout, MonitorElementsDb::endJob(), lat::endl(), icycle_, and ME_Db_.

00075                                            {
00076 
00077   if ( ME_Db_ ) ME_Db_->endJob();
00078 
00079   std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ << std::endl;
00080 
00081 }


Member Data Documentation

DQMStore* EcalBarrelMonitorDbModule::dqmStore_ [private]

Definition at line 52 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

std::string EcalBarrelMonitorDbModule::htmlDir_ [private]

Definition at line 56 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

int EcalBarrelMonitorDbModule::icycle_ [private]

Definition at line 50 of file EcalBarrelMonitorDbModule.h.

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

MonitorElementsDb* EcalBarrelMonitorDbModule::ME_Db_ [private]

Definition at line 60 of file EcalBarrelMonitorDbModule.h.

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

std::string EcalBarrelMonitorDbModule::prefixME_ [private]

Definition at line 54 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

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

Definition at line 64 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze().

unsigned int EcalBarrelMonitorDbModule::sleepTime_ [private]

Definition at line 62 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

std::string EcalBarrelMonitorDbModule::xmlFile_ [private]

Definition at line 58 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:25 2009 for CMSSW by  doxygen 1.5.4