I want to draw a box in cern root which contains both the legend and the text (written through TLatex) . For this I tried TBox, but it is not showing the box.
here is the code snippet :
TCanvas *cmean = new TCanvas("cmean", " ", 1053, 991);
cmean->Divide(1, 2);
TPad *pad1 = (TPad *)cmean->GetPad(1);
TPad *pad2 = (TPad *)cmean->GetPad(2);
pad1->SetBottomMargin(0.2);
pad2->SetTopMargin(0.12);
pad2->SetBottomMargin(0.18);
pad1->SetGrid(1, 1);
pad2->SetGrid(1, 1);
pad1->cd();
SetCanvasStyle(cmean, 0.15, 0.15, 0.15, 0.15);
SetHistostyle2(meanped);
meanped->SetTitle(0);
meanped->SetMarkerStyle(8);
meanped->Fit("fitgaus", "M");
meanped->GetXaxis()->SetTitle("Pedestal Mean ADC");
meanped->GetYaxis()->SetTitle("Counts");
meanped->Draw("pe");
TLegend *leg = new TLegend(0.16, 0.65, 0.45, 0.8);
leg->AddEntry(meanped, "Data point", "lpe");
leg->AddEntry(fitgaus, "Gauss fit", "l");
leg->SetFillColor(0);
leg->SetFillStyle(0);
leg->SetTextFont(42);
leg->SetTextSize(0.045);
leg->SetLineColor(0);
leg->SetShadowColor(0);
leg->Draw();
TLatex lat;
lat.SetNDC();
lat.SetTextSize(0.045);
lat.SetTextFont(42);
// lat.SetTextColor(4);
lat.DrawLatex(0.16, 0.8, "Pedestal mean distribution");
// lat.SetTextColor(1);
lat.DrawLatex(0.16, 0.60, "Beam: OFF");
lat.DrawLatex(0.16, 0.55, "Bias Voltage: 60V");
// lat.DrawLatex(0.2,0.65,Form("Mean: %.2f",fitgaus->GetParameter(1)));
// lat.DrawLatex(0.2,0.6,Form("Sigma: %.2f",fitgaus->GetParameter(2)));
TBox *box = new TBox(0.14, 0.53, 0.5, 0.9);
box->SetFillColor(19);
box->Draw();
TBox *box2 = new TBox(0.14, 0.53, 0.5, 0.9);
box2->SetFillStyle(0);
box2->SetLineWidth(2);
box2->SetLineColor(2);
box2->Draw();