#include #include #include #include #include #pragma link C++ class vector >+; using namespace std; void read(char str[128],vector < vector > &data); void draw () { vector < vector > data; TCanvas *c1 = new TCanvas("c1","Example",10,10,700,520); c1->SetHighLightColor(kYellow-6); c1->SetBorderMode(1); c1->SetBorderSize(5); c1->SetLogx(); c1->SetLogy(); c1->SetFillColor(kYellow-8); c1->SetFrameFillColor(kYellow-5); read("/users/davoudi/data/vog/PDg_bin2_HH786K_WS_V300k_S0_T0.2.dat",data); TGraph *g=new TGraph(data[0].size(),&data[0].front(),&data[5].front()); g->SetMaximum(0.5); g->SetMinimum(0.0005); g->GetXaxis()->SetLimits(1,500); g->GetXaxis()->SetTitle("S"); g->GetYaxis()->SetTitle("P^{g}(S)"); g->GetXaxis()->CenterTitle(); g->GetYaxis()->CenterTitle(); g->SetLineColor(kRed); g->SetLineWidth(2); g->Draw("AL"); } void read(char str[128],vector < vector > &data){ string line; ifstream in; in.open(str); vector > v2; while ( getline(in, line) ) { vector < double > v1; double value; istringstream iss(line); while (iss >> value) { v1.push_back(value); } v2.push_back(v1); } data.resize(v2[0].size()); for (int i=0; i