{ gStyle->SetOptStat(kFALSE); TFile f("cid.root","RECREATE"); string table_name; FILE *ft = fopen("table.dat","r"); while(!feof(ft)){ fscanf(ft,"%s",&table_name); char t[]= table_name; printf("%s\n",t); char t1[256]; char t2[256]; char t3[256]; char run_cid[256]; char cid_date[256]; char run_date[256]; strcpy(t1,t); strcpy(t2,t); strcpy(t3,t); strcpy(run_cid,t); strcpy(cid_date,t); strcpy(run_date,t); strcat(t1,"a"); strcat(t2,"b"); strcat(t3,"c"); Int_t run; Int_t cid; Int_t date; Int_t start_run = 190000; Int_t end_run = 202000; TTree *table = new TTree(t,"cid"); table -> Branch("cid",&cid,"cid/I"); table -> Branch("date",&date,"date/I"); table -> Branch("run",&run,"run/I"); TH2C *table1 = new TH2C(t1, t, 1000,start_run ,end_run, 5000, 90000, 500000); TH2C *table2 = new TH2C(t2, t, 5000, 90000, 500000,5000, 500000000, 1500000000); TH2C *table3 = new TH2C(t3, t, 1000,start_run ,end_run, 5000, 500000000, 1500000000); FILE *fp = fopen("datafile.dat","r"); int s1; int s2; int s3; char s4[256]; while(!feof(fp)){ fscanf(fp,"%d %s %d %d",&s1,&s4,&s2,&s3); if (!strcmp (s4,t)) { // if ( s5!=0){ // printf("%d %d %d %s %d\n", s1,s2,s3,s4,s5); // } run = s1; cid = s2; date = s3; table1->SetLineColor(1); table2->SetLineColor(1); table3->SetLineColor(1); table1->GetXaxis()->SetTitle("PROCESS RUN"); table1->GetYaxis()->SetTitle("CID"); table2->GetXaxis()->SetTitle("CID"); table2->GetYaxis()->SetTitle("DATE"); table3->GetXaxis()->SetTitle("PROCESS RUN"); table3->GetYaxis()->SetTitle("DATE"); table1->Fill(s1,s2); table2->Fill(s2,s3); table3->Fill(s1,s3); table->Fill(); } } fclose(fp); strcat(run_cid,"_run_cid.eps"); strcat(cid_date,"_cid_date.eps"); strcat(run_date,"_run_date.eps"); table1->Draw("BOX"); c1->Print(run_cid); table2->Draw("BOX"); c1->Print(cid_date); table3->Draw("BOX"); c1->Print(run_date); } f->Write(); }