Hey All,
I have a file with seven columns and am trying to plot a TGraph using only the first two columns using this macro below but this error: Processing goodrunstime.C…
Error: goodrunstime() declared but not defined :0:
#include <fstream>
#include <iostream>
void goodrunstime();
{
ifstream infile;
string line;
infile.open("goodruns.out");
const int n = 800;
int runNumber[n], runlength[n];
int i =0;
while(getline(infile,line))
{
int col1, col2;
std::istringstream ss(line);
ss >> col1 >> col2 ;
cout << "Run Number " << col1 << "runLength " << col2 << std::endl;
runNumber[i]= col1 ;
runlength[i]= col2;
i++;
}
TGraph *plot = new TGraph(n,runNumber,runlength);
plot->Draw("ACP");
}
How can I resolve this error?
Looking forward to your kind assistance.