CMS 3D CMS Logo

ESClient.h
Go to the documentation of this file.
1 #ifndef ESClient_H
2 #define ESClient_H
3 
4 #include <string>
5 
7 
8 namespace edm {
9  class ParameterSet;
10 }
11 
12 class ESClient {
13 public:
16 
17  ESClient(edm::ParameterSet const &);
18  virtual ~ESClient() {}
19 
20  virtual void endLumiAnalyze(DQMStore::IGetter &) {}
21  virtual void endJobAnalyze(DQMStore::IGetter &) {}
22 
23  void setup(DQMStore::IBooker &);
24 
25  template <typename T>
26  T *getHisto(MonitorElement *, bool = false, T * = 0) const;
27 
28 protected:
29  virtual void book(DQMStore::IBooker &) {}
30 
33  bool cloneME_;
34  bool verbose_;
35  bool debug_;
36 };
37 
38 template <typename T>
39 T *ESClient::getHisto(MonitorElement *_me, bool _clone /* = false*/, T *_current /* = 0*/) const {
40  if (!_me) {
41  if (_clone)
42  return _current;
43  else
44  return nullptr;
45  }
46 
47  TObject *obj(_me->getRootObject());
48 
49  if (!obj)
50  return nullptr;
51 
52  if (_clone) {
53  delete _current;
54  _current = dynamic_cast<T *>(obj->Clone(("ME " + _me->getName()).c_str()));
55  if (_current)
56  _current->SetDirectory(nullptr);
57  return _current;
58  } else
59  return dynamic_cast<T *>(obj);
60 }
61 
62 #endif // ESClient_H
edm
HLT enums.
Definition: AlignableModifier.h:19
ESClient::ESClient
ESClient(edm::ParameterSet const &)
Definition: ESClient.cc:5
ESClient::book
virtual void book(DQMStore::IBooker &)
Definition: ESClient.h:29
ESClient::endLumiAnalyze
virtual void endLumiAnalyze(DQMStore::IGetter &)
Definition: ESClient.h:20
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
ESClient::prefixME_
std::string prefixME_
Definition: ESClient.h:32
ESClient::endJobAnalyze
virtual void endJobAnalyze(DQMStore::IGetter &)
Definition: ESClient.h:21
dqm::legacy::DQMStore
Definition: DQMStore.h:727
dqm::legacy::MonitorElement::getRootObject
TObject * getRootObject() const override
Definition: MonitorElement.h:469
ESClient::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: ESClient.h:14
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ESClient::setup
void setup(DQMStore::IBooker &)
Definition: ESClient.cc:12
ESClient::getHisto
T * getHisto(MonitorElement *, bool=false, T *=0) const
Definition: ESClient.h:39
edm::ParameterSet
Definition: ParameterSet.h:36
ParameterSet
Definition: Functions.h:16
ESClient::~ESClient
virtual ~ESClient()
Definition: ESClient.h:18
ESClient
Definition: ESClient.h:12
ESClient::debug_
bool debug_
Definition: ESClient.h:35
ESClient::verbose_
bool verbose_
Definition: ESClient.h:34
T
long double T
Definition: Basic3DVectorLD.h:48
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::impl::MonitorElement::getName
const std::string & getName() const
get name of ME
Definition: MonitorElement.h:250
dqm::implementation::IBooker
Definition: DQMStore.h:43
ESClient::cloneME_
bool cloneME_
Definition: ESClient.h:33
ESClient::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: ESClient.h:15
ESClient::initialized_
bool initialized_
Definition: ESClient.h:31