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[] = {
122 const Int_t *powers =
fit->GetPowers();
123 const Int_t *pindex =
fit->GetPowerIndex();
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 Longptr_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 };
181 fit->SetMaxPowers(mPowers);
182 fit->SetMaxFunctions(1000);
183 fit->SetMaxStudy(1000);
184 fit->SetMaxTerms(30);
185 fit->SetPowerLimit(1);
186 fit->SetMinAngle(10);
187 fit->SetMaxAngle(10);
188 fit->SetMinRelativeError(.01);
197 printf(
"======================================\n");
201 for (i = 0; i < nData ; i++) {
214 fit->MakeHistograms();
217 fit->FindParameterization();
226 for (i = 0; i < nVars; i++) {
227 xMax[i] = (*
fit->GetMaxVariables())(i);
228 xMin[i] = (*
fit->GetMinVariables())(i);
231 nData =
fit->GetNCoefficients() * 100;
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.
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.
fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
Double_t Sqrt(Double_t x)
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
static void output(int code)