00001 void basic2() {
00002
00003
00004
00005
00006 TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
00007 dir.ReplaceAll("basic2.C","");
00008 dir.ReplaceAll("/./","/");
00009
00010 TFile *f = new TFile("basic2.root","RECREATE");
00011 TH1F *h1 = new TH1F("h1","x distribution",100,-4,4);
00012 TTree *T = new TTree("ntuple","data from ascii file");
00013 Long64_t nlines = T->ReadFile(Form("%sbasic.dat",dir.Data()),"x:y:z");
00014 printf(" found %lld points\n",nlines);
00015 T->Draw("x","z>2");
00016 T->Write();
00017 }