// create "root function(TF1)" to use in fit // ex) // root[i] .x slew.C // root[i] fit("slew") // using Nadeko // root[i] hist->Fit("slew") // not using Nadeko Double_t func_slew(Double_t *x, Double_t *par) { return par[0]-par[1]/sqrt(x[0]); } void slew() { TString name = "slew"; Double_t (*fcn)(Double_t *,Double_t *) = func_slew; Double_t xmin=0; Double_t xmax=1; Int_t npar=2; TF1 *f1 = new TF1(name, fcn, xmin, xmax, npar); f1->SetParameters(0, 1); f1->SetParNames("constant", "coefficient"); }