]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/flow/AliFMDFlowBessel.h
Misalignment-related bug fixed
[u/mrichter/AliRoot.git] / FMD / flow / AliFMDFlowBessel.h
1 // -*- mode: C++ -*-
2 /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 2.1 of
7  * the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA
18  */
19 /** @file 
20     @brief Declaration of Bessel functions */
21 #ifndef ALIFMDFLOWBESSEL_H
22 #define ALIFMDFLOWBESSEL_H
23 #include <cctype>
24 #include <Rtypes.h>
25
26 /** @defgroup z_bessel Bessel utility functions.  
27     @brief This group contains a number of functions to calculate
28     the modified Bessel function of the first kind @f$
29     I_{\nu}(x)@f$ for integer and half-integer values of @f$
30     \nu@f$, of any real number @f$ x@f$.
31     
32     The main entry of these functions is the function Inu, which
33     in turn call I01, Iwhole, or Ihalf.  Inu always returns a list
34     of the function values for the specified values of @f$ \nu@f$.
35     
36     The convinience functions I and DiffI returns a single value
37     of @f$ I_{\nu}(x)@f$ or @f$ dI_{\nu}(x)/dx@f$ for a specified
38     value of @f$ \nu@f$. 
39     
40     @example test_bessel.cxx */
41
42 /** Namespace for Bessel functions 
43     @ingroup z_bessel */
44 namespace AliFMDFlowBessel
45 {
46   /** @{ 
47       @ingroup z_bessel */
48   /** Compute the modified Bessel functions 
49       @f[
50       I_0(x) = \sum_{k=1}^\infty\frac{\left(\frac{x^2}{4}\right)^k}{(k!)^2}
51       @f]
52       and @f$ I_1(x)@f$, and their first derivatives  
53       @param x   Argument @f$ x@f$ 
54       @param bi0 On return, @f$ I_0(x)@f$ 
55       @param di0 On return, @f$ I_0'(x)@f$ 
56       @param bi1 On return, @f$ I_1(x)@f$ 
57       @param di1 On return, @f$ I_1'(x)@f$ 
58   */
59   void I01(Double_t x, 
60            Double_t& bi0, Double_t& di0, Double_t& bi1, Double_t& di1);
61   
62   /** Compute the modified Bessel functions @f$ I_{n/2}(x)@f$ and their
63       derivatives.  
64       @param x  Argument. 
65       @param n  Order
66       @param bi On output, @f$ I_{1/2}(x), \ldots, I_{n/2}(x)@f$ for
67       @f$ n > 0@f$ and @f$ I_{-n/2}(x), \ldots, I_{-1/2}(x)@f$ for
68       @f$ n < 0@f$ 
69       @param di On output, @f$ I_{1/2}'(x), \ldots, I_{n/2}'(x)@f$ for
70       @f$ n > 0@f$ and @f$ I_{-n/2}'(x), \ldots, I_{-1/2}'(x)@f$ for
71       @f$ n < 0@f$ 
72       @return number of valid entries in @a bi and @a di */
73   UInt_t Ihalf(Int_t n, Double_t x, Double_t* bi, Double_t* di);
74   /** Compute the modified Bessel functions @f$ I_n(x)@f$ and their
75       derivatives.  Note, that @f$ I_{-n}(x) = I_n(x)@f$ and 
76       @f$ dI_{-n}(x)/dx = dI_{n}(x)/dx@f$ so this function can be used
77       to evaluate @f$ I_n \forall n \in \mathcal{Z}@f$ 
78       @param x  Argument. 
79       @param n  Order
80       @param bi On output, @f$ I_0(x), \ldots, I_{mn}(x)@f$ 
81       @param di On output, @f$ I_0'(x), \ldots, I_{mn}'(x)@f$ 
82       @return number of valid entries in @a bi and @a di */
83   UInt_t Iwhole(UInt_t n, Double_t x, Double_t* bi, Double_t* di);
84
85   /** Compute the modified Bessel functions @f$ I_{\nu}(x)@f$ and
86       their derivatives for @f$ \nu = n_1, n_1+1, \ldots, n_2@f$ for
87       and integer @f$ n_1, n_2@f$ or any half-integer @f$ n_1,
88       n_2@f$. 
89       @param x  Argument. 
90       @param n1 Lower order
91       @param n2 Upper order
92       @param bi On output, @f$ I_{n_1}(x), \ldots, I_{n_2}(x)@f$ 
93       @param di On output, @f$ I_{n_1}'(x), \ldots, I_{n_2}'(x)@f$ 
94       @return number of valid entries in @a bi and @a di */
95   UInt_t Inu(Double_t n1, Double_t n2, Double_t x, Double_t* bi, Double_t* di);
96
97   /** Compute the modified Bessel function of the first kind 
98       @f[
99       I_n(x) = \left(\frac{x}{2}\right)^n
100       \sum_{k=0}^\infty\frac{\left(\frac{x^2}{4}\right)^k}
101       {k!\Gamma(n+k+1)}
102       @f]
103       for arbirary integer order @f$ n@f$ 
104       @param n  Order
105       @param x  Argument 
106       @return @f$ I_n(x)@f$ */ 
107   Double_t I(Double_t n, Double_t x);
108       
109   /** Compute the derivative of the modified Bessel function of the
110       first kind 
111       @f[ 
112       \frac{dI_n(x)}{dx} = I_{n-1}(x) - \frac{n}{x} I_{n}(x)
113       @f]
114       for arbirary integer order @f$ n@f$
115       @param n Order 
116       @param x Argument 
117       @return @f$ \frac{dI_n(x)}{dx}@f$ */ 
118   Double_t DiffI(Double_t n, Double_t x);
119   /** @} */
120 }
121
122 #endif
123 //
124 // EOF
125 //
126
127