Reading ascii file and making Graph by TTree

Dear, I want to draw few graphs (column 8 Vs column 9, column 11 Vs column 12, then 1D histogram of area (= 3.1416column 11 column 12) from an ascii file (attached below). I stuck in first stage, reading ascii file accurately by TTree and Ntuple. Here I attach the code. So the problems are how can I read all column accurately , then perform mathematical equation for area and then fill column for graph (TGraph or TH1D). I tried this code from User Guide and some examples.

gROOT->Reset(); struct staff_t { Double_t a; Double_t b; Double_t c; Double_t d; Double_t e; Double_t f; Double_t g; Double_t h; Double_t k; Double_t l; Double_t m; }; staff_t staff; FILE *fp = fopen("Image_146.pft","r"); char line[650]; TFile *i = new TFile("staff.root","RECREATE"); TTree *tree = new TTree("T","pit data from ascii file"); tree->Branch("staff",&staff.a,"a/D:b/D:c/D:d/D:e/D:f/D:g/D:h/D:k/D:l/D:m/D"); while (fgets(&line,650,fp)) { sscanf(&line[0],"%f%f%f%f",&staff.a,&staff.b,&staff.c,&staff.d,); sscanf(&line[13],"%f%f%f%f",&staff.e,&staff.f,&staff.g,&staff.h); sscanf(&line[24],"%f%f%f",&staff.k,&staff.l,&staff.m); tree->Fill(); } tree.Scan("a:b:c:d:e:f:g:h:k:l:m");

Your kind help will be appreciated. It can be mention that I am a new user of ROOT.
ascii file (Image_146.pft): http://www.filedropper.com/image146

Looking into your data file I can see that you need to skip the first 19 lines then fill your tree with lines 20 to 611 and then again skip the remaining 5 lines.

You could also try to use xml classes built into ROOT:
root.cern.ch/root/html534/IO_XML_Index.html
root.cern.ch/root/html534/IO_XM … Index.html

Thanks for your kind cooperation. I can solve the problem. The code is

[code]#include “Riostream.h”
#include “TString.h”
#include “TFile.h”
#include “TTree.h”
#include “TSystem.h”

TString dir = gSystem->UnixPathName(FILE);
dir.ReplaceAll(“UScsvToRoot.C”,"");
dir.ReplaceAll("/./","/");
Float_t c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13;
int i =0;
TFile f = new TFile(“USPopDens.root”,“RECREATE”);
TTree tree = new TTree(“ntuple”,“data from csv file”);
tree->ReadFile(“Image_146.pft”,“c1/F:c2/F:c3/F:c4/F:c5/F:c6/F:c7/F:c8/F:c9/F:c10/F:c11/F:c12/F:c13/F”,’,’);
tree.Draw(“c12:c11”);
tree.Draw(“c9”,“c10”,“P”);
tree.Draw("3.1416
c11
c12");
[/code]