// $Id$ //----------------------------------------------------------------------- // The GSI Online Offline Object Oriented (Go4) Project // Experiment Data Processing at EE department, GSI //----------------------------------------------------------------------- // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH // Planckstr. 1, 64291 Darmstadt, Germany // Contact: http://go4.gsi.de //----------------------------------------------------------------------- // This software can be used under the license agreements as stated // in Go4License.txt file which is part of the distribution. //----------------------------------------------------------------------- #ifndef TGO4FITMODELPOLYNOM_H #define TGO4FITMODELPOLYNOM_H #include "TGo4FitModel.h" class TArrayD; /** * @brief Model objects, which reproduce component of polynomial function. * * @details Expression can be written like: * ~~~ * Ampl * x^nx * y^ny * z^nz * ... * ~~~ * * The order of polynomial function should be sets up in constructor like: * ~~~{cpp} * TGo4FitModelPolynom *p1 = new TGo4FitModelPolynom("Pol1",orderx,ordery,orderz); * ~~~ * or * ~~~{cpp} * TArrayD orders(5); * Orders[0] = 1.; Orders[1] = 0.; ... * TGo4FitModelPolynom *p2 = new TGo4FitModelPolynom("Pol2",Orders); * ~~~ * * According to number of parameters in constructor TGo4FitModelPolynom has set of parameters "Order0", "Order1" and so on, representing polynom orders for axis x, y and so on correspondingly. * By default, these parameters are fixed and not fitted in optimizations. To change this default behavior, use: * ~~~{cpp} * p1->FindPar("Order0")->SetFixed(kFALSE); * ~~~ * * TGo4FitModelPolynom class always has amplitude parameter, named "Ampl". It can be accessed by its name, for instance: * ~~~{cpp} * p1->FindPar("Ampl")->SetValue(1000.); * ~~~ * or * ~~~{cpp} * p1->GetAmplitudePar("Ampl")->SetValue(1000.); * ~~~ * * GetAmplitudePar() method can be used in other models classes only if they create amplitude parameters, otherwise method returns 0. * * @ingroup go4_fit */ class TGo4FitModelPolynom : public TGo4FitModel { public: /** * Default constructor. */ TGo4FitModelPolynom(); /** * Creates TGo4FitModelPolynom object with given name for 1-dim case. * The order of polynom for x axis can be specified (0 by default). */ TGo4FitModelPolynom(const char *iName, Double_t iOrderX = 0.); /** * Creates TGo4FitModelPolynom object with given name for 2-dim case. * The order of polynom for x and y axes should be specified. */ TGo4FitModelPolynom(const char *iName, Double_t iOrderX, Double_t iOrderY); /** * Creates TGo4FitModelPolynom object with given name for 3-dim case. * The order of polynom for x, y and z axes should be specified. */ TGo4FitModelPolynom(const char *iName, Double_t iOrderX, Double_t iOrderY, Double_t iOrderZ); /** * Creates TGo4FitModelPolynom object with given name for n-dim case. * An array of polynoms orders for appropriate axis should be specified. * The size of array will be a dimensions size of polynom. But the n-dim polynom can be used for m-dim case. * If n > m, orders for missing axis will be set 0. If n