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

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices 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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

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.

28  {
29  dqmStore_ = edm::Service<DQMStore>().operator->();
30 
31  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
32 
33  xmlFile_ = ps.getUntrackedParameter<std::string>("xmlFile", "");
34  if (!xmlFile_.empty()) {
35  std::cout << "Monitor Elements from DB xml source file is " << xmlFile_ << std::endl;
36  }
37 
38  sleepTime_ = ps.getUntrackedParameter<int>("sleepTime", 0);
39  std::cout << "Sleep time is " << sleepTime_ << " second(s)." << std::endl;
40 
41  // html output directory
42  htmlDir_ = ps.getUntrackedParameter<std::string>("htmlDir", ".");
43 
44  if (!htmlDir_.empty()) {
45  std::cout << " HTML output will go to"
46  << " htmlDir = " << htmlDir_ << std::endl;
47  } else {
48  std::cout << " HTML output is disabled" << std::endl;
49  }
50 
52 
53  icycle_ = 0;
54  session_ = nullptr;
55 }

References gather_cfg::cout, dqmStore_, edm::ParameterSet::getUntrackedParameter(), htmlDir_, icycle_, ME_Db_, prefixME_, session_, sleepTime_, AlCaHLTBitMon_QueryRunRegistry::string, and xmlFile_.

◆ ~EcalBarrelMonitorDbModule()

EcalBarrelMonitorDbModule::~EcalBarrelMonitorDbModule ( )
override

Destructor.

Definition at line 57 of file EcalBarrelMonitorDbModule.cc.

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

References ME_Db_.

Member Function Documentation

◆ analyze()

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 76 of file EcalBarrelMonitorDbModule.cc.

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

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

◆ beginJob()

void EcalBarrelMonitorDbModule::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 62 of file EcalBarrelMonitorDbModule.cc.

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

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

◆ endJob()

void EcalBarrelMonitorDbModule::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file EcalBarrelMonitorDbModule.cc.

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

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

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

EcalBarrelMonitorDbModule::dqmStore_
DQMStore * dqmStore_
Definition: EcalBarrelMonitorDbModule.h:48
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalBarrelMonitorDbModule::icycle_
int icycle_
Definition: EcalBarrelMonitorDbModule.h:46
MonitorElementsDb::htmlOutput
void htmlOutput(std::string &htmlDir)
Definition: MonitorElementsDb.cc:194
config
Definition: config.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
MonitorElementsDb::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c, coral::ISessionProxy *s)
Analyze.
Definition: MonitorElementsDb.cc:104
edm::Service
Definition: Service.h:30
MonitorElementsDb::endJob
void endJob(void)
Definition: MonitorElementsDb.cc:102
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
EcalBarrelMonitorDbModule::htmlDir_
std::string htmlDir_
Definition: EcalBarrelMonitorDbModule.h:52
EcalBarrelMonitorDbModule::xmlFile_
std::string xmlFile_
Definition: EcalBarrelMonitorDbModule.h:54
MonitorElementsDb
Definition: MonitorElementsDb.h:25
Exception
Definition: hltDiff.cc:245
EcalBarrelMonitorDbModule::prefixME_
std::string prefixME_
Definition: EcalBarrelMonitorDbModule.h:50
EcalBarrelMonitorDbModule::session_
coral::ISessionProxy * session_
Definition: EcalBarrelMonitorDbModule.h:60
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
EcalBarrelMonitorDbModule::sleepTime_
unsigned int sleepTime_
Definition: EcalBarrelMonitorDbModule.h:58
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
MonitorElementsDb::beginJob
void beginJob(void)
Definition: MonitorElementsDb.cc:100
EcalBarrelMonitorDbModule::ME_Db_
MonitorElementsDb * ME_Db_
Definition: EcalBarrelMonitorDbModule.h:56