1 #ifndef __JMATHSUPPORTKIT__
2 #define __JMATHSUPPORTKIT__
19 namespace JPP {
using namespace JMATH; }
33 inline double gauss(
const double x,
const double sigma)
35 const double u = x / sigma;
52 inline double gauss(
const double x,
const double x0,
const double sigma)
54 return gauss(x - x0, sigma);
65 inline double Gauss(
const double x,
const double sigma)
67 return gauss(x, sigma) / sqrt(2.0*
PI) / sigma;
79 inline double Gauss(
const double x,
const double x0,
const double sigma)
81 return Gauss(x - x0, sigma);
92 inline double Gamma(
const double a,
const double x)
101 const double gln = lgamma(a);
113 for (
int i = 1; i != max; ++i) {
119 if (fabs(del) < fabs(sum)*numeric_limits<double>::epsilon()) {
120 return sum*
exp(-x + a*log(x) - gln);
126 double b = x + 1.0 -
a;
127 double c = numeric_limits<double>::epsilon() / numeric_limits<double>::min();
131 for (
int i = 1; i != max; ++i) {
133 const double an = -i * (i-
a);
138 if (fabs(d) < numeric_limits<double>::min()) {
139 d = numeric_limits<double>::min();
144 if (fabs(c) < numeric_limits<double>::min()) {
145 c = numeric_limits<double>::min();
150 const double del = d*c;
154 if (fabs(del - 1.0) < numeric_limits<double>::epsilon()) {
155 return 1.0 -
exp(-x + a*log(x) - gln) * h;
189 for (
unsigned int i = 2; i <=
n; ++i) {
192 p2 = ((2*i-1) * x*p1 - (i-1) * p0) / i;
210 if (k == 0 || n == k) {
214 if (n <= 0 || k < 0 || n < k) {
218 const int k1 = std::min(k, n - k);
219 const int k2 = n - k1;
221 double value = k2 + 1;
223 for (
int i = k1; i != 1; --i) {
224 value *= (double) (k2 + i) / (double) i;
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
double binomial(const int n, const int k)
Binomial function.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
double Gamma(const double a, const double x)
Incomplete gamma function.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
static const double PI
Mathematical constants.
double legendre(const unsigned int n, const double x)
Legendre polynome.
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
double gauss(const double x, const double sigma)
Gauss function (normalised to 1 at x = 0).
double Gauss(const double x, const double sigma)
Normalised Gauss function.
Exception for accessing a value in a collection that is outside of its range.