FairRoot/PandaRoot
debug.h
Go to the documentation of this file.
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project *
3  * All rights reserved. *
4  * *
5  * Primary Authors: *
6  * Copyright 2009 Matthias Kretz <kretz@kde.org> *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
17 #ifndef DEBUG_H
18 #define DEBUG_H
19 
20 #include <iostream>
21 
22 static class PndFTSCANoDebugStream {
23  public:
24  inline PndFTSCANoDebugStream &operator<<( std::ostream &(*)(std::ostream &) ) { return *this; }
25 
26  template<typename T>
27  inline PndFTSCANoDebugStream &operator<<( const T & ) { return *this; }
29 
30 #ifdef DEBUG_MESSAGES
31 template<typename T> inline void prepareForDebugOutput( const typename T::Mask k, T *x0,
32  T *x1 = 0, T *x2 = 0, T *x3 = 0, T *x4 = 0, T *x5 = 0, T *x6 = 0, T *x7 = 0, T *x8 = 0, T *x9 = 0) {
33  if ( x0 ) ( *x0 )( k ) = T( 0 );
34  if ( x1 ) ( *x1 )( k ) = T( 0 );
35  if ( x2 ) ( *x2 )( k ) = T( 0 );
36  if ( x3 ) ( *x3 )( k ) = T( 0 );
37  if ( x4 ) ( *x4 )( k ) = T( 0 );
38  if ( x5 ) ( *x5 )( k ) = T( 0 );
39  if ( x6 ) ( *x6 )( k ) = T( 0 );
40  if ( x7 ) ( *x7 )( k ) = T( 0 );
41  if ( x8 ) ( *x8 )( k ) = T( 0 );
42  if ( x9 ) ( *x9 )( k ) = T( 0 );
43 }
44 #if DEBUG_MESSAGES & 1
45 inline std::ostream &debugS() { return std::cerr; }
46 #else
48 #endif
49 #if DEBUG_MESSAGES & 2
50 inline std::ostream &debugF() { return std::cerr; }
51 #else
53 #endif
54 #if DEBUG_MESSAGES & 4
55 inline std::ostream &debugKF() { return std::cerr; }
56 #else
58 #endif
59 #if DEBUG_MESSAGES & 8
60 inline std::ostream &debugTS() { return std::cerr; }
61 #else
63 #endif
64 #if DEBUG_MESSAGES & 16
65 inline std::ostream &debugWO() { return std::cerr; }
66 #else
68 #endif
69 #else
70 template<typename T> inline void prepareForDebugOutput( const typename T::Mask, T *,
71  T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0, T * = 0) {}
77 #endif
78 
79 #endif // DEBUG_H
PndFTSCANoDebugStream & operator<<(const T &)
Definition: debug.h:27
Double_t x0
Definition: checkhelixhit.C:70
void prepareForDebugOutput(const typename T::Mask, T *, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0, T *=0)
Definition: debug.h:70
PndFTSCANoDebugStream & operator<<(std::ostream &(*)(std::ostream &))
Definition: debug.h:24
PndFTSCANoDebugStream & debugF()
Definition: debug.h:73
PndFTSCANoDebugStream & debugS()
Definition: debug.h:72
TTree * T
Definition: anaLmdReco.C:32
PndFTSCANoDebugStream & debugTS()
Definition: debug.h:75
static class PndFTSCANoDebugStream PndFTSCANoDebugStreamInst
PndFTSCANoDebugStream & debugWO()
Definition: debug.h:76
PndFTSCANoDebugStream & debugKF()
Definition: debug.h:74