CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EcalDQMonitorClient Class Reference

#include <EcalDQMonitorClient.h>

Inheritance diagram for EcalDQMonitorClient:
DQMEDHarvester ecaldqm::EcalDQMonitor edm::one::EDProducer< T > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalDQMonitorClient (edm::ParameterSet const &)
 
 ~EcalDQMonitorClient () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector
< edm::ProductResolverIndex >
const & 
putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 
- Public Member Functions inherited from ecaldqm::EcalDQMonitor
 EcalDQMonitor (edm::ParameterSet const &)
 
virtual ~EcalDQMonitor () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void runWorkers (DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
 

Private Attributes

edm::ESGetToken
< EcalDQMChannelStatus,
EcalDQMChannelStatusRcd
cStHndl
 
unsigned eventCycleLength_
 
unsigned iEvt_
 
ecaldqm::StatusManager statusManager_
 
edm::ESGetToken
< EcalDQMTowerStatus,
EcalDQMTowerStatusRcd
tStHndl
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef
dqm::harvesting::MonitorElement 
MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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< B > consumes (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 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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
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)
 
- Protected Member Functions inherited from ecaldqm::EcalDQMonitor
void ecaldqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const
 
void ecaldqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
void ecaldqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void ecaldqmEndRun (edm::Run const &, edm::EventSetup const &)
 
template<typename FuncOnWorker >
void executeOnWorkers_ (FuncOnWorker, std::string const &, std::string const &="", int=1) const
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
- Protected Attributes inherited from ecaldqm::EcalDQMonitor
std::string const moduleName_
 
const int verbosity_
 
std::vector< DQWorker * > workers_
 

Detailed Description

Definition at line 14 of file EcalDQMonitorClient.h.

Constructor & Destructor Documentation

EcalDQMonitorClient::EcalDQMonitorClient ( edm::ParameterSet const &  _ps)

Definition at line 22 of file EcalDQMonitorClient.cc.

References HLTObjectMonitor_Client_cff::client, edm::EDConsumerBase::consumesCollector(), Exception, ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorker::getName(), ecaldqm::DQWorkerClient::setStatusManager(), ecaldqm::DQWorkerClient::setTokens(), ecaldqm::DQWorker::setTokens(), and statusManager_.

23  : DQMEDHarvester(),
25  iEvt_(0),
26  cStHndl(esConsumes<edm::Transition::BeginRun>()),
27  tStHndl(esConsumes<edm::Transition::BeginRun>()),
28  statusManager_() {
31  [this, &collector](ecaldqm::DQWorker* worker) {
32  ecaldqm::DQWorkerClient* client(dynamic_cast<ecaldqm::DQWorkerClient*>(worker));
33  if (!client)
34  throw cms::Exception("InvalidConfiguration") << "Non-client DQWorker " << worker->getName() << " passed";
35  client->setStatusManager(this->statusManager_);
36  client->setTokens(collector);
37  worker->setTokens(collector);
38  },
39  "initialization");
40 
41  // This is no longer used since run 2
42  //
43  //if (_ps.existsAs<edm::FileInPath>("PNMaskFile", false)) {
44  // std::ifstream maskFile(_ps.getUntrackedParameter<edm::FileInPath>("PNMaskFile").fullPath());
45  // if (maskFile.is_open())
46  // statusManager_.readFromStream(maskFile);
47  //}
48 }
ecaldqm::StatusManager statusManager_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ESGetToken< EcalDQMChannelStatus, EcalDQMChannelStatusRcd > cStHndl
edm::ESGetToken< EcalDQMTowerStatus, EcalDQMTowerStatusRcd > tStHndl
std::string const & getName() const
Definition: DQWorker.h:118
void setTokens(edm::ConsumesCollector &)
Definition: DQWorker.cc:53
EcalDQMonitorClient::~EcalDQMonitorClient ( )
override

Definition at line 50 of file EcalDQMonitorClient.cc.

50 {}

Member Function Documentation

void EcalDQMonitorClient::beginRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 69 of file EcalDQMonitorClient.cc.

References cStHndl, ecaldqm::EcalDQMonitor::ecaldqmBeginRun(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), edm::EventSetup::find(), edm::EventSetup::getData(), ecaldqm::StatusManager::readFromObj(), ecaldqm::DQWorker::setSetupObjects(), statusManager_, and tStHndl.

69  {
70  executeOnWorkers_([&_es](ecaldqm::DQWorker* worker) { worker->setSetupObjects(_es); },
71  "ecaldqmGetSetupObjects",
72  "Getting EventSetup Objects");
73 
74  if (_es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMChannelStatusRcd>()) &&
75  _es.find(edm::eventsetup::EventSetupRecordKey::makeKey<EcalDQMTowerStatusRcd>())) {
76  const EcalDQMChannelStatus* ChStatus = &_es.getData(cStHndl);
77  const EcalDQMTowerStatus* TStatus = &_es.getData(tStHndl);
78 
79  statusManager_.readFromObj(*ChStatus, *TStatus);
80  }
81 
82  ecaldqmBeginRun(_run, _es);
83 }
ecaldqm::StatusManager statusManager_
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &)
edm::ESGetToken< EcalDQMChannelStatus, EcalDQMChannelStatusRcd > cStHndl
edm::ESGetToken< EcalDQMTowerStatus, EcalDQMTowerStatusRcd > tStHndl
void setSetupObjects(edm::EventSetup const &)
Definition: DQWorker.cc:104
void readFromObj(EcalDQMChannelStatus const &, EcalDQMTowerStatus const &)
void EcalDQMonitorClient::dqmEndJob ( DQMStore::IBooker _ibooker,
DQMStore::IGetter _igetter 
)
overrideprivatevirtual

Implements DQMEDHarvester.

Definition at line 114 of file EcalDQMonitorClient.cc.

References ecaldqm::DQWorker::bookMEs(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorkerClient::kJob, ecaldqm::DQWorker::releaseMEs(), and runWorkers().

114  {
116  [&_ibooker](ecaldqm::DQWorker* worker) {
117  worker->bookMEs(_ibooker); // worker returns if already booked
118  },
119  "bookMEs",
120  "Booking MEs");
121 
123 
124  executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
125 }
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
virtual void releaseMEs()
Definition: DQWorker.cc:90
virtual void bookMEs(DQMStore::IBooker &)
Definition: DQWorker.cc:96
void EcalDQMonitorClient::dqmEndLuminosityBlock ( DQMStore::IBooker _ibooker,
DQMStore::IGetter _igetter,
edm::LuminosityBlock const &  _lumi,
edm::EventSetup const &  _es 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 87 of file EcalDQMonitorClient.cc.

References ecaldqm::DQWorkerClient::bookMEs(), HLTObjectMonitor_Client_cff::client, ecaldqm::EcalDQMonitor::ecaldqmEndLuminosityBlock(), ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::DQWorkerClient::kLumi, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorkerClient::resetPerLumi(), ecaldqm::DQWorkerClient::runsOn(), and runWorkers().

90  {
92  [&_ibooker](ecaldqm::DQWorker* worker) {
93  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
94  if (!client->onlineMode() && !client->runsOn(ecaldqm::DQWorkerClient::kLumi))
95  return;
96  client->bookMEs(_ibooker);
97  },
98  "bookMEs",
99  "Booking MEs");
100 
101  ecaldqmEndLuminosityBlock(_lumi, _es);
102 
104 
106  [](ecaldqm::DQWorker* worker) {
107  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
108  client->resetPerLumi();
109  },
110  "dqmEndLuminosityBlock",
111  "Reset per-lumi MEs");
112 }
void runWorkers(DQMStore::IGetter &, ecaldqm::DQWorkerClient::ProcessType)
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void EcalDQMonitorClient::endRun ( edm::Run const &  _run,
edm::EventSetup const &  _es 
)
overrideprivate

Definition at line 85 of file EcalDQMonitorClient.cc.

References ecaldqm::EcalDQMonitor::ecaldqmEndRun().

85 { ecaldqmEndRun(_run, _es); }
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &)
void EcalDQMonitorClient::fillDescriptions ( edm::ConfigurationDescriptions _descs)
static

Definition at line 53 of file EcalDQMonitorClient.cc.

References edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addNode(), edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, ecaldqm::DQWorkerClient::fillDescriptions(), ecaldqm::EcalDQMonitor::fillDescriptions(), and edm::RequireZeroOrMore.

53  {
56 
57  edm::ParameterSetDescription clientParameters;
60  allWorkers.addNode(
62  desc.addUntracked("workerParameters", allWorkers);
63 
64  desc.addOptionalUntracked<edm::FileInPath>("PNMaskFile");
65 
66  _descs.addDefault(desc);
67 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static void fillDescriptions(edm::ParameterSetDescription &)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ParameterSetDescription &)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
void EcalDQMonitorClient::runWorkers ( DQMStore::IGetter _igetter,
ecaldqm::DQWorkerClient::ProcessType  _type 
)
private

Definition at line 127 of file EcalDQMonitorClient.cc.

References HLTObjectMonitor_Client_cff::client, ecaldqm::EcalDQMonitor::executeOnWorkers_(), ecaldqm::EcalDQMonitor::moduleName_, ecaldqm::DQWorker::onlineMode(), ecaldqm::DQWorkerClient::producePlots(), ecaldqm::DQWorkerClient::releaseSource(), ecaldqm::DQWorkerClient::resetMEs(), ecaldqm::DQWorkerClient::retrieveSource(), ecaldqm::DQWorkerClient::runsOn(), ecaldqm::DQWorker::setTime(), and ecaldqm::EcalDQMonitor::verbosity_.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

127  {
128  if (verbosity_ > 0)
129  edm::LogInfo("EcalDQM") << moduleName_ << ": Starting worker modules..";
130 
132  [&_igetter, &_type](ecaldqm::DQWorker* worker) {
133  ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
134  if (!client->onlineMode() && !client->runsOn(_type))
135  return;
136  client->releaseSource();
137  client->resetMEs();
138  if (!client->retrieveSource(_igetter, _type))
139  return;
140  if (client->onlineMode())
141  client->setTime(time(nullptr));
142  client->producePlots(_type);
143  },
144  "retrieveAndRun",
145  "producing plots");
146 
147  if (verbosity_ > 0)
148  edm::LogInfo("EcalDQM") << " done." << std::endl;
149 }
void executeOnWorkers_(FuncOnWorker, std::string const &, std::string const &="", int=1) const
Definition: EcalDQMonitor.h:50
std::string const moduleName_
Definition: EcalDQMonitor.h:45
Log< level::Info, false > LogInfo

Member Data Documentation

edm::ESGetToken<EcalDQMChannelStatus, EcalDQMChannelStatusRcd> EcalDQMonitorClient::cStHndl
private

Definition at line 34 of file EcalDQMonitorClient.h.

Referenced by beginRun().

unsigned EcalDQMonitorClient::eventCycleLength_
private

Definition at line 32 of file EcalDQMonitorClient.h.

unsigned EcalDQMonitorClient::iEvt_
private

Definition at line 33 of file EcalDQMonitorClient.h.

ecaldqm::StatusManager EcalDQMonitorClient::statusManager_
private

Definition at line 36 of file EcalDQMonitorClient.h.

Referenced by beginRun(), and EcalDQMonitorClient().

edm::ESGetToken<EcalDQMTowerStatus, EcalDQMTowerStatusRcd> EcalDQMonitorClient::tStHndl
private

Definition at line 35 of file EcalDQMonitorClient.h.

Referenced by beginRun().