void pedestal_width_data_18(void) { // data for T=18 degC. Use fudge=1.4 for 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.202206); h2_vover_4->SetBinContent(2,1.20575); h2_vover_4->SetBinContent(3,1.213999); h2_vover_4->SetBinContent(4,1.249648); h2_vover_4->SetBinContent(5,1.316148); h2_vover_4->SetBinContent(6,1.360637); h2_vover_4->SetBinContent(7,1.465889); h2_vover_4->SetBinContent(8,1.586292); h2_vover_4->SetBinContent(9,1.721064); h2_vover_4->SetBinContent(10,1.919154); h2_vover_4->SetBinContent(11,2.199122); h2_vover_4->SetBinError(1,0.008396674); h2_vover_4->SetBinError(2,0.008357689); h2_vover_4->SetBinError(3,0.00849988); h2_vover_4->SetBinError(4,0.00895022); h2_vover_4->SetBinError(5,0.009298736); h2_vover_4->SetBinError(6,0.009958122); h2_vover_4->SetBinError(7,0.01038143); h2_vover_4->SetBinError(8,0.01133485); h2_vover_4->SetBinError(9,0.01193265); h2_vover_4->SetBinError(10,0.01356643); h2_vover_4->SetBinError(11,0.01614781); 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.196207); h2_vover_3->SetBinContent(2,1.208249); h2_vover_3->SetBinContent(3,1.223771); h2_vover_3->SetBinContent(4,1.227232); h2_vover_3->SetBinContent(5,1.276993); h2_vover_3->SetBinContent(6,1.326701); h2_vover_3->SetBinContent(7,1.395784); h2_vover_3->SetBinContent(8,1.491851); h2_vover_3->SetBinContent(9,1.604456); h2_vover_3->SetBinContent(10,1.712047); h2_vover_3->SetBinContent(11,1.931678); h2_vover_3->SetBinError(1,0.008351304); h2_vover_3->SetBinError(2,0.008350272); h2_vover_3->SetBinError(3,0.008914405); h2_vover_3->SetBinError(4,0.008921695); h2_vover_3->SetBinError(5,0.00884036); h2_vover_3->SetBinError(6,0.009708087); h2_vover_3->SetBinError(7,0.009728883); h2_vover_3->SetBinError(8,0.01069339); h2_vover_3->SetBinError(9,0.01187592); h2_vover_3->SetBinError(10,0.0123888); h2_vover_3->SetBinError(11,0.01407675); 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.199816); h2_vover_2->SetBinContent(2,1.201601); h2_vover_2->SetBinContent(3,1.226484); h2_vover_2->SetBinContent(4,1.217464); h2_vover_2->SetBinContent(5,1.266904); h2_vover_2->SetBinContent(6,1.303993); h2_vover_2->SetBinContent(7,1.320093); h2_vover_2->SetBinContent(8,1.424716); h2_vover_2->SetBinContent(9,1.483315); h2_vover_2->SetBinContent(10,1.570623); h2_vover_2->SetBinContent(11,1.756409); h2_vover_2->SetBinError(1,0.008631017); h2_vover_2->SetBinError(2,0.008411192); h2_vover_2->SetBinError(3,0.008693978); h2_vover_2->SetBinError(4,0.0086503); h2_vover_2->SetBinError(5,0.008775746); h2_vover_2->SetBinError(6,0.009312714); h2_vover_2->SetBinError(7,0.009742245); h2_vover_2->SetBinError(8,0.0108301); h2_vover_2->SetBinError(9,0.01054921); h2_vover_2->SetBinError(10,0.01133913); h2_vover_2->SetBinError(11,0.01313238); 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.201044); h2_vover_1->SetBinContent(2,1.196193); h2_vover_1->SetBinContent(3,1.210809); h2_vover_1->SetBinContent(4,1.202605); h2_vover_1->SetBinContent(5,1.228276); h2_vover_1->SetBinContent(6,1.264132); h2_vover_1->SetBinContent(7,1.250239); h2_vover_1->SetBinContent(8,1.307478); h2_vover_1->SetBinContent(9,1.357351); h2_vover_1->SetBinContent(10,1.397199); h2_vover_1->SetBinContent(11,1.442031); h2_vover_1->SetBinError(1,0.008641946); h2_vover_1->SetBinError(2,0.008062181); h2_vover_1->SetBinError(3,0.008641308); h2_vover_1->SetBinError(4,0.008739843); h2_vover_1->SetBinError(5,0.008349639); h2_vover_1->SetBinError(6,0.009039904); h2_vover_1->SetBinError(7,0.008811615); h2_vover_1->SetBinError(8,0.009227845); h2_vover_1->SetBinError(9,0.009744574); h2_vover_1->SetBinError(10,0.009524665); h2_vover_1->SetBinError(11,0.009960879); 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=11; Double_t vover[npts]; Double_t data18_1[npts]={1.197600,1.192458,1.196844,1.202551,1.208938,1.213045,1.218550,1.239892,1.274607,1.345781,1.470383}; Double_t data18_2[npts]={1.204519,1.205610,1.204831,1.213589,1.225688,1.238219,1.258752,1.296558,1.364615,1.499798,1.737140}; Double_t data18_3[npts]={1.205838,1.208299,1.213065,1.220873,1.233453,1.255267,1.287350,1.346850,1.450760,1.634256,1.948465}; Double_t data18_4[npts]={1.221769,1.224926,1.229694,1.240102,1.255919,1.283498,1.323768,1.395381,1.518889,1.734118,2.093691}; 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=1.2e-2; sqroot->SetParameters(parA,parB); sqroot->SetParNames("parA","parB"); // draw data and simulation TCanvas *c1 = new TCanvas("c1","c1 pedestal_width_data_18",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); g18_4->SetTitle(""); g18_4->GetXaxis()->SetLabelSize(0.05); g18_4->GetXaxis()->SetTitleSize(0.05); g18_4->GetYaxis()->SetLabelSize(0.05); g18_4->GetYaxis()->SetTitleSize(0.05); g18_4->GetYaxis()->SetTitleOffset(1.5); g18_4->GetYaxis()->SetTitle("Pedestal Width (counts)"); g18_4->GetXaxis()->SetTitle("Over Bias (V)"); g18_4->GetXaxis()->SetNdivisions(505); g18_4->SetMinimum(1); g18_4->SetMaximum(2.2); g18_4->SetMarkerStyle(20); g18_4->SetMarkerColor(2); g18_4->SetMarkerSize(1); g18_4->Fit(sqroot); // g18_4->Fit("pol3"); g18_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=18degC"); leg->AddEntry(g18_4,"Data","p"); leg->AddEntry(h2_vover_4,"Simulation","p"); leg->Draw(); c1->cd(2); c1_2->SetBorderMode(0); c1_2->SetFillColor(0); g18_3->SetTitle(""); g18_3->GetXaxis()->SetLabelSize(0.05); g18_3->GetXaxis()->SetTitleSize(0.05); g18_3->GetYaxis()->SetLabelSize(0.05); g18_3->GetYaxis()->SetTitleSize(0.05); g18_3->GetYaxis()->SetTitleOffset(1.5); g18_3->GetYaxis()->SetTitle("Pedestal Width (counts)"); g18_3->GetXaxis()->SetTitle("Over Bias (V)"); g18_3->GetXaxis()->SetNdivisions(505); g18_3->SetMinimum(1); g18_3->SetMaximum(2.2); g18_3->SetMarkerStyle(20); g18_3->SetMarkerColor(2); g18_3->SetMarkerSize(1); sqroot->SetLineColor(2); g18_3->Fit(sqroot); // g18_3->Fit("pol2"); g18_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=18degC"); leg->AddEntry(g18_3,"Data","p"); leg->AddEntry(h2_vover_3,"Simulation","p"); leg->Draw(); c1->cd(3); c1_3->SetBorderMode(0); c1_3->SetFillColor(0); g18_2->SetTitle(""); g18_2->GetXaxis()->SetLabelSize(0.05); g18_2->GetXaxis()->SetTitleSize(0.05); g18_2->GetYaxis()->SetLabelSize(0.05); g18_2->GetYaxis()->SetTitleSize(0.05); g18_2->GetYaxis()->SetTitleOffset(1.5); g18_2->GetYaxis()->SetTitle("Pedestal Width (counts)"); g18_2->GetXaxis()->SetTitle("Over Bias (V)"); g18_2->GetXaxis()->SetNdivisions(505); g18_2->SetMinimum(1); g18_2->SetMaximum(2.2); g18_2->SetMarkerStyle(20); g18_2->SetMarkerColor(2); g18_2->SetMarkerSize(1); sqroot->SetLineColor(2); g18_2->Fit(sqroot); // g18_2->Fit("pol2"); g18_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=18degC"); leg->AddEntry(g18_2,"Data","p"); leg->AddEntry(h2_vover_2,"Simulation","p"); leg->Draw(); c1->cd(4); c1_4->SetBorderMode(0); c1_4->SetFillColor(0); g18_1->SetTitle(""); g18_1->GetXaxis()->SetLabelSize(0.05); g18_1->GetXaxis()->SetTitleSize(0.05); g18_1->GetYaxis()->SetLabelSize(0.05); g18_1->GetYaxis()->SetTitleSize(0.05); g18_1->GetYaxis()->SetTitleOffset(1.5); g18_1->GetYaxis()->SetTitle("Pedestal Width (counts)"); g18_1->GetXaxis()->SetTitle("Over Bias (V)"); g18_1->GetXaxis()->SetNdivisions(505); g18_1->SetMinimum(1); g18_1->SetMaximum(2.2); g18_1->SetMarkerStyle(20); g18_1->SetMarkerColor(2); g18_1->SetMarkerSize(1); sqroot->SetLineColor(2); g18_1->Fit(sqroot); // g18_1->Fit("pol2"); g18_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=18degC"); leg->AddEntry(g18_1,"Data","p"); leg->AddEntry(h2_vover_1,"Simulation","p"); leg->Draw(); sprintf (string,"pedestal_width_data_18.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; }