401#define RADDEG (180. / TMath::Pi()) 
  402#define DEGRAD (TMath::Pi() / 180.) 
  411#define PARAM_MAXSTUDY 1 
  412#define PARAM_SEVERAL  2 
  413#define PARAM_RELERR   3 
  414#define PARAM_MAXTERMS 4 
  419static void mdfHelper(
int&, 
double*, 
double&, 
double*, 
int);
 
  511: 
TNamed(
"multidimfit",
"Multi-dimensional fit object"),
 
  514fVariables(dimension*100),
 
  515fMeanVariables(dimension),
 
  516fMaxVariables(dimension),
 
  517fMinVariables(dimension)
 
  725         Warning(
"AddTestRow", 
"variable %d (row: %d) too large: %f > %f",
 
  728         Warning(
"AddTestRow", 
"variable %d (row: %d) too small: %f < %f",
 
  742      while ((
h = (
TH1*)next()))
 
  832   for (i = 0; i < 
n; i++) {
 
  835      for (j = 0; j < 
m; j++)
 
  925      returnValue += term*term;
 
  928   returnValue = sqrt(returnValue);
 
  969         for (i = 3; i <= 
p; i++) {
 
  972               p3 = ((2 * i - 3) * p2 * 
x - (i - 2) * p1) / (i - 1);
 
  974               p3 = 2 * 
x * p2 - p1;
 
 1030      sumSqR       += res * res;
 
 1047      Warning(
"Fit", 
"test sample is very small");
 
 1050      Error(
"Fit", 
"invalid option");
 
 1057      Error(
"Fit", 
"Cannot create Fitter");
 
 1063   const Int_t  maxArgs = 16;
 
 1073                            startVal, startErr, 0, 0);
 
 1082      Double_t val = 0, err = 0, low = 0, high = 0;
 
 1087                            val, err, low, high);
 
 1132      Int_t     numberFunctions = 0;
 
 1152               control[numberFunctions-1] = 
Int_t(1.0e+6*s);
 
 1176         for (j = 0; j < i; j++)
 
 1207         if (control[j] <= 
x) {
 
 1215         control[k] = control[i];
 
 1217         order[k]   = order[i];
 
 1321      for (j = 0; j <= i; j++) {
 
 1324            curvatureMatrix(i,j) +=
 
 1326         curvatureMatrix(j,i) = curvatureMatrix(i,j);
 
 1346      Error(
"MakeCoefficientErrors", 
"curvature matrix is singular");
 
 1347   chol.
Invert(curvatureMatrix);
 
 1368   Int_t col = 0, row = 0;
 
 1372      for (row = col - 1; row > -1; row--) {
 
 1374         for (i = row; i <= col ; i++)
 
 1474      for (j = 0; j < i; j++) {
 
 1667                                   "Computed residuals vs Quantity",
 
 1681                                   "Computed residuals over training sample",
 
 1690                                   "Distribution of residuals from test",
 
 1871         std::cout << 
"Coeff   SumSqRes    Contrib   Angle      QM   Func" 
 1872         << 
"     Value        W^2  Powers" << std::endl;
 
 1877      if (dResidur == 0) {
 
 1906      squareResidual -= dResidur;
 
 1920         << std::setw(10) << std::setprecision(4) << squareResidual << 
" " 
 1921         << std::setw(10) << std::setprecision(4) << dResidur << 
" " 
 1922         << std::setw(7)  << std::setprecision(3) << 
fMaxAngle << 
" " 
 1923         << std::setw(7)  << std::setprecision(3) << s << 
" " 
 1924         << std::setw(5)  << i << 
" " 
 1925         << std::setw(10) << std::setprecision(4)
 
 1927         << std::setw(10) << std::setprecision(4)
 
 1932         std::cout << std::endl;
 
 1964                                const char *classname,
 
 1971   const char *cv_qual  = isMethod ? 
"" : 
"static ";
 
 1973      prefix.
Form(
"%s::", classname);
 
 1975   std::ofstream outFile(
filename,std::ios::out|std::ios::trunc);
 
 1977      Error(
"MakeRealCode",
"couldn't open output file '%s'",
filename);
 
 1982      std::cout << 
"Writing on file \"" << 
filename << 
"\" ... " << std::flush;
 
 1987   outFile << 
"// -*- mode: c++ -*-" << std::endl;
 
 1989   outFile << 
"// " << std::endl
 
 1991   << 
" generated by TMultiDimFit::MakeRealCode" << std::endl;
 
 1994   outFile << 
"// on " << date.
AsString() << std::endl;
 
 1996   outFile << 
"// ROOT version " << 
gROOT->GetVersion()
 
 1997   << std::endl << 
"//" << std::endl;
 
 1999   outFile << 
"// This file contains the function " << std::endl
 
 2000   << 
"//" << std::endl
 
 2001   << 
"//    double  " << prefix << 
"MDF(double *x); " << std::endl
 
 2002   << 
"//" << std::endl
 
 2003   << 
"// For evaluating the parameterization obtained" << std::endl
 
 2004   << 
"// from TMultiDimFit and the point x" << std::endl
 
 2005   << 
"// " << std::endl
 
 2006   << 
"// See TMultiDimFit class documentation for more " 
 2007   << 
"information " << std::endl << 
"// " << std::endl;
 
 2011      outFile << 
"#include \"" << classname << 
".h\"" << std::endl;
 
 2016   outFile << 
"//" << std::endl
 
 2017   << 
"// Static data variables"  << std::endl
 
 2018   << 
"//" << std::endl;
 
 2019   outFile << cv_qual << 
"int    " << prefix << 
"gNVariables    = " 
 2021   outFile << cv_qual << 
"int    " << prefix << 
"gNCoefficients = " 
 2023   outFile << cv_qual << 
"double " << prefix << 
"gDMean         = " 
 2027   outFile << 
"// Assignment to mean vector." << std::endl;
 
 2028   outFile << cv_qual << 
"double " << prefix
 
 2029   << 
"gXMean[] = {" << std::endl;
 
 2031      outFile << (i != 0 ? 
", " : 
"  ") << 
fMeanVariables(i) << std::flush;
 
 2032   outFile << 
" };" << std::endl << std::endl;
 
 2035   outFile << 
"// Assignment to minimum vector." << std::endl;
 
 2036   outFile << cv_qual << 
"double " << prefix
 
 2037   << 
"gXMin[] = {" << std::endl;
 
 2039      outFile << (i != 0 ? 
", " : 
"  ") << 
fMinVariables(i) << std::flush;
 
 2040   outFile << 
" };" << std::endl << std::endl;
 
 2043   outFile << 
"// Assignment to maximum vector." << std::endl;
 
 2044   outFile << cv_qual << 
"double " << prefix
 
 2045   << 
"gXMax[] = {" << std::endl;
 
 2047      outFile << (i != 0 ? 
", " : 
"  ") << 
fMaxVariables(i) << std::flush;
 
 2048   outFile << 
" };" << std::endl << std::endl;
 
 2051   outFile << 
"// Assignment to coefficients vector." << std::endl;
 
 2052   outFile << cv_qual << 
"double " << prefix
 
 2053   << 
"gCoefficient[] = {" << std::flush;
 
 2055      outFile << (i != 0 ? 
"," : 
"") << std::endl
 
 2057   outFile << std::endl << 
" };" << std::endl << std::endl;
 
 2060   outFile << 
"// Assignment to error coefficients vector." << std::endl;
 
 2061   outFile << cv_qual << 
"double " << prefix
 
 2062   << 
"gCoefficientRMS[] = {" << std::flush;
 
 2064      outFile << (i != 0 ? 
"," : 
"") << std::endl
 
 2066   outFile << std::endl << 
" };" << std::endl << std::endl;
 
 2069   outFile << 
"// Assignment to powers vector." << std::endl
 
 2070   << 
"// The powers are stored row-wise, that is" << std::endl
 
 2071   << 
"//  p_ij = " << prefix
 
 2072   << 
"gPower[i * NVariables + j];" << std::endl;
 
 2073   outFile << cv_qual << 
"int    " << prefix
 
 2074   << 
"gPower[] = {" << std::flush;
 
 2077         if (j != 0) outFile << std::flush << 
"  ";
 
 2078         else        outFile << std::endl << 
"  ";
 
 2084   outFile << std::endl << 
"};" << std::endl << std::endl;
 
 2090   outFile << 
"// " << std::endl
 
 2092   << (isMethod ? 
"method " : 
"function ")
 
 2093   << 
"  double " << prefix
 
 2095   << std::endl << 
"// " << std::endl;
 
 2096   outFile << 
"double " << prefix
 
 2097   << 
"MDF(double *x) {" << std::endl
 
 2098   << 
"  double returnValue = " << prefix << 
"gDMean;" << std::endl
 
 2099   << 
"  int    i = 0, j = 0, k = 0;" << std::endl
 
 2100   << 
"  for (i = 0; i < " << prefix << 
"gNCoefficients ; i++) {" 
 2102   << 
"    // Evaluate the ith term in the expansion" << std::endl
 
 2103   << 
"    double term = " << prefix << 
"gCoefficient[i];" 
 2105   << 
"    for (j = 0; j < " << prefix << 
"gNVariables; j++) {" 
 2107   << 
"      // Evaluate the polynomial in the jth variable." << std::endl
 
 2108   << 
"      int power = "<< prefix << 
"gPower[" 
 2109   << prefix << 
"gNVariables * i + j]; " << std::endl
 
 2110   << 
"      double p1 = 1, p2 = 0, p3 = 0, r = 0;" << std::endl
 
 2111   << 
"      double v =  1 + 2. / (" 
 2112   << prefix << 
"gXMax[j] - " << prefix
 
 2113   << 
"gXMin[j]) * (x[j] - " << prefix << 
"gXMax[j]);" << std::endl
 
 2114   << 
"      // what is the power to use!" << std::endl
 
 2115   << 
"      switch(power) {" << std::endl
 
 2116   << 
"      case 1: r = 1; break; " << std::endl
 
 2117   << 
"      case 2: r = v; break; " << std::endl
 
 2118   << 
"      default: " << std::endl
 
 2119   << 
"        p2 = v; " << std::endl
 
 2120   << 
"        for (k = 3; k <= power; k++) { " << std::endl
 
 2121   << 
"          p3 = p2 * v;" << std::endl;
 
 2123      outFile << 
"          p3 = ((2 * i - 3) * p2 * v - (i - 2) * p1)" 
 2124      << 
" / (i - 1);" << std::endl;
 
 2126      outFile << 
"          p3 = 2 * v * p2 - p1; " << std::endl;
 
 2127   outFile << 
"          p1 = p2; p2 = p3; " << std::endl << 
"        }" << std::endl
 
 2128   << 
"        r = p3;" << std::endl << 
"      }" << std::endl
 
 2129   << 
"      // multiply this term by the poly in the jth var" << std::endl
 
 2130   << 
"      term *= r; " << std::endl << 
"    }" << std::endl
 
 2131   << 
"    // Add this term to the final result" << std::endl
 
 2132   << 
"    returnValue += term;" << std::endl << 
"  }" << std::endl
 
 2133   << 
"  return returnValue;" << std::endl << 
"}" << std::endl << std::endl;
 
 2136   outFile << 
"// EOF for " << 
filename << std::endl;
 
 2142      std::cout << 
"done" << std::endl;
 
 2168      std::cout << 
"User parameters:" << std::endl
 
 2169      << 
"----------------" << std::endl
 
 2172      << 
" Max Terms:                    " << 
fMaxTerms << std::endl
 
 2173      << 
" Power Limit Parameter:        " << 
fPowerLimit << std::endl
 
 2175      << 
" Max functions to study:       " << 
fMaxStudy << std::endl
 
 2176      << 
" Max angle (optional):         " << 
fMaxAngle << std::endl
 
 2177      << 
" Min angle:                    " << 
fMinAngle << std::endl
 
 2179      << 
" Maximum Powers:               " << std::flush;
 
 2181         std::cout << 
" " << 
fMaxPowers[i] - 1 << std::flush;
 
 2182      std::cout << std::endl << std::endl
 
 2183      << 
" Parameterisation will be done using " << std::flush;
 
 2185         std::cout << 
"Chebyshev polynomials" << std::endl;
 
 2187         std::cout << 
"Legendre polynomials" << std::endl;
 
 2189         std::cout << 
"Monomials" << std::endl;
 
 2190      std::cout << std::endl;
 
 2195      std::cout << 
"Sample statistics:" << std::endl
 
 2196      << 
"------------------" << std::endl
 
 2197      << 
"                 D"  << std::flush;
 
 2199         std::cout << 
" " << std::setw(10) << i+1 << std::flush;
 
 2200      std::cout << std::endl << 
" Max:   " << std::setw(10) << std::setprecision(7)
 
 2203         std::cout << 
" " << std::setw(10) << std::setprecision(4)
 
 2205      std::cout << std::endl << 
" Min:   " << std::setw(10) << std::setprecision(7)
 
 2208         std::cout << 
" " << std::setw(10) << std::setprecision(4)
 
 2210      std::cout << std::endl << 
" Mean:  " << std::setw(10) << std::setprecision(7)
 
 2213         std::cout << 
" " << std::setw(10) << std::setprecision(4)
 
 2215      std::cout << std::endl << 
" Function Sum Squares:         " << 
fSumSqQuantity 
 2216      << std::endl << std::endl;
 
 2220      std::cout << 
"Results of Parameterisation:" << std::endl
 
 2221      << 
"----------------------------" << std::endl
 
 2222      << 
" Total reduction of square residuals    " 
 2224      << 
" Relative precision obtained:           " 
 2226      << 
" Error obtained:                        " 
 2228      << 
" Multiple correlation coefficient:      " 
 2230      << 
" Reduced Chi square over sample:        " 
 2232      << 
" Maximum residual value:                " 
 2234      << 
" Minimum residual value:                " 
 2236      << 
" Estimated root mean square:            " 
 2237      << 
fRMS << std::endl
 
 2238      << 
" Maximum powers used:                   " << std::flush;
 
 2241      std::cout << std::endl
 
 2242      << 
" Function codes of candidate functions." << std::endl
 
 2243      << 
"  1: considered," 
 2244      << 
"  2: too little contribution," 
 2245      << 
"  3: accepted." << std::flush;
 
 2248            std::cout << std::endl << 
" " << std::flush;
 
 2249         else if (i % 10 == 0)
 
 2250            std::cout << 
" " << std::flush;
 
 2253      std::cout << std::endl << 
" Loop over candidates stopped because " << std::flush;
 
 2256            std::cout << 
"max allowed studies reached" << std::endl; 
break;
 
 2258            std::cout << 
"all candidates considered several times" << std::endl; 
break;
 
 2260            std::cout << 
"wanted relative error obtained" << std::endl; 
break;
 
 2262            std::cout << 
"max number of terms reached" << std::endl; 
break;
 
 2264            std::cout << 
"some unknown reason" << std::endl;
 
 2267      std::cout << std::endl;
 
 2271      std::cout << 
"Results of Fit:" << std::endl
 
 2272      << 
"---------------" << std::endl
 
 2273      << 
" Test sample size:                      " 
 2275      << 
" Multiple correlation coefficient:      " 
 2277      << 
" Relative precision obtained:           " 
 2279      << 
" Error obtained:                        " 
 2281      << 
" Reduced Chi square over sample:        " 
 2286         std::cout << std::endl;
 
 2291      std::cout << 
"Coefficients:" << std::endl
 
 2292      << 
"-------------" << std::endl
 
 2293      << 
"   #         Value        Error   Powers" << std::endl
 
 2294      << 
" ---------------------------------------" << std::endl;
 
 2296         std::cout << 
" " << std::setw(3) << i << 
"  " 
 2300            std::cout << 
" " << std::setw(3)
 
 2302         std::cout << std::endl;
 
 2304      std::cout << std::endl;
 
 2307      std::cout << 
"Correlation Matrix:" << std::endl
 
 2308      << 
"-------------------";
 
 2313      std::cout << 
"Parameterization:" << std::endl
 
 2314      << 
"-----------------" << std::endl
 
 2315      << 
"  Normalised variables: " << std::endl;
 
 2317         std::cout << 
"\ty_" << i << 
"\t= 1 + 2 * (x_" << i << 
" - " 
 2321      std::cout << std::endl
 
 2324         std::cout << 
"y_" << i;
 
 2327      std::cout << 
") = ";
 
 2330            std::cout << std::endl << 
"\t" << (
fCoefficients(i) < 0 ? 
"- " : 
"+ ")
 
 2338               case 2: std::cout << 
" * y_" << j; 
break;
 
 2341                     case kLegendre:  std::cout << 
" * L_" << 
p-1 << 
"(y_" << j << 
")"; 
break;
 
 2342                     case kChebyshev: std::cout << 
" * C_" << 
p-1 << 
"(y_" << j << 
")"; 
break;
 
 2343                     default:         std::cout << 
" * y_" << j << 
"^" << 
p-1; 
break;
 
 2349      std::cout << std::endl;
 
 2379   if (ang >= 90 || ang < 0) {
 
 2380      Warning(
"SetMaxAngle", 
"angle must be in [0,90)");
 
 2395   if (ang > 90 || ang <= 0) {
 
 2396      Warning(
"SetMinAngle", 
"angle must be in [0,90)");
 
 2500               double* coeffs, 
int )
 
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
TMatrixTRow< Double_t > TMatrixDRow
TMatrixTDiag_const< Double_t > TMatrixDDiag_const
static void mdfHelper(int &, double *, double &, double *, int)
Helper function for doing the minimisation of Chi2 using Minuit.
Using a TBrowser one can browse all ROOT objects.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
Cholesky Decomposition class.
Bool_t Decompose() override
Matrix A is decomposed in component U so that A = U^T * U If the decomposition succeeds,...
Bool_t Invert(TMatrixDSym &inv)
For a symmetric matrix A(m,m), its inverse A_inv(m,m) is returned .
1-D histogram with a double per channel (see TH1 documentation)}
TH1 is the base class of all histogram classes in ROOT.
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2),...
2-D histogram with a double per channel (see TH1 documentation)}
void Clear(Option_t *option="") override
Remove all objects from the list.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
virtual TMatrixTBase< Element > & Zero()
Set matrix elements to zero.
void Print(Option_t *name="") const override
Print the matrix as a table of elements.
virtual TMatrixTBase< Element > & NormByDiag(const TVectorT< Element > &v, Option_t *option="D")
option:
TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1) override
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
Multidimensional Fits in ROOT.
void Print(Option_t *option="ps") const override
Print statistics etc.
virtual void MakeCorrelation()
PRIVATE METHOD: Compute the correlation matrix.
TVectorD fCoefficients
Vector of the final coefficients.
Double_t fPrecision
Relative precision of param.
Byte_t fHistogramMask
Bit pattern of histograms used.
virtual void MakeCoefficientErrors()
PRIVATE METHOD: Compute the errors on the coefficients.
TMatrixD fOrthCurvatureMatrix
Model matrix.
Bool_t fShowCorrelation
print correlation matrix
Bool_t fIsUserFunction
Flag for user defined function.
Int_t fNVariables
Number of independent variables.
Int_t fMaxResidualRow
Row giving max residual.
Double_t fMinQuantity
Min value of dependent quantity.
virtual Double_t MakeChi2(const Double_t *coeff=nullptr)
Calculate Chi square over either the test sample.
Double_t fSumSqQuantity
SumSquare of dependent quantity.
TVectorD fMaxVariables
max value of independent variables
Int_t fSampleSize
Size of training sample.
Double_t fSumSqAvgQuantity
Sum of squares away from mean.
Int_t fMaxTerms
Max terms expected in final expr.
Int_t * fPowers
[fMaxFuncNV] where fMaxFuncNV = fMaxFunctions*fNVariables
virtual void MakeNormalized()
PRIVATE METHOD: Normalize data to the interval [-1;1].
Int_t * fMaxPowers
[fNVariables] maximum powers
Int_t fMaxStudy
max functions to study
TVectorD fTestQuantity
Test sample, dependent quantity.
TVectorD fTestSqError
Test sample, Error in quantity.
virtual Double_t Eval(const Double_t *x, const Double_t *coeff=nullptr) const
Evaluate parameterization at point x.
Int_t fMaxFunctions
max number of functions
Int_t fBinVarY
Number of bin in dependent variables.
static TMultiDimFit * Instance()
Return the static instance.
virtual void MakeCode(const char *functionName="MDF", Option_t *option="")
Generate the file <filename> with .C appended if argument doesn't end in .cxx or ....
virtual void MakeCandidates()
PRIVATE METHOD: Create list of candidate functions for the parameterisation.
Double_t fTestError
Error from test.
Double_t fMinResidual
Min residual value.
void SetPowerLimit(Double_t limit=1e-3)
Set the user parameter for the function selection.
virtual void FindParameterization(Option_t *option="")
Find the parameterization.
virtual Double_t MakeGramSchmidt(Int_t function)
PRIVATE METHOD: Make Gram-Schmidt orthogonalisation.
TVectorD fSqError
Training sample, error in quantity.
virtual void AddRow(const Double_t *x, Double_t D, Double_t E=0)
Add a row consisting of fNVariables independent variables, the known, dependent quantity,...
TVectorD fQuantity
Training sample, dependent quantity.
TVectorD fTestVariables
Test sample, independent variables.
TVectorD fOrthCoefficients
The model coefficients.
Int_t fTestSampleSize
Size of test sample.
TVectorD fResiduals
Vector of the final residuals.
virtual Bool_t TestFunction(Double_t squareResidual, Double_t dResidur)
PRIVATE METHOD: Test whether the currently considered function contributes to the fit.
TVectorD fVariables
Training sample, independent variables.
Double_t fCorrelationCoeff
Multi Correlation coefficient.
void SetMaxPowers(const Int_t *powers)
Set the maximum power to be considered in the fit for each variable.
Int_t * fMaxPowersFinal
[fNVariables] maximum powers from fit;
Int_t fMinResidualRow
Row giving min residual.
virtual void SetPowers(const Int_t *powers, Int_t terms)
Define a user function.
Double_t fMaxQuantity
Max value of dependent quantity.
virtual void MakeRealCode(const char *filename, const char *classname, Option_t *option="")
PRIVATE METHOD: This is the method that actually generates the code for the evaluation the parameteri...
Double_t fRMS
Root mean square of fit.
TMatrixD fFunctions
Functions evaluated over sample.
virtual void AddTestRow(const Double_t *x, Double_t D, Double_t E=0)
Add a row consisting of fNVariables independent variables, the known, dependent quantity,...
Int_t fParameterisationCode
Exit code of parameterisation.
Double_t fMaxAngle
Max angle for accepting new function.
Int_t fNCoefficients
Dimension of model coefficients.
virtual void Fit(Option_t *option="")
Try to fit the found parameterisation to the test sample.
TMultiDimFit()
Empty CTOR. Do not use.
Double_t fTestCorrelationCoeff
Multi Correlation coefficient.
Double_t fMinAngle
Min angle for accepting new function.
void SetMinRelativeError(Double_t error)
Set the acceptable relative error for when sum of square residuals is considered minimized.
Double_t fSumSqResidual
Sum of Square residuals.
TVectorD fMeanVariables
mean value of independent variables
virtual void MakeMethod(const Char_t *className="MDF", Option_t *option="")
Generate the file <classname>MDF.cxx which contains the implementation of the method:
void SetMaxAngle(Double_t angle=0)
Set the max angle (in degrees) between the initial data vector to be fitted, and the new candidate fu...
Double_t fTestPrecision
Relative precision of test.
virtual void MakeCoefficients()
PRIVATE METHOD: Invert the model matrix B, and compute final coefficients.
TMatrixD fCorrelationMatrix
Correlation matrix.
Int_t * fPowerIndex
[fMaxTerms] Index of accepted powers
TMatrixD fOrthFunctions
As above, but orthogonalised.
virtual Double_t EvalControl(const Int_t *powers) const
PRIVATE METHOD: Calculate the control parameter from the passed powers.
void Clear(Option_t *option="") override
Clear internal structures and variables.
virtual void MakeParameterization()
PRIVATE METHOD: Find the parameterization over the training sample.
EMDFPolyType fPolyType
Fit object (MINUIT)
void Browse(TBrowser *b) override
Browse the TMultiDimFit object in the TBrowser.
virtual Bool_t Select(const Int_t *iv)
Selection method.
TList * fHistograms
List of histograms.
Double_t fChi2
Chi square of fit.
Double_t fMaxResidual
Max residual value.
Double_t fError
Error from parametrization.
Int_t fBinVarX
Number of bin in independent variables.
virtual Double_t EvalFactor(Int_t p, Double_t x) const
PRIVATE METHOD: Evaluate function with power p at variable value x.
void SetMinAngle(Double_t angle=1)
Set the min angle (in degrees) between a new candidate function and the subspace spanned by the previ...
virtual Double_t EvalError(const Double_t *x, const Double_t *coeff=nullptr) const
Evaluate parameterization error at point x.
TVectorD fMinVariables
min value of independent variables
TVectorD fOrthFunctionNorms
Norm of the evaluated functions.
Double_t fMeanQuantity
Mean of dependent quantity.
TVectorD fCoefficientsRMS
Vector of RMS of coefficients.
Double_t fPowerLimit
Control parameter.
static TMultiDimFit * fgInstance
~TMultiDimFit() override
Destructor.
virtual void MakeHistograms(Option_t *option="A")
Make histograms of the result of the analysis.
Int_t fMaxFuncNV
fMaxFunctions*fNVariables
Double_t fMinRelativeError
Min relative error accepted.
Int_t * fFunctionCodes
[fMaxFunctions] acceptance code
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void ToLower()
Change string to lower-case.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TVectorT< Element > & Zero()
Set vector elements to zero.
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
virtual void PrintResults(Int_t level, Double_t amin) const =0
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
To set the address of the minimization objective function called by the native compiler (see function...
virtual Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)=0
virtual Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs)=0
virtual Double_t GetParameter(Int_t ipar) const =0
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)