void viewmpv(int counter){ char hodofile[128]; sprintf(hodofile, "hodoMPV.dat"); ifstream INF1(hodofile); double X[500]; double Y[500][500]; int cnt = 0; while (!INF1.eof()){ string str1; getline(INF1,str1); stringstream ss(str1); ss>>X[cnt]; int c1=0; while (ss){ ss>>Y[c1++][cnt]; } cnt++; } cnt -=1; INF1.close(); while (counter>0){ TGraphErrors *gr = new TGraphErrors(cnt,X,Y[counter],NULL,NULL); gr->SetMarkerStyle(21); gr->SetMarkerColor(2); gr->Draw("AP"); char tit[128]; sprintf(tit,"Hodoscope Coutnter # %d",counter); gr->SetTitle(tit); gr->GetXaxis()->SetTitle("Run Number #"); gr->GetYaxis()->SetTitle("MPV ADC counts"); double max = TMath::MaxElement(cnt,gr->GetY()); gr->GetYaxis()->SetRangeUser(0.,max*1.1); gPad->SetGrid(); gPad->Update(); cout<<"another ocunter#? (-1 exit) "; cin>>counter; } }