29 Double_t upp[5] = { 10, 10, 10, 10, 1 };
30 Double_t low[5] = { 0, 0, 0, 0, .1 };
31 for (
int i = 0; i < 4; i++)
46 double GoodCoeffsNoFit[] = {
71 double GoodCoeffs[] = {
124 if (nc != 21)
return 1;
127 for (
Int_t i=0;i<nc;i++) {
132 if (
TMath::Abs((*coeffs)[i] - GoodCoeffsNoFit[i]) > 5
e-5)
return 2;
134 for (
Int_t j=0;j<nv;j++) {
135 if (powers[pindex[i]*nv+j] != GoodPower[k])
return 3;
141 gROOT->ProcessLine(
".L MDF.C");
143 Double_t refMDF = (doFit) ? 43.95 : 43.98;
148 Long_t iret =
gROOT->ProcessLine(
" Double_t xvalues[] = {5,5,5,5}; double result=MDF(xvalues); &result;");
156Int_t multidimfit(
bool doFit =
true)
159 cout <<
"*************************************************" << endl;
160 cout <<
"* Multidimensional Fit *" << endl;
161 cout <<
"* *" << endl;
162 cout <<
"* By Christian Holm <cholm@nbi.dk> 14/10/00 *" << endl;
163 cout <<
"*************************************************" << endl;
180 Int_t mPowers[] = { 6 , 6, 6, 6 };
197 printf(
"======================================\n");
201 for (i = 0; i < nData ; i++) {
226 for (i = 0; i < nVars; i++) {
235 for (i = 0; i < nData ; i++) {
239 for (j = 0; j < nVars; j++)
240 if (
x[j] < xMin[j] ||
x[j] > xMax[j])
268 Int_t compare = CompareResults(fit, doFit);
270 printf(
"\nmultidimfit .............................................. OK\n");
272 printf(
"\nmultidimfit .............................................. fails case %d\n",compare);
R__EXTERN TRandom * gRandom
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Multidimensional Fits in ROOT.
Int_t GetNCoefficients() const
void SetMaxStudy(Int_t n)
void SetMaxFunctions(Int_t n)
void SetMaxTerms(Int_t terms)
Int_t GetNVariables() const
virtual void MakeCode(const char *functionName="MDF", Option_t *option="")
Generate the file <filename> with .C appended if argument doesn't end in .cxx or ....
const TVectorD * GetMaxVariables() const
void SetPowerLimit(Double_t limit=1e-3)
Set the user parameter for the function selection.
virtual void FindParameterization(Option_t *option="")
Find the parameterization.
const TVectorD * GetMinVariables() const
virtual void AddRow(const Double_t *x, Double_t D, Double_t E=0)
Add a row consisting of fNVariables independent variables, the known, dependent quantity,...
const Int_t * GetPowers() const
void SetMaxPowers(const Int_t *powers)
Set the maximum power to be considered in the fit for each variable.
virtual void AddTestRow(const Double_t *x, Double_t D, Double_t E=0)
Add a row consisting of fNVariables independent variables, the known, dependent quantity,...
virtual void Fit(Option_t *option="")
Try to fit the found parameterisation to the test sample.
void SetMinRelativeError(Double_t error)
Set the acceptable relative error for when sum of square residuals is considered minimized.
void SetMaxAngle(Double_t angle=0)
Set the max angle (in degrees) between the initial data vector to be fitted, and the new candidate fu...
Int_t * GetPowerIndex() const
void SetMinAngle(Double_t angle=1)
Set the min angle (in degrees) between a new candidate function and the subspace spanned by the previ...
virtual void Print(Option_t *option="ps") const
Print statistics etc.
const TVectorD * GetCoefficients() const
virtual void MakeHistograms(Option_t *option="A")
Make histograms of the result of the analysis.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t Rndm()
Machine independent random number generator.
Double_t Sqrt(Double_t x)
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
static void output(int code)