6 /** @defgroup z_eff Efficiency calculations
7 @brief Functions to do efficiency calculations based on a
10 /** Namespace for efficency calculations
12 namespace AliFMDFlowEfficiency
16 /** Calculate @f$ \log(\Gamma(z))\ \forall z>0@f$
18 @return @f$ \log(\Gamma(z))@f$ */
19 Double_t LnGamma(Double_t z);
21 /** Continued fraction evaluation by modified Lentz's method
22 used in calculation of incomplete Beta function.
26 @return incomplete Beta function evaluated at x */
27 Double_t BetaCf(Double_t x, Double_t a, Double_t b);
29 /** Calculates the incomplete Beta function @f$ I_x(a,b)@f$;
30 this is the incomplete Beta function divided by the
31 complete Beta function.
35 @return @f$ I_x(a,b)@f$ */
36 Double_t IBetaI(Double_t a, Double_t b, Double_t x);
38 /** Calculates the fraction of the area under the curve
39 @f$ x^k (1-x)^{n-k}@f$ between @f$ x=a@f$ and @f$ x=b@f$
42 @param k Parameter @f$ k@f$
43 @param n Parameter @f$ n@f$
44 @return The fraction under the curve */
45 Double_t BetaAB(Double_t a, Double_t b, Int_t k, Int_t n);
47 /** Integrates the Binomial distribution with parameters @a k and @a
48 n, and determines the upper edge of the integration region,
49 starting at @a low, which contains probability content @a c. If
50 an upper limit is found, the value is returned. If no solution
51 is found, -1 is returned. Check to see if there is any solution
52 by verifying that the integral up to the maximum upper limit (1)
54 @param low Where to start the integration from.
55 @param k @a k parameter of the Binomial distribution.
56 @param n @a N parameter of the Binomial distribution.
57 @param c Wanted confidence limit (defaults to 68% - similar to
58 @f$ 1\sigma@f$ of a Gaussian distribution)
59 @return the upper limit of the confidence interval, or -1 in
61 Double_t SearchUpper(Double_t low, Int_t k, Int_t n, Double_t c=0.683);
63 /** Integrates the Binomial distribution with parameters @a k and @a
64 n, and determines the lower edge of the integration region,
65 ending at @a high, which contains probability content @a c. If
66 a lower limit is found, the value is returned. If no solution
67 is found, -1 is returned. Check to see if there is any solution
68 by verifying that the integral up to the maximum upper limit (1)
70 @param high Where to end the integration at.
71 @param k @a k parameter of the Binomial distribution.
72 @param n @a N parameter of the Binomial distribution.
73 @param c Wanted confidence limit (defaults to 68% - similar to
74 @f$ 1\sigma@f$ of a Gaussian distribution)
75 @return the upper limit of the confidence interval, or -1 in
77 Double_t SearchLower(Double_t high, Int_t k, Int_t n, Double_t c=0.683);
79 /** Numerical equation solver. This includes root finding and
80 minimum finding algorithms. Adapted from Numerical Recipes in
81 C, 2nd edition. Translated to C++ by Marc Paterno
82 @param ax Left side of interval
83 @param bx Middle of interval
84 @param cx Right side of interval
86 @param xmin On return, the value of @f$ x@f$ such that @f$
88 @param k Parameter of the Binomial distribution
89 @param n Parameter of the Binomial distribution
90 @param c Confidence level.
91 @return Minimum of @f$ f = f(x)@f$. */
92 Double_t Brent(Double_t ax, Double_t bx, Double_t cx, Double_t& xmin,
93 Int_t k, Int_t n, Double_t c=.683, Double_t tol=1e-9);
95 /** Return the length of the interval starting at @a l that contains
96 @a c of the @f$ x^k (1-x)^{n-k}@f$ distribution. If there is no
97 sufficient interval starting at @a l, we return 2.0
99 @param k Binomial parameter k
100 @param n Binomial parameter n
101 @param c Condifience level
102 @return Legnth of interval */
103 Double_t Length(Double_t l, Int_t k, Int_t n, Double_t c=0.683);
106 /** Calculate the shortest central confidence interval containing
107 the required probability content @a c. Interval(low) returns the
108 length of the interval starting at low that contains @a c
109 probability. We use Brent's method, except in two special cases:
110 when @a k=0, or when @a k=n
112 @param k Binomial parameter @a k
113 @param n Binomial parameter @a n
114 @param low On return, the lower limit
115 @param high On return, the upper limit
116 @param c Required confidence level (defaults to 68% - similar
117 to @f$ 1\sigma@f$ of a Gaussian distribution)
119 Double_t Interval(Int_t k, Int_t n, Double_t& low, Double_t& high, Double_t c=0.683);