[root] / trunk / math / mathcore / inc / Math / Error.h Repository:
ViewVC logotype

View of /trunk/math/mathcore/inc/Math/Error.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25486 - (download) (as text) (annotate)
Mon Sep 22 12:43:03 2008 UTC (6 years, 4 months ago) by moneta
File size: 4662 byte(s)
import changes from math development branches for subdirectory math. List of changes in detail: 

mathcore: 
---------
  MinimizerOptions: 
	new  class for storing Minimizer option, with static default values that can be 
	changed by the user

  FitConfig: 
   	- use default values from MinimizerOption class
   	- rename method to create parameter settings from a function

  FitUtil.cxx:   
    	improve the derivative calculations used in the effective chi2 and in Fumili and 
	fix a bug for evaluation of likelihood or chi2 terms. 
	In  EvaluatePdf() work and return  the log of the pdf. 
      
  FitResult:
	- improve the class by adding extra information like, num. of free parameters, 
	minimizer status, global correlation coefficients, information about fixed 
	and bound parameters. 
   	- add method for getting fit confidence intervals 
  	- improve print method   

  DataRange: 
	add method SetRange to distinguish from AddRange. SetRange deletes the existing 
	ranges. 

  ParamsSettings: make few methods const

  FCN functions (Chi2FCN, LogLikelihoodFCN, etc..) 
	move some common methods and data members in base class (FitMethodFunction)

  RootFinder: add template Solve() for any callable function.  

mathmore:
--------
  minimizer classes: fill status information
  GSLNLSMinimizer: return error and covariance matrix 

minuit2: 
-------
  Minuit2Minimizer: fill  status information 
  DavidonErrorUpdator: check that delgam or gvg are not zero ( can happen when dg = 0)
  FumiliFCNAdapter: work on the log of pdf

minuit:
------- 
  TLinearMinimizer: add support for robust fitting
  TMinuitMinimizer: fill status information and fix a bug in filling the correlation matrix. 
 fumili:
 ------ 
  add TFumiliMinimizer: 
	wrapper class for TFumili using Minimizer interface

// @(#)root/mathcore:$Id$
// Authors: L. Moneta

/**********************************************************************
 *                                                                    *
 * Copyright (c) 2007 LCG ROOT Math team,  CERN/PH-SFT                *
 *                                                                    *
 **********************************************************************/

#ifndef ROOT_Math_Error
#define ROOT_Math_Error




#ifdef DEBUG
#ifndef WARNINGMSG
#define WARNINGMSG
#endif
#endif



/** 
   Pre-processor macro to report messages 
   which can be configured to use ROOT error or 
   simply an iostream in case of stan-alone builds
*/

#ifndef USE_ROOT_ERROR

// use iostream instead of ROOT 

#include <iostream>

#ifndef ROOT_MATH_LOG
#define ROOT_MATH_OS std::cerr
#else 
#define ROOT_MATH_LOG
#endif

// giving a location + string

#define MATH_INFO_MSG(loc,str)                   \
   ROOT_MATH_OS << "Info in ROOT::Math::" << loc << ">: "  << str \
       << std::endl;
#define MATH_WARN_MSG(loc,str)                      \
   ROOT_MATH_OS << "Warning in ROOT::Math::" << loc << ">: " << str \
       << std::endl;
#define MATH_ERROR_MSG(loc,str)                   \
   ROOT_MATH_OS << "Error in ROOT::Math::" << loc << ">: " << str \
       << std::endl;

// giving location +  a value

# define MATH_INFO_VAL(loc,x)                                           \
   ROOT_MATH_OS << "Info in <ROOT::Math::" << loc << ">: " << #x << " = " << (x) << std::endl; 
# define MATH_WARN_VAL(loc,x)                                           \
   ROOT_MATH_OS << "Warning in ROOT::Math::" << loc << ">: " << #x << " = " << (x) << std::endl; 
# define MATH_ERROR_VAL(loc,x)                                          \
   ROOT_MATH_OS << "Error in ROOT::Math::" << loc << ">: " << #x << " = " << (x) << std::endl; 

// giving a location + string + value

# define MATH_INFO_MSGVAL(loc,str,x)                                    \
   ROOT_MATH_OS << "Info in <ROOT::Math::" << loc << ">: "  << str << "; " << #x << " = " << (x) << std::endl; 
# define MATH_WARN_MSGVAL(loc,str,x)                                    \
   ROOT_MATH_OS << "Warning in ROOT::Math::" << loc << ">: " << str << "; " << #x << " = " << (x) << std::endl; 
# define MATH_ERROR_MSGVAL(loc,str,x)                                   \
   ROOT_MATH_OS << "Error in ROOT::Math::" << loc << ">: " << str << "; " << #x << " = " << (x) << std::endl; 


#else
// use ROOT error reporting system 

#include "TError.h"
#include "Math/Util.h"

#define  MATH_INFO_MSG(loc,str)                 \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
      ::Info(sl.c_str(),str);}
#define  MATH_WARN_MSG(loc,str)                 \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
      ::Warning(sl.c_str(),str);}
#define  MATH_ERROR_MSG(loc,str)                \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
      ::Error(sl.c_str(),str);}

# define MATH_INFO_VAL(loc,x)                                           \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Info(sl.c_str(),str.c_str() );} 
# define MATH_WARN_VAL(loc,x)                                           \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Warning(sl.c_str(),str.c_str() );} 
# define MATH_ERROR_VAL(loc,x)                                          \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Error(sl.c_str(),str.c_str() );} 


# define MATH_INFO_MSGVAL(loc,txt,x)                    \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(txt) + std::string("; ") + std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Info(sl.c_str(),str.c_str() );} 
# define MATH_WARN_MSGVAL(loc,txt,x)                      \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(txt) + std::string("; ") + std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Warning(sl.c_str(),str.c_str() );} 
# define MATH_ERROR_MSGVAL(loc,txt,x)                     \
   {std::string sl = "ROOT::Math::" + std::string(loc); \
   std::string str = std::string(txt) + std::string("; ") + std::string(#x) + std::string(" = ") + ROOT::Math::Util::ToString(x); \
   ::Error(sl.c_str(),str.c_str() );} 



#endif


#endif  // ROOT_MATH_Error

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9