//
Double_t dx = x-fX[index];
Double_t dxc = fX[index+1]-fX[index];
+ if (dxc<=0) return fY0[index];
Double_t y0 = fY0[index];
Double_t y1 = fY1[index];
Double_t y01 = fY0[index+1];
//
Int_t npoints=graph0->GetN();
- Float_t min=1e+39,max=-1e+39;
+ Float_t min=1e38,max=-1e38;
for (Int_t ip=0; ip<npoints; ip++){
Double_t x = graph0->GetX()[ip];
Double_t y = Eval(x,0)-graph0->GetY()[ip];
Int_t nknots = fN;
if (nknots < 2 ) return;
Int_t npoints = graph->GetN();
+ if (npoints < fMinPoints ) return;
//
//
// spline fit
//
Int_t npoints = graph->GetN();
- Double_t *xknots = new Double_t[npoints];
+ Double_t *xknots = new Double_t[npoints];
+ for (Int_t ip=0;ip<npoints;ip++) xknots[ip]=0;
+ //
Int_t nknots =0;
Int_t ipoints =0;
//
-void AliSplineFit::MakeSmooth(TGraph * graph, Float_t ratio, char * type){
+void AliSplineFit::MakeSmooth(TGraph * graph, Float_t ratio, Option_t * type){
//
// Interface to GraphSmooth
//
Double_t sigmaS = hS->GetRMS();
char fname[100];
if (fit.fN<20){
- sprintf(fname,"pol%d",fit.fN);
+ snprintf(fname,100,"pol%d",fit.fN);
}else{
- sprintf(fname,"pol%d",19);
+ snprintf(fname,100,"pol%d",19);
}
TF1 fpol("fpol",fname);
graph1->Fit(&fpol);
// deletes extra information to reduce amount of information stored on the data
// base
- delete fGraph; fGraph=0;
+ // delete fGraph; fGraph=0; // Don't delete fGraph -- input parameter
delete fParams; fParams=0;
delete fCovars; fCovars=0;
delete [] fIndex; fIndex=0;
// enter graph points directly to fit parameters
// (to bee used when too few points are available)
//
- fN = fGraph->GetN();
+ fN = fGraph->GetN();
fX = new Double_t[fN];
fY0 = new Double_t[fN];
fY1 = new Double_t[fN];
for (Int_t i=0; i<fN; i++ ) {
fX[i] = fGraph->GetX()[i];
- fY0[i] = fGraph->GetY()[i];
+ fY0[i] = fGraph->GetY()[i];
fY1[i] = 0;
}
}