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 edm::EDConsumerBase

Public Member Functions

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

Constructor & Destructor Documentation

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

Constructor.

Definition at line 26 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_.

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

Destructor.

Definition at line 59 of file EcalEndcapMonitorDbModule.cc.

References ME_Db_.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 81 of file EcalEndcapMonitorDbModule.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 65 of file EcalEndcapMonitorDbModule.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file EcalEndcapMonitorDbModule.cc.

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

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

Member Data Documentation

DQMStore* EcalEndcapMonitorDbModule::dqmStore_
private

Definition at line 48 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().

std::string EcalEndcapMonitorDbModule::htmlDir_
private

Definition at line 52 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

int EcalEndcapMonitorDbModule::icycle_
private

Definition at line 46 of file EcalEndcapMonitorDbModule.h.

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

MonitorElementsDb* EcalEndcapMonitorDbModule::ME_Db_
private
std::string EcalEndcapMonitorDbModule::prefixME_
private

Definition at line 50 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().

coral::ISessionProxy* EcalEndcapMonitorDbModule::session_
private

Definition at line 60 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

unsigned int EcalEndcapMonitorDbModule::sleepTime_
private

Definition at line 58 of file EcalEndcapMonitorDbModule.h.

Referenced by analyze(), and EcalEndcapMonitorDbModule().

std::string EcalEndcapMonitorDbModule::xmlFile_
private

Definition at line 54 of file EcalEndcapMonitorDbModule.h.

Referenced by EcalEndcapMonitorDbModule().