test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MyWatcher.h
Go to the documentation of this file.
1 #ifndef MyWATCHER_H
2 #define MyWATCHER_H
3 
4 #include "TStopwatch.h"
5 #include <iostream>
6 #include <sstream>
7 
8 #ifdef EDM_ML_DEBUG
9 class MyWatcher : public TStopwatch {
10  public:
11  MyWatcher(const std::string n=""):name(n),total(0) {}
12  ~MyWatcher(){}
13 
14  std::string start(bool r=true){Start(r); return " [Start]";}
15  std::string continu(){Continue(); return " [Continue]";}
16  std::string reset(){Reset(); return " [Reset]";}
17  std::string stop() {Stop(); return " [Stop]";}
18  std::string lap() {
19  std::stringstream o;
20  double r=RealTime();
21  total+=r;
22  o<<"\n "<<r<<" total:"<<total<<" ["<<name<<"]";
23  Start();
24  return o.str();}
26  double total;
27 };
28 #else
29 class MyWatcher {
30  public:
33 
34  std::string start(bool r=true){return name;}
36  std::string reset(){return name;}
37  std::string stop(){return name;}
38  std::string lap() {return name;}
40 };
41 #endif
42 
43 #endif
std::string start(bool r=true)
Definition: MyWatcher.h:34
MyWatcher(const std::string)
Definition: MyWatcher.h:31
std::string lap()
Definition: MyWatcher.h:38
std::string name
Definition: MyWatcher.h:39
std::string stop()
Definition: MyWatcher.h:37
~MyWatcher()
Definition: MyWatcher.h:32
std::string continu()
Definition: MyWatcher.h:35
std::string reset()
Definition: MyWatcher.h:36
void Reset(std::vector< TH2F > &depth)