]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/flow/AliFMDFlowBessel.h
Added code to do flow analysis.
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBessel.h
1 // -*- mode: C++ -*-
2 /** @file 
3     @brief Declaration of Bessel functions */
4 #ifndef Bessel_h
5 #define Bessel_h
6 #include <cctype>
7 #include <Rtypes.h>
8
9 /** @defgroup z_bessel Bessel utility functions.  
10     @brief This group contains a number of functions to calculate
11     the modified Bessel function of the first kind @f$
12     I_{\nu}(x)@f$ for integer and half-integer values of @f$
13     \nu@f$, of any real number @f$ x@f$.
14     
15     The main entry of these functions is the function Inu, which
16     in turn call I01, Iwhole, or Ihalf.  Inu always returns a list
17     of the function values for the specified values of @f$ \nu@f$.
18     
19     The convinience functions I and DiffI returns a single value
20     of @f$ I_{\nu}(x)@f$ or @f$ dI_{\nu}(x)/dx@f$ for a specified
21     value of @f$ \nu@f$. 
22     
23     @example test_bessel.cxx */
24
25 /** Namespace for Bessel functions 
26     @ingroup z_bessel */
27 namespace AliFMDFlowBessel
28 {
29   /** @{ 
30       @ingroup z_bessel */
31   /** Compute the modified Bessel functions 
32       @f[
33       I_0(x) = \sum_{k=1}^\infty\frac{\left(\frac{x^2}{4}\right)^k}{(k!)^2}
34       @f]
35       and @f$ I_1(x)@f$, and their first derivatives  
36       @param x   Argument @f$ x@f$ 
37       @param bi0 On return, @f$ I_0(x)@f$ 
38       @param di0 On return, @f$ I_0'(x)@f$ 
39       @param bi1 On return, @f$ I_1(x)@f$ 
40       @param di1 On return, @f$ I_1'(x)@f$ 
41   */
42   void I01(Double_t x, 
43            Double_t& bi0, Double_t& di0, Double_t& bi1, Double_t& di1);
44   
45   /** Compute the modified Bessel functions @f$ I_{n/2}(x)@f$ and their
46       derivatives.  
47       @param x  Argument. 
48       @param n  Order
49       @param bi On output, @f$ I_{1/2}(x), \ldots, I_{n/2}(x)@f$ for
50       @f$ n > 0@f$ and @f$ I_{-n/2}(x), \ldots, I_{-1/2}(x)@f$ for
51       @f$ n < 0@f$ 
52       @param di On output, @f$ I_{1/2}'(x), \ldots, I_{n/2}'(x)@f$ for
53       @f$ n > 0@f$ and @f$ I_{-n/2}'(x), \ldots, I_{-1/2}'(x)@f$ for
54       @f$ n < 0@f$ 
55       @return number of valid entries in @a bi and @a di */
56   UInt_t Ihalf(Int_t n, Double_t x, Double_t* bi, Double_t* di);
57   /** Compute the modified Bessel functions @f$ I_n(x)@f$ and their
58       derivatives.  Note, that @f$ I_{-n}(x) = I_n(x)@f$ and 
59       @f$ dI_{-n}(x)/dx = dI_{n}(x)/dx@f$ so this function can be used
60       to evaluate @f$ I_n \forall n \in \mathcal{Z}@f$ 
61       @param x  Argument. 
62       @param n  Order
63       @param bi On output, @f$ I_0(x), \ldots, I_{mn}(x)@f$ 
64       @param di On output, @f$ I_0'(x), \ldots, I_{mn}'(x)@f$ 
65       @return number of valid entries in @a bi and @a di */
66   UInt_t Iwhole(UInt_t n, Double_t x, Double_t* bi, Double_t* di);
67
68   /** Compute the modified Bessel functions @f$ I_{\nu}(x)@f$ and
69       their derivatives for @f$ \nu = n_1, n_1+1, \ldots, n_2@f$ for
70       and integer @f$ n_1, n_2@f$ or any half-integer @f$ n_1,
71       n_2@f$. 
72       @param x  Argument. 
73       @param n1 Lower order
74       @param n2 Upper order
75       @param bi On output, @f$ I_{n_1}(x), \ldots, I_{n_2}(x)@f$ 
76       @param di On output, @f$ I_{n_1}'(x), \ldots, I_{n_2}'(x)@f$ 
77       @return number of valid entries in @a bi and @a di */
78   UInt_t Inu(Double_t n1, Double_t n2, Double_t x, Double_t* bi, Double_t* di);
79
80   /** Compute the modified Bessel function of the first kind 
81       @f[
82       I_n(x) = \left(\frac{x}{2}\right)^n
83       \sum_{k=0}^\infty\frac{\left(\frac{x^2}{4}\right)^k}
84       {k!\Gamma(n+k+1)}
85       @f]
86       for arbirary integer order @f$ n@f$ 
87       @param n  Order
88       @param x  Argument 
89       @return @f$ I_n(x)@f$ */ 
90   Double_t I(Double_t n, Double_t x);
91       
92   /** Compute the derivative of the modified Bessel function of the
93       first kind 
94       @f[ 
95       \frac{dI_n(x)}{dx} = I_{n-1}(x) - \frac{n}{x} I_{n}(x)
96       @f]
97       for arbirary integer order @f$ n@f$
98       @param n Order 
99       @param x Argument 
100       @return @f$ \frac{dI_n(x)}{dx}@f$ */ 
101   Double_t DiffI(Double_t n, Double_t x);
102   /** @} */
103 }
104
105 #endif
106 //
107 // EOF
108 //
109
110