void plot_pid_purity(){ gStyle->SetOptStat(0); TCanvas *c1=new TCanvas("c1","c1",1600,600); c1->Divide(2,2); TH2F *MyKmDenom=(TH2F *)(_file0->FindObjectAny("KmDenom"))->Clone("KmDenom"); TH2F *MyKmNumer_Em=(TH2F *)(_file0->FindObjectAny("KmNumer_Em"))->Clone("MyKmNumer_Em"); TH2F *MyKmNumer_Pim=(TH2F *)(_file0->FindObjectAny("KmNumer_Pim"))->Clone("MyKmNumer_Pim"); TH2F *MyKmNumer_Km=(TH2F *)(_file0->FindObjectAny("KmNumer_Km"))->Clone("MyKmNumer_Km"); TH2F *MyKmNumer_aP=(TH2F *)(_file0->FindObjectAny("KmNumer_aP"))->Clone("MyKmNumer_aP"); MyKmDenom->Sumw2(); MyKmNumer_Em->Sumw2(); MyKmNumer_Pim->Sumw2(); MyKmNumer_Km->Sumw2(); MyKmNumer_aP->Sumw2(); MyKmNumer_Em->Divide(MyKmDenom); MyKmNumer_Pim->Divide(MyKmDenom); MyKmNumer_Km->Divide(MyKmDenom); MyKmNumer_aP->Divide(MyKmDenom); c1->cd(1); MyKmNumer_Em->GetXaxis()->SetRangeUser(0,40); MyKmNumer_Em->GetXaxis()->SetLabelSize(0.04); MyKmNumer_Em->GetXaxis()->SetTitleSize(0.05); MyKmNumer_Em->GetYaxis()->SetLabelSize(0.04); MyKmNumer_Em->GetYaxis()->SetTitleSize(0.05); MyKmNumer_Em->GetXaxis()->SetRangeUser(0,20); MyKmNumer_Em->SetTitle("Ratio of e^{-} ID to true K^{-}"); MyKmNumer_Em->SetXTitle("#theta [degrees]"); MyKmNumer_Em->SetYTitle("p [GeV/c]"); MyKmNumer_Em->Draw("colz"); c1->cd(2); MyKmNumer_Pim->GetXaxis()->SetLabelSize(0.04); MyKmNumer_Pim->GetXaxis()->SetTitleSize(0.05); MyKmNumer_Pim->GetYaxis()->SetLabelSize(0.04); MyKmNumer_Pim->GetYaxis()->SetTitleSize(0.05); MyKmNumer_Pim->GetXaxis()->SetRangeUser(0,20); MyKmNumer_Pim->SetTitle("Ratio of #pi^{-} ID to true K^{-}"); MyKmNumer_Pim->SetXTitle("#theta [degrees]"); MyKmNumer_Pim->SetYTitle("p [GeV/c]"); MyKmNumer_Pim->Draw("colz"); c1->cd(3); MyKmNumer_Km->GetXaxis()->SetRangeUser(0,20); MyKmNumer_Km->GetXaxis()->SetLabelSize(0.04); MyKmNumer_Km->GetXaxis()->SetTitleSize(0.05); MyKmNumer_Km->GetYaxis()->SetLabelSize(0.04); MyKmNumer_Km->GetYaxis()->SetTitleSize(0.05); MyKmNumer_Km->SetTitle("Ratio of K^{-} ID to true K^{-}"); MyKmNumer_Km->SetXTitle("#theta [degrees]"); MyKmNumer_Km->SetYTitle("p [GeV/c]"); MyKmNumer_Km->Draw("colz"); c1->cd(4); MyKmNumer_aP->GetXaxis()->SetRangeUser(0,20); MyKmNumer_aP->GetXaxis()->SetLabelSize(0.04); MyKmNumer_aP->GetXaxis()->SetTitleSize(0.05); MyKmNumer_aP->GetYaxis()->SetLabelSize(0.04); MyKmNumer_aP->GetYaxis()->SetTitleSize(0.05); MyKmNumer_aP->SetTitle("Ratio of anti-proton ID to true K^{-}"); MyKmNumer_aP->SetXTitle("#theta [degrees]"); MyKmNumer_aP->SetYTitle("p [GeV/c]"); MyKmNumer_aP->Draw("colz"); TCanvas *c2=new TCanvas(); TH1D *km=MyKmNumer_Km->ProjectionX("km",21,21); TH1D *ap=MyKmNumer_aP->ProjectionX("ap",21,21); TH1D *pm=MyKmNumer_Pim->ProjectionX("pm",21,21); TH1D *em=MyKmNumer_Em->ProjectionX("em",21,21); km->GetXaxis()->SetTitleOffset(0.8); km->GetYaxis()->SetRangeUser(0,1.); km->SetTitle("Kaon PID efficiency at p=2.0 GeV/c"); km->SetYTitle("fraction PIDFOM ID/true ID"); km->SetMarkerColor(1); km->SetLineColor(1); km->SetMarkerStyle(20); km->Draw(); em->SetMarkerColor(2); em->SetLineColor(2); em->SetMarkerStyle(21); em->Draw("same"); pm->SetMarkerColor(4); pm->SetLineColor(4); pm->SetMarkerStyle(22); pm->Draw("same"); ap->SetMarkerColor(8); ap->SetLineColor(8); ap->SetMarkerStyle(23); ap->Draw("same"); TCanvas *c3=new TCanvas(); TH1D *km2=MyKmNumer_Km->ProjectionX("km2",41,41); TH1D *ap2=MyKmNumer_aP->ProjectionX("ap2",41,41); TH1D *pm2=MyKmNumer_Pim->ProjectionX("pm2",41,41); TH1D *em2=MyKmNumer_Em->ProjectionX("em2",41,41); km2->GetXaxis()->SetTitleOffset(0.8); km2->GetYaxis()->SetRangeUser(0,1.); km2->SetTitle("Kaon PID efficiency at p=4.0 GeV/c"); km2->SetYTitle("fraction PIDFOM ID/true ID"); km2->SetMarkerColor(1); km2->SetLineColor(1); km2->SetMarkerStyle(20); km2->Draw(); em2->SetMarkerColor(2); em2->SetLineColor(2); em2->SetMarkerStyle(21); em2->Draw("same"); pm2->SetMarkerColor(4); pm2->SetLineColor(4); pm2->SetMarkerStyle(22); pm2->Draw("same"); ap2->SetMarkerColor(8); ap2->SetLineColor(8); ap2->SetMarkerStyle(23); ap2->Draw("same"); }