void pedestal_width_data_10(void) { // data for T=10 degC. Fudge factor of 1.4 to rate char string[256]; //=========Macro generated from canvas: c3/c3g gROOT->Reset(); gStyle->SetPalette(1,0); //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); // input simulation data from pedestal_width.C TH1D *h2_vover_4 = new TH1D("h2_vover_4","",11,0,2.2); h2_vover_4->SetBinContent(1,1.202565); h2_vover_4->SetBinContent(2,1.202668); h2_vover_4->SetBinContent(3,1.222485); h2_vover_4->SetBinContent(4,1.223757); h2_vover_4->SetBinContent(5,1.266507); h2_vover_4->SetBinContent(6,1.31198); h2_vover_4->SetBinContent(7,1.34417); h2_vover_4->SetBinContent(8,1.427527); h2_vover_4->SetBinContent(9,1.492203); h2_vover_4->SetBinContent(10,1.600184); h2_vover_4->SetBinContent(11,1.73796); h2_vover_4->SetBinError(1,0.008703119); h2_vover_4->SetBinError(2,0.008459436); h2_vover_4->SetBinError(3,0.008413121); h2_vover_4->SetBinError(4,0.008641801); h2_vover_4->SetBinError(5,0.009062092); h2_vover_4->SetBinError(6,0.009614236); h2_vover_4->SetBinError(7,0.009525658); h2_vover_4->SetBinError(8,0.01019246); h2_vover_4->SetBinError(9,0.01065148); h2_vover_4->SetBinError(10,0.01054599); h2_vover_4->SetBinError(11,0.01236417); h2_vover_4->SetMinimum(1); h2_vover_4->SetMaximum(3); h2_vover_4->SetEntries(11); TH1D *h2_vover_3 = new TH1D("h2_vover_3","",11,0,2.2); h2_vover_3->SetBinContent(1,1.199558); h2_vover_3->SetBinContent(2,1.20078); h2_vover_3->SetBinContent(3,1.212758); h2_vover_3->SetBinContent(4,1.216624); h2_vover_3->SetBinContent(5,1.25129); h2_vover_3->SetBinContent(6,1.280419); h2_vover_3->SetBinContent(7,1.307612); h2_vover_3->SetBinContent(8,1.366803); h2_vover_3->SetBinContent(9,1.455391); h2_vover_3->SetBinContent(10,1.528737); h2_vover_3->SetBinContent(11,1.656932); h2_vover_3->SetBinError(1,0.008690026); h2_vover_3->SetBinError(2,0.00827221); h2_vover_3->SetBinError(3,0.008646063); h2_vover_3->SetBinError(4,0.008658915); h2_vover_3->SetBinError(5,0.008829094); h2_vover_3->SetBinError(6,0.00904614); h2_vover_3->SetBinError(7,0.008974807); h2_vover_3->SetBinError(8,0.009894843); h2_vover_3->SetBinError(9,0.01046118); h2_vover_3->SetBinError(10,0.01097797); h2_vover_3->SetBinError(11,0.01161824); h2_vover_3->SetMinimum(1); h2_vover_3->SetMaximum(3); h2_vover_3->SetEntries(11); TH1D *h2_vover_2 = new TH1D("h2_vover_2","",11,0,2.2); h2_vover_2->SetBinContent(1,1.201114); h2_vover_2->SetBinContent(2,1.196909); h2_vover_2->SetBinContent(3,1.217806); h2_vover_2->SetBinContent(4,1.21226); h2_vover_2->SetBinContent(5,1.227224); h2_vover_2->SetBinContent(6,1.269156); h2_vover_2->SetBinContent(7,1.267448); h2_vover_2->SetBinContent(8,1.311418); h2_vover_2->SetBinContent(9,1.375948); h2_vover_2->SetBinContent(10,1.428454); h2_vover_2->SetBinContent(11,1.525917); h2_vover_2->SetBinError(1,0.008668533); h2_vover_2->SetBinError(2,0.00813945); h2_vover_2->SetBinError(3,0.008730433); h2_vover_2->SetBinError(4,0.008994221); h2_vover_2->SetBinError(5,0.00870085); h2_vover_2->SetBinError(6,0.008801782); h2_vover_2->SetBinError(7,0.009359582); h2_vover_2->SetBinError(8,0.009320264); h2_vover_2->SetBinError(9,0.009757413); h2_vover_2->SetBinError(10,0.01057615); h2_vover_2->SetBinError(11,0.01092287); h2_vover_2->SetMinimum(1); h2_vover_2->SetMaximum(3); h2_vover_2->SetEntries(11); TH1D *h2_vover_1 = new TH1D("h2_vover_1","",11,0,2.2); h2_vover_1->SetBinContent(1,1.200128); h2_vover_1->SetBinContent(2,1.194788); h2_vover_1->SetBinContent(3,1.21727); h2_vover_1->SetBinContent(4,1.197803); h2_vover_1->SetBinContent(5,1.212605); h2_vover_1->SetBinContent(6,1.24211); h2_vover_1->SetBinContent(7,1.233887); h2_vover_1->SetBinContent(8,1.252956); h2_vover_1->SetBinContent(9,1.294019); h2_vover_1->SetBinContent(10,1.341563); h2_vover_1->SetBinContent(11,1.351739); h2_vover_1->SetBinError(1,0.008721192); h2_vover_1->SetBinError(2,0.008147089); h2_vover_1->SetBinError(3,0.008304805); h2_vover_1->SetBinError(4,0.008701837); h2_vover_1->SetBinError(5,0.008247864); h2_vover_1->SetBinError(6,0.008511562); h2_vover_1->SetBinError(7,0.008672596); h2_vover_1->SetBinError(8,0.008762351); h2_vover_1->SetBinError(9,0.009391274); h2_vover_1->SetBinError(10,0.009723377); h2_vover_1->SetBinError(11,0.009445756); h2_vover_1->SetMinimum(1); h2_vover_1->SetMaximum(3); h2_vover_1->SetEntries(11); // input pedestal data. See Log Entry 3333598, or https://logbooks.jlab.org/entry/3333598 const Int_t npts=10; Double_t vover[npts]; Double_t data10_1[npts]={1.183374,1.186552,1.188244,1.189941,1.190342,1.199265,1.217779,1.231694,1.277289,1.364472}; Double_t data10_2[npts]={1.197222,1.199135,1.201198,1.207138,1.207860,1.225726,1.254245,1.292518,1.380758,1.563541}; Double_t data10_3[npts]={1.204848,1.205203,1.210622,1.217523,1.219980,1.248891,1.286875,1.347827,1.478682,1.739243}; Double_t data10_4[npts]={1.221982,1.221661,1.229999,1.237823,1.241576,1.276989,1.323895,1.398051,1.551686,1.845197}; for (Int_t jj=0;jjSetParameters(1.2,0.153); TF1 *sqroot = new TF1("sqroot_func",sqroot_func,xmin,xmax,2); Double_t parA=1.2; Double_t parB=0.4; sqroot->SetParameters(parA,parB); sqroot->SetParNames("parA","parB"); // draw data and simulation TCanvas *c1 = new TCanvas("c1","c1 pedestal_width_data_10",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); g10_4->SetTitle(""); g10_4->GetXaxis()->SetLabelSize(0.05); g10_4->GetXaxis()->SetTitleSize(0.05); g10_4->GetYaxis()->SetLabelSize(0.05); g10_4->GetYaxis()->SetTitleSize(0.05); g10_4->GetYaxis()->SetTitleOffset(1.5); g10_4->GetYaxis()->SetTitle("Pedestal Width (counts)"); g10_4->GetXaxis()->SetTitle("Over Bias (V)"); g10_4->GetXaxis()->SetNdivisions(505); g10_4->SetMinimum(1); g10_4->SetMaximum(2.2); g10_4->SetMarkerStyle(20); g10_4->SetMarkerColor(2); g10_4->SetMarkerSize(1); g10_4->Fit(sqroot); // g10_4->Fit("pol3"); g10_4->Draw("Ap"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Data: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.65,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Data: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.61,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); h2_vover_4->SetMarkerStyle(24); h2_vover_4->SetMarkerColor(4); h2_vover_4->SetMarkerSize(1); h2_vover_4->Fit(sqroot,"0"); sqroot->SetLineColor(4); sqroot->DrawCopy("same"); h2_vover_4->Draw("psame"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Sim: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.53,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Sim: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.49,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); // add Legend TLegend *leg = new TLegend(0.2,0.70,0.7,0.9,"Layer 4, T=10degC"); leg->AddEntry(g10_4,"Data","p"); leg->AddEntry(h2_vover_4,"Simulation","p"); leg->Draw(); c1->cd(2); c1_2->SetBorderMode(0); c1_2->SetFillColor(0); g10_3->SetTitle(""); g10_3->GetXaxis()->SetLabelSize(0.05); g10_3->GetXaxis()->SetTitleSize(0.05); g10_3->GetYaxis()->SetLabelSize(0.05); g10_3->GetYaxis()->SetTitleSize(0.05); g10_3->GetYaxis()->SetTitleOffset(1.5); g10_3->GetYaxis()->SetTitle("Pedestal Width (counts)"); g10_3->GetXaxis()->SetTitle("Over Bias (V)"); g10_3->GetXaxis()->SetNdivisions(505); g10_3->SetMinimum(1); g10_3->SetMaximum(2.2); g10_3->SetMarkerStyle(20); g10_3->SetMarkerColor(2); g10_3->SetMarkerSize(1); sqroot->SetLineColor(2); g10_3->Fit(sqroot); // g10_3->Fit("pol2"); g10_3->Draw("Ap"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Data: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.65,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Data: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.61,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); h2_vover_3->SetMarkerStyle(24); h2_vover_3->SetMarkerColor(4); h2_vover_3->SetMarkerSize(1); h2_vover_3->Fit(sqroot,"0"); sqroot->SetLineColor(4); sqroot->DrawCopy("same"); h2_vover_3->Draw("psame"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Sim: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.53,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Sim: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.49,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); // add Legend TLegend *leg = new TLegend(0.2,0.70,0.7,0.9,"Layer 3, T=10degC"); leg->AddEntry(g10_3,"Data","p"); leg->AddEntry(h2_vover_3,"Simulation","p"); leg->Draw(); c1->cd(3); c1_3->SetBorderMode(0); c1_3->SetFillColor(0); g10_2->SetTitle(""); g10_2->GetXaxis()->SetLabelSize(0.05); g10_2->GetXaxis()->SetTitleSize(0.05); g10_2->GetYaxis()->SetLabelSize(0.05); g10_2->GetYaxis()->SetTitleSize(0.05); g10_2->GetYaxis()->SetTitleOffset(1.5); g10_2->GetYaxis()->SetTitle("Pedestal Width (counts)"); g10_2->GetXaxis()->SetTitle("Over Bias (V)"); g10_2->GetXaxis()->SetNdivisions(505); g10_2->SetMinimum(1); g10_2->SetMaximum(2.2); g10_2->SetMarkerStyle(20); g10_2->SetMarkerColor(2); g10_2->SetMarkerSize(1); sqroot->SetLineColor(2); g10_2->Fit(sqroot); // g10_2->Fit("pol2"); g10_2->Draw("Ap"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Data: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.65,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Data: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.61,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); h2_vover_2->SetMarkerStyle(24); h2_vover_2->SetMarkerColor(4); h2_vover_2->SetMarkerSize(1); h2_vover_2->Fit(sqroot,"0"); sqroot->SetLineColor(4); sqroot->DrawCopy("same"); h2_vover_2->Draw("psame"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Sim: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.53,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Sim: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.49,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); // add Legend TLegend *leg = new TLegend(0.2,0.70,0.7,0.9,"Layer 2, T=10degC"); leg->AddEntry(g10_2,"Data","p"); leg->AddEntry(h2_vover_2,"Simulation","p"); leg->Draw(); c1->cd(4); c1_4->SetBorderMode(0); c1_4->SetFillColor(0); g10_1->SetTitle(""); g10_1->GetXaxis()->SetLabelSize(0.05); g10_1->GetXaxis()->SetTitleSize(0.05); g10_1->GetYaxis()->SetLabelSize(0.05); g10_1->GetYaxis()->SetTitleSize(0.05); g10_1->GetYaxis()->SetTitleOffset(1.5); g10_1->GetYaxis()->SetTitle("Pedestal Width (counts)"); g10_1->GetXaxis()->SetTitle("Over Bias (V)"); g10_1->GetXaxis()->SetNdivisions(505); g10_1->SetMinimum(1); g10_1->SetMaximum(2.2); g10_1->SetMarkerStyle(20); g10_1->SetMarkerColor(2); g10_1->SetMarkerSize(1); sqroot->SetLineColor(2); g10_1->Fit(sqroot); // g10_1->Fit("pol2"); g10_1->Draw("Ap"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Data: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.65,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Data: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.61,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); h2_vover_1->SetMarkerStyle(24); h2_vover_1->SetMarkerColor(4); h2_vover_1->SetMarkerSize(1); h2_vover_1->Fit(sqroot,"0"); sqroot->SetLineColor(4); sqroot->DrawCopy("same"); h2_vover_1->Draw("psame"); Double_t parA = sqroot->GetParameter(0); Double_t parAerr = sqroot->GetParError(0); Double_t parB = sqroot->GetParameter(1); Double_t parBerr = sqroot->GetParError(1); sprintf (string,"Sim: A= %.3f #pm%.3f\n",parA,parAerr); printf("string=%s",string); t1 = new TLatex(0.2,0.53,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); sprintf (string,"Sim: B= %.3f #pm%.3f\n",parB,parBerr); printf("string=%s",string); t1 = new TLatex(0.2,0.49,string); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); // add Legend TLegend *leg = new TLegend(0.2,0.70,0.7,0.9,"Layer 1, T=10degC"); leg->AddEntry(g10_1,"Data","p"); leg->AddEntry(h2_vover_1,"Simulation","p"); leg->Draw(); sprintf (string,"pedestal_width_data_10.pdf"); c1->SaveAs(string); } Double_t sqroot_func (Double_t *x, Double_t *par) { Double_t parA=par[0]; Double_t parB=par[1]; Double_t x1=x[0]; char string[256]; Double_t func; func = sqrt(parA*parA + parB*parB*x1*x1*x1*x1); /*sprintf (string,"sqroot_func: x1=%f amplitude=%f mu=%f sigma=%f t0=%f pedestal=%f, func=%f\n",x1,amplitude,mu,sigma,pedestal,func); printf ("string=%s",string);*/ return func; }