// @(#)root/mathmore:$Id$
// Authors: B. List 29.4.2010

/**********************************************************************
*                                                                    *
* Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
*                                                                    *
* This library is free software; you can redistribute it and/or      *
* modify it under the terms of the GNU General Public License        *
* as published by the Free Software Foundation; either version 2     *
* of the License, or (at your option) any later version.             *
*                                                                    *
* This library is distributed in the hope that it will be useful,    *
* but WITHOUT ANY WARRANTY; without even the implied warranty of     *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
* General Public License for more details.                           *
*                                                                    *
* You should have received a copy of the GNU General Public License  *
* along with this library (see file COPYING); if not, write          *
* to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
* 330, Boston, MA 02111-1307 USA, or contact the author.             *
*                                                                    *
**********************************************************************/

// Header file for class VavilovAccurateCdf
//
// Created by: blist  at Thu Apr 29 11:19:00 2010
//
// Last update: Thu Apr 29 11:19:00 2010
//
#ifndef ROOT_Math_VavilovAccurateCdf
#define ROOT_Math_VavilovAccurateCdf

#include "Math/IParamFunction.h"
#include "Math/VavilovAccurate.h"

#include <memory>

namespace ROOT {
namespace Math {

//____________________________________________________________________________
/**
Class describing the Vavilov cdf.

The probability density function of the Vavilov distribution
is given by:
\f[ p(\lambda; \kappa, \beta^2) =
\frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda s} ds\f]
where \f$\phi(s) = e^{C} e^{\psi(s)}\f$
with  \f$C = \kappa (1+\beta^2 \gamma )\f$
and \f$\psi(s)&=& s \ln \kappa + (s+\beta^2 \kappa) \cdot \left ( \int \limits_{0}^{1} \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,\der t- \gamma \right ) - \kappa \, e^{\frac{-s}{\kappa}}\f$.
\f$\gamma = 0.5772156649\dots\f$ is Euler's constant.

The parameters are:
- 0: Norm: Normalization constant
- 1: x0:   Location parameter
- 2: xi:   Width parameter
- 3: kappa: Parameter \f$\kappa\f$ of the Vavilov distribution
- 4: beta2: Parameter \f$\beta^2\f$ of the Vavilov distribution

Benno List, June 2010

@ingroup StatFunc
*/

class VavilovAccurateCdf: public IParametricFunctionOneDim {
public:

/**
Default constructor
*/
VavilovAccurateCdf();

/**
Constructor with parameter values
@param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).
*/
VavilovAccurateCdf(const double *p);

/**
Destructor
*/
virtual ~VavilovAccurateCdf ();

/**
Access the parameter values
*/
virtual const double * Parameters() const;

/**
Set the parameter values
@param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).

*/
virtual void SetParameters(const double * p );

/**
Return the number of Parameters
*/
virtual unsigned int NPar() const;

/**
Return the name of the i-th parameter (starting from zero)
Overwrite if want to avoid the default name ("Par_0, Par_1, ...")
*/
virtual std::string ParameterName(unsigned int i) const;

/**
Evaluate the function

@param x The Landau parameter \f$x = \lambda_L\f$

*/
virtual double DoEval(double x) const;

/**
Evaluate the function, using parameters p

@param x The Landau parameter \f$x = \lambda_L\f$
@param p vector of doubles containing the parameter values (Norm, x0, xi, kappa, beta2).
*/
virtual double DoEvalPar(double x, const double * p) const;

/**
Return a clone of the object
*/
virtual IBaseFunctionOneDim  * Clone() const;

private:
double fP[5];

};

} // namespace Math
} // namespace ROOT

#endif /* ROOT_Math_VavilovAccurateCdf */

VavilovAccurateCdf.h:1
VavilovAccurateCdf.h:2
VavilovAccurateCdf.h:3
VavilovAccurateCdf.h:4
VavilovAccurateCdf.h:5
VavilovAccurateCdf.h:6
VavilovAccurateCdf.h:7
VavilovAccurateCdf.h:8
VavilovAccurateCdf.h:9
VavilovAccurateCdf.h:10
VavilovAccurateCdf.h:11
VavilovAccurateCdf.h:12
VavilovAccurateCdf.h:13
VavilovAccurateCdf.h:14
VavilovAccurateCdf.h:15
VavilovAccurateCdf.h:16
VavilovAccurateCdf.h:17
VavilovAccurateCdf.h:18
VavilovAccurateCdf.h:19
VavilovAccurateCdf.h:20
VavilovAccurateCdf.h:21
VavilovAccurateCdf.h:22
VavilovAccurateCdf.h:23
VavilovAccurateCdf.h:24
VavilovAccurateCdf.h:25
VavilovAccurateCdf.h:26
VavilovAccurateCdf.h:27
VavilovAccurateCdf.h:28
VavilovAccurateCdf.h:29
VavilovAccurateCdf.h:30
VavilovAccurateCdf.h:31
VavilovAccurateCdf.h:32
VavilovAccurateCdf.h:33
VavilovAccurateCdf.h:34
VavilovAccurateCdf.h:35
VavilovAccurateCdf.h:36
VavilovAccurateCdf.h:37
VavilovAccurateCdf.h:38
VavilovAccurateCdf.h:39
VavilovAccurateCdf.h:40
VavilovAccurateCdf.h:41
VavilovAccurateCdf.h:42
VavilovAccurateCdf.h:43
VavilovAccurateCdf.h:44
VavilovAccurateCdf.h:45
VavilovAccurateCdf.h:46
VavilovAccurateCdf.h:47
VavilovAccurateCdf.h:48
VavilovAccurateCdf.h:49
VavilovAccurateCdf.h:50
VavilovAccurateCdf.h:51
VavilovAccurateCdf.h:52
VavilovAccurateCdf.h:53
VavilovAccurateCdf.h:54
VavilovAccurateCdf.h:55
VavilovAccurateCdf.h:56
VavilovAccurateCdf.h:57
VavilovAccurateCdf.h:58
VavilovAccurateCdf.h:59
VavilovAccurateCdf.h:60
VavilovAccurateCdf.h:61
VavilovAccurateCdf.h:62
VavilovAccurateCdf.h:63
VavilovAccurateCdf.h:64
VavilovAccurateCdf.h:65
VavilovAccurateCdf.h:66
VavilovAccurateCdf.h:67
VavilovAccurateCdf.h:68
VavilovAccurateCdf.h:69
VavilovAccurateCdf.h:70
VavilovAccurateCdf.h:71
VavilovAccurateCdf.h:72
VavilovAccurateCdf.h:73
VavilovAccurateCdf.h:74
VavilovAccurateCdf.h:75
VavilovAccurateCdf.h:76
VavilovAccurateCdf.h:77
VavilovAccurateCdf.h:78
VavilovAccurateCdf.h:79
VavilovAccurateCdf.h:80
VavilovAccurateCdf.h:81
VavilovAccurateCdf.h:82
VavilovAccurateCdf.h:83
VavilovAccurateCdf.h:84
VavilovAccurateCdf.h:85
VavilovAccurateCdf.h:86
VavilovAccurateCdf.h:87
VavilovAccurateCdf.h:88
VavilovAccurateCdf.h:89
VavilovAccurateCdf.h:90
VavilovAccurateCdf.h:91
VavilovAccurateCdf.h:92
VavilovAccurateCdf.h:93
VavilovAccurateCdf.h:94
VavilovAccurateCdf.h:95
VavilovAccurateCdf.h:96
VavilovAccurateCdf.h:97
VavilovAccurateCdf.h:98
VavilovAccurateCdf.h:99
VavilovAccurateCdf.h:100
VavilovAccurateCdf.h:101
VavilovAccurateCdf.h:102
VavilovAccurateCdf.h:103
VavilovAccurateCdf.h:104
VavilovAccurateCdf.h:105
VavilovAccurateCdf.h:106
VavilovAccurateCdf.h:107
VavilovAccurateCdf.h:108
VavilovAccurateCdf.h:109
VavilovAccurateCdf.h:110
VavilovAccurateCdf.h:111
VavilovAccurateCdf.h:112
VavilovAccurateCdf.h:113
VavilovAccurateCdf.h:114
VavilovAccurateCdf.h:115
VavilovAccurateCdf.h:116
VavilovAccurateCdf.h:117
VavilovAccurateCdf.h:118
VavilovAccurateCdf.h:119
VavilovAccurateCdf.h:120
VavilovAccurateCdf.h:121
VavilovAccurateCdf.h:122
VavilovAccurateCdf.h:123
VavilovAccurateCdf.h:124
VavilovAccurateCdf.h:125
VavilovAccurateCdf.h:126
VavilovAccurateCdf.h:127
VavilovAccurateCdf.h:128
VavilovAccurateCdf.h:129
VavilovAccurateCdf.h:130
VavilovAccurateCdf.h:131
VavilovAccurateCdf.h:132
VavilovAccurateCdf.h:133
VavilovAccurateCdf.h:134
VavilovAccurateCdf.h:135
VavilovAccurateCdf.h:136
VavilovAccurateCdf.h:137
VavilovAccurateCdf.h:138
VavilovAccurateCdf.h:139
VavilovAccurateCdf.h:140
VavilovAccurateCdf.h:141
VavilovAccurateCdf.h:142
VavilovAccurateCdf.h:143
VavilovAccurateCdf.h:144
VavilovAccurateCdf.h:145