BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
TDFun.h
Go to the documentation of this file.
1#ifndef RAD_TDFun
2#define RAD_TDFun
3
4#include <cmath>
5#include "TRadSpline.h"
6
7class TDFun{
8protected:
9 double fxmin;
10 double fxmax;
11 double fD0;
12 double fb2;
14public:
16 TDFun(const double&, const double&);
18 void Init();
19 void Init(const double&, const double&);
20
21 inline double EvalSpline(const double &z){return fd->Eval(z);}
22
23 inline double Eval(const double &z){
24 double x = 1 - z;
25 // double D = fb2*pow(x,fb2-1)*fD0 - 0.5*fb2*(1+z) -
26 // fb2*fb2/8*(4*(1+z)*log(x)+(1+3*z*z)/x*log(z)+5+z);
27 double D = fb2*pow(x,fb2-1)*fD0 - 0.5*fb2*(1+z) -
28 fb2*fb2/8*(4*(1+z)*log(x)+(1+3*z*z)/x*log1p(-x)+5+z);
29 return D;
30 }
31
32 inline double Eval(const double &z, const double &b2, const double &D0){
33 double x = 1 - z;
34 // double D = b2*pow(x,b2-1)*D0 - 0.5*b2*(1+z) -
35 // b2*b2/8*(4*(1+z)*log(x)+(1+3*z*z)/x*log(z)+5+z);
36 double D = b2*pow(x,b2-1)*D0 - 0.5*b2*(1+z) -
37 b2*b2/8*(4*(1+z)*log(x)+(1+3*z*z)/x*log1p(-x)+5+z);
38 return D;
39 }
40
41 inline double EvalSoft(const double &x){
42 double z = 1 - x;
43 double lx = log(x);
44 double t1 = exp(-fb2*lx);
45 double t2 = t1*x;
46 // double D = fD0 - t2*(0.5*(1+z) + fb2/8*( 4*(1+z)*lx + 4 + (1+z))) -
47 // fb2/8*t1*(1+3*z*z)*log(z);
48 double D = fD0 - t2*(0.5*(1+z) + fb2/8*( 4*(1+z)*lx + 4 + (1+z))) -
49 fb2/8*t1*(1+3*z*z)*log1p(-x);
50 return D;
51 }
52
53 inline double EvalSoft(const double &x, const double &b2, const double &D0){
54 double z = 1 - x;
55 double lx = log(x);
56 double t1 = exp(-b2*lx);
57 double t2 = t1*x;
58 // double D = D0 - t2*(0.5*(1+z) + b2/8*( 4*(1+z)*lx + 4 + (1+z))) -
59 // b2/8*t1*(1+3*z*z)*log(z);
60 double D = D0 - t2*(0.5*(1+z) + b2/8*( 4*(1+z)*lx + 4 + (1+z))) -
61 b2/8*t1*(1+3*z*z)*log1p(-x);
62 return D;
63 }
64
65};
66
67#endif //#ifndef RAD_TDFun
Double_t x[10]
EvtComplex exp(const EvtComplex &c)
Definition TDFun.h:7
double Eval(const double &z, const double &b2, const double &D0)
Definition TDFun.h:32
TRadSpline3 * fd
Definition TDFun.h:13
double EvalSoft(const double &x)
Definition TDFun.h:41
double EvalSoft(const double &x, const double &b2, const double &D0)
Definition TDFun.h:53
TDFun(const double &, const double &)
double EvalSpline(const double &z)
Definition TDFun.h:21
double fxmax
Definition TDFun.h:10
double fxmin
Definition TDFun.h:9
double fb2
Definition TDFun.h:12
double fD0
Definition TDFun.h:11
void Init(const double &, const double &)
void Init()
double Eval(const double &z)
Definition TDFun.h:23
double Eval(double x) const