| 1 |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.21 2005/05/02 21:45:05 brun Exp $ |
// @(#)root/graf:$Name: $:$Id: TMultiGraph.cxx,v 1.22 2005/05/06 15:40:22 rdm Exp $ |
| 2 |
// Author: Rene Brun 12/10/2000 |
// Author: Rene Brun 12/10/2000 |
| 3 |
|
|
| 4 |
/************************************************************************* |
/************************************************************************* |
| 213 |
// = "C" In case of linear fitting, not calculate the chisquare |
// = "C" In case of linear fitting, not calculate the chisquare |
| 214 |
// (saves time) |
// (saves time) |
| 215 |
// = "F" If fitting a polN, switch to minuit fitter |
// = "F" If fitting a polN, switch to minuit fitter |
| 216 |
|
// = "ROB" In case of linear fitting, compute the LTS regression |
| 217 |
|
// coefficients (robust(resistant) regression), using |
| 218 |
|
// the default fraction of good points |
| 219 |
|
// "ROB=0.x" - compute the LTS regression coefficients, using |
| 220 |
|
// 0.x as a fraction of good points |
| 221 |
// |
// |
| 222 |
// When the fit is drawn (by default), the parameter goption may be used |
// When the fit is drawn (by default), the parameter goption may be used |
| 223 |
// to specify a list of graphics options. See TGraph::Paint for a complete |
// to specify a list of graphics options. See TGraph::Paint for a complete |
| 331 |
// Root > st->SetX1NDC(newx1); //new x start position |
// Root > st->SetX1NDC(newx1); //new x start position |
| 332 |
// Root > st->SetX2NDC(newx2); //new x end position |
// Root > st->SetX2NDC(newx2); //new x end position |
| 333 |
|
|
|
|
|
|
|
|
| 334 |
Int_t fitResult = 0; |
Int_t fitResult = 0; |
| 335 |
Double_t xmin, xmax, ymin, ymax; |
Double_t xmin, xmax, ymin, ymax; |
| 336 |
Int_t i, npar,nvpar,nparx; |
Int_t i, npar,nvpar,nparx; |
| 370 |
|
|
| 371 |
TString opt = option; |
TString opt = option; |
| 372 |
opt.ToUpper(); |
opt.ToUpper(); |
| 373 |
|
Double_t h=0; |
| 374 |
|
opt.ReplaceAll("ROB", "H"); |
| 375 |
|
//for robust fitting, see if # of good points is defined |
| 376 |
|
if (opt.Contains("H=0.")) { |
| 377 |
|
int start = opt.Index("H=0."); |
| 378 |
|
int numpos = start + strlen("H=0."); |
| 379 |
|
int numlen = 0; |
| 380 |
|
int len = opt.Length(); |
| 381 |
|
while( (numpos+numlen<len) && isdigit(opt[numpos+numlen]) ) numlen++; |
| 382 |
|
TString num = opt(numpos,numlen); |
| 383 |
|
opt.Remove(start+strlen("H"),strlen("=0.")+numlen); |
| 384 |
|
h = atof(num.Data()); |
| 385 |
|
h*=TMath::Power(10, -numlen); |
| 386 |
|
} |
| 387 |
|
|
| 388 |
if (opt.Contains("U")) fitOption.User = 1; |
if (opt.Contains("U")) fitOption.User = 1; |
| 389 |
if (opt.Contains("Q")) fitOption.Quiet = 1; |
if (opt.Contains("Q")) fitOption.Quiet = 1; |
| 397 |
if (opt.Contains("B")) fitOption.Bound = 1; |
if (opt.Contains("B")) fitOption.Bound = 1; |
| 398 |
if (opt.Contains("C")) fitOption.Nochisq = 1; |
if (opt.Contains("C")) fitOption.Nochisq = 1; |
| 399 |
if (opt.Contains("F")) fitOption.Minuit = 1; |
if (opt.Contains("F")) fitOption.Minuit = 1; |
| 400 |
|
if (opt.Contains("H")) fitOption.Robust = 1; |
| 401 |
|
|
| 402 |
if (rxmax > rxmin) { |
if (rxmax > rxmin) { |
| 403 |
xmin = rxmin; |
xmin = rxmin; |
| 487 |
} |
} |
| 488 |
|
|
| 489 |
if (linear){ |
if (linear){ |
| 490 |
|
if (fitOption.Robust) |
| 491 |
|
grFitter->ExecuteCommand("FitMultiGraph", &h, 0); |
| 492 |
|
else |
| 493 |
grFitter->ExecuteCommand("FitMultiGraph", 0, 0); |
grFitter->ExecuteCommand("FitMultiGraph", 0, 0); |
|
|
|
| 494 |
} else { |
} else { |
| 495 |
|
|
| 496 |
//Int_t special = f1->GetNumber(); |
//Int_t special = f1->GetNumber(); |