00001 // -*- C++ -*- 00002 // 00003 // Debug.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef ThePEG_Debug_H 00010 #define ThePEG_Debug_H 00011 // This is the declaration of the Debug class. 00012 00013 #include <vector> 00014 00015 namespace ThePEG { 00016 00021 class Debug { 00022 00023 public: 00024 00028 enum Levels { 00029 noDebug = 0, 00030 printSomeEvents = 1, 00031 printEveryEvent = 5, 00032 full = 9 00033 }; 00034 00038 static int level; 00039 00047 static std::vector<bool> debugItems; 00048 00053 static void debugItem(int item, bool on); 00054 00058 static void setDebug(int ilev); 00059 00064 static bool debugItem(int item) 00065 { 00066 if ( level == noDebug ) return false; 00067 if ( level == full ) return true; 00068 return ( item < 0 || size_t(item) >= debugItems.size() )? false: 00069 debugItems[item]; 00070 } 00071 00079 static void unmaskFpuErrors(); 00083 static void unmaskFpuOverflow(); 00087 static void unmaskFpuUnderflow(); 00091 static void unmaskFpuDivZero(); 00095 static void unmaskFpuDenorm(); 00099 static void unmaskFpuInvalid(); 00103 static void maskFpuErrors(); 00107 static void maskFpuOverflow(); 00111 static void maskFpuUnderflow(); 00115 static void maskFpuDivZero(); 00119 static void maskFpuDenorm(); 00123 static void maskFpuInvalid(); 00125 00126 }; 00127 00128 } 00129 00130 #endif /* ThePEG_Debug_H */