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_FitResult 00024 // 00025 // Authors : Lorenzo Moneta , Jakub Moscicki 00026 // Created : Fri Oct 4 14:08:23 2002 00027 // 00028 // Last update: Fri Oct 4 14:08:23 2002 00029 // 00030 #ifndef ANAPHE_AIDA_FITTER_FML_AIDA_FITRESULT 00031 #define ANAPHE_AIDA_FITTER_FML_AIDA_FITRESULT 1 00032 00033 #include "AIDA_Dev/IDevFitResult.h" 00034 00035 # include "AIDA_Function_FML/AIDA_FunctionAdapter.h" 00036 # include "AIDA_FitParameterSettings.h" 00037 00038 # include "FML/FitResult.h" 00039 00040 00041 #include <memory> 00042 00043 namespace Anaphe { 00044 namespace AIDA_Fitter_FML { 00045 00046 00047 class AIDA_FitResult : virtual public AIDA::Dev::IDevFitResult { 00048 00049 public: 00050 AIDA_FitResult(std::auto_ptr<Anaphe::FML::FitResult> r); 00051 virtual ~AIDA_FitResult(); 00052 00053 private: 00054 // usually copying is non trivial, so we make this unaccessible 00055 AIDA_FitResult(const AIDA_FitResult &); 00056 AIDA_FitResult & operator = (const AIDA_FitResult &); 00057 00058 public: 00059 00061 00062 bool isValid(); 00063 int fitStatus(); 00064 AIDA::IFunction * fittedFunction(); 00065 double quality(); 00066 int ndf(); 00067 00068 const std::vector<double> & fittedParameters() const; 00069 const std::vector<std::string> & fittedParameterNames() const; 00070 double fittedParameter(std::string & name); 00071 const std::vector<double> & errors() const; 00072 const std::vector<double> & errorsPlus() const; 00073 const std::vector<double> & errorsMinus() const; 00074 double covMatrixElement(int i, int j); 00075 std::string fitMethodName(); 00076 std::string engineName(); 00077 std::string dataDescription(); 00078 const std::vector<std::string> & constraints(); 00079 AIDA::IFitParameterSettings * fitParameterSettings(std::string name); 00080 00083 00084 void setIsValid(bool yes); 00085 void setFitStatus(int status); 00086 void setFittedFunction(AIDA::IFunction * f); 00087 void setQuality(double quality); 00088 void setNdf(int ndf); 00089 void setCovMatrixElement(int i, int j, double val); 00090 void setFitMethodName(std::string name); 00091 void setEngineName(std::string name); 00092 void setDataDescription(std::string descr); 00093 void setConstraints(const std::vector<std::string> & cv); 00094 void setFitParameterSettings(std::string name, AIDA::IFitParameterSettings * s); 00095 00096 // fill Function annotation with fit result informations 00097 void fillAnnotation(AIDA::IFunction * f); 00098 00099 protected: 00100 00101 private: 00102 00103 std::auto_ptr<Anaphe::FML::FitResult> m_result; 00104 std::auto_ptr<Anaphe::AIDA_Function_FML::AIDA_FunctionAdapter> m_fadapter; 00105 std::vector<std::string> m_constr; 00106 00107 typedef std::map<std::string, AIDA_FitParameterSettings *> FitParMap; 00108 mutable FitParMap m_fitpar; 00109 00110 }; 00111 00112 } // end of namespace Anaphe::AIDA_Fitter_FML 00113 } 00114 #endif /* AIDA_FITRESULT */