Convert root file to data file (TCanvas::SavePrimitive)

I have a root file, it have two parameters, and I convert the root file to .C file, but the .C file didn’t have the two parameters values, How can I to get Tof1 and Tof2 values of each point? Thanks

Following is the .C file

[code]{
//=========Macro generated from canvas: c1/c1
//========= (Sat Mar 31 09:50:15 2012) by ROOT version5.17/04
TCanvas *c1 = new TCanvas(“c1”, “c1”,12,42,699,499);
c1->Range(-3072,-512,27648,4608);
c1->SetBorderSize(2);
c1->SetFrameFillColor(0);

TH1 *Ban = new TH2F(“Ban”,“f”,5120,0,24576,1024,0,4096);
Ban->SetBinContent(468527,1);
Ban->SetBinContent(582844,1);
Ban->SetBinContent(730633,1);
Ban->SetBinContent(764606,1);
Ban->SetBinContent(782548,1);
Ban->SetBinContent(784391,1);
Ban->SetBinContent(786864,1);
Ban->SetEntries(7);

TPaveStats *ptstats = new TPaveStats(0.78,0.755,0.98,0.995,“brNDC”);
ptstats->SetName(“stats”);
ptstats->SetBorderSize(2);
ptstats->SetFillColor(19);
ptstats->SetTextAlign(12);
TText *text = ptstats->AddText(“Ban”);
text->SetTextSize(0.0368);
ptstats->SetOptStat(1111);
ptstats->SetOptFit(0);
ptstats->Draw();
Ban->GetListOfFunctions()->Add(ptstats);
ptstats->SetParent(Ban->GetListOfFunctions());
Ban->GetXaxis()->SetTitle(“Tof1”);
Ban->GetYaxis()->SetTitle(“Tof2”);
Ban->Draw("");

TPaveText *pt = new TPaveText(0.01,0.945,0.3894549,0.995,“blNDC”);
pt->SetName(“title”);
pt->SetBorderSize(2);
pt->SetFillColor(19);
text = pt->AddText(“TOF v TOF”);
pt->Draw();
c1->Modified();
c1->cd();
c1->SetSelected(c1);
}
[/code]

Hi,

What do you mean? What is missing? Can you upload the original root file?

Philippe.

This is my root fileTof.root (128 KB), how can I get the x and y values of each point! Thanks

You can’t. The object holding your data is an histogram:

root [2] c1->GetListOfPrimitives()->ls()
OBJ: TList	TList	Doubly linked list : 0
 TFrame  X1= 0.000000 Y1=0.000000 X2=24576.000000 Y2=4096.000000
 OBJ: TH2F	Ban	GR-TDC TOF v MCP TOF : 1 at: 0x7ff7a1e504c0
 OBJ: TPaveText	title  	X1= -2764.800224 Y1=4326.400021 X2=8892.054477 Y2=4582.400024

An histogram is a binned data set. You can get the content of each bin, but the points you see do no correspond to any (x,x) postion in you data set. See:
root.cern.ch/root/html/THistPainter.html#HP11

Thank you all the same