void hist() { TFile *f = new TFile("1.root","RECREATE"); TH1D *h1 = new TH1D("h1","x and Y distribution",10000,0,2500); TTree *T = new TTree("ntuple","data from dat file"); Long64_t nlines = T->ReadFile(Form("13MeV-Ge-19-03-2020.dat"),"x/D:y/D"); T->Project("h1","x","y"); printf(" found %lld points\n",nlines); T->Draw("x","y"); T->Write(); }