Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:root:fit

目次

Fitting


簡単な例

  TH1F *hist = new TH1F("hist","hist",100,-10,10);
  hist->FillRandom("gaus",10000);
  hist->Fit("gaus","","",-10,10);

としてやればガウシアンでのfittingの例が得られる。

“gaus”の他にも以下のような関数が使える。

任意の関数でfitting

  TF1 *func = new TF1("func","[0] + [1]*x", -10 , 10);
  hist->Fit("func","","",-10,10);

のようにして、先にfittingするための関数を用意してやり、Fitでそれを指定する。