// -*- mode: c++ -*- // // File MDF.C generated by TMultiDimFit::MakeRealCode // on Fri Nov 24 19:11:40 2000 // ROOT version 2.26/00 // // This file contains the function // // Double_t MDF(Double_t *x); // // For evaluating the parameterization obtained // from TMultiDimFit and the point x // // See TMultiDimFit class documentation for more information // #ifndef __CINT__ #include // needed for Double_t etc #endif // // Static data variables // static Int_t gNVariables = 4; static Int_t gNCoefficients = 24; static Double_t gDMean = 45.8383; // Assignment to mean vector. static Double_t gXMean[] = { -0.0361681, 0.0063121, -0.00773313, 0.023277 }; // Assignment to minimum vector. static Double_t gXMin[] = { 0.000501871, 0.00257969, 0.037837, 0.0216842 }; // Assignment to maximum vector. static Double_t gXMax[] = { 9.95356, 9.99543, 9.99466, 9.95317 }; // Assignment to coefficients vector. static Double_t gCoefficient[] = { -2.60917, 43.7318, 13.26, 13.4144, 13.4252, 13.2749, 13.4955, 13.3308, 4.50256, -3.8387, -4.03819, -0.180865, -4.01578, -3.9821, 4.48921, 3.37037, -4.33534, 2.87185, 4.69131, 4.48804, 3.9983, -3.97653, 3.65933, 4.50076 }; // Assignment to powers vector. // The powers are stored row-wise, that is // p_ij = gPower[i * NVariables + j]; static Int_t gPower[] = { 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 3, 1, 2, 1, 2, 1, 2, 2, 1, 1, 3, 3, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 3, 1, 2, 2, 2, 2, 2, 1, 2, 2, 3, 3, 1, 1, 1, 3, 1, 1, 3, 1, 1, 2, 1, 3, 1, 2, 1, 2, 2, 2, 2, 2, 2, 4, 3, 1, 1 }; // // The function Double_t MDF(Double_t *x) // Double_t MDF(Double_t *x) { Double_t returnValue = gDMean; Int_t i = 0, j = 0; for (i = 0; i < gNCoefficients ; i++) { // Evaluate the ith term in the expansion Double_t term = gCoefficient[i]; << for (j = 0; j < gNVariables; j++) { // Evaluate the polynomial in the jth variable. Int_t power = gPower[gNVariables * i + j]; Double_t p1 = 1, p2 = 0, p3 = 0, r = 0; Double_t v = 1 + 2. / (gXMax[j] - gXMin[j]) * (x[j] - gXMax[j]); // what is the power to use! switch(power) { case 1: r = 1; break; case 2: r = v; break; default: p2 = v; for (i = 3; i <= power; i++) { p3 = p2 * v; p1 = p2; p2 = p3; } r = p3; } // multiply this term by the poly in the jth var term *= r; } // Add this term to the final result returnValue += term; } return returnValue; } // EOF for MDF.C