CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
EcalBarrelMonitorDbModule Class Reference

#include <EcalBarrelMonitorDbModule.h>

Inheritance diagram for EcalBarrelMonitorDbModule:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 EcalBarrelMonitorDbModule (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalBarrelMonitorDbModule () override
 Destructor. More...
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginJob (void) override
 
void endJob (void) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 24 of file EcalBarrelMonitorDbModule.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 27 of file EcalBarrelMonitorDbModule.h.

◆ MonitorElement

Definition at line 26 of file EcalBarrelMonitorDbModule.h.

Constructor & Destructor Documentation

◆ EcalBarrelMonitorDbModule()

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_, Utilities::operator, prefixME_, session_, sleepTime_, AlCaHLTBitMon_QueryRunRegistry::string, and xmlFile_.

28  {
29  usesResource("DQMStore");
31 
32  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
33 
34  xmlFile_ = ps.getUntrackedParameter<std::string>("xmlFile", "");
35  if (!xmlFile_.empty()) {
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_.empty()) {
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 
53 
54  icycle_ = 0;
55  session_ = nullptr;
56 }
T getUntrackedParameter(std::string const &, T const &) const

◆ ~EcalBarrelMonitorDbModule()

EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule ( )
override

Destructor.

Definition at line 58 of file EcalBarrelMonitorDbModule.cc.

References ME_Db_.

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

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::one::EDAnalyzerBase.

Definition at line 77 of file EcalBarrelMonitorDbModule.cc.

References MonitorElementsDb::analyze(), HltBtagPostValidation_cff::c, DMR_cfg::cerr, visDQMUpload::context, gather_cfg::cout, MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, Exception, htmlDir_, MonitorElementsDb::htmlOutput(), icycle_, instance, ME_Db_, session_, and sleepTime_.

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

◆ beginJob()

void EcalBarrelMonitorDbModule::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 63 of file EcalBarrelMonitorDbModule.cc.

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

63  {
64  icycle_ = 0;
65 
66  if (ME_Db_)
67  ME_Db_->beginJob();
68 }

◆ endJob()

void EcalBarrelMonitorDbModule::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 70 of file EcalBarrelMonitorDbModule.cc.

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

70  {
71  if (ME_Db_)
72  ME_Db_->endJob();
73 
74  std::cout << "EcalBarrelMonitorDbModule: endJob, icycle = " << icycle_ << std::endl;
75 }

Member Data Documentation

◆ dqmStore_

DQMStore* EcalBarrelMonitorDbModule::dqmStore_
private

Definition at line 48 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

◆ htmlDir_

std::string EcalBarrelMonitorDbModule::htmlDir_
private

Definition at line 52 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

◆ icycle_

int EcalBarrelMonitorDbModule::icycle_
private

Definition at line 46 of file EcalBarrelMonitorDbModule.h.

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

◆ ME_Db_

MonitorElementsDb* EcalBarrelMonitorDbModule::ME_Db_
private

◆ prefixME_

std::string EcalBarrelMonitorDbModule::prefixME_
private

Definition at line 50 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().

◆ session_

coral::ISessionProxy* EcalBarrelMonitorDbModule::session_
private

Definition at line 60 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

◆ sleepTime_

unsigned int EcalBarrelMonitorDbModule::sleepTime_
private

Definition at line 58 of file EcalBarrelMonitorDbModule.h.

Referenced by analyze(), and EcalBarrelMonitorDbModule().

◆ xmlFile_

std::string EcalBarrelMonitorDbModule::xmlFile_
private

Definition at line 54 of file EcalBarrelMonitorDbModule.h.

Referenced by EcalBarrelMonitorDbModule().