KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVLightEnergyCsI_Tabacaru_Camp2_10_17.cpp
1#include "KVLightEnergyCsI_Tabacaru_Camp2_10_17.h"
2
4
5
6
7
13
14Double_t KVLightEnergyCsI_Tabacaru_Camp2_10_17::tabacaru(double* L, double* par)
15{
16 // The original inverted function (i.e. gives energy for a given value of light) from the INDRA
17 // 2nd campaign FORTRAN (csi10_17_2_E.f), because the inversion of CalculLumiere by TF1
18 // does not give the same results - I suspect that in fact the formula used was not the same.
19 // L=Lumiere
20 // par = a1, a2, a3, a4
21
22 double hl = L[0];
23 double a1t = par[0];
24 double a2t = par[1];
25 double a3t = par[2];
26 double a4t = par[3];
27
28 double x;
29 if (a2t < 1.e-7)
30 x = (hl) / a1t;
31 else
32 x = 2000.;
33
34 double az2 = A * Z * Z;
35 double argx = 1. + x / (a2t * az2);
36 double cond = true;
37
38 double niter = 0;
39 double eps = 1.e-4;
40 double fbe = 1.0;
41
42 double E0 = a3t * A;
43
44 while (cond) {
45 niter = niter + 1;
46
47 double a4e = a4t;
48 if (x < E0) a4e = 0;
49
50 double fx = -hl + fbe * a1t * (x - a2t * az2 * log(argx) + a2t * a4e * az2 * log((x + a2t * az2) / (E0 + a2t * az2)));
51 double fpx = fbe * a1t * (x + a2t * az2 * a4e) / (x + a2t * az2);
52
53 double dx = - fx / fpx;
54 x += dx;
55 argx = 1. + x / (a2t * az2);
56 cond = (abs(dx / x) >= eps) && (argx > 0.) && (niter <= 50);
57 }
58
59 if (argx <= 0 || niter > 50) {
60 return 0;
61 }
62 return fbe * x;
63}
64
65
double Double_t
Copy of light-energy used for iNDRA 2nd campaign rings 10-17.
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< PromoteType< T > > log(const RVec< T > &v)
Double_t x[n]
RooArgList L(Args_t &&... args)
ClassImp(TPyArg)