void pedestal_width_vover(void) { char string[256]; //=========Macro generated from canvas: c3/c3 //========= (Mon Apr 20 17:49:02 2015) by ROOT version5.34/09 TCanvas *c3 = new TCanvas("c3", "c3",200,32,700,700); gStyle->SetOptFit(1); c3->Range(0,0,1,1); c3->SetFillColor(0); c3->SetBorderMode(0); c3->SetBorderSize(2); c3->SetGridx(); c3->SetGridy(); c3->SetLeftMargin(0.15); c3->SetRightMargin(0.15); c3->SetBottomMargin(0.15); c3->SetFrameBorderMode(0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kFALSE); // gStyle->SetOptFit(1111); // ------------>Primitives in pad: c3_3 TH1D *h2_vover_1 = new TH1D("h2_vover_1","",11,0,2.2); h2_vover_1->SetBinContent(1,1.199494); h2_vover_1->SetBinContent(2,1.203572); h2_vover_1->SetBinContent(3,1.219583); h2_vover_1->SetBinContent(4,1.196043); h2_vover_1->SetBinContent(5,1.217882); h2_vover_1->SetBinContent(6,1.246047); h2_vover_1->SetBinContent(7,1.243562); h2_vover_1->SetBinContent(8,1.260265); h2_vover_1->SetBinContent(9,1.299442); h2_vover_1->SetBinContent(10,1.345636); h2_vover_1->SetBinContent(11,1.408961); h2_vover_1->SetBinError(1,0.008660609); h2_vover_1->SetBinError(2,0.008342119); h2_vover_1->SetBinError(3,0.00836968); h2_vover_1->SetBinError(4,0.008444712); h2_vover_1->SetBinError(5,0.008433455); h2_vover_1->SetBinError(6,0.008860058); h2_vover_1->SetBinError(7,0.008927867); h2_vover_1->SetBinError(8,0.008896927); h2_vover_1->SetBinError(9,0.008985637); h2_vover_1->SetBinError(10,0.009854486); h2_vover_1->SetBinError(11,0.01010533); h2_vover_1->SetMinimum(1); h2_vover_1->SetMaximum(2.2); h2_vover_1->SetEntries(11); TF1 *fit = new TF1("fit","[0]+[1]*x*x",0,2.4); fit->SetFillColor(19); fit->SetFillStyle(0); fit->SetLineColor(2); fit->SetLineWidth(2); fit->SetChisquare(35.78323); fit->SetNDF(9); fit->GetXaxis()->SetLabelFont(42); fit->GetXaxis()->SetLabelSize(0.035); fit->GetXaxis()->SetTitleSize(0.035); fit->GetXaxis()->SetTitleFont(42); fit->GetYaxis()->SetLabelFont(42); fit->GetYaxis()->SetLabelSize(0.035); fit->GetYaxis()->SetTitleSize(0.035); fit->GetYaxis()->SetTitleFont(42); fit->SetParameter(0,1.189518); fit->SetParError(0,0.003897563); fit->SetParLimits(0,0,0); fit->SetParameter(1,0.0423788); fit->SetParError(1,0.001951708); fit->SetParLimits(1,0,0); h2_vover_1->GetListOfFunctions()->Add(fit); h2_vover_1->SetMarkerStyle(20); h2_vover_1->SetMarkerColor(2); h2_vover_1->Draw(); ci = TColor::GetColor("#000099"); h2_vover_1->SetLineColor(ci); h2_vover_1->SetMarkerColor(2); h2_vover_1->SetMarkerStyle(20); h2_vover_1->GetXaxis()->SetTitle("Vover (V)"); h2_vover_1->GetXaxis()->SetRange(1,12); h2_vover_1->GetXaxis()->SetNdivisions(505); h2_vover_1->GetXaxis()->SetLabelFont(42); h2_vover_1->GetXaxis()->SetLabelSize(0.05); h2_vover_1->GetXaxis()->SetTitleSize(0.05); h2_vover_1->GetXaxis()->SetTitleFont(42); h2_vover_1->GetYaxis()->SetTitle("Width (counts)"); h2_vover_1->GetYaxis()->SetLabelFont(42); h2_vover_1->GetYaxis()->SetLabelSize(0.05); h2_vover_1->GetYaxis()->SetTitleSize(0.05); h2_vover_1->GetYaxis()->SetTitleOffset(1.5); h2_vover_1->GetYaxis()->SetTitleFont(42); h2_vover_1->GetZaxis()->SetLabelFont(42); h2_vover_1->GetZaxis()->SetLabelSize(0.035); h2_vover_1->GetZaxis()->SetTitleSize(0.035); h2_vover_1->GetZaxis()->SetTitleFont(42); h2_vover_1->Draw(""); TH1D *h2_vover_2 = new TH1D("h2_vover_2","",11,0,2.2); h2_vover_2->SetBinContent(1,1.197222); h2_vover_2->SetBinContent(2,1.20483); h2_vover_2->SetBinContent(3,1.216955); h2_vover_2->SetBinContent(4,1.207026); h2_vover_2->SetBinContent(5,1.226344); h2_vover_2->SetBinContent(6,1.270921); h2_vover_2->SetBinContent(7,1.296149); h2_vover_2->SetBinContent(8,1.34314); h2_vover_2->SetBinContent(9,1.427705); h2_vover_2->SetBinContent(10,1.468157); h2_vover_2->SetBinContent(11,1.57678); h2_vover_2->SetBinError(1,0.00860915); h2_vover_2->SetBinError(2,0.008361243); h2_vover_2->SetBinError(3,0.008656993); h2_vover_2->SetBinError(4,0.008472891); h2_vover_2->SetBinError(5,0.008334845); h2_vover_2->SetBinError(6,0.009113714); h2_vover_2->SetBinError(7,0.00890298); h2_vover_2->SetBinError(8,0.009387918); h2_vover_2->SetBinError(9,0.01037952); h2_vover_2->SetBinError(10,0.01055875); h2_vover_2->SetBinError(11,0.01151018); h2_vover_2->SetMinimum(1); h2_vover_2->SetMaximum(3); h2_vover_2->SetEntries(11); TF1 *fit = new TF1("fit","[0]+[1]*x*x",0,2.4); fit->SetFillColor(19); fit->SetFillStyle(0); fit->SetLineColor(2); fit->SetLineWidth(2); fit->SetChisquare(43.01618); fit->SetNDF(9); fit->GetXaxis()->SetLabelFont(42); fit->GetXaxis()->SetLabelSize(0.035); fit->GetXaxis()->SetTitleSize(0.035); fit->GetXaxis()->SetTitleFont(42); fit->GetYaxis()->SetLabelFont(42); fit->GetYaxis()->SetLabelSize(0.035); fit->GetYaxis()->SetTitleSize(0.035); fit->GetYaxis()->SetTitleFont(42); fit->SetParameter(0,1.17934); fit->SetParError(0,0.003955115); fit->SetParLimits(0,0,0); fit->SetParameter(1,0.08185309); fit->SetParError(1,0.002099018); fit->SetParLimits(1,0,0); h2_vover_2->GetListOfFunctions()->Add(fit); h2_vover_2->SetMarkerStyle(21); h2_vover_2->SetMarkerColor(4); h2_vover_2->Draw("same"); TH1D *h2_vover_3 = new TH1D("h2_vover_3","",11,0,2.2); h2_vover_3->SetBinContent(1,1.199601); h2_vover_3->SetBinContent(2,1.193964); h2_vover_3->SetBinContent(3,1.230911); h2_vover_3->SetBinContent(4,1.222279); h2_vover_3->SetBinContent(5,1.249017); h2_vover_3->SetBinContent(6,1.299691); h2_vover_3->SetBinContent(7,1.322204); h2_vover_3->SetBinContent(8,1.416378); h2_vover_3->SetBinContent(9,1.510113); h2_vover_3->SetBinContent(10,1.611048); h2_vover_3->SetBinContent(11,1.766366); h2_vover_3->SetBinError(1,0.008656201); h2_vover_3->SetBinError(2,0.008259725); h2_vover_3->SetBinError(3,0.008766172); h2_vover_3->SetBinError(4,0.008551053); h2_vover_3->SetBinError(5,0.008388716); h2_vover_3->SetBinError(6,0.009317507); h2_vover_3->SetBinError(7,0.009165232); h2_vover_3->SetBinError(8,0.01029839); h2_vover_3->SetBinError(9,0.01107577); h2_vover_3->SetBinError(10,0.01137324); h2_vover_3->SetBinError(11,0.01249682); h2_vover_3->SetMinimum(1); h2_vover_3->SetMaximum(3); h2_vover_3->SetEntries(11); TF1 *fit = new TF1("fit","[0]+[1]*x*x",0,2.4); fit->SetFillColor(19); fit->SetFillStyle(0); fit->SetLineColor(2); fit->SetLineWidth(2); fit->SetChisquare(99.22379); fit->SetNDF(9); fit->GetXaxis()->SetLabelFont(42); fit->GetXaxis()->SetLabelSize(0.035); fit->GetXaxis()->SetTitleSize(0.035); fit->GetXaxis()->SetTitleFont(42); fit->GetYaxis()->SetLabelFont(42); fit->GetYaxis()->SetLabelSize(0.035); fit->GetYaxis()->SetTitleSize(0.035); fit->GetYaxis()->SetTitleFont(42); fit->SetParameter(0,1.170376); fit->SetParError(0,0.00399806); fit->SetParLimits(0,0,0); fit->SetParameter(1,0.1200795); fit->SetParError(1,0.002211231); fit->SetParLimits(1,0,0); h2_vover_3->GetListOfFunctions()->Add(fit); h2_vover_3->SetMarkerStyle(22); h2_vover_3->SetMarkerColor(1); h2_vover_3->Draw("same"); TH1D *h2_vover_4 = new TH1D("h2_vover_4","",11,0,2.2); h2_vover_4->SetBinContent(1,1.199894); h2_vover_4->SetBinContent(2,1.207158); h2_vover_4->SetBinContent(3,1.217556); h2_vover_4->SetBinContent(4,1.226875); h2_vover_4->SetBinContent(5,1.277582); h2_vover_4->SetBinContent(6,1.338804); h2_vover_4->SetBinContent(7,1.381932); h2_vover_4->SetBinContent(8,1.464386); h2_vover_4->SetBinContent(9,1.580163); h2_vover_4->SetBinContent(10,1.770427); h2_vover_4->SetBinContent(11,1.909945); h2_vover_4->SetBinError(1,0.008603802); h2_vover_4->SetBinError(2,0.008334468); h2_vover_4->SetBinError(3,0.008691162); h2_vover_4->SetBinError(4,0.008653266); h2_vover_4->SetBinError(5,0.008867018); h2_vover_4->SetBinError(6,0.009636698); h2_vover_4->SetBinError(7,0.0100516); h2_vover_4->SetBinError(8,0.009991336); h2_vover_4->SetBinError(9,0.01093789); h2_vover_4->SetBinError(10,0.01292918); h2_vover_4->SetBinError(11,0.01315615); h2_vover_4->SetMinimum(1); h2_vover_4->SetMaximum(3); h2_vover_4->SetEntries(11); TF1 *fit = new TF1("fit","[0]+[1]*x*x",0,2.4); fit->SetFillColor(19); fit->SetFillStyle(0); fit->SetLineColor(2); fit->SetLineWidth(2); fit->SetChisquare(122.9222); fit->SetNDF(9); fit->GetXaxis()->SetLabelFont(42); fit->GetXaxis()->SetLabelSize(0.035); fit->GetXaxis()->SetTitleSize(0.035); fit->GetXaxis()->SetTitleFont(42); fit->GetYaxis()->SetLabelFont(42); fit->GetYaxis()->SetLabelSize(0.035); fit->GetYaxis()->SetTitleSize(0.035); fit->GetYaxis()->SetTitleFont(42); fit->SetParameter(0,1.16697); fit->SetParError(0,0.004058886); fit->SetParLimits(0,0,0); fit->SetParameter(1,0.1530768); fit->SetParError(1,0.002300519); fit->SetParLimits(1,0,0); h2_vover_4->GetListOfFunctions()->Add(fit); h2_vover_4->SetMarkerStyle(23); h2_vover_4->SetMarkerColor(3); h2_vover_4->Draw("same"); // add Legend sprintf (string,"Layer Dependence\n"); printf("string=%s",string); TLegend *leg = new TLegend(0.2,0.65,0.5,0.9,string); leg->AddEntry(h2_vover_1,"Layer 1","p"); leg->AddEntry(h2_vover_2,"Layer 2","p"); leg->AddEntry(h2_vover_3,"Layer 3","p"); leg->AddEntry(h2_vover_4,"Layer 4","p"); leg->Draw(); sprintf (string,"pedestal_width_vover.pdf"); c3->SaveAs(string); }