00001 // @(#)root/mathmore:$Id: VavilovAccuratePdf.h 34195 2010-06-30 04:33:36Z brun $ 00002 // Authors: B. List 29.4.2010 00003 00004 /********************************************************************** 00005 * * 00006 * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT * 00007 * * 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU General Public License * 00010 * as published by the Free Software Foundation; either version 2 * 00011 * of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this library (see file COPYING); if not, write * 00020 * to the Free Software Foundation, Inc., 59 Temple Place, Suite * 00021 * 330, Boston, MA 02111-1307 USA, or contact the author. * 00022 * * 00023 **********************************************************************/ 00024 00025 // Header file for class VavilovAccuratePdf 00026 // 00027 // Created by: blist at Thu Apr 29 11:19:00 2010 00028 // 00029 // Last update: Thu Apr 29 11:19:00 2010 00030 // 00031 #ifndef ROOT_Math_VavilovAccuratePdf 00032 #define ROOT_Math_VavilovAccuratePdf 00033 00034 00035 #include "Math/IParamFunction.h" 00036 #include "Math/VavilovAccurate.h" 00037 00038 namespace ROOT { 00039 namespace Math { 00040 00041 //____________________________________________________________________________ 00042 /** 00043 Class describing the Vavilov pdf. 00044 00045 The probability density function of the Vavilov distribution 00046 is given by: 00047 \f[ p(\lambda; \kappa, \beta^2) = 00048 \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda s} ds\f] 00049 where \f$\phi(s) = e^{C} e^{\psi(s)}\f$ 00050 with \f$ C = \kappa (1+\beta^2 \gamma )\f$ 00051 and \f$\psi(s)&=& s \ln \kappa + (s+\beta^2 \kappa) 00052 \cdot \left ( \int \limits_{0}^{1} 00053 \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,\der t- \gamma \right ) 00054 - \kappa \, e^{\frac{-s}{\kappa}}\f$. 00055 \f$ \gamma = 0.5772156649\dots\f$ is Euler's constant. 00056 00057 The parameters are: 00058 - 0: Norm: Normalization constant 00059 - 1: x0: Location parameter 00060 - 2: xi: Width parameter 00061 - 3: kappa: Parameter \f$\kappa\f$ of the Vavilov distribution 00062 - 4: beta2: Parameter \f$\beta^2\f$ of the Vavilov distribution 00063 00064 Benno List, June 2010 00065 00066 @ingroup StatFunc 00067 */ 00068 00069 00070 class VavilovAccuratePdf: public IParametricFunctionOneDim { 00071 public: 00072 00073 /** 00074 Default constructor 00075 */ 00076 VavilovAccuratePdf(); 00077 00078 /** 00079 Constructor with parameter values 00080 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00081 */ 00082 VavilovAccuratePdf (const double *p); 00083 00084 /** 00085 Destructor 00086 */ 00087 virtual ~VavilovAccuratePdf (); 00088 00089 /** 00090 Access the parameter values 00091 */ 00092 virtual const double * Parameters() const; 00093 00094 /** 00095 Set the parameter values 00096 00097 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00098 00099 */ 00100 virtual void SetParameters(const double * p ); 00101 00102 /** 00103 Return the number of Parameters 00104 */ 00105 virtual unsigned int NPar() const; 00106 00107 /** 00108 Return the name of the i-th parameter (starting from zero) 00109 */ 00110 virtual std::string ParameterName(unsigned int i) const; 00111 00112 /** 00113 Evaluate the function 00114 00115 @param x The Landau parameter \f$x = \lambda_L\f$ 00116 */ 00117 virtual double DoEval(double x) const; 00118 00119 /** 00120 Evaluate the function, using parameters p 00121 00122 @param x The Landau parameter \f$x = \lambda_L\f$ 00123 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00124 */ 00125 virtual double DoEvalPar(double x, const double * p) const; 00126 00127 /** 00128 Return a clone of the object 00129 */ 00130 virtual IBaseFunctionOneDim * Clone() const; 00131 00132 private: 00133 double fP[5]; 00134 00135 }; 00136 00137 00138 } // namespace Math 00139 } // namespace ROOT 00140 00141 #endif /* ROOT_Math_VavilovAccuratePdf */