6 TTree *tres =
new TTree();
8 tres->ReadFile( csvfile,
"",
',' );
14 TH1F *hframe_par1 =
new TH1F(
"hframe_par1",
"",10,-4.1,4.1);
15 hframe_par1->GetXaxis()->SetTitle(
"#eta");
16 hframe_par1->GetYaxis()->SetTitle(
"Parameter 1");
17 hframe_par1->GetYaxis()->SetRangeUser(0,0.1);
18 hframe_par1->GetYaxis()->SetNdivisions(505);
20 TH1F *hframe_par2 =
new TH1F(
"hframe_par2",
"",10,-4.1,4.1);
21 hframe_par2->GetXaxis()->SetTitle(
"#eta");
22 hframe_par2->GetYaxis()->SetTitle(
"Parameter 2");
23 hframe_par2->GetYaxis()->SetRangeUser(0,0.01);
24 hframe_par2->GetYaxis()->SetNdivisions(505);
27 TCanvas *c1 =
new TCanvas();
28 tres->Draw(
"par1:eta:par1err:0");
31 TGraphErrors *gpar1 =
new TGraphErrors( tres->GetEntries(),
35 &(tres->GetV3())[0] );
40 TF1* fpar1 =
new TF1(
"fpar1",
"[0] + [1] * x**2 + [2] * x**4");
41 fpar1->SetLineColor(kBlue);
42 gpar1->Fit(fpar1,
"",
"", -2.5, 2.5);
43 gpar1->Fit(fpar1,
"",
"", -2.5, 2.5);
44 gpar1->Fit(fpar1,
"",
"", -2.5, 2.5);
46 c1->Print(
"momres_par1_fit.eps");
49 TCanvas *
c2 =
new TCanvas();
50 tres->Draw(
"par2:eta:par2err:0");
53 TGraphErrors *gpar2 =
new TGraphErrors( tres->GetEntries(),
57 &(tres->GetV3())[0] );
62 TF1* fpar2 =
new TF1(
"fpar2",
"[0] + [1] * x**2 + [2] * x**3 + [3] * x**4");
63 fpar2->SetLineColor(kBlue);
64 gpar2->Fit(fpar2,
"",
"", -2.5, 2.5);
65 gpar2->Fit(fpar2,
"",
"", -2.5, 2.5);
66 gpar2->Fit(fpar2,
"",
"", -2.5, 2.5);
68 c2->Print(
"momres_par2_fit.eps");