{ TH1F *hista = new TH1F("firsthist","thefirsthist",20,0,10); ifstream theinfileA; theinfileA.open("data.dat"); if(theinfileA.is_open()){ while(!theinfileA.eof()){ Double_t x,value; theinfileA >> x >> value; hista->Fill(x,value); //OPTION A Errors and Drawing problems //for(int i=0;iFill(x); //OPTION B This works, but obviously is slow. //int bin = hista->FindBin(x); //OPTION C This works fine. //hista->AddBinContent(bin, value); } } theinfileA.close(); for(int j=1;j<=20;j++) cout << hista->GetBinContent(j) << " " << hista->GetBinError(j) << endl; //hista->Draw(); hista->Draw("HIST"); //This fixes the drawing option but not the errors are still wrong }