00001 // @(#)root/mathmore:$Id: VavilovAccurateCdf.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 VavilovAccurateCdf 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_VavilovAccurateCdf 00032 #define ROOT_Math_VavilovAccurateCdf 00033 00034 00035 #include "Math/IParamFunction.h" 00036 #include "Math/VavilovAccurate.h" 00037 00038 #include <memory> 00039 00040 namespace ROOT { 00041 namespace Math { 00042 00043 //____________________________________________________________________________ 00044 /** 00045 Class describing the Vavilov cdf. 00046 00047 The probability density function of the Vavilov distribution 00048 is given by: 00049 \f[ p(\lambda; \kappa, \beta^2) = 00050 \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda s} ds\f] 00051 where \f$\phi(s) = e^{C} e^{\psi(s)}\f$ 00052 with \f$ C = \kappa (1+\beta^2 \gamma )\f$ 00053 and \f$\psi(s)&=& s \ln \kappa + (s+\beta^2 \kappa) 00054 \cdot \left ( \int \limits_{0}^{1} 00055 \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,\der t- \gamma \right ) 00056 - \kappa \, e^{\frac{-s}{\kappa}}\f$. 00057 \f$ \gamma = 0.5772156649\dots\f$ is Euler's constant. 00058 00059 The parameters are: 00060 - 0: Norm: Normalization constant 00061 - 1: x0: Location parameter 00062 - 2: xi: Width parameter 00063 - 3: kappa: Parameter \f$\kappa\f$ of the Vavilov distribution 00064 - 4: beta2: Parameter \f$\beta^2\f$ of the Vavilov distribution 00065 00066 Benno List, June 2010 00067 00068 00069 @ingroup StatFunc 00070 */ 00071 00072 00073 class VavilovAccurateCdf: public IParametricFunctionOneDim { 00074 public: 00075 00076 /** 00077 Default constructor 00078 */ 00079 VavilovAccurateCdf(); 00080 00081 /** 00082 Constructor with parameter values 00083 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00084 */ 00085 VavilovAccurateCdf(const double *p); 00086 00087 /** 00088 Destructor 00089 */ 00090 virtual ~VavilovAccurateCdf (); 00091 00092 /** 00093 Access the parameter values 00094 */ 00095 virtual const double * Parameters() const; 00096 00097 /** 00098 Set the parameter values 00099 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00100 00101 */ 00102 virtual void SetParameters(const double * p ); 00103 00104 /** 00105 Return the number of Parameters 00106 */ 00107 virtual unsigned int NPar() const; 00108 00109 /** 00110 Return the name of the i-th parameter (starting from zero) 00111 Overwrite if want to avoid the default name ("Par_0, Par_1, ...") 00112 */ 00113 virtual std::string ParameterName(unsigned int i) const; 00114 00115 /** 00116 Evaluate the function 00117 00118 @param x The Landau parameter \f$x = \lambda_L\f$ 00119 00120 */ 00121 virtual double DoEval(double x) const; 00122 00123 /** 00124 Evaluate the function, using parameters p 00125 00126 @param x The Landau parameter \f$x = \lambda_L\f$ 00127 @param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2). 00128 */ 00129 virtual double DoEvalPar(double x, const double * p) const; 00130 00131 /** 00132 Return a clone of the object 00133 */ 00134 virtual IBaseFunctionOneDim * Clone() const; 00135 00136 private: 00137 double fP[5]; 00138 00139 }; 00140 00141 00142 } // namespace Math 00143 } // namespace ROOT 00144 00145 #endif /* ROOT_Math_VavilovAccurateCdf */