CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes
ecaldqm::DBWriterWorker Class Referenceabstract

#include <DBWriterWorkers.h>

Inheritance diagram for ecaldqm::DBWriterWorker:
ecaldqm::IntegrityWriter ecaldqm::LaserWriter ecaldqm::LedWriter ecaldqm::OccupancyWriter ecaldqm::PedestalWriter ecaldqm::PresampleWriter ecaldqm::SummaryWriter ecaldqm::TestPulseWriter ecaldqm::TimingWriter

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

 DBWriterWorker (std::string const &, edm::ParameterSet const &)
 
const std::string & getName () const
 
bool isActive () const
 
void retrieveSource (DQMStore::IGetter &)
 
virtual bool run (EcalCondDBInterface *, MonRunIOV &)=0
 
bool runsOn (std::string const &_runType) const
 
void setVerbosity (int _v)
 
virtual ~DBWriterWorker ()
 

Protected Attributes

bool active_
 
const std::string name_
 
std::set< std::string > runTypes_
 
MESetCollection source_
 
int verbosity_
 

Detailed Description

Definition at line 16 of file DBWriterWorkers.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 18 of file DBWriterWorkers.h.

◆ MonitorElement

Definition at line 19 of file DBWriterWorkers.h.

Constructor & Destructor Documentation

◆ DBWriterWorker()

ecaldqm::DBWriterWorker::DBWriterWorker ( std::string const &  _name,
edm::ParameterSet const &  _ps 
)

Definition at line 59 of file DBWriterWorkers.cc.

60  : name_(_name), runTypes_(), source_(), active_(false) {
61  edm::ParameterSet const &params(_ps.getUntrackedParameterSet(name_));
62 
63  std::vector<std::string> runTypes(params.getUntrackedParameter<std::vector<std::string>>("runTypes"));
64  for (unsigned iT(0); iT < runTypes.size(); ++iT)
65  runTypes_.insert(runTypes[iT]);
66 
67  if (!params.existsAs<edm::ParameterSet>("source", false))
68  return;
69 
70  edm::ParameterSet const &sourceParams(params.getUntrackedParameterSet("source"));
71  std::vector<std::string> const &meNames(sourceParams.getParameterNames());
72  for (unsigned iP(0); iP < meNames.size(); ++iP) {
73  std::string meName(meNames[iP]);
74  edm::ParameterSet const &meParam(sourceParams.getUntrackedParameterSet(meName));
75  source_.insert(meName, createMESet(meParam));
76  }
77  }

References ecaldqm::createMESet(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::MESetCollection::insert(), name_, CalibrationSummaryClient_cfi::params, EcalCondDBWriter_cfi::runTypes, runTypes_, source_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~DBWriterWorker()

virtual ecaldqm::DBWriterWorker::~DBWriterWorker ( )
inlinevirtual

Definition at line 21 of file DBWriterWorkers.h.

21 {}

Member Function Documentation

◆ getName()

const std::string& ecaldqm::DBWriterWorker::getName ( ) const
inline

Definition at line 30 of file DBWriterWorkers.h.

30 { return name_; }

References name_.

Referenced by EcalCondDBWriter::dqmEndJob(), and plotting.Plot::draw().

◆ isActive()

bool ecaldqm::DBWriterWorker::isActive ( ) const
inline

Definition at line 31 of file DBWriterWorkers.h.

31 { return active_; }

References active_.

◆ retrieveSource()

void ecaldqm::DBWriterWorker::retrieveSource ( DQMStore::IGetter _igetter)

Definition at line 79 of file DBWriterWorkers.cc.

79  {
80  std::string failedPath;
81  for (MESetCollection::iterator sItr(this->source_.begin()); sItr != this->source_.end(); ++sItr) {
82  if (!sItr->second->retrieve(_igetter, &failedPath)) {
83  edm::LogError("EcalDQM") << name_ << ": MESet " << sItr->first << "@" << failedPath << " not found";
84  this->active_ = false;
85  return;
86  }
87  }
88  }

References active_, ecaldqm::MESetCollection::begin(), ecaldqm::MESetCollection::end(), name_, source_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EcalCondDBWriter::dqmEndJob().

◆ run()

virtual bool ecaldqm::DBWriterWorker::run ( EcalCondDBInterface ,
MonRunIOV  
)
pure virtual

◆ runsOn()

bool ecaldqm::DBWriterWorker::runsOn ( std::string const &  _runType) const
inline

Definition at line 26 of file DBWriterWorkers.h.

26 { return runTypes_.find(_runType) != runTypes_.end(); }

References runTypes_.

◆ setVerbosity()

void ecaldqm::DBWriterWorker::setVerbosity ( int  _v)
inline

Definition at line 28 of file DBWriterWorkers.h.

28 { verbosity_ = _v; }

References verbosity_.

Referenced by EcalCondDBWriter::EcalCondDBWriter().

Member Data Documentation

◆ active_

bool ecaldqm::DBWriterWorker::active_
protected

Definition at line 37 of file DBWriterWorkers.h.

Referenced by isActive(), and retrieveSource().

◆ name_

const std::string ecaldqm::DBWriterWorker::name_
protected

Definition at line 34 of file DBWriterWorkers.h.

Referenced by DBWriterWorker(), getName(), and retrieveSource().

◆ runTypes_

std::set<std::string> ecaldqm::DBWriterWorker::runTypes_
protected

Definition at line 35 of file DBWriterWorkers.h.

Referenced by DBWriterWorker(), and runsOn().

◆ source_

MESetCollection ecaldqm::DBWriterWorker::source_
protected

◆ verbosity_

int ecaldqm::DBWriterWorker::verbosity_
protected

Definition at line 38 of file DBWriterWorkers.h.

Referenced by ecaldqm::IntegrityWriter::run(), and setVerbosity().

CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
ecaldqm::DBWriterWorker::runTypes_
std::set< std::string > runTypes_
Definition: DBWriterWorkers.h:35
ecaldqm::MESetCollection::end
auto end() const
Definition: MESet.h:356
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
ecaldqm::MESetCollection::insert
void insert(const std::string &key, MESet *ptr)
Definition: MESet.h:350
ecaldqm::DBWriterWorker::name_
const std::string name_
Definition: DBWriterWorkers.h:34
ecaldqm::MESetCollection::begin
auto begin()
Definition: MESet.h:355
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ecaldqm::createMESet
MESet * createMESet(edm::ParameterSet const &)
Definition: MESetUtils.cc:18
ecaldqm::DBWriterWorker::active_
bool active_
Definition: DBWriterWorkers.h:37
EcalCondDBWriter_cfi.runTypes
runTypes
Definition: EcalCondDBWriter_cfi.py:70
ecaldqm::MESetCollection::iterator
MESetColletionType::iterator iterator
Definition: MESet.h:347
ecaldqm::DBWriterWorker::source_
MESetCollection source_
Definition: DBWriterWorkers.h:36
ecaldqm::DBWriterWorker::verbosity_
int verbosity_
Definition: DBWriterWorkers.h:38