void DrawDmDiff2_HIM(TString path="/home/karavdin/datastorage/BOXoutputJune2014_NewGeo5/"){ // double dP[11]={-1e-1,-1e-2,-1e-3,-1e-4,-1e-5,0,1e-5,1e-4,1e-3,1e-2,1e-1}; // TString dPstr[Nsteps]={"0","-1e-1", "-1e-2", "-1e-3", "-1e-4", "-1e-5", "1e-5", "1e-4", "1e-3", "1e-2", "1e-1"}; const int Nsteps=7; // TString dPstr[Nsteps]={"0","-1e-3", "-1e-4"}; TString dPstr[Nsteps]={"0","-1e-1", "-1e-2", "-1e-3", "-1e-4", "-1e-6", "-1e-10"}; // const int Nsteps=3; // TString dPstr[Nsteps]={"0","0","0"}; TH2D *hthphLMD[Nsteps]; TH2D *hthphIP[Nsteps]; TH2D *hthIPthLMD[Nsteps]; TH2D *hphIPphLMD[Nsteps]; TH1D *hthLMD[Nsteps]; TH1D *hthIP[Nsteps]; TCanvas *c1 = new TCanvas(); TString name_out = path+"/PlotsAccSummary_Cuts_PrecIsPbeam_all_15.pdf"; name_out_o = name_out+"("; name_out_c = name_out+")"; TLegend *leg = new TLegend(0.75,0.6,0.98,0.99); leg->SetHeader("P_{sim}=P_{beam}+dP, P_{rec}=P_{beam}"); c1->Divide(2,3); for(int i=0;iGet("hphthLMD"); if(hresPhi_phi==0) continue; // cout<<"read hhphthLMD"<Get("hphthLMD"); hthphLMD[i]->RebinY(5); hthphLMD[i]->RebinX(5); hthphLMD[i]->Print(); TString nameAcc = "dP ="; nameAcc+=dPstr[i]; hthphLMD[i]->SetTitle(nameAcc.Data()); hthLMD[i] = hthphLMD[i]->ProjectionY("_py",0,-1,"e"); c1->cd(1); if(i>0){ hthphLMD[i]->Divide(hthphLMD[0]); hthphLMD[i]->SetMaximum(1.5); hthphLMD[i]->SetMinimum(0.5); hthLMD[i]->Divide(hthLMD[0]); hthLMD[i]->SetTitle(nameAcc.Data()); hthLMD[i]->SetMaximum(1.05); hthLMD[i]->SetMinimum(0.95); } hthphLMD[i]->SetStats(kFALSE); hthphLMD[i]->Draw("colz"); // c1->Print(name_out_o); hthphIP[i] = (TH2D*)f_in->Get("hphthIP"); hthphIP[i]->RebinY(5); hthphIP[i]->RebinX(5); hthphIP[i]->SetTitle(nameAcc.Data()); // hthIP[i] = hthphIP[i]->ProjectionY(); hthIP[i] = hthphIP[i]->ProjectionY("_py",0,-1,"e"); c1->cd(2); if(i>0){ hthphIP[i]->Divide(hthphIP[0]); hthphIP[i]->SetMaximum(1.5); hthphIP[i]->SetMinimum(0.5); hthIP[i]->Divide(hthIP[0]); hthIP[i]->SetTitle(nameAcc.Data()); hthIP[i]->SetMaximum(1.05); hthIP[i]->SetMinimum(0.95); } hthphIP[i]->SetStats(kFALSE); hthphIP[i]->Draw("colz"); hthIPthLMD[i] = (TH2D*)f_in->Get("hthIPthLMD"); hthIPthLMD[i]->RebinY(5); hthIPthLMD[i]->RebinX(5); hthIPthLMD[i]->SetTitle(nameAcc.Data()); c1->cd(3); if(i>0){ hthIPthLMD[i]->Divide(hthIPthLMD[0]); hthIPthLMD[i]->SetMaximum(1.5); hthIPthLMD[i]->SetMinimum(0.5); } hthIPthLMD[i]->SetStats(kFALSE); hthIPthLMD[i]->Draw("colz"); hphIPphLMD[i] = (TH2D*)f_in->Get("hphIPphLMD"); hphIPphLMD[i]->RebinY(5); hphIPphLMD[i]->RebinX(5); hphIPphLMD[i]->SetTitle(nameAcc.Data()); c1->cd(4); if(i>0){ hphIPphLMD[i]->Divide(hphIPphLMD[0]); hphIPphLMD[i]->SetMaximum(1.5); hphIPphLMD[i]->SetMinimum(0.5); } hphIPphLMD[i]->SetStats(kFALSE); hphIPphLMD[i]->Draw("colz"); c1->cd(5); hthLMD[i]->Draw(); c1->cd(6); hthIP[i]->Draw(); c1->Print(name_out_o); // if(i==10) c1->Print(name_out_c); // else c1->Print(name_out_o); // leg->AddEntry(hresPhi_phi_mean[i],Pleg.Data(),"ep"); // f_in->Close(); } // leg->Draw(); c1->Clear(); c1->Print(name_out_c); TString nameroot = path+"/PlotsAccSummary_Cuts_PrecIsPbeam_all_15.root"; TFile *f = new TFile(nameroot,"RECREATE"); for(int i=0;iWrite(); hthphIP[i]->Write(); hthIPthLMD[i]->Write(); hphIPphLMD[i]->Write(); } f->Write(); f->Close(); // TString name_out2 = path+"/PlotsAccSummary_Cuts_PrecIsPbeam_SUMMARY.pdf"; // name_out2_o = name_out2+"("; // name_out2_c = name_out2+")"; // c1->Divide(2,2); // c1->cd(1); // hthphLMD[Nsteps-1]->Draw("colz"); // c1->cd(2); // hthphLMD[Nsteps-2]->Draw("colz"); // c1->cd(3); // hthphLMD[Nsteps-3]->Draw("colz"); // c1->cd(4); // hthphLMD[Nsteps-4]->Draw("colz"); // c1->Print(name_out2_o); // c1->Clear(); // c1->Divide(2,2); // c1->cd(1); // hthphIP[Nsteps-1]->Draw("colz"); // c1->cd(2); // hthphIP[Nsteps-2]->Draw("colz"); // c1->cd(3); // hthphIP[Nsteps-3]->Draw("colz"); // c1->cd(4); // hthphIP[Nsteps-4]->Draw("colz"); // c1->Print(name_out2_c); //TString dPstr[Nsteps]={"0","-1e-1", "-1e-2", "-1e-3", "-1e-4", "-1e-6", "-1e-10"}; TString name_out2 = path+"/PlotsAccSummary_Cuts_PrecIsPbeam_SUMMARY2_all_15.pdf"; name_out2_o = name_out2+"("; name_out2_c = name_out2+")"; c1->Divide(2,2); c1->cd(1); hthphLMD[Nsteps-1]->Draw("colz"); c1->cd(2); hthphLMD[3]->Draw("colz"); c1->cd(3); hthphLMD[2]->Draw("colz"); c1->cd(4); hthphLMD[1]->Draw("colz"); c1->Print(name_out2_o); c1->Clear(); c1->Divide(2,2); c1->cd(1); hthphIP[Nsteps-1]->Draw("colz"); c1->cd(2); hthphIP[3]->Draw("colz"); c1->cd(3); hthphIP[2]->Draw("colz"); c1->cd(4); hthphIP[1]->Draw("colz"); c1->Print(name_out2_c); }