void plot_ped_sigma(void) { // // plot the contribution to the pedestal width from noise hits in the Bcal. Data from gen_bal_pulse.C // #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kTRUE); // gStyle->SetOptFit(kTRUE); // gStyle->SetOptFit(1111); gStyle->SetOptStat(111111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; char filename[80]; Int_t k,j,jj; // input data #define npts 7; Double_t mean[npts]={2,5,10,15,20,30,40}; // mean number of hits per 100 ns Double_t sig_est[npts]={0.08,0.2,0.4,0.6,0.8,1.2,1.6}; // estimated assuming Poisson distribution Double_t sig_nosmear[npts]={0.27,0.44,0.63,0.77,0.88,1.1,1.3}; // MC without pulse smearing, should approximate Poisson Double_t sig_smear[npts]={0.023,0.037,0.054,0.066,0.076,0.092,0.108}; // MC with pulse smearing, should average baseline TGraph *gest = new TGraph(npts,mean,sig_est); TGraph *gnosmear = new TGraph(npts,mean,sig_nosmear); TGraph *gsmear= new TGraph(npts,mean,sig_smear); TCanvas *c1 = new TCanvas("c1","c1 plot_ped_sigma",200,10,700,700); c1->SetBorderMode(0); c1->SetFillColor(0); // c1->SetGridx(); // c1->SetGridy(); // c1->SetLogy(); /*c1->Divide(2,2); c1->cd(1); c1_1->SetBorderMode(0); c1_1->SetFillColor(0);*/ TLegend *leg = new TLegend(0.2,0.75,0.55,0.9); gest->SetTitle(""); // gest->GetYaxis()->SetRangeUser(0,100); gest->GetXaxis()->SetTitleSize(0.04); gest->GetYaxis()->SetTitleSize(0.04); gest->GetYaxis()->SetTitleOffset(1.5); gest->GetXaxis()->SetTitle("Average Number of Hits in 100 ns"); gest->GetYaxis()->SetTitle("Contribution to Ped Width (counts)"); gest->GetXaxis()->SetNdivisions(505); gest->SetMarkerStyle(20); gest->SetMarkerColor(1); gest->Draw("Ap"); leg->AddEntry(gest,"Stat Estimate","p"); gnosmear->SetMarkerStyle(20); gnosmear->SetMarkerColor(4); gnosmear->Draw("samep"); leg->AddEntry(gnosmear,"MC Without Smearing","p"); gsmear->SetMarkerStyle(20); gsmear->SetMarkerColor(2); gsmear->Draw("samep"); leg->AddEntry(gsmear,"MC Using Pulse Parm","p"); leg->Draw(); TLine *line = new TLine(0,1.3,44,1.3); line->SetLineWidth(2); line->SetLineColor(2); line->Draw(); TLatex *text = new TLatex(4,1.23,"FCAL Ped Width"); text->SetTextSize(0.03); text->Draw(); sprintf(filename,"plot_ped_sigma.pdf"); c1->SaveAs(filename); sprintf(filename,"plot_ped_sigma.png"); c1->SaveAs(filename); }