#include "Riostream.h" void rt1() { TString dir = gSystem->UnixPathName(__FILE__); dir.ReplaceAll("rt1.C",""); dir.ReplaceAll("/./","/"); ifstream in; in.open(Form("%sq18.txt",dir.Data())); Float_t x,y; Int_t nlines = 0; TCanvas *c1 = new TCanvas("c1","c1",600,400); TH1F *he = new TH1F("he","Distribution drawn with error bars (option E1) ",100,-150,150); while (1) { in >> x >> y; if (!in.good()) break; if (nlines < 350000) printf("x=%8f, y=%8f\n",x,y); nlines++; he->Fill(x,(y/1.80E-08)*100); } gStyle->SetEndErrorSize(3); gStyle->SetErrorX(1.); he->SetMarkerStyle(20); gPad->Update(); gPad->GetFrame()->GetY2(); he->Draw("*"); gPad->Update(); gPad->GetFrame()->GetY2(); return c1; }