int quit=0; void handler(int){quit=1;} void scan_offset_c(){ signal(SIGINT,handler); TCanvas c("c1","c1",0,0,1600,800); c.Divide(1,1); for(int i=0; i<=23; i++) { auto c1=c.cd(1); c1->SetGrid(1,1); TFile *f = new TFile(Form("../../results_run21.root")); //TH2F *h2 = (TH2F*)(f->Get("phicut/pczguess_vs_pc_int")); TH2F *h2 = (TH2F*)(f->Get(std::string("sx3_z_phi2_cwire"+std::to_string(i)).c_str())); // TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2")); if(!h2) continue; h2->SetTitle(Form("cathode_wire%d",i)); h2->Draw("colz"); c1->Modified(); c1->Update(); /* auto c2=c.cd(2); c2->SetGrid(1,1); TH2F *h3 = (TH2F*)(f->Get("sx3phi_vs_pcphi1")); // TH2F *h2 = (TH2F*)(f->Get("hPCQQQ/PC_XY_Projection_QQQ2")); if(!h3) continue; h3->SetTitle(Form("case%d",i)); h3->Draw("colz"); c2->Modified(); c2->Update();*/ while(gPad->WaitPrimitive()); f->Close(); if(i==23) i=0; if(quit) break; } }