void plot_signif2(void) { // plot significance results obtained using gen_phithe.C // data at constant phi_norm #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); // char string[256]; char filename[80]; Int_t j,jj; // input data #define npts 7; // add dummy point on end to be able to plot beyond last data Float_t phi_norm1[npts]={0,1,1,1,1,1,10}; Float_t theta_norm1[npts]={0,1.5,1.25,1.0,0.75,0.5,10}; Float_t nevents1[npts]={0,6090,6045,6000,5954,5909,100000}; Float_t gensb1[npts]={-1,0.562,0.469,0.375,0.281,0.187,10}; Float_t logsig1[npts]={-1,12.2,10.1,8.2,6.5,4.7,100}; Float_t gensig1[npts]={-1,12.07,10.06,8.05,6.03,4.02,100}; Float_t fitsig1[npts]={-1,12.84,10.51,8.48,6.69,4.73,100}; // write data to file FILE *out; sprintf(filename,"plot_signif2.dat"); out = fopen(filename,"w+"); for (j=1;jSetGridx(); c1->SetGridy(); c1->SetBorderMode(0); c1->SetFillColor(0); TGraph *glogsig0 = new TGraph (npts,gensb1,logsig1); TGraph *gphi_norm1 = new TGraph (npts,gensb1,phi_norm); TGraph *gtheta_norm1 = new TGraph (npts,gensb1,theta_norm); TGraph *ggensig1 = new TGraph (npts,gensb1,gensig1); glogsig0->GetXaxis()->SetRangeUser(xmin,xmax); glogsig0->GetYaxis()->SetRangeUser(ymin,ymax); glogsig0->GetXaxis()->SetTitleSize(0.05); glogsig0->GetYaxis()->SetTitleSize(0.05); glogsig0->GetXaxis()->SetTitle("Generated Signal/Background"); glogsig0->GetYaxis()->SetTitle(""); glogsig0->SetTitle(""); glogsig0->SetMarkerColor(2); glogsig0->SetMarkerStyle(20); ggensig1->SetMarkerColor(2); ggensig1->SetMarkerStyle(21); gphi_norm1->SetMarkerColor(1); gphi_norm1->SetMarkerStyle(25); gtheta_norm1->SetMarkerColor(1); gtheta_norm1->SetMarkerStyle(24); TLegend *leg = new TLegend(0.45,0.70,0.85,0.9); leg->AddEntry(glogsig0,"Log Likelihood","p"); leg->AddEntry(ggensig1,"Gen S/sqrt(B)","p"); leg->AddEntry(gphi_norm1,"#phi parameter #times 10","p"); leg->AddEntry(gtheta_norm1,"#theta parameter #times 10","p"); glogsig0->Draw("AP"); leg->Draw(); gphi_norm1->Draw("sameP"); gtheta_norm1->Draw("sameP"); ggensig1->Draw("sameP"); sprintf (string,"Fit function = %.1f + %.2f B\n"); // printf("string=%s",string); t1 = new TLatex(0.2,0.85,string); t1->SetNDC(); t1->SetTextSize(0.04); // t1->Draw(); // TCanvas *c2 = new TCanvas("c2","c2 plot_signif2",200,10,700,500); TGraph *glogsig1 = new TGraph (npts,gensb1,logsig1); for (j=0;jGetXaxis()->SetRangeUser(xmin,xmax); glogsig1->GetYaxis()->SetRangeUser(ymin,ymax); glogsig1->GetXaxis()->SetTitleSize(0.05); glogsig1->GetYaxis()->SetTitleSize(0.05); glogsig1->GetXaxis()->SetTitle("Generated Signal/Background"); glogsig1->GetYaxis()->SetTitle("Estimated Significance"); glogsig1->SetTitle(""); glogsig1->SetMarkerColor(2); glogsig1->SetMarkerStyle(20); c2->SetGridx(); c2->SetGridy(); c2->SetBorderMode(0); c2->SetFillColor(0); c2->Divide(2,2); c2->cd(1); c2_1->SetGridx(); c2_1->SetGridy(); c2_1->SetBorderMode(0); c2_1->SetFillColor(0); TLegend *leg1 = new TLegend(0.45,0.75,0.85,0.9); leg1->AddEntry(glogsig1,"Log Likelihood","p"); glogsig1->Draw("AP"); leg1->Draw(); TGraph *glogsig2 = new TGraph (npts,phi_norm1,logsig1); Float_t xmin = 0; Float_t xmax = 2; Float_t ymin = 0; Float_t ymax = 20; glogsig2->GetXaxis()->SetRangeUser(xmin,xmax); glogsig2->GetYaxis()->SetRangeUser(ymin,ymax); glogsig2->GetXaxis()->SetTitleSize(0.05); glogsig2->GetYaxis()->SetTitleSize(0.05); glogsig2->GetXaxis()->SetTitle("#phi parameter"); glogsig2->GetYaxis()->SetTitle("Estimated Significance"); glogsig2->SetTitle(""); glogsig2->SetMarkerColor(2); glogsig2->SetMarkerStyle(20); c2->cd(2); c2_2->SetGridx(); c2_2->SetGridy(); c2_2->SetBorderMode(0); c2_2->SetFillColor(0); TLegend *leg2 = new TLegend(0.45,0.75,0.85,0.9); leg2->AddEntry(glogsig2,"Log Likelihood","p"); glogsig2->Draw("AP"); leg2->Draw(); TGraph *glogsig3 = new TGraph (npts,theta_norm1,logsig1); Float_t xmin = 0; Float_t xmax = 2; Float_t ymin = 0; Float_t ymax = 20; glogsig3->GetXaxis()->SetRangeUser(xmin,xmax); glogsig3->GetYaxis()->SetRangeUser(ymin,ymax); glogsig3->GetXaxis()->SetTitleSize(0.05); glogsig3->GetYaxis()->SetTitleSize(0.05); glogsig3->GetXaxis()->SetTitle("#theta parameter"); glogsig3->GetYaxis()->SetTitle("Estimated Significance"); glogsig3->SetTitle(""); glogsig3->SetMarkerColor(2); glogsig3->SetMarkerStyle(20); c2->cd(3); c2_3->SetGridx(); c2_3->SetGridy(); c2_3->SetBorderMode(0); c2_3->SetFillColor(0); TLegend *leg3 = new TLegend(0.45,0.75,0.85,0.9); leg3->AddEntry(glogsig3,"Log Likelihood","p"); glogsig3->Draw("AP"); leg3->Draw(); TGraph *glogsig4 = new TGraph (npts,fitsig1,logsig1); Float_t xmin = 4; Float_t xmax = 14; Float_t ymin = 0; Float_t ymax = 20; glogsig4->GetXaxis()->SetRangeUser(xmin,xmax); glogsig4->GetYaxis()->SetRangeUser(ymin,ymax); glogsig4->GetXaxis()->SetTitleSize(0.05); glogsig4->GetYaxis()->SetTitleSize(0.05); glogsig4->GetXaxis()->SetTitle("Fit S/sqrt(B)"); glogsig4->GetYaxis()->SetTitle("Estimated Significance"); glogsig4->SetTitle(""); glogsig4->SetMarkerColor(2); glogsig4->SetMarkerStyle(20); c2->cd(4); c2_4->SetGridx(); c2_4->SetGridy(); c2_4->SetBorderMode(0); c2_4->SetFillColor(0); TLegend *leg4 = new TLegend(0.45,0.75,0.85,0.9); leg4->AddEntry(glogsig4,"Log Likelihood","p"); glogsig4->Draw("AP"); leg4->Draw(); // c1->SaveAs("plot_c1_signif2.eps"); c1->SaveAs("plot_c1_signif2.gif"); c2->SaveAs("plot_c2_signif2.eps"); c2->SaveAs("plot_c2_signif2.gif"); }