Multidimensional Fits in ROOT.
A common problem encountered in different fields of applied science is to find an expression for one physical quantity in terms of several others, which are directly measurable.
An example in high energy physics is the evaluation of the momentum of a charged particle from the observation of its trajectory in a magnetic field. The problem is to relate the momentum of the particle to the observations, which may consists of positional measurements at intervals along the particle trajectory.
The exact functional relationship between the measured quantities (e.g., the space-points) and the dependent quantity (e.g., the momentum) is in general not known, but one possible way of solving the problem, is to find an expression which reliably approximates the dependence of the momentum on the observations.
This explicit function of the observations can be obtained by a least squares fitting procedure applied to a representative sample of the data, for which the dependent quantity (e.g., momentum) and the independent observations are known. The function can then be used to compute the quantity of interest for new observations of the independent variables.
This class TMultiDimFit implements such a procedure in ROOT. It is largely based on the CERNLIB MUDIFI package 2. Though the basic concepts are still sound, and therefore kept, a few implementation details have changed, and this class can take advantage of MINUIT 4 to improve the errors of the fitting, thanks to the class TMinuit.
In 5 and 6 H. Wind demonstrates the utility of this procedure in the context of tracking, magnetic field parameterisation, and so on. The outline of the method used in this class is based on Winds discussion, and I refer these two excellents text for more information.
And example of usage is given in multidimfit.C.
Let \( D \) by the dependent quantity of interest, which depends smoothly on the observable quantities \( x_1, \ldots, x_N \) which we'll denote by \(\mathbf{x}\). Given a training sample of \( M\) tuples of the form, (TMultiDimFit::AddRow)
\[ \left(\mathbf{x}_j, D_j, E_j\right)\quad, \]
where \(\mathbf{x}_j = (x_{1,j},\ldots,x_{N,j})\) are \( N\) independent variables, \( D_j\) is the known, quantity dependent at \(\mathbf{x}_j\) and \( E_j\) is the square error in \( D_j\), the class will try to find the parameterization
\[ D_p(\mathbf{x}) = \sum_{l=1}^{L} c_l \prod_{i=1}^{N} p_{li}\left(x_i\right) = \sum_{l=1}^{L} c_l F_l(\mathbf{x}) \]
such that
\[ S \equiv \sum_{j=1}^{M} \left(D_j - D_p\left(\mathbf{x}_j\right)\right)^2 \]
is minimal. Here \(p_{li}(x_i)\) are monomials, or Chebyshev or Legendre polynomials, labelled \(l = 1, \ldots, L\), in each variable \( x_i\), \( i=1, \ldots, N\).
So what TMultiDimFit does, is to determine the number of terms \( L\), and then \( L\) terms (or functions) \( F_l\), and the \( L\) coefficients \( c_l\), so that \( S\) is minimal (TMultiDimFit::FindParameterization).
Of course it's more than a little unlikely that \( S\) will ever become exact zero as a result of the procedure outlined below. Therefore, the user is asked to provide a minimum relative error \( \epsilon\) (TMultiDimFit::SetMinRelativeError), and \( S\) will be considered minimized when
\[ R = \frac{S}{\sum_{j=1}^M D_j^2} < \epsilon \]
Optionally, the user may impose a functional expression by specifying the powers of each variable in \( L\) specified functions \( F_1, \ldots,F_L\) (TMultiDimFit::SetPowers). In that case, only the coefficients \( c_l\) is calculated by the class.
As always when dealing with fits, there's a real chance of over fitting. As is well-known, it's always possible to fit an \( N-1\) polynomial in \( x\) to \( N\) points \( (x,y)\) with \(\chi^2 = 0\), but the polynomial is not likely to fit new data at all 1. Therefore, the user is asked to provide an upper limit, \( L_{max}\) to the number of terms in \( D_p\) (TMultiDimFit::SetMaxTerms).
However, since there's an infinite number of \( F_l\) to choose from, the user is asked to give the maximum power. \( P_{max,i}\), of each variable \( x_i\) to be considered in the minimization of \( S\) (TMultiDimFit::SetMaxPowers).
One way of obtaining values for the maximum power in variable \( i\), is to perform a regular fit to the dependent quantity \( D\), using a polynomial only in \( x_i\). The maximum power is \( P_{max,i}\) is then the power that does not significantly improve the one-dimensional least-square fit over \( x_i\) to \( D\) 5.
There are still a huge amount of possible choices for \( F_l\); in fact there are \(\prod_{i=1}^{N} (P_{max,i} + 1)\) possible choices. Obviously we need to limit this. To this end, the user is asked to set a power control limit, \( Q\) (TMultiDimFit::SetPowerLimit), and a function \( F_l\) is only accepted if
\[ Q_l = \sum_{i=1}^{N} \frac{P_{li}}{P_{max,i}} < Q \]
where \( P_{li}\) is the leading power of variable \( x_i\) in function \( F_l\) (TMultiDimFit::MakeCandidates). So the number of functions increase with \( Q\) (1, 2 is fine, 5 is way out).
To further reduce the number of functions in the final expression, only those functions that significantly reduce \( S\) is chosen. What `significant' means, is chosen by the user, and will be discussed below (see 2.3).
The functions \( F_l\) are generally not orthogonal, which means one will have to evaluate all possible \( F_l\)'s over all data-points before finding the most significant 1. We can, however, do better then that. By applying the modified Gram-Schmidt orthogonalisation algorithm [5] [3] to the functions \( F_l\), we can evaluate the contribution to the reduction of \( S\) from each function in turn, and we may delay the actual inversion of the curvature-matrix (TMultiDimFit::MakeGramSchmidt).
So we are let to consider an \( M\times L\) matrix \(\mathsf{F}\), an element of which is given by
\[ f_{jl} = F_j\left(x_{1j} , x_{2j}, \ldots, x_{Nj}\right) = F_l(\mathbf{x}_j)\, \quad\mbox{with}~j=1,2,\ldots,M, \]
where \( j\) labels the \( M\) rows in the training sample and \( l\) labels \( L\) functions of \( N\) variables, and \( L \leq M\). That is, \( f_{jl}\) is the term (or function) numbered \( l\) evaluated at the data point \( j\). We have to normalise \(\mathbf{x}_j\) to \( [-1,1]\) for this to succeed [5] (TMultiDimFit::MakeNormalized). We then define a matrix \(\mathsf{W}\) of which the columns \(\mathbf{w}_j\) are given by
\begin{eqnarray*} \mathbf{w}_1 &=& \mathbf{f}_1 = F_1\left(\mathbf x_1\right)\\ \mathbf{w}_l &=& \mathbf{f}_l - \sum^{l-1}_{k=1} \frac{\mathbf{f}_l \bullet \mathbf{w}_k}{\mathbf{w}_k^2}\mathbf{w}_k\,. \end{eqnarray*}
and \(\mathbf{w}_{l}\) is the component of \(\mathbf{f}_{l} \) orthogonal to \(\mathbf{w}_{1}, \ldots, \mathbf{w}_{l-1}\). Hence we obtain [3],
\[ \mathbf{w}_k\bullet\mathbf{w}_l = 0\quad\mbox{if}~k \neq l\quad. \]
We now take as a new model \(\mathsf{W}\mathbf{a}\). We thus want to minimize
\[ S\equiv \left(\mathbf{D} - \mathsf{W}\mathbf{a}\right)^2\quad, \]
where \(\mathbf{D} = \left(D_1,\ldots,D_M\right)\) is a vector of the dependent quantity in the sample. Differentiation with respect to \( a_j\) gives, using 6,
\[ \mathbf{D}\bullet\mathbf{w}_l - a_l\mathbf{w}_l^2 = 0 \]
or
\[ a_l = \frac{\mathbf{D}_l\bullet\mathbf{w}_l}{\mathbf{w}_l^2} \]
Let \( S_j\) be the sum of squares of residuals when taking \( j\) functions into account. Then
\[ S_l = \left[\mathbf{D} - \sum^l_{k=1} a_k\mathbf{w}_k\right]^2 = \mathbf{D}^2 - 2\mathbf{D} \sum^l_{k=1} a_k\mathbf{w}_k + \sum^l_{k=1} a_k^2\mathbf{w}_k^2 \]
Using 9, we see that
\begin{eqnarray*} S_l &=& \mathbf{D}^2 - 2 \sum^l_{k=1} a_k^2\mathbf{w}_k^2 + \sum^j_{k=1} a_k^2\mathbf{w}_k^2\nonumber\\ &=& \mathbf{D}^2 - \sum^l_{k=1} a_k^2\mathbf{w}_k^2\nonumber\\ &=& \mathbf{D}^2 - \sum^l_{k=1} \frac{\left(\mathbf D\bullet \mathbf w_k\right)}{\mathbf w_k^2} \end{eqnarray*}
So for each new function \( F_l\) included in the model, we get a reduction of the sum of squares of residuals of \(a_l^2\mathbf{w}_l^2\), where \(\mathbf{w}_l\) is given by 4 and \( a_l\) by 9. Thus, using the Gram-Schmidt orthogonalisation, we can decide if we want to include this function in the final model, before the matrix inversion.
Supposing that \( L-1\) steps of the procedure have been performed, the problem now is to consider the \(L^{\mbox{th}}\) function.
The sum of squares of residuals can be written as
\[ S_L = \textbf{D}^T\bullet\textbf{D} - \sum^L_{l=1}a^2_l\left(\textbf{w}_l^T\bullet\textbf{w}_l\right) \]
where the relation 9 have been taken into account. The contribution of the \(L^{\mbox{th}}\) function to the reduction of S, is given by
\[ \Delta S_L = a^2_L\left(\textbf{w}_L^T\bullet\textbf{w}_L\right) \]
Two test are now applied to decide whether this \(L^{\mbox{th}}\) function is to be included in the final expression, or not.
Denoting by \( H_{L-1}\) the subspace spanned by \(\textbf{w}_1,\ldots,\textbf{w}_{L-1}\) the function \(\textbf{w}_L\) is by construction (see 4) the projection of the function \( F_L\) onto the direction perpendicular to \( H_{L-1}\). Now, if the length of \(\textbf{w}_L\) (given by \(\textbf{w}_L\bullet\textbf{w}_L\)) is very small compared to the length of \(\textbf{f}_L\) this new function can not contribute much to the reduction of the sum of squares of residuals. The test consists then in calculating the angle \( \theta \) between the two vectors \(\textbf{w}_L\) \( \textbf {f}_L\) (see also figure 1) and requiring that it's greater then a threshold value which the user must set (TMultiDimFit::SetMinAngle).
Let \(\textbf{D}\) be the data vector to be fitted. As illustrated in figure 1, the \(L^{\mbox{th}}\) function \(\textbf{w}_L\) will contribute significantly to the reduction of \( S\), if the angle \(\phi^\prime\) between \(\textbf{w}_L\) and \(\textbf{D}\) is smaller than an upper limit \( \phi \), defined by the user (MultiDimFit::SetMaxAngle)
However, the method automatically readjusts the value of this angle while fitting is in progress, in order to make the selection criteria less and less difficult to be fulfilled. The result is that the functions contributing most to the reduction of \( S\) are chosen first (TMultiDimFit::TestFunction).
In case \( \phi \) isn't defined, an alternative method of performing this second test is used: The \(L^{\mbox{th}}\) function \(\textbf{f}_L\) is accepted if (refer also to equation (13))
\[ \Delta S_L > \frac{S_{L-1}}{L_{max}-L} \]
where \( S_{L-1}\) is the sum of the \( L-1\) first residuals from the \( L-1\) functions previously accepted; and \( L_{max}\) is the total number of functions allowed in the final expression of the fit (defined by user).
From this we see, that by restricting \( L_{max}\) – the number of terms in the final model – the fit is more difficult to perform, since the above selection criteria is more limiting.
The more coefficients we evaluate, the more the sum of squares of residuals \( S\) will be reduced. We can evaluate \( S\) before inverting \(\mathsf{B}\) as shown below.
Having found a parameterization, that is the \( F_l\)'s and \( L\), that minimizes \( S\), we still need to determine the coefficients \( c_l\). However, it's a feature of how we choose the significant functions, that the evaluation of the \( c_l\)'s becomes trivial 5. To derive \(\mathbf{c}\), we first note that equation (4) can be written as
\[ \mathsf{F} = \mathsf{W}\mathsf{B} \]
where
\begin{eqnarray*} b_{ij} = \frac{\mathbf{f}_j \bullet \mathbf{w}_i}{\mathbf{w}_i^2} & \mbox{if} & i < j\\ 1 & \mbox{if} & i = j\\ 0 & \mbox{if} & i > j \end{eqnarray*}
Consequently, \(\mathsf{B}\) is an upper triangle matrix, which can be readily inverted. So we now evaluate
\[ \mathsf{F}\mathsf{B}^{-1} = \mathsf{W} \]
The model \(\mathsf{W}\mathbf{a}\) can therefore be written as \((\mathsf{F}\mathsf{B}^{-1})\mathbf{a} = \mathsf{F}(\mathsf{B}^{-1}\mathbf{a})\,.\)
The original model \(\mathsf{F}\mathbf{c}\) is therefore identical with this if
\[ \mathbf{c} = \left(\mathsf{B}^{-1}\mathbf{a}\right) = \left[\mathbf{a}^T\left(\mathsf{B}^{-1}\right)^T\right]^T\,. \]
The reason we use \(\left(\mathsf{B}^{-1}\right)^T\) rather then \(\mathsf{B}^{-1}\) is to save storage, since \(\left(\mathsf{B}^{-1}\right)^T\) can be stored in the same matrix as \(\mathsf{B}\) (TMultiDimFit::MakeCoefficients). The errors in the coefficients is calculated by inverting the curvature matrix of the non-orthogonal functions \( f_{lj}\) [1] (TMultiDimFit::MakeCoefficientErrors).
It's important to realize that the training sample should be representative of the problem at hand, in particular along the borders of the region of interest. This is because the algorithm presented here, is a interpolation, rather then a extrapolation 5.
Also, the independent variables \( x_{i}\) need to be linear independent, since the procedure will perform poorly if they are not 5. One can find an linear transformation from ones original variables \( \xi_{i}\) to a set of linear independent variables \( x_{i}\), using a Principal Components Analysis (see TPrincipal), and then use the transformed variable as input to this class [5] 6.
H. Wind also outlines a method for parameterising a multidimensional dependence over a multidimensional set of variables. An example of the method from 5, is a follows (please refer to 5 for a full discussion):
To process data, using this parameterisation, do
The class also provides functionality for testing the, over the training sample, found parameterization (TMultiDimFit::Fit). This is done by passing the class a test sample of \( M_t\) tuples of the form \((\mathbf{x}_{t,j},D_{t,j}, E_{t,j})\), where \(\mathbf{x}_{t,j}\) are the independent variables, \( D_{t,j}\) the known, dependent quantity, and \( E_{t,j}\) is the square error in \( D_{t,j}\) (TMultiDimFit::AddTestRow).
The parameterization is then evaluated at every \(\mathbf{x}_t\) in the test sample, and
\[ S_t \equiv \sum_{j=1}^{M_t} \left(D_{t,j} - D_p\left(\mathbf{x}_{t,j}\right)\right)^2 \]
is evaluated. The relative error over the test sample
\[ R_t = \frac{S_t}{\sum_{j=1}^{M_t} D_{t,j}^2} \]
should not be to low or high compared to \( R\) from the training sample. Also, multiple correlation coefficient from both samples should be fairly close, otherwise one of the samples is not representative of the problem. A large difference in the reduced \( \chi^2\) over the two samples indicate an over fit, and the maximum number of terms in the parameterisation should be reduced.
It's possible to use 4 to further improve the fit, using the test sample.
Christian Holm
Philip R. Bevington and D. Keith Robinson. Data Reduction and Error Analysis for the Physical Sciences. McGraw-Hill, 2 edition, 1992.
R. Brun et al. Long writeup DD/75-23, CERN, 1980.
F. James. Minuit. Long writeup D506, CERN, 1998.
H. Wind. Function parameterization. Proceedings of the 1972 CERN Computing and Data Processing School, volume 72-21 of Yellow report. CERN, 1972.
H. Wind. 1. principal component analysis, 2. pattern recognition for track finding, 3. interpolation and functional representation. Yellow report EP/81-12, CERN, 1981.
*/
#define RADDEG
#define DEGRAD
#define HIST_XORIG
#define HIST_DORIG
#define HIST_XNORM
#define HIST_DSHIF
#define HIST_RX
#define HIST_RD
#define HIST_RTRAI
#define HIST_RTEST
#define PARAM_MAXSTUDY
#define PARAM_SEVERAL
#define PARAM_RELERR
#define PARAM_MAXTERMS
//////////////////////////////////////////////////////////////////////////////
static void mdfHelper(int&, double*, double&, double*, int);
//////////////////////////////////////////////////////////////////////////////
Static instance. Used with mdfHelper and TMinuit TMultiDimFit* TMultiDimFit::fgInstance = nullptr;
////////////////////////////////////////////////////////////////////////////// / Empty CTOR. Do not use
TMultiDimFit::TMultiDimFit() { fMeanQuantity = 0; fMaxQuantity = 0; fMinQuantity = 0; fSumSqQuantity = 0; fSumSqAvgQuantity = 0;
fNVariables = 0; fSampleSize = 0; fTestSampleSize = 0;
fMinAngle = 1; fMaxAngle = 0; fMaxTerms = 0; fMinRelativeError = 0; fMaxPowers = nullptr; fPowerLimit = 0;
fMaxFunctions = 0; fFunctionCodes = nullptr; fMaxStudy = 0; fMaxFuncNV = 0;
fMaxPowersFinal = nullptr; fPowers = nullptr; fPowerIndex = nullptr;
fMaxResidual = 0; fMinResidual = 0; fMaxResidualRow = 0; fMinResidualRow = 0; fSumSqResidual = 0;
fNCoefficients = 0; fRMS = 0; fChi2 = 0; fParameterisationCode = 0;
fError = 0; fTestError = 0; fPrecision = 0; fTestPrecision = 0; fCorrelationCoeff = 0; fTestCorrelationCoeff = 0;
fHistograms = nullptr; fHistogramMask = 0; fBinVarX = 100; fBinVarY = 100;
fFitter = nullptr; fPolyType = kMonomials; fShowCorrelation = kFALSE; fIsUserFunction = kFALSE; fIsVerbose = kFALSE;
}
////////////////////////////////////////////////////////////////////////////// / Constructor / Second argument is the type of polynomials to use in / parameterisation, one of: / TMultiDimFit::kMonomials / TMultiDimFit::kChebyshev / TMultiDimFit::kLegendre / / Options: / K Compute (k)correlation matrix / V Be verbose / / Default is no options. /
TMultiDimFit::TMultiDimFit(Int_t dimension, EMDFPolyType type, Option_t *option) : TNamed("multidimfit","Multi-dimensional fit object"), fQuantity(dimension), fSqError(dimension), fVariables(dimension*100), fMeanVariables(dimension), fMaxVariables(dimension), fMinVariables(dimension) { fgInstance = this;
fMeanQuantity = 0; fMaxQuantity = 0; fMinQuantity = 0; fSumSqQuantity = 0; fSumSqAvgQuantity = 0;
fNVariables = dimension; fSampleSize = 0; fTestSampleSize = 0;
fMinAngle = 1; fMaxAngle = 0; fMaxTerms = 0; fMinRelativeError = 0.01; fMaxPowers = new Int_t[dimension]; fPowerLimit = 1;
fMaxFunctions = 0; fFunctionCodes = nullptr; fMaxStudy = 0; fMaxFuncNV = 0;
fMaxPowersFinal = new Int_t[dimension]; fPowers = nullptr; fPowerIndex = nullptr;
fMaxResidual = 0; fMinResidual = 0; fMaxResidualRow = 0; fMinResidualRow = 0; fSumSqResidual = 0;
fNCoefficients = 0; fRMS = 0; fChi2 = 0; fParameterisationCode = 0;
fError = 0; fTestError = 0; fPrecision = 0; fTestPrecision = 0; fCorrelationCoeff = 0; fTestCorrelationCoeff = 0;
fHistograms = nullptr; fHistogramMask = 0; fBinVarX = 100; fBinVarY = 100;
fFitter = nullptr; fPolyType = type; fShowCorrelation = kFALSE; fIsUserFunction = kFALSE; fIsVerbose = kFALSE; TString opt = option; opt.ToLower();
if (opt.Contains("k")) fShowCorrelation = kTRUE; if (opt.Contains("v")) fIsVerbose = kTRUE; }
////////////////////////////////////////////////////////////////////////////// / Destructor
TMultiDimFit::~TMultiDimFit() { delete [] fPowers; delete [] fMaxPowers; delete [] fMaxPowersFinal; delete [] fPowerIndex; delete [] fFunctionCodes; if (fHistograms) fHistograms->Clear("nodelete"); delete fHistograms; }
////////////////////////////////////////////////////////////////////////////// / Add a row consisting of fNVariables independent variables, the / known, dependent quantity, and optionally, the square error in / the dependent quantity, to the training sample to be used for the / parameterization. / The mean of the variables and quantity is calculated on the fly, / as outlined in TPrincipal::AddRow. / This sample should be representative of the problem at hand. / Please note, that if no error is given Poisson statistics is / assumed and the square error is set to the value of dependent / quantity. See also the / class description
void TMultiDimFit::AddRow(const Double_t *x, Double_t D, Double_t E) { if (!x) return;
if (++fSampleSize == 1) { fMeanQuantity = D; fMaxQuantity = D; fMinQuantity = D; fSumSqQuantity = D * D;// G.Q. erratum on August 15th, 2008 } else { fMeanQuantity *= 1 - 1./Double_t(fSampleSize); fMeanQuantity += D / Double_t(fSampleSize); fSumSqQuantity += D * D;
if (D >= fMaxQuantity) fMaxQuantity = D; if (D <= fMinQuantity) fMinQuantity = D; }
If the vector isn't big enough to hold the new data, then expand the vector by half it's size. Int_t size = fQuantity.GetNrows(); if (fSampleSize > size) { fQuantity.ResizeTo(size + size/2); fSqError.ResizeTo(size + size/2); }
Store the value fQuantity(fSampleSize-1) = D; fSqError(fSampleSize-1) = (E == 0 ? D : E);
Store data point in internal vector If the vector isn't big enough to hold the new data, then expand the vector by half it's size size = fVariables.GetNrows(); if (fSampleSize * fNVariables > size) fVariables.ResizeTo(size + size/2);
Increment the data point counter Int_t i,j; for (i = 0; i < fNVariables; i++) { if (fSampleSize == 1) { fMeanVariables(i) = x[i]; fMaxVariables(i) = x[i]; fMinVariables(i) = x[i]; } else { fMeanVariables(i) *= 1 - 1./Double_t(fSampleSize); fMeanVariables(i) += x[i] / Double_t(fSampleSize);
Update the maximum value for this component if (x[i] >= fMaxVariables(i)) fMaxVariables(i) = x[i];
Update the minimum value for this component if (x[i] <= fMinVariables(i)) fMinVariables(i) = x[i];
}
Store the data. j = (fSampleSize-1) * fNVariables + i; fVariables(j) = x[i]; } }
////////////////////////////////////////////////////////////////////////////// / Add a row consisting of fNVariables independent variables, the / known, dependent quantity, and optionally, the square error in / the dependent quantity, to the test sample to be used for the / test of the parameterization. / This sample needn't be representative of the problem at hand. / Please note, that if no error is given Poisson statistics is / assumed and the square error is set to the value of dependent / quantity. See also the / class description
void TMultiDimFit::AddTestRow(const Double_t *x, Double_t D, Double_t E) { if (fTestSampleSize++ == 0) { fTestQuantity.ResizeTo(fNVariables); fTestSqError.ResizeTo(fNVariables); fTestVariables.ResizeTo(fNVariables * 100); }
If the vector isn't big enough to hold the new data, then expand the vector by half it's size. Int_t size = fTestQuantity.GetNrows(); if (fTestSampleSize > size) { fTestQuantity.ResizeTo(size + size/2); fTestSqError.ResizeTo(size + size/2); }
Store the value fTestQuantity(fTestSampleSize-1) = D; fTestSqError(fTestSampleSize-1) = (E == 0 ? D : E);
Store data point in internal vector If the vector isn't big enough to hold the new data, then expand the vector by half it's size size = fTestVariables.GetNrows(); if (fTestSampleSize * fNVariables > size) fTestVariables.ResizeTo(size + size/2);
Increment the data point counter Int_t i,j; for (i = 0; i < fNVariables; i++) { j = fNVariables * (fTestSampleSize - 1) + i; fTestVariables(j) = x[i];
if (x[i] > fMaxVariables(i)) Warning("AddTestRow", "variable %d (row: %d) too large: %f > %f", i, fTestSampleSize, x[i], fMaxVariables(i)); if (x[i] < fMinVariables(i)) Warning("AddTestRow", "variable %d (row: %d) too small: %f < %f", i, fTestSampleSize, x[i], fMinVariables(i)); } }
////////////////////////////////////////////////////////////////////////////// / Browse the TMultiDimFit object in the TBrowser.
void TMultiDimFit::Browse(TBrowser* b) { if (fHistograms) { TIter next(fHistograms); TH1* h = nullptr; while ((h = (TH1*)next())) b->Add(h,h->GetName()); } if (fVariables.IsValid()) b->Add(&fVariables, "Variables (Training)"); if (fQuantity.IsValid()) b->Add(&fQuantity, "Quantity (Training)"); if (fSqError.IsValid()) b->Add(&fSqError, "Error (Training)"); if (fMeanVariables.IsValid()) b->Add(&fMeanVariables, "Mean of Variables (Training)"); if (fMaxVariables.IsValid()) b->Add(&fMaxVariables, "Mean of Variables (Training)"); if (fMinVariables.IsValid()) b->Add(&fMinVariables, "Min of Variables (Training)"); if (fTestVariables.IsValid()) b->Add(&fTestVariables, "Variables (Test)"); if (fTestQuantity.IsValid()) b->Add(&fTestQuantity, "Quantity (Test)"); if (fTestSqError.IsValid()) b->Add(&fTestSqError, "Error (Test)"); if (fFunctions.IsValid()) b->Add(&fFunctions, "Functions"); if(fCoefficients.IsValid()) b->Add(&fCoefficients,"Coefficients"); if(fCoefficientsRMS.IsValid()) b->Add(&fCoefficientsRMS,"Coefficients Errors"); if (fOrthFunctions.IsValid()) b->Add(&fOrthFunctions, "Orthogonal Functions"); if (fOrthFunctionNorms.IsValid()) b->Add(&fOrthFunctionNorms, "Orthogonal Functions Norms"); if (fResiduals.IsValid()) b->Add(&fResiduals, "Residuals"); if(fOrthCoefficients.IsValid()) b->Add(&fOrthCoefficients,"Orthogonal Coefficients"); if (fOrthCurvatureMatrix.IsValid()) b->Add(&fOrthCurvatureMatrix,"Orthogonal curvature matrix"); if(fCorrelationMatrix.IsValid()) b->Add(&fCorrelationMatrix,"Correlation Matrix"); if (fFitter) b->Add(fFitter, fFitter->GetName()); }
////////////////////////////////////////////////////////////////////////////// / Clear internal structures and variables
void TMultiDimFit::Clear(Option_t *option) { Int_t i, j, n = fNVariables, m = fMaxFunctions;
Training sample, dependent quantity fQuantity.Zero(); fSqError.Zero(); fMeanQuantity = 0; fMaxQuantity = 0; fMinQuantity = 0; fSumSqQuantity = 0; fSumSqAvgQuantity = 0;
Training sample, independent variables fVariables.Zero(); fNVariables = 0; fSampleSize = 0; fMeanVariables.Zero(); fMaxVariables.Zero(); fMinVariables.Zero();
Test sample fTestQuantity.Zero(); fTestSqError.Zero(); fTestVariables.Zero(); fTestSampleSize = 0;
Functions fFunctions.Zero(); for (i = 0; i < fMaxTerms; i++) fPowerIndex[i] = 0; for (i = 0; i < fMaxTerms; i++) fFunctionCodes[i] = 0; fMaxFunctions = 0; fMaxStudy = 0; fOrthFunctions.Zero(); fOrthFunctionNorms.Zero();
Control parameters fMinRelativeError = 0; fMinAngle = 0; fMaxAngle = 0; fMaxTerms = 0;
Powers for (i = 0; i < n; i++) { fMaxPowers[i] = 0; fMaxPowersFinal[i] = 0; for (j = 0; j < m; j++) fPowers[i * n + j] = 0; } fPowerLimit = 0;
Residuals fMaxResidual = 0; fMinResidual = 0; fMaxResidualRow = 0; fMinResidualRow = 0; fSumSqResidual = 0;
Fit fNCoefficients = 0; fOrthCoefficients = 0; fOrthCurvatureMatrix = 0; fRMS = 0; fCorrelationMatrix.Zero(); fError = 0; fTestError = 0; fPrecision = 0; fTestPrecision = 0;
Coefficients fCoefficients.Zero(); fCoefficientsRMS.Zero(); fResiduals.Zero(); fHistograms->Clear(option);
Options fPolyType = kMonomials; fShowCorrelation = kFALSE; fIsUserFunction = kFALSE; }
////////////////////////////////////////////////////////////////////////////// / Evaluate parameterization at point x. Optional argument coeff is / a vector of coefficients for the parameterisation, fNCoefficients / elements long.
Double_t TMultiDimFit::Eval(const Double_t x, const Double_t coeff) const { Double_t returnValue = fMeanQuantity; Double_t term = 0; Int_t i, j;
for (i = 0; i < fNCoefficients; i++) { Evaluate the ith term in the expansion term = (coeff ? coeff[i] : fCoefficients(i)); for (j = 0; j < fNVariables; j++) { Evaluate the factor (polynomial) in the j-th variable. Int_t p = fPowers[fPowerIndex[i] * fNVariables + j]; Double_t y = 1 + 2. / (fMaxVariables(j) - fMinVariables(j)) (x[j] - fMaxVariables(j)); term *= EvalFactor(p,y); } Add this term to the final result returnValue += term; } return returnValue; }
////////////////////////////////////////////////////////////////////////////// / Evaluate parameterization error at point x. Optional argument coeff is / a vector of coefficients for the parameterisation, fNCoefficients / elements long.
Double_t TMultiDimFit::EvalError(const Double_t x, const Double_t coeff) const { Double_t returnValue = 0; Double_t term = 0; Int_t i, j;
for (i = 0; i < fNCoefficients; i++) { std::cout << "Error coef " << i << " -> " << fCoefficientsRMS(i) << std::endl; } for (i = 0; i < fNCoefficients; i++) { Evaluate the ith term in the expansion term = (coeff ? coeff[i] : fCoefficientsRMS(i)); for (j = 0; j < fNVariables; j++) { Evaluate the factor (polynomial) in the j-th variable. Int_t p = fPowers[fPowerIndex[i] * fNVariables + j]; Double_t y = 1 + 2. / (fMaxVariables(j) - fMinVariables(j)) (x[j] - fMaxVariables(j)); term *= EvalFactor(p,y); std::cout << "i,j " << i << ", " << j << " " << p << " " << y << " " << EvalFactor(p,y) << " " << term << std::endl; } Add this term to the final result returnValue += term*term; std::cout << " i = " << i << " value = " << returnValue << std::endl; } returnValue = sqrt(returnValue); return returnValue; }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Calculate the control parameter from the passed powers
Double_t TMultiDimFit::EvalControl(const Int_t *iv) const { Double_t s = 0; Double_t epsilon = 1e-6; // a small number for (Int_t i = 0; i < fNVariables; i++) { if (fMaxPowers[i] != 1) s += (epsilon + iv[i] - 1) / (epsilon + fMaxPowers[i] - 1); } return s; }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Evaluate function with power p at variable value x
Double_t TMultiDimFit::EvalFactor(Int_t p, Double_t x) const { Int_t i = 0; Double_t p1 = 1; Double_t p2 = 0; Double_t p3 = 0; Double_t r = 0;
switch(p) { case 1: r = 1; break; case 2: r = x; break; default: p2 = x; for (i = 3; i <= p; i++) { p3 = p2 * x; if (fPolyType == kLegendre) p3 = ((2 * i - 3) * p2 * x - (i - 2) * p1) / (i - 1); else if (fPolyType == kChebyshev) p3 = 2 * x * p2 - p1; p1 = p2; p2 = p3; } r = p3; }
return r; }
////////////////////////////////////////////////////////////////////////////// / Find the parameterization / / Options: / None so far / / For detailed description of what this entails, please refer to the / class description
void TMultiDimFit::FindParameterization(Option_t *) { MakeNormalized(); MakeCandidates(); MakeParameterization(); MakeCoefficients(); MakeCoefficientErrors(); MakeCorrelation(); }
////////////////////////////////////////////////////////////////////////////// / Try to fit the found parameterisation to the test sample. / / Options / M use Minuit to improve coefficients / / Also, refer to / class description
void TMultiDimFit::Fit(Option_t <em>option) { Int_t i, j; Double_t x = new Double_t[fNVariables]; Double_t sumSqD = 0; Double_t sumD = 0; Double_t sumSqR = 0; Double_t sumR = 0;
Calculate the residuals over the test sample for (i = 0; i < fTestSampleSize; i++) { for (j = 0; j < fNVariables; j++) x[j] = fTestVariables(i * fNVariables + j); Double_t res = fTestQuantity(i) - Eval(x); sumD += fTestQuantity(i); sumSqD += fTestQuantity(i) * fTestQuantity(i); sumR += res; sumSqR += res * res; if ( ((Bool_t)(((fHistogramMask) & (1ULL << (7)) ) != 0))) ((TH1D*)fHistograms->FindObject("res_test"))->Fill(res); } Double_t dAvg = sumSqD - (sumD * sumD) / fTestSampleSize; Double_t rAvg = sumSqR - (sumR * sumR) / fTestSampleSize; fTestCorrelationCoeff = (dAvg - rAvg) / dAvg; fTestError = sumSqR; fTestPrecision = sumSqR / sumSqD;
TString opt(option); opt.ToLower();
if (!opt.Contains("m")) MakeChi2();
if (fNCoefficients * 50 > fTestSampleSize) Warning("Fit", "test sample is very small");
if (!opt.Contains("m")) { Error("Fit", "invalid option"); delete [] x; return; }
fFitter = TVirtualFitter::Fitter(nullptr,fNCoefficients); if (!fFitter) { Error("Fit", "Cannot create Fitter"); delete [] x; return; } fFitter->SetFCN(mdfHelper);
const Int_t maxArgs = 16; Int_t args = 1; Double_t* arglist = new Double_t[maxArgs]; arglist[0] = -1; fFitter->ExecuteCommand("SET PRINT",arglist,args);
for (i = 0; i < fNCoefficients; i++) { Double_t startVal = fCoefficients(i); Double_t startErr = fCoefficientsRMS(i); fFitter->SetParameter(i, TString::Format("coeff%02d",i).Data(), startVal, startErr, 0, 0); }
arglist[0] = 0; args = 1; fFitter->ExecuteCommand("SET PRINT",arglist,args); fFitter->ExecuteCommand("MIGRAD",arglist,args);
for (i = 0; i < fNCoefficients; i++) { Double_t val = 0, err = 0, low = 0, high = 0;
use big enough string buffer to get variable name which is not used char namebuf[512]; fFitter->GetParameter(i, namebuf, val, err, low, high); (void) namebuf; fCoefficients(i) = val; fCoefficientsRMS(i) = err; } delete [] x; delete [] arglist; }
////////////////////////////////////////////////////////////////////////////// / Return the static instance.
TMultiDimFit* TMultiDimFit::Instance() { return fgInstance; }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Create list of candidate functions for the parameterisation. See / also / class description
void TMultiDimFit::MakeCandidates() { Int_t i = 0; Int_t j = 0; Int_t k = 0;
The temporary array to store the powers in. We don't need to initialize this array however. fMaxFuncNV = fNVariables * fMaxFunctions; Int_t *powers = new Int_t[fMaxFuncNV];
store of `control variables' Double_t* control = new Double_t[fMaxFunctions];
// We've better initialize the variables Int_t *iv = new Int_t[fNVariables]; for (i = 0; i < fNVariables; i++) iv[i] = 1;
if (!fIsUserFunction) {
// Number of funcs selected Int_t numberFunctions = 0;
while (kTRUE) { // Get the control value for this function Double_t s = EvalControl(iv);
if (s <= fPowerLimit) {
// Call over-loadable method Select, as to allow the user to // interfere with the selection of functions. if (Select(iv)) { numberFunctions++;
// If we've reached the user defined limit of how many // functions we can consider, break out of the loop if (numberFunctions > fMaxFunctions) break;
// Store the control value, so we can sort array of powers // later on control[numberFunctions-1] = Int_t(1.0e+6*s);
// Store the powers in powers array. for (i = 0; i < fNVariables; i++) { j = (numberFunctions - 1) * fNVariables + i; powers[j] = iv[i]; } } // if (Select()) } // if (s <= fPowerLimit)
for (i = 0; i < fNVariables; i++) if (iv[i] < fMaxPowers[i]) break;
// If all variables have reached their maximum power, then we // break out of the loop if (i == fNVariables) { fMaxFunctions = numberFunctions; break; }
// Next power in variable i if (i < fNVariables) iv[i]++;
for (j = 0; j < i; j++) iv[j] = 1; } // while (kTRUE) } else { // In case the user gave an explicit function for (i = 0; i < fMaxFunctions; i++) { // Copy the powers to working arrays for (j = 0; j < fNVariables; j++) { powers[i * fNVariables + j] = fPowers[i * fNVariables + j]; iv[j] = fPowers[i * fNVariables + j]; }
control[i] = Int_t(1.0e+6*EvalControl(iv)); } }
// Now we need to sort the powers according to least `control variable' Int_t *order = new Int_t[fMaxFunctions]; for (i = 0; i < fMaxFunctions; i++) order[i] = i; fMaxFuncNV = fMaxFunctions * fNVariables; fPowers = new Int_t[fMaxFuncNV];
for (i = 0; i < fMaxFunctions; i++) { Double_t x = control[i]; Int_t l = order[i]; k = i;
for (j = i; j < fMaxFunctions; j++) { if (control[j] <= x) { x = control[j]; l = order[j]; k = j; } }
if (k != i) { control[k] = control[i]; control[i] = x; order[k] = order[i]; order[i] = l; } }
for (i = 0; i < fMaxFunctions; i++) for (j = 0; j < fNVariables; j++) fPowers[i * fNVariables + j] = powers[order[i] * fNVariables + j];
delete [] control; delete [] powers; delete [] order; delete [] iv; }
////////////////////////////////////////////////////////////////////////////// / Calculate Chi square over either the test sample. The optional / argument coeff is a vector of coefficients to use in the / evaluation of the parameterisation. If coeff == 0, then the found / coefficients is used. / Used my MINUIT for fit (see TMultDimFit::Fit)
Double_t TMultiDimFit::MakeChi2(const Double_t* coeff) { fChi2 = 0; Int_t i, j; Double_t* x = new Double_t[fNVariables]; for (i = 0; i < fTestSampleSize; i++) { Get the stored point for (j = 0; j < fNVariables; j++) x[j] = fTestVariables(i * fNVariables + j);
Evaluate function. Scale to shifted values Double_t f = Eval(x,coeff);
Calculate contribution to Chic square fChi2 += 1. / TMath::Max(fTestSqError(i),1e-20) (fTestQuantity(i) - f) * (fTestQuantity(i) - f); }
Clean up delete [] x;
return fChi2; }
////////////////////////////////////////////////////////////////////////////// / Generate the file <filename> with .C appended if argument doesn't / end in .cxx or .C. The contains the implementation of the / function: / / Double_t <funcname>(Double_t *x) / / which does the same as TMultiDimFit::Eval. Please refer to this / method. / / Further, the static variables: / / Int_t gNVariables / Int_t gNCoefficients / Double_t gDMean / Double_t gXMean[] / Double_t gXMin[] / Double_t gXMax[] / Double_t gCoefficient[] / Int_t gPower[] / / are initialized. The only ROOT header file needed is Rtypes.h / / See TMultiDimFit::MakeRealCode for a list of options
void TMultiDimFit::MakeCode(const char* filename, Option_t *option) {
TString outName(filename); if (!outName.EndsWith(".C") && !outName.EndsWith(".cxx")) outName += ".C";
MakeRealCode(outName.Data(),"",option); }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Compute the errors on the coefficients. For this to be done, the / curvature matrix of the non-orthogonal functions, is computed.
void TMultiDimFit::MakeCoefficientErrors() { Int_t i = 0; Int_t j = 0; Int_t k = 0; TVectorD iF(fSampleSize); TVectorD jF(fSampleSize); fCoefficientsRMS.ResizeTo(fNCoefficients);
TMatrixDSym curvatureMatrix(fNCoefficients);
Build the curvature matrix for (i = 0; i < fNCoefficients; i++) { iF = TMatrixDRow(fFunctions,i); for (j = 0; j <= i; j++) { jF = TMatrixDRow(fFunctions,j); for (k = 0; k < fSampleSize; k++) curvatureMatrix(i,j) += 1 / TMath::Max(fSqError(k), 1e-20) * iF(k) * jF(k); curvatureMatrix(j,i) = curvatureMatrix(i,j); } }
Calculate Chi Square fChi2 = 0; for (i = 0; i < fSampleSize; i++) { Double_t f = 0; for (j = 0; j < fNCoefficients; j++) f += fCoefficients(j) * fFunctions(j,i); fChi2 += 1. / TMath::Max(fSqError(i),1e-20) * (fQuantity(i) - f) (fQuantity(i) - f); }
Invert the curvature matrix const TVectorD diag = TMatrixDDiag_const(curvatureMatrix); curvatureMatrix.NormByDiag(diag);
TDecompChol chol(curvatureMatrix); if (!chol.Decompose()) Error("MakeCoefficientErrors", "curvature matrix is singular"); chol.Invert(curvatureMatrix);
curvatureMatrix.NormByDiag(diag);
for (i = 0; i < fNCoefficients; i++) fCoefficientsRMS(i) = TMath::Sqrt(curvatureMatrix(i,i)); }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Invert the model matrix B, and compute final coefficients. For a / more thorough discussion of what this means, please refer to the / class description / / First we invert the lower triangle matrix fOrthCurvatureMatrix / and store the inverted matrix in the upper triangle.
void TMultiDimFit::MakeCoefficients() { Int_t i = 0, j = 0; Int_t col = 0, row = 0;
Invert the B matrix for (col = 1; col < fNCoefficients; col++) { for (row = col - 1; row > -1; row–) { fOrthCurvatureMatrix(row,col) = 0; for (i = row; i <= col ; i++) fOrthCurvatureMatrix(row,col) -= fOrthCurvatureMatrix(i,row) fOrthCurvatureMatrix(i,col); } }
Compute the final coefficients fCoefficients.ResizeTo(fNCoefficients);
for (i = 0; i < fNCoefficients; i++) { Double_t sum = 0; for (j = i; j < fNCoefficients; j++) sum += fOrthCurvatureMatrix(i,j) * fOrthCoefficients(j); fCoefficients(i) = sum; }
Compute the final residuals fResiduals.ResizeTo(fSampleSize); for (i = 0; i < fSampleSize; i++) fResiduals(i) = fQuantity(i);
for (i = 0; i < fNCoefficients; i++) for (j = 0; j < fSampleSize; j++) fResiduals(j) -= fCoefficients(i) * fFunctions(i,j);
Compute the max and minimum, and squared sum of the evaluated residuals fMinResidual = 10e10; fMaxResidual = -10e10; Double_t sqRes = 0; for (i = 0; i < fSampleSize; i++){ sqRes += fResiduals(i) * fResiduals(i); if (fResiduals(i) <= fMinResidual) { fMinResidual = fResiduals(i); fMinResidualRow = i; } if (fResiduals(i) >= fMaxResidual) { fMaxResidual = fResiduals(i); fMaxResidualRow = i; } }
fCorrelationCoeff = fSumSqResidual / fSumSqAvgQuantity; fPrecision = TMath::Sqrt(sqRes / fSumSqQuantity);
If we use histograms, fill some more if ( ((Bool_t)(((fHistogramMask) & (1ULL << (5)) ) != 0))|| ((Bool_t)(((fHistogramMask) & (1ULL << (6)) ) != 0))|| ((Bool_t)(((fHistogramMask) & (1ULL << (4)) ) != 0))) { for (i = 0; i < fSampleSize; i++) { if ( ((Bool_t)(((fHistogramMask) & (1ULL << (5)) ) != 0))) ((TH2D*)fHistograms->FindObject("res_d"))->Fill(fQuantity(i), fResiduals(i)); if ( ((Bool_t)(((fHistogramMask) & (1ULL << (6)) ) != 0))) ((TH1D*)fHistograms->FindObject("res_train"))->Fill(fResiduals(i));
if ( ((Bool_t)(((fHistogramMask) & (1ULL << (4)) ) != 0))) for (j = 0; j < fNVariables; j++) ((TH2D*)fHistograms->FindObject(TString::Format("res_x_%d",j))) ->Fill(fVariables(i * fNVariables + j),fResiduals(i)); } } // If histograms
}
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Compute the correlation matrix
void TMultiDimFit::MakeCorrelation() { if (!fShowCorrelation) return;
fCorrelationMatrix.ResizeTo(fNVariables,fNVariables+1);
Double_t d2 = 0; Double_t ddotXi = 0; // G.Q. needs to be reinitialized in the loop over i fNVariables Double_t xiNorm = 0; // G.Q. needs to be reinitialized in the loop over i fNVariables Double_t xidotXj = 0; // G.Q. needs to be reinitialized in the loop over j fNVariables Double_t xjNorm = 0; // G.Q. needs to be reinitialized in the loop over j fNVariables
Int_t i, j, k, l, m; // G.Q. added m variable for (i = 0; i < fSampleSize; i++) d2 += fQuantity(i) * fQuantity(i);
for (i = 0; i < fNVariables; i++) { ddotXi = 0.; // G.Q. reinitialisation xiNorm = 0.; // G.Q. reinitialisation for (j = 0; j< fSampleSize; j++) { Index of sample j of variable i k = j * fNVariables + i; ddotXi += fQuantity(j) * (fVariables(k) - fMeanVariables(i)); xiNorm += (fVariables(k) - fMeanVariables(i)) (fVariables(k) - fMeanVariables(i)); } fCorrelationMatrix(i,0) = ddotXi / TMath::Sqrt(d2 * xiNorm);
for (j = 0; j < i; j++) { xidotXj = 0.; // G.Q. reinitialisation xjNorm = 0.; // G.Q. reinitialisation for (k = 0; k < fSampleSize; k++) { Index of sample j of variable i l = j * fNVariables + k; // G.Q. l = k * fNVariables + j; // G.Q. m = k * fNVariables + i; // G.Q. G.Q. xidotXj += (fVariables(i) - fMeanVariables(i)) G.Q. * (fVariables(l) - fMeanVariables(j)); xidotXj += (fVariables(m) - fMeanVariables(i)) (fVariables(l) - fMeanVariables(j)); // G.Q. modified index for Xi xjNorm += (fVariables(l) - fMeanVariables(j)) (fVariables(l) - fMeanVariables(j)); } fCorrelationMatrix(i+1,j) = xidotXj / TMath::Sqrt(xiNorm * xjNorm); fCorrelationMatrix(i,j+1) = xidotXj / TMath::Sqrt(xiNorm * xjNorm); } } }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Make Gram-Schmidt orthogonalisation. The class description gives / a thorough account of this algorithm, as well as / references. Please refer to the / class description
Double_t TMultiDimFit::MakeGramSchmidt(Int_t function) {
calculate w_i, that is, evaluate the current function at data point i Double_t f2 = 0; fOrthCoefficients(fNCoefficients) = 0; fOrthFunctionNorms(fNCoefficients) = 0; Int_t j = 0; Int_t k = 0;
for (j = 0; j < fSampleSize; j++) { fFunctions(fNCoefficients, j) = 1; fOrthFunctions(fNCoefficients, j) = 0; First, however, we need to calculate f_fNCoefficients for (k = 0; k < fNVariables; k++) { Int_t p = fPowers[function * fNVariables + k]; Double_t x = fVariables(j * fNVariables + k); fFunctions(fNCoefficients, j) *= EvalFactor(p,x); }
Calculate f dot f in f2 f2 += fFunctions(fNCoefficients,j) * fFunctions(fNCoefficients,j); Assign to w_fNCoefficients f_fNCoefficients fOrthFunctions(fNCoefficients, j) = fFunctions(fNCoefficients, j); }
the first column of w is equal to f for (j = 0; j < fNCoefficients; j++) { Double_t fdw = 0; Calculate (f_fNCoefficients dot w_j) / w_j^2 for (k = 0; k < fSampleSize; k++) { fdw += fFunctions(fNCoefficients, k) * fOrthFunctions(j,k) / fOrthFunctionNorms(j); }
fOrthCurvatureMatrix(fNCoefficients,j) = fdw; and subtract it from the current value of w_ij for (k = 0; k < fSampleSize; k++) fOrthFunctions(fNCoefficients,k) -= fdw * fOrthFunctions(j,k); }
for (j = 0; j < fSampleSize; j++) { calculate squared length of w_fNCoefficients fOrthFunctionNorms(fNCoefficients) += fOrthFunctions(fNCoefficients,j) fOrthFunctions(fNCoefficients,j);
calculate D dot w_fNCoefficients in A fOrthCoefficients(fNCoefficients) += fQuantity(j) fOrthFunctions(fNCoefficients, j); }
First test, but only if didn't user specify if (!fIsUserFunction) if (TMath::Sqrt(fOrthFunctionNorms(fNCoefficients) / (f2 + 1e-10)) < TMath::Sin(fMinAngle* (TMath::Pi() / 180.) )) return 0;
The result found by this code for the first residual is always much less then the one found be MUDIFI. That's because it's supposed to be. The cause is the improved precision of Double_t over DOUBLE PRECISION! fOrthCurvatureMatrix(fNCoefficients,fNCoefficients) = 1; Double_t b = fOrthCoefficients(fNCoefficients); fOrthCoefficients(fNCoefficients) /= fOrthFunctionNorms(fNCoefficients);
Calculate the residual from including this fNCoefficients. Double_t dResidur = fOrthCoefficients(fNCoefficients) * b;
return dResidur; }
////////////////////////////////////////////////////////////////////////////// / Make histograms of the result of the analysis. This message / should be sent after having read all data points, but before / finding the parameterization / / Options: / A All the below / X Original independent variables / D Original dependent variables / N Normalised independent variables / S Shifted dependent variables / R1 Residuals versus normalised independent variables / R2 Residuals versus dependent variable / R3 Residuals computed on training sample / R4 Residuals computed on test sample / / For a description of these quantities, refer to / class description
void TMultiDimFit::MakeHistograms(Option_t *option) { TString opt(option); opt.ToLower();
if (opt.Length() < 1) return;
if (!fHistograms) fHistograms = new TList;
Counter variable Int_t i = 0;
Histogram of original variables if (opt.Contains("x") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (0)) ); for (i = 0; i < fNVariables; i++) if (!fHistograms->FindObject(TString::Format("x_%d_orig",i))) fHistograms->Add(new TH1D(TString::Format("x_%d_orig",i), TString::Format("Original variable # %d",i), fBinVarX, fMinVariables(i), fMaxVariables(i))); }
Histogram of original dependent variable if (opt.Contains("d") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (1)) ); if (!fHistograms->FindObject("d_orig")) fHistograms->Add(new TH1D("d_orig", "Original Quantity", fBinVarX, fMinQuantity, fMaxQuantity)); }
Histograms of normalized variables if (opt.Contains("n") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (2)) ); for (i = 0; i < fNVariables; i++) if (!fHistograms->FindObject(TString::Format("x_%d_norm",i))) fHistograms->Add(new TH1D(TString::Format("x_%d_norm",i), TString::Format("Normalized variable # %d",i), fBinVarX, -1,1)); }
Histogram of shifted dependent variable if (opt.Contains("s") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (3)) ); if (!fHistograms->FindObject("d_shifted")) fHistograms->Add(new TH1D("d_shifted", "Shifted Quantity", fBinVarX, fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity)); }
Residual from training sample versus independent variables if (opt.Contains("r1") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (4)) ); for (i = 0; i < fNVariables; i++) if (!fHistograms->FindObject(TString::Format("res_x_%d",i))) fHistograms->Add(new TH2D(TString::Format("res_x_%d",i), TString::Format("Computed residual versus x_%d", i), fBinVarX, -1, 1, fBinVarY, fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity)); }
Residual from training sample versus. dependent variable if (opt.Contains("r2") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (5)) ); if (!fHistograms->FindObject("res_d")) fHistograms->Add(new TH2D("res_d", "Computed residuals vs Quantity", fBinVarX, fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity, fBinVarY, fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity)); }
Residual from training sample if (opt.Contains("r3") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (6)) ); if (!fHistograms->FindObject("res_train")) fHistograms->Add(new TH1D("res_train", "Computed residuals over training sample", fBinVarX, fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity));
} if (opt.Contains("r4") || opt.Contains("a")) { ((fHistogramMask) |= (1ULL << (7)) ); if (!fHistograms->FindObject("res_test")) fHistograms->Add(new TH1D("res_test", "Distribution of residuals from test", fBinVarX,fMinQuantity - fMeanQuantity, fMaxQuantity - fMeanQuantity)); } }
////////////////////////////////////////////////////////////////////////////// / Generate the file <classname>MDF.cxx which contains the / implementation of the method: / / Double_t <classname>::MDF(Double_t *x) / / which does the same as TMultiDimFit::Eval. Please refer to this / method. / / Further, the public static members: /
/ / are initialized, and assumed to exist. The class declaration is / assumed to be in <classname>.h and assumed to be provided by the / user. / /
void TMultiDimFit::MakeMethod(const Char_t* classname, Option_t* option) { MakeRealCode(TString::Format("%sMDF.cxx", classname), classname, option); }
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Normalize data to the interval [-1;1]. This is needed for the / classes method to work.
void TMultiDimFit::MakeNormalized() { Int_t i = 0; Int_t j = 0; Int_t k = 0;
for (i = 0; i < fSampleSize; i++) { if ( ((Bool_t)(((fHistogramMask) & (1ULL << (1)) ) != 0))) ((TH1D*)fHistograms->FindObject("d_orig"))->Fill(fQuantity(i));
fQuantity(i) -= fMeanQuantity; fSumSqAvgQuantity += fQuantity(i) * fQuantity(i);
if ( ((Bool_t)(((fHistogramMask) & (1ULL << (3)) ) != 0))) ((TH1D*)fHistograms->FindObject("d_shifted"))->Fill(fQuantity(i));
for (j = 0; j < fNVariables; j++) { Double_t range = 1. / (fMaxVariables(j) - fMinVariables(j)); k = i * fNVariables + j;
Fill histograms of original independent variables if ( ((Bool_t)(((fHistogramMask) & (1ULL << (0)) ) != 0))) ((TH1D*)fHistograms->FindObject(TString::Format("x_%d_orig",j))) ->Fill(fVariables(k));
Normalise independent variables fVariables(k) = 1 + 2 * range * (fVariables(k) - fMaxVariables(j));
Fill histograms of normalised independent variables if ( ((Bool_t)(((fHistogramMask) & (1ULL << (2)) ) != 0))) ((TH1D*)fHistograms->FindObject(TString::Format("x_%d_norm",j))) ->Fill(fVariables(k));
} } Shift min and max of dependent variable fMaxQuantity -= fMeanQuantity; fMinQuantity -= fMeanQuantity;
Shift mean of independent variables for (i = 0; i < fNVariables; i++) { Double_t range = 1. / (fMaxVariables(i) - fMinVariables(i)); fMeanVariables(i) = 1 + 2 * range * (fMeanVariables(i)
////////////////////////////////////////////////////////////////////////////// / PRIVATE METHOD: / Find the parameterization over the training sample. A full account / of the algorithm is given in the / class description
void TMultiDimFit::MakeParameterization() { Int_t i = -1; Int_t j = 0; Int_t k = 0; Int_t maxPass = 3; Int_t studied = 0; Double_t squareResidual = fSumSqAvgQuantity; fNCoefficients = 0; fSumSqResidual = fSumSqAvgQuantity; fFunctions.ResizeTo(fMaxTerms,fSampleSize); fOrthFunctions.ResizeTo(fMaxTerms,fSampleSize); fOrthFunctionNorms.ResizeTo(fMaxTerms); fOrthCoefficients.ResizeTo(fMaxTerms); fOrthCurvatureMatrix.ResizeTo(fMaxTerms,fMaxTerms); fFunctions = 1;
fFunctionCodes = new Int_t[fMaxFunctions]; fPowerIndex = new Int_t[fMaxTerms]; Int_t l; for (l=0;l<fMaxFunctions;l++) fFunctionCodes[l] = 0; for (l=0;l<fMaxTerms;l++) fPowerIndex[l] = 0;
if (fMaxAngle != 0) maxPass = 100; if (fIsUserFunction) maxPass = 1;
Loop over the number of functions we want to study. increment inspection counter while(kTRUE) {
Reach user defined limit of studies if (studied++ >= fMaxStudy) { fParameterisationCode = 1 ; break; }
Considered all functions several times if (k >= maxPass) { fParameterisationCode = 2 ; break; }
increment function counter i++;
If we've reached the end of the functions, restart pass if (i == fMaxFunctions) { if (fMaxAngle != 0) fMaxAngle += (90 - fMaxAngle) / 2; i = 0; studied–; k++; continue; } if (studied == 1) fFunctionCodes[i] = 0; else if (fFunctionCodes[i] >= 2) continue;
Print a happy message if (fIsVerbose && studied == 1) std::cout << "Coeff SumSqRes Contrib Angle QM Func" << " Value W^2 Powers" << std::endl;
Make the Gram-Schmidt Double_t dResidur = MakeGramSchmidt(i);
if (dResidur == 0) { This function is no good! First test is in MakeGramSchmidt fFunctionCodes[i] = 1; continue; }
If user specified function, assume they know what they are doing if (!fIsUserFunction) { Flag this function as considered fFunctionCodes[i] = 2;
Test if this function contributes to the fit if (!TestFunction(squareResidual, dResidur)) { fFunctionCodes[i] = 1; continue; } }
If we get to here, the function currently considered is fNCoefficients, so we increment the counter Flag this function as OK, and store and the number in the index. fFunctionCodes[i] = 3; fPowerIndex[fNCoefficients] = i; fNCoefficients++;
We add the current contribution to the sum of square of residuals; squareResidual -= dResidur;
Calculate control parameter from this function for (j = 0; j < fNVariables; j++) { if (fNCoefficients == 1 || fMaxPowersFinal[j] <= fPowers[i * fNVariables + j] - 1) fMaxPowersFinal[j] = fPowers[i * fNVariables + j] - 1; } Double_t s = EvalControl(&fPowers[i * fNVariables]);
Print the statistics about this function if (fIsVerbose) { std::cout << std::setw(5) << fNCoefficients << " " << std::setw(10) << std::setprecision(4) << squareResidual << " " << std::setw(10) << std::setprecision(4) << dResidur << " " << std::setw(7) << std::setprecision(3) << fMaxAngle << " " << std::setw(7) << std::setprecision(3) << s << " " << std::setw(5) << i << " " << std::setw(10) << std::setprecision(4) << fOrthCoefficients(fNCoefficients-1) << " " << std::setw(10) << std::setprecision(4) << fOrthFunctionNorms(fNCoefficients-1) << " " << std::flush; for (j = 0; j < fNVariables; j++) std::cout << " " << fPowers[i * fNVariables + j] - 1 << std::flush; std::cout << std::endl; }
if (fNCoefficients >= fMaxTerms /* && fIsVerbose
Definition at line 15 of file TMultiDimFit.h.
Public Types | |
| enum | { kSingleKey = (1ULL << (0)) , kOverwrite = (1ULL << (1)) , kWriteDelete = (1ULL << (2)) } |
| enum | { kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 , kBitMask = 0x00ffffff } |
| enum | EDeprecatedStatusBits { kObjInCanvas = (1ULL << (3)) } |
| enum | EMDFPolyType { kMonomials , kChebyshev , kLegendre } |
| enum | EStatusBits { kCanDelete = (1ULL << (0)) , kMustCleanup = (1ULL << (3)) , kIsReferenced = (1ULL << (4)) , kHasUUID = (1ULL << (5)) , kCannotPick = (1ULL << (6)) , kNoContextMenu = (1ULL << (8)) , kInvalidObject = (1ULL << (13)) } |
Public Member Functions | |
| TMultiDimFit () | |
| TMultiDimFit (Int_t dimension, EMDFPolyType type=kMonomials, Option_t *option="") | |
| ~TMultiDimFit () override | |
| void | AbstractMethod (const char *method) const |
| Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it. | |
| virtual void | AddRow (const Double_t *x, Double_t D, Double_t E=0) |
| virtual void | AddTestRow (const Double_t *x, Double_t D, Double_t E=0) |
| virtual void | AppendPad (Option_t *option="") |
| Append graphics object to current pad. | |
| void | Browse (TBrowser *b) override |
| Browse object. May be overridden for another default action. | |
| ULong_t | CheckedHash () |
| Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. | |
| virtual const char * | ClassName () const |
| Returns name of class to which the object belongs. | |
| void | Clear (Option_t *option="") override |
| TObject * | Clone (const char *newname="") const override |
| Make a clone of an object using the Streamer facility. | |
| Int_t | Compare (const TObject *obj) const override |
| Compare two TNamed objects. | |
| void | Copy (TObject &named) const override |
| Copy this to obj. | |
| virtual void | Delete (Option_t *option="") |
| Delete this object. | |
| virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
| Computes distance from point (px,py) to the object. | |
| void | Draw (Option_t *="d") override |
| Default Draw method for all objects. | |
| virtual void | DrawClass () const |
| Draw class inheritance tree of the class to which this object belongs. | |
| virtual TObject * | DrawClone (Option_t *option="") const |
| Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1). | |
| virtual void | Dump () const |
| Dump contents of object on stdout. | |
| virtual void | Error (const char *method, const char *msgfmt,...) const |
| Issue error message. | |
| virtual Double_t | Eval (const Double_t *x, const Double_t *coeff=nullptr) const |
| virtual Double_t | EvalError (const Double_t *x, const Double_t *coeff=nullptr) const |
| virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
| Execute method on this object with the given parameter string, e.g. | |
| virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
| Execute method on this object with parameters stored in the TObjArray. | |
| virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
| Execute action corresponding to an event at (px,py). | |
| virtual void | Fatal (const char *method, const char *msgfmt,...) const |
| Issue fatal error message. | |
| virtual void | FillBuffer (char *&buffer) |
| Encode TNamed into output buffer. | |
| virtual TObject * | FindObject (const char *name) const |
| Must be redefined in derived classes. | |
| virtual TObject * | FindObject (const TObject *obj) const |
| Must be redefined in derived classes. | |
| virtual void | FindParameterization (Option_t *option="") |
| virtual void | Fit (Option_t *option="") |
| Double_t | GetChi2 () const |
| const TVectorD * | GetCoefficients () const |
| const TVectorD * | GetCoefficientsRMS () const |
| const TMatrixD * | GetCorrelationMatrix () const |
| virtual Option_t * | GetDrawOption () const |
| Get option used by the graphics system to draw this object. | |
| Double_t | GetError () const |
| Int_t * | GetFunctionCodes () const |
| const TMatrixD * | GetFunctions () const |
| virtual TList * | GetHistograms () const |
| virtual const char * | GetIconName () const |
| Returns mime type name of object. | |
| Double_t | GetMaxAngle () const |
| Int_t | GetMaxFunctions () const |
| Int_t * | GetMaxPowers () const |
| Double_t | GetMaxQuantity () const |
| Int_t | GetMaxStudy () const |
| Int_t | GetMaxTerms () const |
| const TVectorD * | GetMaxVariables () const |
| Double_t | GetMeanQuantity () const |
| const TVectorD * | GetMeanVariables () const |
| Double_t | GetMinAngle () const |
| Double_t | GetMinQuantity () const |
| Double_t | GetMinRelativeError () const |
| const TVectorD * | GetMinVariables () const |
| const char * | GetName () const override |
| Returns name of object. | |
| Int_t | GetNCoefficients () const |
| Int_t | GetNVariables () const |
| virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
| Returns string containing info about the object at position (px,py). | |
| virtual Option_t * | GetOption () const |
| Int_t | GetPolyType () const |
| Int_t * | GetPowerIndex () const |
| Double_t | GetPowerLimit () const |
| const Int_t * | GetPowers () const |
| Double_t | GetPrecision () const |
| const TVectorD * | GetQuantity () const |
| Double_t | GetResidualMax () const |
| Int_t | GetResidualMaxRow () const |
| Double_t | GetResidualMin () const |
| Int_t | GetResidualMinRow () const |
| Double_t | GetResidualSumSq () const |
| Double_t | GetRMS () const |
| Int_t | GetSampleSize () const |
| const TVectorD * | GetSqError () const |
| Double_t | GetSumSqAvgQuantity () const |
| Double_t | GetSumSqQuantity () const |
| Double_t | GetTestError () const |
| Double_t | GetTestPrecision () const |
| const TVectorD * | GetTestQuantity () const |
| Int_t | GetTestSampleSize () const |
| const TVectorD * | GetTestSqError () const |
| const TVectorD * | GetTestVariables () const |
| const char * | GetTitle () const override |
| Returns title of object. | |
| virtual UInt_t | GetUniqueID () const |
| Return the unique object id. | |
| const TVectorD * | GetVariables () const |
| virtual Bool_t | HandleTimer (TTimer *timer) |
| Execute action in response of a timer timing out. | |
| ULong_t | Hash () const override |
| Return hash value for this object. | |
| Bool_t | HasInconsistentHash () const |
| Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. | |
| virtual void | Info (const char *method, const char *msgfmt,...) const |
| Issue info message. | |
| virtual Bool_t | InheritsFrom (const char *classname) const |
| Returns kTRUE if object inherits from class "classname". | |
| virtual Bool_t | InheritsFrom (const TClass *cl) const |
| Returns kTRUE if object inherits from TClass cl. | |
| virtual void | Inspect () const |
| Dump contents of this object in a graphics canvas. | |
| void | InvertBit (UInt_t f) |
| TClass * | IsA () const override |
| Bool_t | IsDestructed () const |
| IsDestructed. | |
| virtual Bool_t | IsEqual (const TObject *obj) const |
| Default equal comparison (objects are equal if they have the same address in memory). | |
| Bool_t | IsFolder () const override |
| Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). | |
| Bool_t | IsOnHeap () const |
| Bool_t | IsSortable () const override |
| Bool_t | IsZombie () const |
| void | ls (Option_t *option="") const override |
| List TNamed name and title. | |
| virtual Double_t | MakeChi2 (const Double_t *coeff=nullptr) |
| virtual void | MakeCode (const char *functionName="MDF", Option_t *option="") |
| virtual void | MakeHistograms (Option_t *option="A") |
| virtual void | MakeMethod (const Char_t *className="MDF", Option_t *option="") |
| void | MayNotUse (const char *method) const |
| Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). | |
| virtual Bool_t | Notify () |
| This method must be overridden to handle object notification (the base implementation is no-op). | |
| void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
| Use this method to declare a method obsolete. | |
| void | operator delete (void *, size_t) |
| Operator delete for sized deallocation. | |
| void | operator delete (void *ptr) |
| Operator delete. | |
| void | operator delete (void *ptr, void *vp) |
| Only called by placement new when throwing an exception. | |
| void | operator delete[] (void *, size_t) |
| Operator delete [] for sized deallocation. | |
| void | operator delete[] (void *ptr) |
| Operator delete []. | |
| void | operator delete[] (void *ptr, void *vp) |
| Only called by placement new[] when throwing an exception. | |
| void * | operator new (size_t sz) |
| void * | operator new (size_t sz, void *vp) |
| void * | operator new[] (size_t sz) |
| void * | operator new[] (size_t sz, void *vp) |
| virtual void | Paint (Option_t *option="") |
| This method must be overridden if a class wants to paint itself. | |
| virtual void | Pop () |
| Pop on object drawn in a pad to the top of the display list. | |
| void | Print (Option_t *option="ps") const override |
| Print statistics etc. Options are P Parameters S Statistics C Coefficients R Result of parameterisation F Result of fit K Correlation Matrix M Pretty print formula. | |
| virtual Int_t | Read (const char *name) |
| Read contents of object with specified name from the current directory. | |
| virtual void | RecursiveRemove (TObject *obj) |
| Recursively remove this object from a list. | |
| void | ResetBit (UInt_t f) |
| virtual void | SaveAs (const char *filename="", Option_t *option="") const |
| Save this object in the file specified by filename. | |
| virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
| Save a primitive as a C++ statement(s) on output stream "out". | |
| void | SetBinVarX (Int_t nbbinvarx) |
| void | SetBinVarY (Int_t nbbinvary) |
| void | SetBit (UInt_t f) |
| void | SetBit (UInt_t f, Bool_t set) |
| Set or unset the user status bits as specified in f. | |
| virtual void | SetDrawOption (Option_t *option="") |
| Set drawing option for object. | |
| void | SetMaxAngle (Double_t angle=0) |
| Set the max angle (in degrees) between the initial data vector to be fitted, and the new candidate function to be included in the fit. By default it is 0, which automatically chooses another selection criteria. See also class description. | |
| void | SetMaxFunctions (Int_t n) |
| void | SetMaxPowers (const Int_t *powers) |
| Set the maximum power to be considered in the fit for each variable. See also class description. | |
| void | SetMaxStudy (Int_t n) |
| void | SetMaxTerms (Int_t terms) |
| void | SetMinAngle (Double_t angle=1) |
| Set the min angle (in degrees) between a new candidate function and the subspace spanned by the previously accepted functions. See also class description. | |
| void | SetMinRelativeError (Double_t error) |
| Set the acceptable relative error for when sum of square residuals is considered minimized. For a full account, refer to the class description. | |
| virtual void | SetName (const char *name) |
| Set the name of the TNamed. | |
| virtual void | SetNameTitle (const char *name, const char *title) |
| Set all the TNamed parameters (name and title). | |
| void | SetPowerLimit (Double_t limit=1e-3) |
| Set the user parameter for the function selection. The bigger the limit, the more functions are used. The meaning of this variable is defined in the class description. | |
| virtual void | SetPowers (const Int_t *powers, Int_t terms) |
| Define a user function. The input array must be of the form (p11, ..., p1N, ... ,pL1, ..., pLN) Where N is the dimension of the data sample, L is the number of terms (given in terms) and the first number, labels the term, the second the variable. More information is given in the class description. | |
| virtual void | SetTitle (const char *title="") |
| Set the title of the TNamed. | |
| virtual void | SetUniqueID (UInt_t uid) |
| Set the unique object id. | |
| virtual Int_t | Sizeof () const |
| Return size of the TNamed part of the TObject. | |
| void | Streamer (TBuffer &) override |
| Stream an object of class TObject. | |
| void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
| virtual void | SysError (const char *method, const char *msgfmt,...) const |
| Issue system error message. | |
| Bool_t | TestBit (UInt_t f) const |
| Int_t | TestBits (UInt_t f) const |
| virtual void | UseCurrentStyle () |
| Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. | |
| virtual void | Warning (const char *method, const char *msgfmt,...) const |
| Issue warning message. | |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
| Write this object to the current directory. | |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
| Write this object to the current directory. | |
Static Public Member Functions | |
| static TClass * | Class () |
| static const char * | Class_Name () |
| static constexpr Version_t | Class_Version () |
| static const char * | DeclFileName () |
| static Longptr_t | GetDtorOnly () |
| Return destructor only flag. | |
| static Bool_t | GetObjectStat () |
| Get status of object stat flag. | |
| static TMultiDimFit * | Instance () |
| static void | SetDtorOnly (void *obj) |
| Set destructor only flag. | |
| static void | SetObjectStat (Bool_t stat) |
| Turn on/off tracking of objects in the TObjectTable. | |
Protected Types | |
| enum | { kOnlyPrepStep = (1ULL << (3)) } |
Protected Member Functions | |
| virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
| Interface to ErrorHandler (protected). | |
| virtual Double_t | EvalControl (const Int_t *powers) const |
| virtual Double_t | EvalFactor (Int_t p, Double_t x) const |
| virtual void | MakeCandidates () |
| virtual void | MakeCoefficientErrors () |
| virtual void | MakeCoefficients () |
| virtual void | MakeCorrelation () |
| virtual Double_t | MakeGramSchmidt (Int_t function) |
| virtual void | MakeNormalized () |
| virtual void | MakeParameterization () |
| 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 parameterization on some point. It's called by TMultiDimFit::MakeCode and TMultiDimFit::MakeMethod. | |
| void | MakeZombie () |
| void | SavePrimitiveNameTitle (std::ostream &out, const char *variable_name) |
| Save object name and title into the output stream "out". | |
| virtual Bool_t | Select (const Int_t *iv) |
| Selection method. User can override this method for specialized selection of acceptable functions in fit. Default is to select all. This message is sent during the build-up of the function candidates table once for each set of powers in variables. Notice, that the argument array contains the powers PLUS ONE. For example, to De select the function f = x1^2 * x2^4 * x3^5, this method should return kFALSE if given the argument { 3, 4, 6 }. | |
| virtual Bool_t | TestFunction (Double_t squareResidual, Double_t dResidur) |
| PRIVATE METHOD: Test whether the currently considered function contributes to the fit. See also class description. | |
Static Protected Member Functions | |
| static void | SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE) |
| Save object constructor in the output stream "out". | |
| static void | SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr) |
| Save invocation of primitive Draw() method Skipped if option contains "nodraw" string. | |
| static TString | SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0) |
| Save array in the output stream "out" as vector. | |
Protected Attributes | |
| Int_t | fBinVarX |
| Number of bin in independent variables. | |
| Int_t | fBinVarY |
| Number of bin in dependent variables. | |
| Double_t | fChi2 |
| Chi square of fit. | |
| TVectorD | fCoefficients |
| Vector of the final coefficients. | |
| TVectorD | fCoefficientsRMS |
| Vector of RMS of coefficients. | |
| Double_t | fCorrelationCoeff |
| Multi Correlation coefficient. | |
| TMatrixD | fCorrelationMatrix |
| Correlation matrix. | |
| Double_t | fError |
| Error from parametrization. | |
| TVirtualFitter * | fFitter |
| ! Fit object (MINUIT) | |
| Int_t * | fFunctionCodes |
| [fMaxFunctions] acceptance code | |
| TMatrixD | fFunctions |
| Functions evaluated over sample. | |
| Byte_t | fHistogramMask |
| Bit pattern of histograms used. | |
| TList * | fHistograms |
| List of histograms. | |
| Bool_t | fIsUserFunction |
| Flag for user defined function. | |
| Bool_t | fIsVerbose |
| Double_t | fMaxAngle |
| Max angle for accepting new function. | |
| Int_t | fMaxFuncNV |
| fMaxFunctions*fNVariables | |
| Int_t | fMaxFunctions |
| max number of functions | |
| Int_t * | fMaxPowers |
| [fNVariables] maximum powers | |
| Int_t * | fMaxPowersFinal |
| [fNVariables] maximum powers from fit; | |
| Double_t | fMaxQuantity |
| Max value of dependent quantity. | |
| Double_t | fMaxResidual |
| Max residual value. | |
| Int_t | fMaxResidualRow |
| Row giving max residual. | |
| Int_t | fMaxStudy |
| max functions to study | |
| Int_t | fMaxTerms |
| Max terms expected in final expr. | |
| TVectorD | fMaxVariables |
| max value of independent variables | |
| Double_t | fMeanQuantity |
| Mean of dependent quantity. | |
| TVectorD | fMeanVariables |
| mean value of independent variables | |
| Double_t | fMinAngle |
| Min angle for accepting new function. | |
| Double_t | fMinQuantity |
| Min value of dependent quantity. | |
| Double_t | fMinRelativeError |
| Min relative error accepted. | |
| Double_t | fMinResidual |
| Min residual value. | |
| Int_t | fMinResidualRow |
| Row giving min residual. | |
| TVectorD | fMinVariables |
| min value of independent variables | |
| TString | fName |
| Int_t | fNCoefficients |
| Dimension of model coefficients. | |
| Int_t | fNVariables |
| Number of independent variables. | |
| TVectorD | fOrthCoefficients |
| The model coefficients. | |
| TMatrixD | fOrthCurvatureMatrix |
| Model matrix. | |
| TVectorD | fOrthFunctionNorms |
| Norm of the evaluated functions. | |
| TMatrixD | fOrthFunctions |
| As above, but orthogonalised. | |
| Int_t | fParameterisationCode |
| Exit code of parameterisation. | |
| EMDFPolyType | fPolyType |
| Type of polynomials to use. | |
| Int_t * | fPowerIndex |
| [fMaxTerms] Index of accepted powers | |
| Double_t | fPowerLimit |
| Control parameter. | |
| Int_t * | fPowers |
| [fMaxFuncNV] where fMaxFuncNV = fMaxFunctions*fNVariables | |
| Double_t | fPrecision |
| Relative precision of param. | |
| TVectorD | fQuantity |
| Training sample, dependent quantity. | |
| TVectorD | fResiduals |
| Vector of the final residuals. | |
| Double_t | fRMS |
| Root mean square of fit. | |
| Int_t | fSampleSize |
| Size of training sample. | |
| Bool_t | fShowCorrelation |
| print correlation matrix | |
| TVectorD | fSqError |
| Training sample, error in quantity. | |
| Double_t | fSumSqAvgQuantity |
| Sum of squares away from mean. | |
| Double_t | fSumSqQuantity |
| SumSquare of dependent quantity. | |
| Double_t | fSumSqResidual |
| Sum of Square residuals. | |
| Double_t | fTestCorrelationCoeff |
| Multi Correlation coefficient. | |
| Double_t | fTestError |
| Error from test. | |
| Double_t | fTestPrecision |
| Relative precision of test. | |
| TVectorD | fTestQuantity |
| Test sample, dependent quantity. | |
| Int_t | fTestSampleSize |
| Size of test sample. | |
| TVectorD | fTestSqError |
| Test sample, Error in quantity. | |
| TVectorD | fTestVariables |
| Test sample, independent variables. | |
| TString | fTitle |
| TVectorD | fVariables |
| Training sample, independent variables. | |
Static Private Member Functions | |
| static void | AddToTObjectTable (TObject *) |
| Private helper function which will dispatch to TObjectTable::AddObj. | |
Private Attributes | |
| UInt_t | fBits |
| bit field status word | |
| UInt_t | fUniqueID |
| object unique identifier | |
Static Private Attributes | |
| static Longptr_t | fgDtorOnly = 0 |
| object for which to call dtor only (i.e. no delete) | |
| static TMultiDimFit * | fgInstance |
| static Bool_t | fgObjectStat = kTRUE |
| if true keep track of objects in TObjectTable | |
#include <TMultiDimFit.h>
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
| Enumerator | |
|---|---|
| kMonomials | |
| kChebyshev | |
| kLegendre | |
Definition at line 18 of file TMultiDimFit.h.
|
inherited |
| TMultiDimFit::TMultiDimFit | ( | ) |
| TMultiDimFit::TMultiDimFit | ( | Int_t | dimension, |
| EMDFPolyType | type = kMonomials, | ||
| Option_t * | option = "" ) |
|
override |
|
inherited |
Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.
Definition at line 1149 of file TObject.cxx.
|
staticprivateinherited |
Private helper function which will dispatch to TObjectTable::AddObj.
Included here to avoid circular dependency between header files.
Definition at line 195 of file TObject.cxx.
|
virtualinherited |
Append graphics object to current pad.
In case no current pad is set yet, create a default canvas with the name "c1".
Definition at line 204 of file TObject.cxx.
|
overridevirtual |
Browse object. May be overridden for another default action.
Reimplemented from TObject.
|
inlineinherited |
Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();
(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.
|
static |
|
static |
|
inlinestaticconstexpr |
Definition at line 207 of file TMultiDimFit.h.
|
virtualinherited |
Returns name of class to which the object belongs.
Definition at line 227 of file TObject.cxx.
|
overridevirtualinherited |
Make a clone of an object using the Streamer facility.
If newname is specified, this will be the name of the new object.
Reimplemented from TObject.
Reimplemented in TStreamerInfo, and TTreeIndex.
Definition at line 73 of file TNamed.cxx.
Compare two TNamed objects.
Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).
Reimplemented from TObject.
Reimplemented in TStructNodeProperty.
Definition at line 84 of file TNamed.cxx.
|
overridevirtualinherited |
Copy this to obj.
Reimplemented from TObject.
Reimplemented in TPieSlice, TProfile2D, TProfile3D, TProfile, TStyle, TSystemDirectory, TSystemFile, TText, and TXTRU.
Definition at line 93 of file TNamed.cxx.
|
inlinestatic |
Definition at line 207 of file TMultiDimFit.h.
|
virtualinherited |
Delete this object.
Typically called as a command via the interpreter. Normally use "delete" operator when object has been allocated on the heap.
Reimplemented in RooLinkedList, TAxis, TBtree, TCanvas, TClonesArray, TCollection, TDirectory, TDirectoryFile, TExMap, TFile, TGFrame, TGItemContext, TGTextEdit, THashList, THashTable, TKey, TKeySQL, TKeyXML, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TMap, TMVA::Results, TObjArray, TObjectTable, TOrdCollection, TProtoClass, TQCommand, TRefArray, TSystemDirectory, TSystemFile, TThread, TTree, TTreeViewer, TViewPubDataMembers, and TViewPubFunctions.
Definition at line 268 of file TObject.cxx.
Computes distance from point (px,py) to the object.
This member function must be implemented for each graphics primitive. This default function returns a big number (999999).
Reimplemented in TASImage, TAxis3D, TAxis, TBox, TBRIK, TColorWheel, TCrown, TCurlyArc, TCurlyLine, TDiamond, TEfficiency, TEllipse, TF1, TF2, TF3, TFileDrawMap, TGenerator, TGeoBBox, TGeoCompositeShape, TGeoCone, TGeoConeSeg, TGeoEltu, TGeoHalfSpace, TGeoHype, TGeoNode, TGeoOverlap, TGeoParaboloid, TGeoPcon, TGeoPgon, TGeoScaledShape, TGeoShape, TGeoShapeAssembly, TGeoSphere, TGeoTessellated, TGeoTorus, TGeoTrack, TGeoTube, TGeoTubeSeg, TGeoVGShape, TGeoVolume, TGeoXtru, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLScenePad, TGLTH3Composition, TGLViewer, TGraph2D, TGraph, TGraphEdge, TGraphNode, TGraphPolargram, TH1, THistPainter, THStack, TLine, TMarker3DBox, TMarker, TMultiGraph, TNode, TPad, TPaletteAxis, TParallelCoord, TParallelCoordRange, TParallelCoordVar, TParticle, TPave, TPCON, TPie, TPieSlice, TPoints3DABC, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TPrimary, TScatter2D, TScatter, TSPHE, TSpider, TSpline, TStyle, TText, TTreePerfStats, TTUBE, TTUBS, TVirtualHistPainter, and TXTRU.
Definition at line 284 of file TObject.cxx.
|
protectedvirtualinherited |
Interface to ErrorHandler (protected).
Reimplemented in TThread, and TTreeViewer.
Definition at line 1059 of file TObject.cxx.
|
inlineoverridevirtual |
Default Draw method for all objects.
Reimplemented from TObject.
Definition at line 134 of file TMultiDimFit.h.
|
virtualinherited |
Draw class inheritance tree of the class to which this object belongs.
If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:
Reimplemented in TGFrame, TSystemDirectory, and TSystemFile.
Definition at line 308 of file TObject.cxx.
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
If pad was not selected - gPad will be used.
Reimplemented in TAxis, TCanvas, TGFrame, TSystemDirectory, and TSystemFile.
Definition at line 319 of file TObject.cxx.
|
virtualinherited |
Dump contents of object on stdout.
Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed
The following output is the Dump of a TArrow object:
Reimplemented in TClass, TCollection, TGFrame, TGPack, and TSystemFile.
Definition at line 367 of file TObject.cxx.
|
virtualinherited |
Issue error message.
Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.
Reimplemented in TFitResult.
Definition at line 1098 of file TObject.cxx.
|
virtual |
|
virtual |
|
virtualinherited |
Execute method on this object with the given parameter string, e.g.
"3.14,1,\"text\"".
Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.
Definition at line 378 of file TObject.cxx.
|
virtualinherited |
Execute method on this object with parameters stored in the TObjArray.
The TObjArray should contain an argv vector like:
Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.
Definition at line 398 of file TObject.cxx.
Execute action corresponding to an event at (px,py).
This method must be overridden if an object can react to graphics events.
Reimplemented in TASImage, TASPaletteEditor::LimitLine, TAxis3D, TAxis, TBox, TButton, TCanvas, TCrown, TCurlyArc, TCurlyLine, TDiamond, TEfficiency, TEllipse, TF1, TF2, TF3, TFrame, TGenerator, TGeoManager, TGeoNode, TGeoOverlap, TGeoShape, TGeoTrack, TGeoVolume, TGL5DDataSet, TGLEventHandler, TGLHistPainter, TGLParametricEquation, TGLScenePad, TGLTH3Composition, TGLViewer, TGraph2D, TGraph, TGraphEdge, TGraphNode, TGraphPolargram, TGroupButton, TH1, THistPainter, TLine, TLink, TMarker3DBox, TMarker, TNode, TPad, TPaletteAxis, TParallelCoord, TParallelCoordRange, TParallelCoordVar, TParticle, TPave, TPie, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TPrimary, TScatter2D, TScatter, TSliderBox, TSpider, TSpline, TText, TTreePerfStats, TView3D, TView, TVirtualHistPainter, and TWbox.
Definition at line 415 of file TObject.cxx.
|
virtualinherited |
Issue fatal error message.
Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.
Definition at line 1126 of file TObject.cxx.
|
virtualinherited |
Encode TNamed into output buffer.
Reimplemented in TDirectoryFile, TFile, TKey, TKeySQL, TKeyXML, TSQLFile, and TXMLFile.
Definition at line 103 of file TNamed.cxx.
|
virtualinherited |
Must be redefined in derived classes.
This function is typically used with TCollections, but can also be used to find an object by name inside this object.
Reimplemented in RooAbsCollection, RooLinkedList, TBtree, TCollection, TDirectory, TFolder, TGeometry, TGraph2D, TGraph, TH1, THashList, THashTable, THbookFile, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfTypes, TMap, TObjArray, TPad, TROOT, TViewPubDataMembers, and TViewPubFunctions.
Definition at line 425 of file TObject.cxx.
Must be redefined in derived classes.
This function is typically used with TCollections, but can also be used to find an object inside this object.
Reimplemented in RooAbsCollection, RooLinkedList, TBtree, TCollection, TDirectory, TFolder, TGeometry, TGraph2D, TGraph, TH1, THashList, THashTable, THbookFile, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfTypes, TMap, TObjArray, TPad, TROOT, TViewPubDataMembers, and TViewPubFunctions.
Definition at line 435 of file TObject.cxx.
|
virtual |
|
virtual |
|
inline |
Definition at line 140 of file TMultiDimFit.h.
|
inline |
Definition at line 142 of file TMultiDimFit.h.
|
inline |
Definition at line 143 of file TMultiDimFit.h.
|
inline |
Definition at line 141 of file TMultiDimFit.h.
|
virtualinherited |
Get option used by the graphics system to draw this object.
Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.
Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.
Definition at line 445 of file TObject.cxx.
|
staticinherited |
Return destructor only flag.
Definition at line 1196 of file TObject.cxx.
|
inline |
Definition at line 144 of file TMultiDimFit.h.
|
inline |
Definition at line 145 of file TMultiDimFit.h.
|
inline |
Definition at line 146 of file TMultiDimFit.h.
|
inlinevirtual |
Definition at line 147 of file TMultiDimFit.h.
|
virtualinherited |
Returns mime type name of object.
Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TASImage, TBranch, TBranchElement, TGeoVolume, TGMainFrame, TKey, TMethodBrowsable, TSystemFile, and TVirtualBranchBrowsable.
Definition at line 472 of file TObject.cxx.
|
inline |
Definition at line 148 of file TMultiDimFit.h.
|
inline |
Definition at line 149 of file TMultiDimFit.h.
|
inline |
Definition at line 150 of file TMultiDimFit.h.
|
inline |
Definition at line 151 of file TMultiDimFit.h.
|
inline |
Definition at line 152 of file TMultiDimFit.h.
|
inline |
Definition at line 153 of file TMultiDimFit.h.
|
inline |
Definition at line 154 of file TMultiDimFit.h.
|
inline |
Definition at line 155 of file TMultiDimFit.h.
|
inline |
Definition at line 156 of file TMultiDimFit.h.
|
inline |
Definition at line 157 of file TMultiDimFit.h.
|
inline |
Definition at line 158 of file TMultiDimFit.h.
|
inline |
Definition at line 159 of file TMultiDimFit.h.
|
inline |
Definition at line 160 of file TMultiDimFit.h.
|
inlineoverridevirtualinherited |
|
inline |
Definition at line 162 of file TMultiDimFit.h.
|
inline |
Definition at line 161 of file TMultiDimFit.h.
Returns string containing info about the object at position (px,py).
This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).
Reimplemented in TASImage, TAxis3D, TColorWheel, TF1, TF2, TFileDrawMap, TGeoNode, TGeoTrack, TGeoVolume, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph, TH1, THistPainter, TNode, TPaletteAxis, TParallelCoordVar, and TVirtualHistPainter.
Definition at line 491 of file TObject.cxx.
|
staticinherited |
Get status of object stat flag.
Definition at line 1181 of file TObject.cxx.
|
inlinevirtualinherited |
Reimplemented in TArrow, TAxis3D, TFile, TGaxis, TGeoVolume, TH1, THelix, TLegendEntry, TMapFile, TNode, TPave, TPoints3DABC, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TPSocket, TSelector, TSocket, and TUDPSocket.
|
inline |
Definition at line 163 of file TMultiDimFit.h.
|
inline |
Definition at line 164 of file TMultiDimFit.h.
|
inline |
Definition at line 165 of file TMultiDimFit.h.
|
inline |
Definition at line 166 of file TMultiDimFit.h.
|
inline |
Definition at line 167 of file TMultiDimFit.h.
|
inline |
Definition at line 168 of file TMultiDimFit.h.
|
inline |
Definition at line 169 of file TMultiDimFit.h.
|
inline |
Definition at line 171 of file TMultiDimFit.h.
|
inline |
Definition at line 170 of file TMultiDimFit.h.
|
inline |
Definition at line 172 of file TMultiDimFit.h.
|
inline |
Definition at line 173 of file TMultiDimFit.h.
|
inline |
Definition at line 174 of file TMultiDimFit.h.
|
inline |
Definition at line 175 of file TMultiDimFit.h.
|
inline |
Definition at line 176 of file TMultiDimFit.h.
|
inline |
Definition at line 177 of file TMultiDimFit.h.
|
inline |
Definition at line 178 of file TMultiDimFit.h.
|
inline |
Definition at line 179 of file TMultiDimFit.h.
|
inline |
Definition at line 180 of file TMultiDimFit.h.
|
inline |
Definition at line 181 of file TMultiDimFit.h.
|
inline |
Definition at line 182 of file TMultiDimFit.h.
|
inline |
Definition at line 183 of file TMultiDimFit.h.
|
inline |
Definition at line 184 of file TMultiDimFit.h.
|
inlineoverridevirtualinherited |
|
virtualinherited |
Return the unique object id.
Definition at line 480 of file TObject.cxx.
|
inline |
Definition at line 185 of file TMultiDimFit.h.
Execute action in response of a timer timing out.
This method must be overridden if an object has to react to timers.
Reimplemented in TGCommandPlugin, TGDNDManager, TGFileContainer, TGHtml, TGLEventHandler, TGPopupMenu, TGraphTime, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGuiBldDragManager, TGWindow, and TTreeViewer.
Definition at line 516 of file TObject.cxx.
|
inlineoverridevirtualinherited |
Return hash value for this object.
Note: If this routine is overloaded in a derived class, this derived class should also add
Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like
Reimplemented from TObject.
|
inlineinherited |
Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
missing call to RecursiveRemove in destructor).
Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)
|
virtualinherited |
Issue info message.
Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.
Definition at line 1072 of file TObject.cxx.
|
virtualinherited |
Returns kTRUE if object inherits from class "classname".
Reimplemented in TClass.
Definition at line 549 of file TObject.cxx.
Returns kTRUE if object inherits from TClass cl.
Reimplemented in TClass.
Definition at line 557 of file TObject.cxx.
|
virtualinherited |
Dump contents of this object in a graphics canvas.
Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.
The following picture is the Inspect of a histogram object:
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TGFrame, TInspectorObject, and TSystemFile.
Definition at line 570 of file TObject.cxx.
|
static |
|
inlineoverridevirtual |
Reimplemented from TObject.
Definition at line 207 of file TMultiDimFit.h.
|
inlineinherited |
IsDestructed.
Default equal comparison (objects are equal if they have the same address in memory).
More complicated classes might want to override this function.
Reimplemented in TGObject, TObjString, TPair, and TQCommand.
Definition at line 589 of file TObject.cxx.
|
inlineoverridevirtual |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Reimplemented from TObject.
Definition at line 188 of file TMultiDimFit.h.
|
inlineoverridevirtualinherited |
Reimplemented from TObject.
Reimplemented in TStructNodeProperty.
|
overridevirtualinherited |
List TNamed name and title.
Reimplemented from TObject.
Reimplemented in ROOT::Experimental::XRooFit::xRooBrowser, TNode, TROOT, TStreamerBase, TStreamerElement, TStreamerInfo, TStreamerSTL, TTask, TText, and TVirtualStreamerInfo.
Definition at line 112 of file TNamed.cxx.
|
protectedvirtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
PRIVATE METHOD: This is the method that actually generates the code for the evaluation the parameterization on some point. It's called by TMultiDimFit::MakeCode and TMultiDimFit::MakeMethod.
The options are: NONE so far
Definition at line 1962 of file TMultiDimFit.cxx.
|
inherited |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
Definition at line 1160 of file TObject.cxx.
|
virtualinherited |
This method must be overridden to handle object notification (the base implementation is no-op).
Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.
For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.
Reimplemented in h1analysis, h1analysisTreeReader, TARInterruptHandler, TASInputHandler, TASInterruptHandler, TASLogHandler, TASSigPipeHandler, TBlinkTimer, TBranchElement, TBranchRef, TBreakLineCom, TBrowserTimer, TCollection, TDelCharCom, TDelTextCom, TFileHandler, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TGLRedrawTimer, TGTextEditHist, TGuiBldDragManagerRepeatTimer, TIdleTimer, TInsCharCom, TInsTextCom, TInterruptHandler, TLeafObject, TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TPopupDelayTimer, TProcessEventTimer, TRefTable, TRepeatTimer, TSBRepeatTimer, TSelector, TSelectorDraw, TSelectorEntries, TSignalHandler, TSingleShotCleaner, TSocketHandler, TStdExceptionHandler, TSysEvtHandler, TTermInputHandler, TThreadTimer, TTimeOutTimer, TTimer, TTipDelayTimer, TTree, TTreeFormula, TTreeFormulaManager, TTreeReader, TViewTimer, and TViewUpdateTimer.
Definition at line 618 of file TObject.cxx.
|
inherited |
Use this method to declare a method obsolete.
Specify as of which version the method is obsolete and as from which version it will be removed.
Definition at line 1169 of file TObject.cxx.
|
inherited |
Operator delete for sized deallocation.
Definition at line 1234 of file TObject.cxx.
|
inherited |
Operator delete.
Definition at line 1212 of file TObject.cxx.
|
inherited |
Only called by placement new when throwing an exception.
Definition at line 1266 of file TObject.cxx.
|
inherited |
Operator delete [] for sized deallocation.
Definition at line 1245 of file TObject.cxx.
|
inherited |
Operator delete [].
Definition at line 1223 of file TObject.cxx.
|
inherited |
Only called by placement new[] when throwing an exception.
Definition at line 1274 of file TObject.cxx.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
virtualinherited |
This method must be overridden if a class wants to paint itself.
The difference between Paint() and Draw() is that when a object draws itself it is added to the display list of the pad in which it is drawn (and automatically redrawn whenever the pad is redrawn). While paint just draws the object without adding it to the pad display list.
Reimplemented in ROOT::Experimental::RTreeMapPainter, ROOT::RGeoPainter, TAnnotation, TArrow, TASImage, TASPaletteEditor::LimitLine, TASPaletteEditor::PaintPalette, TAxis3D, TBits, TBox, TButton, TCanvas, TClassTree, TCollection, TColorWheel, TCrown, TDiamond, TDirectory, TEfficiency, TEllipse, TEveArrow, TEveCaloViz, TEveDigitSet, TEveGeoShape, TEveGeoTopNode, TEvePlot3D, TEvePointSet, TEveProjectionAxes, TEveScene, TEveShape, TEveStraightLineSet, TEveText, TEveTriangleSet, TExec, TF1, TF2, TF3, TFile, TFileDrawMap, TFrame, TGaxis, TGenerator, TGeoBoolNode, TGeoIntersection, TGeoNode, TGeoOverlap, TGeoPainter, TGeoPhysicalNode, TGeoShape, TGeoSubtraction, TGeoTrack, TGeoUnion, TGeoVGShape, TGeoVolume, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph2D, TGraph2DPainter, TGraph, TGraphEdge, TGraphNode, TGraphPolargram, TGraphTime, TH1, THistPainter, THStack, TLatex, TLegend, TLine, TMacro, TMarker3DBox, TMarker, TMathText, TMultiGraph, TNode, TNodeDiv, TPad, TPaletteAxis, TParallelCoord, TParallelCoordRange, TParallelCoordVar, TParticle, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPie, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TPrimary, TRatioPlot, TScatter2D, TScatter, TShape, TSpectrum2Painter, TSpider, TSpline, TSQLFile, TStyle, TText, TTreePerfStats, TVirtualGeoPainter, TVirtualGeoTrack, TVirtualHistPainter, TVirtualPad, TWbox, and TXMLFile.
Definition at line 631 of file TObject.cxx.
|
virtualinherited |
Pop on object drawn in a pad to the top of the display list.
I.e. it will be drawn last and on top of all other primitives.
Reimplemented in TFrame, TPad, and TVirtualPad.
Definition at line 640 of file TObject.cxx.
|
overridevirtual |
Print statistics etc. Options are P Parameters S Statistics C Coefficients R Result of parameterisation F Result of fit K Correlation Matrix M Pretty print formula.
Reimplemented from TObject.
Definition at line 2157 of file TMultiDimFit.cxx.
|
virtualinherited |
Read contents of object with specified name from the current directory.
First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().
Reimplemented in TBuffer, TKey, TKeySQL, and TKeyXML.
Definition at line 673 of file TObject.cxx.
|
virtualinherited |
Recursively remove this object from a list.
Typically implemented by classes that can contain multiple references to a same object.
Reimplemented in RooAbsCollection, RooAbsData, RooLinkedList, RooMCStudy, ROOT::Internal::TCheckHashRecursiveRemoveConsistency, ROOT::RBrowserDataCleanup, RooWorkspace, TBrowser, TChain, TCling, TCollection, TDialogCanvas, TDirectory, TEfficiency, TFileMerger, TFitEditor, TFolder, TFriendElement, TGedEditor, TGeometry, TGFileBrowser, TGraph2D, TGraph, TH1, TH1Editor, TH2Editor, THashList, THistPainter, THStack, TInspectCanvas, TLegend, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TMultiGraph, TNode, TObjArray, TObjectRefSpy, TObjectSpy, TPad, TProcessID, TROOT, TRootBrowser, TRootBrowserHistory, TRootBrowserLite, TRootContextMenu, TTree, TTreePlayer, TViewPubDataMembers, TViewPubFunctions, and TVirtualPad.
Definition at line 684 of file TObject.cxx.
|
virtualinherited |
Save this object in the file specified by filename.
otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.
The function is available via the object context menu.
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TClassTree, TFolder, TGeoVolume, TGObject, TGraph, TH1, TPad, TPaveClass, TSpline3, TSpline5, TSpline, TTreePerfStats, and TVirtualPad.
Definition at line 708 of file TObject.cxx.
|
virtualinherited |
Save a primitive as a C++ statement(s) on output stream "out".
Reimplemented in TAnnotation, TArc, TArrow, TASImage, TAxis3D, TBox, TButton, TCanvas, TChain, TCrown, TCurlyArc, TCurlyLine, TCutG, TDiamond, TEfficiency, TEllipse, TExec, TF12, TF1, TF2, TF3, TFrame, TGaxis, TGButton, TGButtonGroup, TGCanvas, TGCheckButton, TGColorSelect, TGColumnLayout, TGComboBox, TGCompositeFrame, TGContainer, TGDockableFrame, TGDoubleHSlider, TGDoubleVSlider, TGedMarkerSelect, TGedPatternSelect, TGeoArb8, TGeoBBox, TGeoBoolNode, TGeoCombiTrans, TGeoCompositeShape, TGeoCone, TGeoConeSeg, TGeoCtub, TGeoDecayChannel, TGeoElementRN, TGeoEltu, TGeoGtra, TGeoHalfSpace, TGeoHMatrix, TGeoHype, TGeoIdentity, TGeoIntersection, TGeoMaterial, TGeoMedium, TGeoMixture, TGeoPara, TGeoParaboloid, TGeoPatternCylPhi, TGeoPatternCylR, TGeoPatternParaX, TGeoPatternParaY, TGeoPatternParaZ, TGeoPatternSphPhi, TGeoPatternSphR, TGeoPatternSphTheta, TGeoPatternTrapZ, TGeoPatternX, TGeoPatternY, TGeoPatternZ, TGeoPcon, TGeoPgon, TGeoRotation, TGeoScaledShape, TGeoShapeAssembly, TGeoSphere, TGeoSubtraction, TGeoTessellated, TGeoTorus, TGeoTranslation, TGeoTrap, TGeoTrd1, TGeoTrd2, TGeoTube, TGeoTubeSeg, TGeoUnion, TGeoVolume, TGeoXtru, TGFileContainer, TGFont, TGFrame, TGFSComboBox, TGGC, TGGroupFrame, TGHButtonGroup, TGHorizontal3DLine, TGHorizontalFrame, TGHorizontalLayout, TGHProgressBar, TGHScrollBar, TGHSlider, TGHSplitter, TGHtml, TGIcon, TGLabel, TGLayoutHints, TGLineStyleComboBox, TGLineWidthComboBox, TGListBox, TGListDetailsLayout, TGListLayout, TGListTree, TGListView, TGLVContainer, TGMainFrame, TGMatrixLayout, TGMdiFrame, TGMdiMainFrame, TGMdiMenuBar, TGMenuBar, TGMenuTitle, TGNumberEntry, TGNumberEntryField, TGPictureButton, TGPopupMenu, TGProgressBar, TGRadioButton, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraph, TGraphAsymmErrors, TGraphBentErrors, TGraphEdge, TGraphErrors, TGraphMultiErrors, TGraphNode, TGraphPolar, TGraphPolargram, TGraphStruct, TGroupButton, TGRowLayout, TGShapedFrame, TGShutter, TGShutterItem, TGSplitFrame, TGStatusBar, TGTab, TGTabLayout, TGTableLayout, TGTableLayoutHints, TGTextButton, TGTextEdit, TGTextEntry, TGTextLBEntry, TGTextView, TGTileLayout, TGToolBar, TGTransientFrame, TGTripleHSlider, TGTripleVSlider, TGVButtonGroup, TGVertical3DLine, TGVerticalFrame, TGVerticalLayout, TGVFileSplitter, TGVProgressBar, TGVScrollBar, TGVSlider, TGVSplitter, TGXYLayout, TGXYLayoutHints, TH1, TH2Poly, THelix, THStack, TLatex, TLegend, TLine, TMacro, TMarker3DBox, TMarker, TMathText, TMultiGraph, TPad, TPaletteAxis, TParallelCoord, TParallelCoordVar, TPave, TPaveClass, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPie, TPieSlice, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TProfile2D, TProfile3D, TProfile, TRootContainer, TRootEmbeddedCanvas, TScatter2D, TScatter, TSlider, TSliderBox, TSpline3, TSpline5, TStyle, TText, TTreePerfStats, and TWbox.
Definition at line 858 of file TObject.cxx.
|
staticprotectedinherited |
Save object constructor in the output stream "out".
Can be used as first statement when implementing SavePrimitive() method for the object
Definition at line 777 of file TObject.cxx.
|
staticprotectedinherited |
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition at line 845 of file TObject.cxx.
|
protectedinherited |
Save object name and title into the output stream "out".
Definition at line 135 of file TNamed.cxx.
|
staticprotectedinherited |
Save array in the output stream "out" as vector.
Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()
Definition at line 796 of file TObject.cxx.
Selection method. User can override this method for specialized selection of acceptable functions in fit. Default is to select all. This message is sent during the build-up of the function candidates table once for each set of powers in variables. Notice, that the argument array contains the powers PLUS ONE. For example, to De select the function f = x1^2 * x2^4 * x3^5, this method should return kFALSE if given the argument { 3, 4, 6 }.
Definition at line 2364 of file TMultiDimFit.cxx.
|
inline |
Definition at line 195 of file TMultiDimFit.h.
|
inline |
Definition at line 196 of file TMultiDimFit.h.
Set or unset the user status bits as specified in f.
Definition at line 888 of file TObject.cxx.
|
virtualinherited |
Set drawing option for object.
This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().
Reimplemented in RooPlot, TAxis, TBrowser, TGedFrame, TGFrame, TPad, TPaveStats, TRootBrowserLite, TSystemDirectory, and TSystemFile.
Definition at line 871 of file TObject.cxx.
|
staticinherited |
Set destructor only flag.
Definition at line 1204 of file TObject.cxx.
| void TMultiDimFit::SetMaxAngle | ( | Double_t | angle = 0 | ) |
Set the max angle (in degrees) between the initial data vector to be fitted, and the new candidate function to be included in the fit. By default it is 0, which automatically chooses another selection criteria. See also class description.
Definition at line 2376 of file TMultiDimFit.cxx.
|
inline |
Definition at line 198 of file TMultiDimFit.h.
| void TMultiDimFit::SetMaxPowers | ( | const Int_t * | powers | ) |
Set the maximum power to be considered in the fit for each variable. See also class description.
Definition at line 2442 of file TMultiDimFit.cxx.
|
inline |
Definition at line 200 of file TMultiDimFit.h.
|
inline |
Definition at line 201 of file TMultiDimFit.h.
| void TMultiDimFit::SetMinAngle | ( | Double_t | angle = 1 | ) |
Set the min angle (in degrees) between a new candidate function and the subspace spanned by the previously accepted functions. See also class description.
Definition at line 2392 of file TMultiDimFit.cxx.
| void TMultiDimFit::SetMinRelativeError | ( | Double_t | error | ) |
Set the acceptable relative error for when sum of square residuals is considered minimized. For a full account, refer to the class description.
Definition at line 2457 of file TMultiDimFit.cxx.
|
virtualinherited |
Set the name of the TNamed.
WARNING: if the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.
Reimplemented in RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, ROOT::Experimental::XRooFit::xRooNode, TChain, TColor, TDirectory, TEfficiency, TEventList, TEveScene, TFormula, TGraph2D, TGraph, TH1, TNode, TRotMatrix, TShape, TSystemDirectory, TSystemFile, and TTree.
Definition at line 149 of file TNamed.cxx.
|
virtualinherited |
Set all the TNamed parameters (name and title).
WARNING: if the name is changed and the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.
Reimplemented in RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, TContextMenu, TGraph2D, TGraph, TH1, and TNode.
Definition at line 163 of file TNamed.cxx.
|
staticinherited |
Turn on/off tracking of objects in the TObjectTable.
Definition at line 1188 of file TObject.cxx.
Set the user parameter for the function selection. The bigger the limit, the more functions are used. The meaning of this variable is defined in the class description.
Definition at line 2432 of file TMultiDimFit.cxx.
Define a user function. The input array must be of the form (p11, ..., p1N, ... ,pL1, ..., pLN) Where N is the dimension of the data sample, L is the number of terms (given in terms) and the first number, labels the term, the second the variable. More information is given in the class description.
Definition at line 2412 of file TMultiDimFit.cxx.
|
virtualinherited |
Set the title of the TNamed.
Reimplemented in Axis2, RooPlot, ROOT::Experimental::XRooFit::xRooNode, ROOT::TSchemaRule::TSources, TASImage, TEfficiency, TF1, TGraph2D, TGraph, TH1, THnBase, TParallelCoordVar, TSystemDirectory, and TSystemFile.
Definition at line 173 of file TNamed.cxx.
|
virtualinherited |
Set the unique object id.
Definition at line 899 of file TObject.cxx.
|
virtualinherited |
Return size of the TNamed part of the TObject.
Reimplemented in TDirectory, TDirectoryFile, TFile, TKey, TSQLFile, and TXMLFile.
Definition at line 182 of file TNamed.cxx.
|
overridevirtual |
Stream an object of class TObject.
Reimplemented from TObject.
|
inline |
Definition at line 207 of file TMultiDimFit.h.
|
virtualinherited |
Issue system error message.
Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.
Definition at line 1112 of file TObject.cxx.
PRIVATE METHOD: Test whether the currently considered function contributes to the fit. See also class description.
Definition at line 2469 of file TMultiDimFit.cxx.
|
virtualinherited |
|
virtualinherited |
Issue warning message.
Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.
Definition at line 1084 of file TObject.cxx.
|
virtualinherited |
Write this object to the current directory.
For more see the const version of this method.
Reimplemented in ROOT::TBufferMergerFile, TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.
Definition at line 989 of file TObject.cxx.
|
virtualinherited |
Write this object to the current directory.
The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".
Writing an object to a file involves the following steps:
Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.
If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().
The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.
An object is read from the file into memory via TKey::Read() or via TObject::Read().
The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.
Reimplemented in TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.
Definition at line 964 of file TObject.cxx.
|
protected |
Number of bin in independent variables.
Definition at line 98 of file TMultiDimFit.h.
|
protected |
Number of bin in dependent variables.
Definition at line 99 of file TMultiDimFit.h.
|
privateinherited |
|
protected |
Chi square of fit.
Definition at line 85 of file TMultiDimFit.h.
|
protected |
Vector of the final coefficients.
Definition at line 82 of file TMultiDimFit.h.
|
protected |
Vector of RMS of coefficients.
Definition at line 83 of file TMultiDimFit.h.
|
protected |
Multi Correlation coefficient.
Definition at line 92 of file TMultiDimFit.h.
|
protected |
Correlation matrix.
Definition at line 93 of file TMultiDimFit.h.
|
protected |
Error from parametrization.
Definition at line 88 of file TMultiDimFit.h.
|
protected |
! Fit object (MINUIT)
Definition at line 101 of file TMultiDimFit.h.
|
protected |
[fMaxFunctions] acceptance code
Definition at line 60 of file TMultiDimFit.h.
|
protected |
Functions evaluated over sample.
Definition at line 58 of file TMultiDimFit.h.
|
staticprivateinherited |
|
staticprivate |
Definition at line 25 of file TMultiDimFit.h.
|
protected |
Bit pattern of histograms used.
Definition at line 97 of file TMultiDimFit.h.
|
protected |
List of histograms.
Definition at line 96 of file TMultiDimFit.h.
|
protected |
Flag for user defined function.
Definition at line 105 of file TMultiDimFit.h.
|
protected |
Definition at line 106 of file TMultiDimFit.h.
|
protected |
Max angle for accepting new function.
Definition at line 51 of file TMultiDimFit.h.
|
protected |
fMaxFunctions*fNVariables
Definition at line 62 of file TMultiDimFit.h.
|
protected |
max number of functions
Definition at line 59 of file TMultiDimFit.h.
|
protected |
[fNVariables] maximum powers
Definition at line 54 of file TMultiDimFit.h.
|
protected |
[fNVariables] maximum powers from fit;
Definition at line 68 of file TMultiDimFit.h.
|
protected |
Max value of dependent quantity.
Definition at line 31 of file TMultiDimFit.h.
|
protected |
Max residual value.
Definition at line 73 of file TMultiDimFit.h.
|
protected |
Row giving max residual.
Definition at line 75 of file TMultiDimFit.h.
|
protected |
max functions to study
Definition at line 61 of file TMultiDimFit.h.
|
protected |
Max terms expected in final expr.
Definition at line 52 of file TMultiDimFit.h.
|
protected |
max value of independent variables
Definition at line 39 of file TMultiDimFit.h.
|
protected |
Mean of dependent quantity.
Definition at line 30 of file TMultiDimFit.h.
|
protected |
mean value of independent variables
Definition at line 38 of file TMultiDimFit.h.
|
protected |
Min angle for accepting new function.
Definition at line 50 of file TMultiDimFit.h.
|
protected |
Min value of dependent quantity.
Definition at line 32 of file TMultiDimFit.h.
|
protected |
Min relative error accepted.
Definition at line 53 of file TMultiDimFit.h.
|
protected |
Min residual value.
Definition at line 74 of file TMultiDimFit.h.
|
protected |
Row giving min residual.
Definition at line 76 of file TMultiDimFit.h.
|
protected |
min value of independent variables
Definition at line 40 of file TMultiDimFit.h.
|
protected |
Dimension of model coefficients.
Definition at line 79 of file TMultiDimFit.h.
|
protected |
Number of independent variables.
Definition at line 37 of file TMultiDimFit.h.
|
protected |
The model coefficients.
Definition at line 80 of file TMultiDimFit.h.
|
protected |
Model matrix.
Definition at line 81 of file TMultiDimFit.h.
|
protected |
Norm of the evaluated functions.
Definition at line 65 of file TMultiDimFit.h.
|
protected |
As above, but orthogonalised.
Definition at line 64 of file TMultiDimFit.h.
|
protected |
Exit code of parameterisation.
Definition at line 86 of file TMultiDimFit.h.
|
protected |
Type of polynomials to use.
Definition at line 103 of file TMultiDimFit.h.
|
protected |
[fMaxTerms] Index of accepted powers
Definition at line 70 of file TMultiDimFit.h.
|
protected |
Control parameter.
Definition at line 55 of file TMultiDimFit.h.
|
protected |
[fMaxFuncNV] where fMaxFuncNV = fMaxFunctions*fNVariables
Definition at line 69 of file TMultiDimFit.h.
|
protected |
Relative precision of param.
Definition at line 90 of file TMultiDimFit.h.
|
protected |
Training sample, dependent quantity.
Definition at line 28 of file TMultiDimFit.h.
|
protected |
Vector of the final residuals.
Definition at line 72 of file TMultiDimFit.h.
|
protected |
Root mean square of fit.
Definition at line 84 of file TMultiDimFit.h.
|
protected |
Size of training sample.
Definition at line 42 of file TMultiDimFit.h.
|
protected |
print correlation matrix
Definition at line 104 of file TMultiDimFit.h.
|
protected |
Training sample, error in quantity.
Definition at line 29 of file TMultiDimFit.h.
|
protected |
Sum of squares away from mean.
Definition at line 34 of file TMultiDimFit.h.
|
protected |
SumSquare of dependent quantity.
Definition at line 33 of file TMultiDimFit.h.
|
protected |
Sum of Square residuals.
Definition at line 77 of file TMultiDimFit.h.
|
protected |
Multi Correlation coefficient.
Definition at line 94 of file TMultiDimFit.h.
|
protected |
Error from test.
Definition at line 89 of file TMultiDimFit.h.
|
protected |
Relative precision of test.
Definition at line 91 of file TMultiDimFit.h.
|
protected |
Test sample, dependent quantity.
Definition at line 44 of file TMultiDimFit.h.
|
protected |
Size of test sample.
Definition at line 48 of file TMultiDimFit.h.
|
protected |
Test sample, Error in quantity.
Definition at line 45 of file TMultiDimFit.h.
|
protected |
Test sample, independent variables.
Definition at line 46 of file TMultiDimFit.h.
|
privateinherited |
|
protected |
Training sample, independent variables.
Definition at line 36 of file TMultiDimFit.h.