00001 // @(#)root/tmva $Id: FitterBase.h 29195 2009-06-24 10:39:49Z brun $ 00002 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss 00003 00004 /********************************************************************************** 00005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00006 * Package: TMVA * 00007 * Class : FitterBase * 00008 * Web : http://tmva.sourceforge.net * 00009 * * 00010 * Description: * 00011 * Base class for TMVA fitters * 00012 * * 00013 * Authors (alphabetical): * 00014 * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland * 00015 * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland * 00016 * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland * 00017 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany * 00018 * * 00019 * Copyright (c) 2005: * 00020 * CERN, Switzerland * 00021 * MPI-K Heidelberg, Germany * 00022 * * 00023 * Redistribution and use in source and binary forms, with or without * 00024 * modification, are permitted according to the terms listed in LICENSE * 00025 * (http://tmva.sourceforge.net/LICENSE) * 00026 **********************************************************************************/ 00027 00028 #ifndef ROOT_TMVA_FitterBase 00029 #define ROOT_TMVA_FitterBase 00030 00031 ////////////////////////////////////////////////////////////////////////// 00032 // // 00033 // FitterBase // 00034 // // 00035 // Baseclass for TMVA fitters // 00036 // // 00037 ////////////////////////////////////////////////////////////////////////// 00038 00039 #include<vector> 00040 #ifndef ROOT_TObject 00041 #include "TObject.h" 00042 #endif 00043 #ifndef ROOT_TString 00044 #include "TString.h" 00045 #endif 00046 00047 #ifndef ROOT_TMVA_Configurable 00048 #include "TMVA/Configurable.h" 00049 #endif 00050 00051 namespace TMVA { 00052 00053 class Interval; 00054 class IFitterTarget; 00055 class MsgLogger; 00056 00057 class FitterBase : public Configurable { 00058 00059 public: 00060 00061 FitterBase( IFitterTarget& target, const TString& name, const std::vector<TMVA::Interval*> ranges, 00062 const TString& theOption ); 00063 00064 virtual ~FitterBase() {} 00065 00066 Double_t Run(); 00067 virtual Double_t Run( std::vector<Double_t>& pars ) = 0; 00068 00069 Double_t EstimatorFunction( std::vector<Double_t>& parameters ); 00070 IFitterTarget& GetFitterTarget() const { return fFitterTarget; } 00071 00072 // accessor 00073 Int_t GetNpars() const { return fNpars; } 00074 00075 // remove namespace in name 00076 const char* GetName() const { return fClassName; } 00077 00078 protected: 00079 00080 // need to implement option declaration 00081 virtual void DeclareOptions() = 0; 00082 00083 IFitterTarget& fFitterTarget; // pointer to target of fitting procedure 00084 const std::vector<TMVA::Interval*> fRanges; // allowed intervals 00085 Int_t fNpars; // number of parameters 00086 00087 mutable MsgLogger* fLogger; // message logger 00088 MsgLogger& Log() const { return *fLogger; } 00089 00090 TString fClassName; // remove TMVA:: from TObject name 00091 00092 ClassDef(FitterBase,0) // Baseclass for fitters 00093 }; 00094 00095 } // namespace TMVA 00096 00097 #endif