test
CMS 3D CMS Logo

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