void plot_resolutions(void) { // // plot the number of fits to a cdc segment that result in prob > prob_cut (currently set to 0.01). // // #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kFALSE); // gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; Int_t j,jj; #define npts 6; #define npts5 2; // input data set first point (actually -1) to -10 so that it is not plotted. // use offset on x-axis to make data visible and give negative y-values for reference (not plotted) Double_t config[npts]={-1,1,2,3,4,20}; Double_t config_err[npts]={-1,0.001,0.001,0.001,0.001,20}; Double_t sig_omega_nohadr[npts]={-1,20.2,19.7,14.6,13.5,-1}; Double_t sig_omega_hadr[npts]={-1,26.7,24.5,17.4,15.9,-1}; Double_t sig_b1pi_nohadr[npts]={-1,32.3,15.8,16.7,13.9,-1}; Double_t sig_b1pi_hadr[npts]={-1,42.3,29.5,13.5,14.2,-1}; Double_t sig_omega_nohadr_err[npts]={-1,1,1,1,1,-1}; Double_t sig_omega_hadr_err[npts]={-1,1.5,1.5,1.5,-1}; Double_t sig_b1pi_nohadr_err[npts]={-1,4,3,2,2,-1}; Double_t sig_b1pi_hadr_err[npts]={-1,7,5,2,2,-1}; Double_t current[npts]={2500,1500,1200,1050,750,-1}; Double_t current2[npts]={2500,1500,1200,1050,-1,-1}; Double_t current_err[npts]={1,1,1,1,1,-1}; Double_t current2_err[npts]={1,1,1,1,-1,-1}; Double_t omega_sigma1[npts]={100,20.1,26.2,25.8,32.0,100}; Double_t omega_sigma2[npts]={-1,20.3,22.7,23.1,28.2,-1}; Double_t omega_sigma3[npts]={-1,14.6,19.0,19.3,26.7,-1}; Double_t omega_sigma4[npts]={-1,11.1,14.4,15.3,19.2,-1}; Double_t omega_sigma1_err[npts]={100,1.5,1.5,1.5,1.5,100}; Double_t omega_sigma2_err[npts]={-1,1.5,1.5,1.5,1.5,-1}; Double_t omega_sigma3_err[npts]={-1,1.5,1.5,1.5,1.5,-1}; Double_t omega_sigma4_err[npts]={-1,1.5,1.5,1.5,1.5,-1}; Double_t sigma_pip[npts]={-1,2.6,3.0,3.4,5.9,-1}; Double_t sigma_pim[npts]={-1,3.0,2.9,3.7,6.6,-1}; Double_t sigma_p[npts]={-1,3.6,3.6,3.7,5.0,-1}; Double_t sigma_pip_err[npts]={-1,0.2,0.2,0.2,0.2,-1}; Double_t sigma_pim_err[npts]={-1,0.2,0.2,0.2,0.2,-1}; Double_t sigma_p_err[npts]={-1,0.2,0.2,0.2,0.2,-1}; Double_t SoverB[npts]={-1,1,0.5,0.38,-1,-1}; // compute resolutions normalized by solenoidal current. Double_t omega_sigma1_norm[npts]; Double_t omega_sigma2_norm[npts]; Double_t omega_sigma3_norm[npts]; Double_t omega_sigma4_norm[npts]; Double_t sigma_pip_norm[npts]; Double_t sigma_pim_norm[npts]; Double_t sigma_p_norm[npts]; for (j=0;jSetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); c1->SetBorderMode(0); c1->SetFillColor(0); TGraphErrors *sigma1= new TGraphErrors (npts,current,omega_sigma1,current_err,omega_sigma1_err); TGraphErrors *sigma2= new TGraphErrors (npts,current,omega_sigma2,current_err,omega_sigma2_err); TGraphErrors *sigma3= new TGraphErrors (npts,current,omega_sigma3,current_err,omega_sigma3_err); TGraphErrors *sigma4= new TGraphErrors (npts,current,omega_sigma4,current_err,omega_sigma4_err); TGraphErrors *pip= new TGraphErrors (npts,current,sigma_pip,current_err,sigma_pip_err); TGraphErrors *pim= new TGraphErrors (npts,current,sigma_pim,current_err,sigma_pim_err); TGraphErrors *p= new TGraphErrors (npts,current,sigma_p,current_err,sigma_p_err); TLegend *leg = new TLegend(0.55,0.70,0.85,0.9); leg->AddEntry(sigma1,"#sigma_{#omega}","p"); leg->AddEntry(sigma2,"#sigma_{#omega} (#Deltap/p<0.2)","p"); leg->AddEntry(sigma3,"#sigma_{#omega} (Gen #pi^{0})","p"); leg->AddEntry(sigma4,"#sigma_{#omega} (Gen #pi^{0}, #Deltap/p<0.2)","p"); //leg->AddEntry(pip,"#sigma_{#pi^{+}}","p"); //leg->AddEntry(pim,"#sigma_{#pi^{-}}","p"); //leg->AddEntry(p,"#sigma_{p}","p"); sigma1->SetTitle(""); sigma1->GetXaxis()->SetRangeUser(xmin,xmax); sigma1->GetYaxis()->SetRangeUser(ymin,ymax); sigma1->GetXaxis()->SetTitleSize(0.04); sigma1->GetYaxis()->SetTitleSize(0.04); sigma1->GetYaxis()->SetTitleOffset(1.5); sigma1->GetXaxis()->SetTitle("Solenoid Current (A)"); sigma1->GetYaxis()->SetTitle("Reconstructed #omega width (MeV)"); sigma1->GetXaxis()->SetNdivisions(5); Double_t markersize=1.0; sigma1->SetMarkerColor(2); sigma1->SetMarkerSize(markersize); sigma1->SetMarkerStyle(21); sigma1->Draw("AP"); sigma2->SetMarkerColor(1); sigma2->SetMarkerSize(markersize); sigma2->SetMarkerStyle(24); sigma2->Draw("Psame"); sigma3->SetMarkerColor(4); sigma3->SetMarkerSize(markersize); sigma3->SetMarkerStyle(22); sigma3->Draw("Psame"); sigma4->SetMarkerColor(1); sigma4->SetMarkerSize(markersize); sigma4->SetMarkerStyle(23); sigma4->Draw("Psame"); pip->SetMarkerColor(2); pip->SetMarkerSize(markersize); pip->SetMarkerStyle(25); //pip->Draw("Psame"); pim->SetMarkerColor(2); pim->SetMarkerSize(markersize); pim->SetMarkerStyle(26); //pim->Draw("Psame"); p->SetMarkerColor(2); p->SetMarkerSize(markersize); p->SetMarkerStyle(26); //p->Draw("Psame"); leg->Draw(); TCanvas *c2 = new TCanvas("c2","Tracking Resolutions",200,10,700,700); c2->SetBorderMode(0); c2->SetFillColor(0); c2->SetGridx(); c2->SetGridy(); c2->SetBorderMode(0); c2->SetFillColor(0); Double_t xmin=500; Double_t xmax=1500; Double_t ymin=0; Double_t ymax=8; pip->SetTitle(""); pip->GetXaxis()->SetRangeUser(xmin,xmax); pip->GetYaxis()->SetRangeUser(ymin,ymax); pip->GetXaxis()->SetTitleSize(0.04); pip->GetYaxis()->SetTitleSize(0.04); pip->GetYaxis()->SetTitleOffset(1.5); pip->GetXaxis()->SetTitle("Solenoid Current (A)"); pip->GetYaxis()->SetTitle("Reconstructed Track Resolution (%)"); pip->GetXaxis()->SetNdivisions(5); pip->SetMarkerColor(2); pip->SetMarkerSize(markersize); pip->SetMarkerStyle(20); pip->Draw("AP"); pim->SetMarkerColor(2); pim->SetMarkerSize(markersize); pim->SetMarkerStyle(21); pim->Draw("Psame"); p->SetMarkerColor(2); p->SetMarkerSize(markersize); p->SetMarkerStyle(22); p->Draw("Psame"); TLegend *leg1 = new TLegend(0.55,0.80,0.65,0.9); leg1->AddEntry(pip,"#pi^{+}","p"); leg1->AddEntry(pim,"#pi^{-}","p"); leg1->AddEntry(p,"p","p"); leg1->Draw(); TCanvas *c3 = new TCanvas("c3","Resolutions normalized",200,10,700,700); c3->SetBorderMode(0); c3->SetFillColor(0); c3->SetGridx(); c3->SetGridy(); c3->SetBorderMode(0); c3->SetFillColor(0); Double_t xmin=500; Double_t xmax=1500; Double_t ymin=0; Double_t ymax=2; TGraph *sigma1_norm = new TGraph (npts,current,omega_sigma1_norm); TGraph *sigma2_norm = new TGraph (npts,current,omega_sigma2_norm); TGraph *sigma3_norm = new TGraph (npts,current,omega_sigma3_norm); TGraph *sigma4_norm = new TGraph (npts,current,omega_sigma4_norm); TGraph *pip_norm = new TGraph (npts,current,sigma_pip_norm); TGraph *pim_norm = new TGraph (npts,current,sigma_pim_norm); TGraph *p_norm = new TGraph (npts,current,sigma_p_norm); TLegend *leg2 = new TLegend(0.5,0.60,0.85,0.9); leg2->AddEntry(sigma1,"#sigma_{#omega}","p"); leg2->AddEntry(sigma2,"#sigma_{#omega} (#Deltap/p<0.2)","p"); leg2->AddEntry(sigma3,"#sigma_{#omega} (Gen #pi^{0})","p"); leg2->AddEntry(sigma4,"#sigma_{#omega} (Gen #pi^{0}, #Deltap/p<0.2)","p"); leg2->AddEntry(pip,"#sigma_{#pi^{+}}","p"); leg2->AddEntry(pim,"#sigma_{#pi^{-}}","p"); leg2->AddEntry(p,"#sigma_{p}","p"); sigma1_norm->SetTitle(""); sigma1_norm->GetXaxis()->SetRangeUser(xmin,xmax); sigma1_norm->GetYaxis()->SetRangeUser(ymin,ymax); sigma1_norm->GetXaxis()->SetTitleSize(0.04); sigma1_norm->GetYaxis()->SetTitleSize(0.04); sigma1_norm->GetYaxis()->SetTitleOffset(1.5); sigma1_norm->GetXaxis()->SetTitle("Solenoid Current (A)"); sigma1_norm->GetYaxis()->SetTitle("Reconstructed #omega width (MeV)"); sigma1_norm->GetXaxis()->SetNdivisions(5); Double_t markersize=1.0; sigma1_norm->SetMarkerColor(2); sigma1_norm->SetMarkerSize(markersize); sigma1_norm->SetMarkerStyle(21); sigma1_norm->Draw("AP"); sigma2_norm->SetMarkerColor(1); sigma2_norm->SetMarkerSize(markersize); sigma2_norm->SetMarkerStyle(24); sigma2_norm->Draw("Psame"); sigma3_norm->SetMarkerColor(4); sigma3_norm->SetMarkerSize(markersize); sigma3_norm->SetMarkerStyle(22); sigma3_norm->Draw("Psame"); sigma4_norm->SetMarkerColor(1); sigma4_norm->SetMarkerSize(markersize); sigma4_norm->SetMarkerStyle(23); sigma4_norm->Draw("Psame"); pip_norm->SetMarkerColor(2); pip_norm->SetMarkerSize(markersize); pip_norm->SetMarkerStyle(25); pip_norm->Draw("Psame"); pim_norm->SetMarkerColor(2); pim_norm->SetMarkerSize(markersize); pim_norm->SetMarkerStyle(26); pim_norm->Draw("Psame"); p_norm->SetMarkerColor(2); p_norm->SetMarkerSize(markersize); p_norm->SetMarkerStyle(27); p_norm->Draw("Psame"); leg2->Draw(); TCanvas *c4 = new TCanvas("c4","Resolutions vs configuration",200,10,700,700); c4->SetBorderMode(0); c4->SetFillColor(0); c4->SetGridx(); c4->SetGridy(); c4->SetBorderMode(0); c4->SetFillColor(0); Double_t xmin=0.5; Double_t xmax=4.5; Double_t ymin=0; Double_t ymax=60; TGraphErrors *omega_nohadr = new TGraphErrors (npts,config,sig_omega_nohadr,config_err,sig_omega_nohadr_err); TGraphErrors *omega_hadr = new TGraphErrors (npts,config,sig_omega_hadr,config_err,sig_omega_hadr_err); TGraphErrors *b1pi_nohadr = new TGraphErrors (npts,config,sig_b1pi_nohadr,config_err,sig_b1pi_nohadr_err); TGraphErrors *b1pi_hadr = new TGraphErrors (npts,config,sig_b1pi_hadr,config_err,sig_b1pi_hadr_err); TLegend *leg3 = new TLegend(0.45,0.75,0.85,0.9); leg3->AddEntry(omega_nohadr,"#omega HADR=DCAY=0","p"); leg3->AddEntry(omega_hadr,"#omega HADR=DCAY=1","p"); leg3->AddEntry(b1pi_nohadr,"b_{1}#pi HADR=DCAY=0","p"); leg3->AddEntry(b1pi_hadr,"b_{1}#pi HADR=DCAY=1","p"); omega_nohadr->SetTitle(""); omega_nohadr->GetXaxis()->SetRangeUser(xmin,xmax); omega_nohadr->GetYaxis()->SetRangeUser(ymin,ymax); omega_nohadr->GetXaxis()->SetTitleSize(0.04); omega_nohadr->GetYaxis()->SetTitleSize(0.04); omega_nohadr->GetYaxis()->SetTitleOffset(1.5); omega_nohadr->GetXaxis()->SetTitle(""); omega_nohadr->GetXaxis()->SetLabelSize(0); omega_nohadr->GetYaxis()->SetTitle("Reconstructed #omega width (MeV)"); omega_nohadr->GetXaxis()->SetNdivisions(5); Double_t markersize=1.0; omega_nohadr->SetMarkerColor(2); omega_nohadr->SetMarkerSize(markersize); omega_nohadr->SetMarkerStyle(24); omega_nohadr->Draw("AP"); omega_hadr->SetMarkerColor(2); omega_hadr->SetMarkerSize(markersize); omega_hadr->SetMarkerStyle(20); omega_hadr->Draw("Psame"); b1pi_nohadr->SetMarkerColor(4); b1pi_nohadr->SetMarkerSize(markersize); b1pi_nohadr->SetMarkerStyle(25); b1pi_nohadr->Draw("Psame"); b1pi_hadr->SetMarkerColor(4); b1pi_hadr->SetMarkerSize(markersize); b1pi_hadr->SetMarkerStyle(21); b1pi_hadr->Draw("Psame"); leg3->Draw(); sprintf(string,"Full\n"); t1 = new TLatex(0.90,-3,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"Full\n"); t1 = new TLatex(1.90,-3,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"#Deltap/p<0.2\n"); t1 = new TLatex(1.8,-6,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"Gen #pi^{0}\n"); t1 = new TLatex(2.9,-3,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"Gen #pi^{0}\n"); t1 = new TLatex(3.9,-3,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"#Deltap/p<0.2\n"); t1 = new TLatex(3.8,-6,string); t1->SetTextColor(1); // t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); TCanvas *c5 = new TCanvas("c5","Resolutions vs configuration",200,10,700,700); c5->SetBorderMode(0); c5->SetFillColor(0); c5->SetGridx(); c5->SetGridy(); c5->SetBorderMode(0); c5->SetFillColor(0); Double_t xmin=1000; Double_t xmax=1500; Double_t ymin=0; Double_t ymax=1.5; TGraph *sb= new TGraph (npts,current2,SoverB); TLegend *leg5 = new TLegend(0.4,0.75,0.85,0.9); leg5->AddEntry(sb,"FOM ~ #frac{1}{Rate(E&M) #times #sigma_{#omega}}","p"); sb->SetTitle(""); sb->GetXaxis()->SetRangeUser(xmin,xmax); sb->GetYaxis()->SetRangeUser(ymin,ymax); sb->GetXaxis()->SetTitleSize(0.04); sb->GetYaxis()->SetTitleSize(0.04); sb->GetYaxis()->SetTitleOffset(1.5); sb->GetXaxis()->SetTitle("Solenoid Current (A)"); sb->GetYaxis()->SetTitle("Figure-of-merit"); sb->GetXaxis()->SetNdivisions(5); Double_t markersize=1.5; sb->SetMarkerColor(2); sb->SetMarkerSize(markersize); sb->SetMarkerStyle(20); sb->Draw("AP"); leg5->Draw(); // c1->SaveAs("plot_resolutions_c1.eps"); c1->SaveAs("plot_resolutions_c1.png"); c2->SaveAs("plot_resolutions_c2.eps"); c2->SaveAs("plot_resolutions_c2.png"); c3->SaveAs("plot_resolutions_c3.eps"); c3->SaveAs("plot_resolutions_c3.png"); c4->SaveAs("plot_resolutions_c4.eps"); c4->SaveAs("plot_resolutions_c4.png"); c5->SaveAs("plot_resolutions_c5.eps"); c5->SaveAs("plot_resolutions_c5.png"); }