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
EcalBarrelMonitorDbModule Class Reference

#include <EcalBarrelMonitorDbModule.h>

Inheritance diagram for EcalBarrelMonitorDbModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalBarrelMonitorDbModule (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EcalBarrelMonitorDbModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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_, cppFunctionSkipper::operator, prefixME_, session_, DQMStore::showDirStructure(), sleepTime_, AlCaHLTBitMon_QueryRunRegistry::string, 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  icycle_ = 0;
57  session_ = 0;
58 }
T getUntrackedParameter(std::string const &, T const &) const
tuple cout
Definition: gather_cfg.py:145
void showDirStructure(void) const
Definition: DQMStore.cc:3398
EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule ( )
virtual

Destructor.

Definition at line 60 of file EcalBarrelMonitorDbModule.cc.

References ME_Db_.

60  {
61 
62  if ( ME_Db_ ) delete ME_Db_;
63 
64 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 82 of file EcalBarrelMonitorDbModule.cc.

References MonitorElementsDb::analyze(), ecal_dqm_sourceclient-live_cfg::cerr, HDQMDatabaseProducer::config, gather_cfg::cout, cppFunctionSkipper::exception, Exception, htmlDir_, MonitorElementsDb::htmlOutput(), icycle_, instance, ME_Db_, session_, and sleepTime_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file EcalBarrelMonitorDbModule.cc.

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

66  {
67 
68  icycle_ = 0;
69 
70  if ( ME_Db_ ) ME_Db_->beginJob();
71 
72 }
void EcalBarrelMonitorDbModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file EcalBarrelMonitorDbModule.cc.

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

74  {
75 
76  if ( ME_Db_ ) ME_Db_->endJob();
77 
78  std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ << std::endl;
79 
80 }
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

DQMStore* EcalBarrelMonitorDbModule::dqmStore_
private

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

int EcalBarrelMonitorDbModule::icycle_
private

Definition at line 48 of file EcalBarrelMonitorDbModule.h.

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

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