Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AIDA_Fitter.h

Go to the documentation of this file.
00001  /**********************************************************************
00002   *                                                                    *
00003   * Copyright (c) 2002 Lorenzo Moneta, CERN/IT                       *
00004   *                   <Lorenzo.Moneta.cern.ch>                       *
00005   *                                                                    *
00006   * This library is free software; you can redistribute it and/or      *
00007   * modify it under the terms of the GNU Lesser General Public         *
00008   * License as published by the Free Software Foundation; either       *
00009   * version 2.1 of the License, or (at your option) any later version. *
00010   *                                                                    *
00011   * This library is distributed in the hope that it will be useful,    *
00012   * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
00013   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014   * Lesser General Public License for more details.                    *
00015   *                                                                    *
00016   * You should have received a copy of the GNU Lesser General Public   *
00017   * License along with this library (see file COPYING); if not, write  *
00018   * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
00019   * 330, Boston, MA 02111-1307 USA, or contact the author.             *
00020   *                                                                    *
00021   **********************************************************************/
00022 
00023 // Header file for class AIDA_Fitter
00024 // 
00025 // Authors  : Lorenzo Moneta , Jakub Moscicki
00026 // Created  : Thu Oct  3 15:00:32 2002
00027 // 
00028 // Last update: Thu Oct  3 15:00:32 2002
00029 // 
00030 #ifndef ANAPHE_AIDA_FITTER_FML_AIDA_FITTER
00031 #define ANAPHE_AIDA_FITTER_FML_AIDA_FITTER 1
00032 
00033 #include "AIDA_Dev/IDevFitter.h"
00034 
00035 #include <vector>
00036 #include <map>
00037 
00038 
00039 namespace Anaphe { 
00040    namespace FML { 
00041      class IFMLFunction; 
00042      class Fitter; 
00043    }
00044  }
00045 
00046 namespace Anaphe  { 
00047   namespace AIDA_Fitter_FML { 
00048 
00049     class AIDA_FitParameterSettings; 
00050 
00051 
00052 class AIDA_Fitter : virtual public AIDA::Dev::IDevFitter {
00053 
00054 public: 
00055   AIDA_Fitter(); 
00056   virtual ~AIDA_Fitter(); 
00057 
00058 private:
00059 // usually copying is non trivial, so we make this unaccessible
00060   AIDA_Fitter(const AIDA_Fitter &); 
00061   AIDA_Fitter & operator = (const AIDA_Fitter &); 
00062 
00063 public: 
00064 
00066 
00070   AIDA::IFitResult * fit(AIDA::IFitData & fitData, AIDA::IFunction & func) ;
00071 
00075   AIDA::IFitResult * fit(AIDA::IBaseHistogram & hist, AIDA::IFunction & func) ;
00076 
00080   AIDA::IFitResult * fit(AIDA::IBaseHistogram & hist, std::string model) ;
00081 
00085   AIDA::IFitResult * fit(AIDA::IBaseHistogram & hist, std::string model, std::vector<double>  & initialParameters) ;
00086 
00090   AIDA::IFitResult * fit(AIDA::IDataPointSet & dataPointSet, AIDA::IFunction & f) ;
00091 
00095   AIDA::IFitResult * fit(AIDA::IDataPointSet & dataPointSet, std::string model) ;
00096 
00100   AIDA::IFitResult * fit(AIDA::IDataPointSet & dataPointSet, std::string model, std::vector<double>  & initialParameters) ;
00101 
00103   AIDA::IFitResult * fit(AIDA::IFitData & d, std::string model) ;
00104 
00105   AIDA::IFitResult * fit(AIDA::IFitData & d, std::string model, std::vector<double>  & initialParameters) ;
00106 
00110   bool setEngine(std::string name) ;
00111 
00115   std::string engineName() ;
00116 
00120   AIDA::IFitParameterSettings & fitParameterSettings(std::string name) ;
00121 
00125   const std::vector<std::string>  & listParameterSettings() ;
00126 
00130   void resetParameterSettings() ;
00131 
00136   bool setConstraint(std::string expr) ;
00137 
00139   const std::vector<std::string>  & constraints() ;
00140 
00144   void resetConstraints() ;
00145 
00149   bool setFitMethod(std::string name);
00150 
00154   std::string fitMethodName() ;
00155 
00158   AIDA::IDataPointSet * createScan1D(AIDA::IFitData & d, AIDA::IFunction & f, std::string par, int npts, double pmin, double pmax) ;
00159 
00164   AIDA::IDataPointSet * createContour(AIDA::IFitData & d, AIDA::IFitResult & r, std::string par1, std::string par2, int npts, double up) ;
00165 
00173   void setUseFunctionGradient(bool useGrad) ;
00174 
00181   bool useFunctionGradient() ;
00182 
00183 
00185   // need to be outside constructors because some options must be set 
00186   // after having choosen the fit type(e.g. errorUp)
00187   bool setOptions(const std::string & options); 
00188 
00189   
00190 
00191 protected: 
00192 
00193   AIDA::IFitResult * fit(AIDA::IFitData& d, Anaphe::FML::IFMLFunction &f);
00194   
00195   bool connect(AIDA::IFitData& d, AIDA::IBaseHistogram &h); 
00196   bool connect(AIDA::IFitData& d, AIDA::IDataPointSet &dps); 
00197 
00198 
00199 private: 
00200 
00201   Anaphe::FML::Fitter * m_fitter; 
00202 
00203   typedef std::map<std::string, AIDA_FitParameterSettings *> FitParMap;
00204   FitParMap m_parmap;
00205   std::vector<std::string> m_constr;
00206 
00207 
00208 }; 
00209 
00210   }
00211 }
00212 #endif /* AIDA_FITTER */

Generated on Tue May 20 14:49:01 2003 for AIDA_Fitter_FML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002