Logo ROOT  
Reference Guide
MDF.C
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 //
3 // File MDF.C generated by TMultiDimFit::MakeRealCode
4 // on Tue Jan 26 08:41:45 2021
5 // ROOT version 6.23/01
6 //
7 // This file contains the function
8 //
9 // double MDF(double *x);
10 //
11 // For evaluating the parameterization obtained
12 // from TMultiDimFit and the point x
13 //
14 // See TMultiDimFit class documentation for more information
15 //
16 //
17 // Static data variables
18 //
19 static int gNVariables = 4;
20 static int gNCoefficients = 21;
21 static double gDMean = 48.4044;
22 // Assignment to mean vector.
23 static double gXMean[] = {
24  0.00657672, 0.0083759, -0.00385446, 0.000527764 };
25 
26 // Assignment to minimum vector.
27 static double gXMin[] = {
28  0.0454982, 0.0152285, 0.0410935, 0.00381892 };
29 
30 // Assignment to maximum vector.
31 static double gXMax[] = {
32  9.95437, 9.98965, 9.99761, 9.99454 };
33 
34 // Assignment to coefficients vector.
35 static double gCoefficient[] = {
36  -4.39851,
37  43.1493,
38  13.4121,
39  13.4869,
40  13.3954,
41  13.228,
42  13.3441,
43  13.2943,
44  4.52254,
45  4.65912,
46  4.94808,
47  -4.02586,
48  -4.04534,
49  -3.93856,
50  4.42141,
51  -4.00581,
52  4.62595,
53  4.37782,
54  3.51629,
55  -4.11068,
56  -3.82302
57  };
58 
59 // Assignment to error coefficients vector.
60 static double gCoefficientRMS[] = {
61  0.044426,
62  0.0856451,
63  0.0378565,
64  0.0380951,
65  0.0374054,
66  0.0657916,
67  0.0675855,
68  0.066641,
69  0.0739945,
70  0.0721745,
71  0.0814935,
72  0.065378,
73  0.0655396,
74  0.0651725,
75  0.130526,
76  0.117191,
77  0.130233,
78  0.128579,
79  0.113771,
80  0.117446,
81  0.116486
82  };
83 
84 // Assignment to powers vector.
85 // The powers are stored row-wise, that is
86 // p_ij = gPower[i * NVariables + j];
87 static int gPower[] = {
88  1, 1, 1, 1,
89  2, 1, 1, 1,
90  1, 1, 1, 2,
91  1, 1, 2, 1,
92  1, 2, 1, 1,
93  2, 2, 1, 1,
94  2, 1, 1, 2,
95  2, 1, 2, 1,
96  1, 1, 1, 3,
97  1, 3, 1, 1,
98  1, 1, 5, 1,
99  1, 1, 2, 2,
100  1, 2, 1, 2,
101  1, 2, 2, 1,
102  2, 1, 1, 3,
103  2, 2, 1, 2,
104  2, 1, 3, 1,
105  2, 3, 1, 1,
106  1, 2, 2, 2,
107  2, 1, 2, 2,
108  2, 2, 2, 1
109 };
110 
111 //
112 // The function double MDF(double *x)
113 //
114 double MDF(double *x) {
115  double returnValue = gDMean;
116  int i = 0, j = 0, k = 0;
117  for (i = 0; i < gNCoefficients ; i++) {
118  // Evaluate the ith term in the expansion
119  double term = gCoefficient[i];
120  for (j = 0; j < gNVariables; j++) {
121  // Evaluate the polynomial in the jth variable.
122  int power = gPower[gNVariables * i + j];
123  double p1 = 1, p2 = 0, p3 = 0, r = 0;
124  double v = 1 + 2. / (gXMax[j] - gXMin[j]) * (x[j] - gXMax[j]);
125  // what is the power to use!
126  switch(power) {
127  case 1: r = 1; break;
128  case 2: r = v; break;
129  default:
130  p2 = v;
131  for (k = 3; k <= power; k++) {
132  p3 = p2 * v;
133  p1 = p2; p2 = p3;
134  }
135  r = p3;
136  }
137  // multiply this term by the poly in the jth var
138  term *= r;
139  }
140  // Add this term to the final result
141  returnValue += term;
142  }
143  return returnValue;
144 }
145 
146 // EOF for MDF.C
MDF
double MDF(double *x)
Definition: MDF.C:114
r
ROOT::R::TRInterface & r
Definition: Object.C:4
gNCoefficients
static int gNCoefficients
Definition: MDF.C:20
x
Double_t x[n]
Definition: legend1.C:17
gNVariables
static int gNVariables
Definition: MDF.C:19
v
@ v
Definition: rootcling_impl.cxx:3635
gPower
static int gPower[]
Definition: MDF.C:87
gXMax
static double gXMax[]
Definition: MDF.C:31
gCoefficient
static double gCoefficient[]
Definition: MDF.C:35
gCoefficientRMS
static double gCoefficientRMS[]
Definition: MDF.C:60
gDMean
static double gDMean
Definition: MDF.C:21
gXMean
static double gXMean[]
Definition: MDF.C:23
gXMin
static double gXMin[]
Definition: MDF.C:27