MnPrint.h

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: MnPrint.h 34256 2010-06-30 21:07:32Z moneta $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #ifndef ROOT_Minuit2_MnPrint
00011 #define ROOT_Minuit2_MnPrint
00012 
00013 #include "Minuit2/MnConfig.h"
00014 
00015 //#define DEBUG
00016 //#define WARNINGMSG
00017 
00018 #include <iostream>
00019 
00020 #ifdef DEBUG
00021 #ifndef WARNINGMSG
00022 #define WARNINGMSG
00023 #endif
00024 #endif
00025 
00026 
00027 
00028 
00029 namespace ROOT {
00030 
00031    namespace Minuit2 {
00032 
00033 
00034 /**
00035     define ostream operators for output 
00036 */
00037 
00038 class FunctionMinimum;
00039 std::ostream& operator<<(std::ostream&, const FunctionMinimum&);
00040 
00041 class MinimumState;
00042 std::ostream& operator<<(std::ostream&, const MinimumState&);
00043 
00044 class LAVector;
00045 std::ostream& operator<<(std::ostream&, const LAVector&);
00046 
00047 class LASymMatrix;
00048 std::ostream& operator<<(std::ostream&, const LASymMatrix&);
00049 
00050 class MnUserParameters;
00051 std::ostream& operator<<(std::ostream&, const MnUserParameters&);
00052 
00053 class MnUserCovariance;
00054 std::ostream& operator<<(std::ostream&, const MnUserCovariance&);
00055 
00056 class MnGlobalCorrelationCoeff;
00057 std::ostream& operator<<(std::ostream&, const MnGlobalCorrelationCoeff&);
00058 
00059 class MnUserParameterState;
00060 std::ostream& operator<<(std::ostream&, const MnUserParameterState&);
00061 
00062 class MnMachinePrecision;
00063 std::ostream& operator<<(std::ostream&, const MnMachinePrecision&);
00064 
00065 class MinosError;
00066 std::ostream& operator<<(std::ostream&, const MinosError&);
00067 
00068 class ContoursError;
00069 std::ostream& operator<<(std::ostream&, const ContoursError&);
00070 
00071   }  // namespace Minuit2
00072 
00073 }  // namespace ROOT
00074 
00075 
00076 // macro to report messages
00077 
00078 #ifndef USE_ROOT_ERROR
00079 
00080 #ifndef MNLOG
00081 #define MN_OS std::cerr
00082 #else 
00083 #define MN_OS MNLOG
00084 #endif
00085 
00086 #define MN_INFO_MSG(str) \
00087    MN_OS << "Info: " << str \
00088        << std::endl;
00089 #define MN_ERROR_MSG(str) \
00090    MN_OS << "Error: " << str \
00091        << std::endl;
00092 # define MN_INFO_VAL(x) \
00093    MN_OS << "Info: " << #x << " = " << (x) << std::endl; 
00094 # define MN_ERROR_VAL(x) \
00095    MN_OS << "Error: " << #x << " = " << (x) << std::endl; 
00096 
00097 
00098 // same giving a location
00099 
00100 #define MN_INFO_MSG2(loc,str) \
00101   MN_OS << "Info in " << loc << " : " << str \
00102        << std::endl;
00103 #define MN_ERROR_MSG2(loc,str) \
00104    MN_OS << "Error in " << loc << " : " << str \
00105        << std::endl;
00106 # define MN_INFO_VAL2(loc,x) \
00107    MN_OS << "Info in " << loc << " : " << #x << " = " << (x) << std::endl;
00108 # define MN_ERROR_VAL2(loc,x) \
00109    MN_OS << "Error in " << loc << " : " << #x << " = " << (x) << std::endl; 
00110 
00111 
00112 
00113 #else
00114 // use ROOT error reporting system 
00115 #include "TError.h"
00116 #include "Math/Util.h"
00117 
00118 // this first two should be used only with string literals to 
00119 // avoid warning produced by the format in TError
00120 #define  MN_INFO_MSG(str) \
00121    ::Info("Minuit2",str);
00122 #define  MN_ERROR_MSG(str) \
00123    ::Error("Minuit2",str);
00124 # define MN_INFO_VAL(x) \
00125    {std::string str = std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
00126       ::Info("Minuit2","%s",str.c_str() );} 
00127 # define MN_ERROR_VAL(x) \
00128    {std::string str = std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
00129    ::Error("Minuit2","%s",str.c_str() );} 
00130 
00131 # define MN_INFO_MSG2(loc,txt) \
00132    {std::string str = std::string(loc) + std::string(" : ") + std::string(txt); \
00133    ::Info("Minuit2","%s",str.c_str() );} 
00134 # define MN_ERROR_MSG2(loc,txt) \
00135    {std::string str = std::string(loc) + std::string(" : ") + std::string(txt); \
00136    ::Error("Minuit2","%s",str.c_str() );} 
00137 
00138 # define MN_INFO_VAL2(loc,x) \
00139    {std::string str = std::string(loc) + std::string(" : ") + std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
00140    ::Info("Minuit2","%s",str.c_str() );} 
00141 # define MN_ERROR_VAL2(loc,x) \
00142    {std::string str = std::string(loc) + std::string(" : ") + std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
00143    ::Error("Minuit2","%s",str.c_str() );} 
00144 
00145 
00146 
00147 #endif
00148 
00149 
00150 #endif  // ROOT_Minuit2_MnPrint

Generated on Tue Jul 5 14:25:44 2011 for ROOT_528-00b_version by  doxygen 1.5.1