ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataUtil/interface/Debug.h
Revision: 1.1
Committed: Tue May 27 19:36:05 2008 UTC (16 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
First commit of Util classes.

File Contents

# User Rev Content
1 loizides 1.1 // $Id: THIDebug.h 2637 2006-03-06 23:53:38Z loizides $
2    
3     #ifndef DATAUTIL_DEBUG_H
4     #define DATAUTIL_DEBUG_H
5    
6     #include <Rtypes.h>
7     #include <TError.h>
8    
9     //--------------------------------------------------------------------------------------------------
10     //
11     // Debug
12     //
13     // Detailed logging / debug scheme:
14     // This class defines the debuging masks (EDebugMask), which
15     // are used with the MDB (MIT DeBug) macro together with
16     // the log levels to control the verbosity.
17     // As a rule of thumb:
18     // level 1 and 2 should not be used in (event) loops,
19     // level 3 and 4 might be used in loops.
20     // Please, do not introduce more levels!
21     //
22     // Authors: C.Loizides
23     //
24     //--------------------------------------------------------------------------------------------------
25    
26     namespace mithep {
27     class Debug
28     {
29     public:
30     enum EDebugMask {
31     kNone = 0,
32     kGeneral = 1,
33     kTreeIO = 2,
34     kAnalysis = 4,
35     kModules = 8,
36     kAll = 0xFFFFFFFF
37     };
38     private:
39     Debug();
40     virtual ~Debug() {}
41     Debug(const Debug &cpy);
42    
43     ClassDef(Debug, 0) // Defines different debug masks
44     };
45     }
46    
47     R__EXTERN mithep::Debug::EDebugMask gDebugMask;
48     R__EXTERN Int_t gDebugLevel;
49    
50     #define MDB(mask,level) \
51     if ((mithep::Debug::mask & gDebugMask) && gDebugLevel >= (level))
52    
53     #define MitAssert(f,e) \
54     if (!(e)) Fatal(f, kAssertMsg, _QUOTE_(e), __LINE__, __FILE__)
55    
56     #define MitAssertStatic(f,e) \
57     if (!(e)) ::Fatal(f, kAssertMsg, _QUOTE_(e), __LINE__, __FILE__)
58    
59     #endif /*DATAUTIL_DEBUG_H*/