Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:58

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : RootFinder                                                            *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Root finding using Brents algorithm                                       *
0012  *      (translated from CERNLIB function RZERO)                                  *
0013  *                                                                                *
0014  * Authors (alphabetical):                                                        *
0015  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0016  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0017  *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
0018  *                                                                                *
0019  * Copyright (c) 2005:                                                            *
0020  *      CERN, Switzerland                                                         *
0021  *      U. of Victoria, Canada                                                    *
0022  *      MPI-K Heidelberg, Germany                                                 *
0023  *                                                                                *
0024  * Redistribution and use in source and binary forms, with or without             *
0025  * modification, are permitted according to the terms listed in LICENSE           *
0026  * (see tmva/doc/LICENSE)                                          *
0027  **********************************************************************************/
0028 
0029 #ifndef ROOT_TMVA_RootFinder
0030 #define ROOT_TMVA_RootFinder
0031 
0032 //////////////////////////////////////////////////////////////////////////
0033 //                                                                      //
0034 // RootFinder                                                           //
0035 //                                                                      //
0036 // Root finding using Brents algorithm                                  //
0037 // (translated from CERNLIB function RZERO)                             //
0038 //                                                                      //
0039 //////////////////////////////////////////////////////////////////////////
0040 
0041 #include "TObject.h"
0042 
0043 namespace TMVA {
0044 
0045    class MsgLogger;
0046    class MethodBase;
0047 
0048    class RootFinder : public TObject {
0049 
0050    public:
0051 
0052       RootFinder( MethodBase *method,
0053                   Double_t rootMin, Double_t rootMax,
0054                   Int_t    maxIterations = 100,
0055                   Double_t absTolerance  = 0.0 );
0056       virtual ~RootFinder( void );
0057 
0058       // returns the root of the function
0059       Double_t Root( Double_t refValue );
0060 
0061    private:
0062 
0063       Double_t fRootMin;  ///< minimum root value
0064       Double_t fRootMax;  ///< maximum root value
0065       Int_t    fMaxIter;  ///< maximum number of iterations
0066       Double_t fAbsTol;   ///< absolute tolerance deviation
0067 
0068       // Methods pointer
0069       MethodBase *fMethod;
0070 
0071       mutable MsgLogger* fLogger;   ///<! message logger
0072       MsgLogger& Log() const { return *fLogger; }
0073 
0074       ClassDef(RootFinder,0); // Root finding using Brents algorithm
0075    };
0076 
0077 } // namespace TMVA
0078 
0079 #endif