00001
00002
00003
00004
00005
00006
00007
00008 #ifndef StMuDebug_h
00009 #define StMuDebug_h
00010
00011 #include "TObject.h"
00012
00013 #if defined(__GNUC__) && ! defined(__CINT__)
00014 # define __PRETTYF__ __PRETTY_FUNCTION__
00015 #else
00016 # define __PRETTYF__ __FILE__
00017 #endif
00018
00019
00020
00021 #define FORCEDDEBUGMESSAGE(x) cout << "##### " << __PRETTYF__ << " ##### " << x << endl;
00022 #define DEBUGMESSAGE(x) if (StMuDebug::level()> 0) cout << "##### " << __PRETTYF__ << " ##### " << x << endl;
00023 #define DEBUGMESSAGE1(x) if (StMuDebug::level()>=1) cout << "##### " << __PRETTYF__ << " ##### " << x << endl;
00024 #define DEBUGMESSAGE2(x) if (StMuDebug::level()>=2) cout << "##### " << __PRETTYF__ << " ##### " << x << endl;
00025 #define DEBUGMESSAGE3(x) if (StMuDebug::level()>=3) cout << "##### " << __PRETTYF__ << " ##### " << x << endl;
00026
00027 #define FORCEDDEBUGVALUE(x) cout << "##### " << __PRETTYF__ << " ##### " << (#x) << "=" << x << endl;
00028 #define DEBUGVALUE(x) if (StMuDebug::level()> 0) cout << "##### " << __PRETTYF__ << " ##### " << (#x) << "=" << x << endl;
00029 #define DEBUGVALUE1(x) if (StMuDebug::level()>=1) cout << "##### " << __PRETTYF__ << " ##### " << (#x) << "=" << x << endl;
00030 #define DEBUGVALUE2(x) if (StMuDebug::level()>=2) cout << "##### " << __PRETTYF__ << " ##### " << (#x) << "=" << x << endl;
00031 #define DEBUGVALUE3(x) if (StMuDebug::level()>=3) cout << "##### " << __PRETTYF__ << " ##### " << (#x) << "=" << x << endl;
00032
00033 #define IFDEBUG(x) if (StMuDebug::level()> 0) { DEBUGMESSAGE(""); (x);}
00034 #define IFDEBUG1(x) if (StMuDebug::level()>=1) { DEBUGMESSAGE(""); (x);}
00035 #define IFDEBUG2(x) if (StMuDebug::level()>=2) { DEBUGMESSAGE(""); (x);}
00036 #define IFDEBUG3(x) if (StMuDebug::level()>=3) { DEBUGMESSAGE(""); (x);}
00037
00038
00061 class StMuDebug : public TObject{
00062 public:
00063 StMuDebug() {};
00064 ~StMuDebug() {};
00065
00067 static void on() { mDebug = absolut(mDebug); }
00069 static void setLevel(unsigned int level) { mDebug=level; }
00071 static void off() { mDebug = -1*absolut(mDebug); }
00073 static int level() { return mDebug;}
00074 protected:
00076 static int absolut(int i) { return (i>0) ? i : -i; }
00078 static int mDebug;
00079 ClassDef(StMuDebug,1)
00080 };
00081
00082 #endif
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116