1. TGraph

型をそろえる。
TGraph TGraph::TGraph(Int_t n,const Int_t* x,const Int_t* y);
TGraph TGraph::TGraph(Int_t n,const Float_t* x,const Float_t* y);
TGraph TGraph::TGraph(Int_t n,const Double_t* x,const Double_t* y);
TGraph TGraph::TGraph(const TVectorF& vx,const TVectorF& vy);
TGraph TGraph::TGraph(const TVectorD& vx,const TVectorD& vy);
TGraph *gr=new TGraph(n, x, y)
gr->Draw("A*");

2. Interpolator

#include "Math/Interpolator.h"
// n は要素数
ROOT::Math::Interpolator inter(n, ROOT::Math::Interpolation::kLINEAR);
// xとyはvector
inter.SetData(x,y);
Double_t y2=inter.Eval(x2);

3. Fit


4. rootfile書き出し

Branchを作って書き込み
TTree* tree=new TTree("treename","test tree");
Double_t x;
tree->Branch("x",&x,"x/D");
x=1;
tree->Fill();
保存
TFile file("test.root","recreate");
tree->Write();
file.Close();

5. histogram

.1 ヒストグラム配列

const int hnum=5;
TH1D *h[hnum];
for(i=0; i< hnum;i++){
h[i] = new TH1D(Form("h%d",i),"",10,0,1);
}

.2 GetBinContent

最初のbinデータはGetBinContent(1)より始まる。上記の例では
0~1 までのdata=h[0]->GetBinContent(1);
9~10までのdata=h[0]->GetBinContent(10);

.3 軸タイトル

h[0]->GetXaxis()->SetTitle("x title");
h[0]->GetYaxis()->SetTitle("y title");
h[0]->SetTitle("title");