////////////////////////////////// // ////////////////////////////////// int plot(const char* Filename = "table.dat") { gStyle->SetOptStat(kFALSE); TFile f("cid.root","RECREATE"); char t[256]; int cid1, cid2, run, start_run, end_run; char s4[100]; TTree *table = new TTree("cid","cid"); table -> Branch("cid1",&cid1,"cid1/I"); table -> Branch("cid2",&cid2,"cid2/I"); table -> Branch("name",&s4,"name/C"); table -> Branch("run",&run,"run/I"); // TH2C *table1 = new TH2C(t1, t, 1000,start_run ,end_run, 5000, 0, 500000); // TH2C *table2 = new TH2C(t2, t, 1000,start_run ,end_run, 5000, 0, 500000); // TH2C *table3 = new TH2C(t3, t, 1000,start_run ,end_run, 5000, 0, 500000); FILE *fp = fopen(Filename,"r"); int s1; int s2; int s3; while(!feof(fp)) { fscanf(fp,"%d %s %d %d",&s1,s4,&s2,&s3); printf( "%d %s %d %d\n",s1,s4,s2,s3); int s5 = s2 -s3; s5 = abs(s5); if ( s5!=0){ printf("%d %d %d %s %d\n", s1,s2,s3,s4,s5); } run = s1; cid1 = s2; cid2 = s3; // table1->SetLineColor(1); // table2->SetLineColor(2); // table3->SetLineColor(3); // table1->GetXaxis()->SetTitle("PROCESS RUN"); // table1->GetYaxis()->SetTitle("CID"); // table2->GetXaxis()->SetTitle("PROCESS RUN"); // table2->GetYaxis()->SetTitle("CID"); // table3->GetXaxis()->SetTitle("PROCESS RUN"); // table3->GetYaxis()->SetTitle("CID"); // table1->Fill(s1,s2); // table2->Fill(s1,s3); // table3->Fill(s1,s5); table->Fill(); } fclose(fp); // table1->Draw("BOX"); // table2->Draw("SAMEBOX"); // table3->Draw("SAMEBOX"); // strcat(name,".eps"); // c1->Print(name); // table->Write(); f.Write(); f.Close(); }