{ //=========Macro generated from canvas: c1/c1 //========= (Mon Feb 25 20:04:23 2013) by ROOT version5.34/01 TCanvas *c1 = new TCanvas("c1", "c1",543,69,700,520); c1->ToggleEventStatus(); c1->Range(-0.7500001,-18750,6.75,168750); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetFrameBorderMode(0); c1->SetFrameBorderMode(0); TH1F *hElectrons = new TH1F("hElectrons","",6,0,6); hElectrons->SetBinContent(1,98261); hElectrons->SetBinContent(2,97488); hElectrons->SetBinContent(3,120438); hElectrons->SetBinContent(4,89464); hElectrons->SetBinContent(5,92912); hElectrons->SetBinContent(6,115876); hElectrons->SetMinimum(0); hElectrons->SetMaximum(150000); hElectrons->SetEntries(756); TPaveStats *ptstats = new TPaveStats(0.795977,0.8347458,0.9971264,0.9957627,"brNDC"); ptstats->SetName("stats"); ptstats->SetBorderSize(1); ptstats->SetFillColor(0); ptstats->SetTextAlign(12); ptstats->SetTextFont(42); TText *text = ptstats->AddText("hElectrons"); text->SetTextSize(0.0370339); text = ptstats->AddText("Entries = 756 "); text = ptstats->AddText("Mean = 2.535"); text = ptstats->AddText("RMS = 1.72"); ptstats->SetOptStat(1111); ptstats->SetOptFit(0); ptstats->Draw(); hElectrons->GetListOfFunctions()->Add(ptstats); ptstats->SetParent(hElectrons); Int_t ci; // for color index setting ci = TColor::GetColor("#ff0000"); hElectrons->SetLineColor(ci); hElectrons->GetXaxis()->SetTitle("sector"); hElectrons->GetXaxis()->SetLabelFont(42); hElectrons->GetXaxis()->SetLabelSize(0.035); hElectrons->GetXaxis()->SetTitleSize(0.035); hElectrons->GetXaxis()->SetTitleFont(42); hElectrons->GetYaxis()->SetLabelFont(42); hElectrons->GetYaxis()->SetLabelSize(0.035); hElectrons->GetYaxis()->SetTitleSize(0.035); hElectrons->GetYaxis()->SetTitleFont(42); hElectrons->GetZaxis()->SetLabelFont(42); hElectrons->GetZaxis()->SetLabelSize(0.035); hElectrons->GetZaxis()->SetTitleSize(0.035); hElectrons->GetZaxis()->SetTitleFont(42); hElectrons->Draw(""); TH1F *hMatched = new TH1F("hMatched","hMatched",6,0,6); hMatched->SetBinContent(1,34864); hMatched->SetBinContent(2,28156); hMatched->SetBinContent(3,35592); hMatched->SetBinContent(4,27419); hMatched->SetBinContent(5,33657); hMatched->SetBinContent(6,37494); hMatched->SetEntries(756); ci = TColor::GetColor("#0000ff"); hMatched->SetLineColor(ci); hMatched->GetXaxis()->SetTitle("sector"); hMatched->GetXaxis()->SetLabelFont(42); hMatched->GetXaxis()->SetLabelSize(0.035); hMatched->GetXaxis()->SetTitleSize(0.035); hMatched->GetXaxis()->SetTitleFont(42); hMatched->GetYaxis()->SetTitle("nr matched rings"); hMatched->GetYaxis()->SetLabelFont(42); hMatched->GetYaxis()->SetLabelSize(0.035); hMatched->GetYaxis()->SetTitleSize(0.035); hMatched->GetYaxis()->SetTitleFont(42); hMatched->GetZaxis()->SetLabelFont(42); hMatched->GetZaxis()->SetLabelSize(0.035); hMatched->GetZaxis()->SetTitleSize(0.035); hMatched->GetZaxis()->SetTitleFont(42); hMatched->Draw("same"); TH1F *hUnmatched = new TH1F("hUnmatched","hUnmatched",6,0,6); hUnmatched->SetBinContent(1,63397); hUnmatched->SetBinContent(2,69332); hUnmatched->SetBinContent(3,84846); hUnmatched->SetBinContent(4,62045); hUnmatched->SetBinContent(5,59255); hUnmatched->SetBinContent(6,78382); hUnmatched->SetEntries(756); ci = TColor::GetColor("#00ff00"); hUnmatched->SetLineColor(ci); hUnmatched->GetXaxis()->SetTitle("sector"); hUnmatched->GetXaxis()->SetLabelFont(42); hUnmatched->GetXaxis()->SetLabelSize(0.035); hUnmatched->GetXaxis()->SetTitleSize(0.035); hUnmatched->GetXaxis()->SetTitleFont(42); hUnmatched->GetYaxis()->SetTitle("nr of unmatched rings"); hUnmatched->GetYaxis()->SetLabelFont(42); hUnmatched->GetYaxis()->SetLabelSize(0.035); hUnmatched->GetYaxis()->SetTitleSize(0.035); hUnmatched->GetYaxis()->SetTitleFont(42); hUnmatched->GetZaxis()->SetLabelFont(42); hUnmatched->GetZaxis()->SetLabelSize(0.035); hUnmatched->GetZaxis()->SetTitleSize(0.035); hUnmatched->GetZaxis()->SetTitleFont(42); hUnmatched->Draw("same"); TLegend *leg = new TLegend(0.6178161,0.7860169,0.9971264,0.9957627,NULL,"brNDC"); leg->SetBorderSize(1); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(19); leg->SetFillStyle(1001); TLegendEntry *entry=leg->AddEntry("hElectrons","hElectrons","lpf"); entry->SetFillStyle(1001); ci = TColor::GetColor("#ff0000"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(1); entry->SetMarkerSize(1); entry=leg->AddEntry("hMatched","hMatched","lpf"); entry->SetFillStyle(1001); ci = TColor::GetColor("#0000ff"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(1); entry->SetMarkerSize(1); entry=leg->AddEntry("hUnmatched","hUnmatched","lpf"); entry->SetFillStyle(1001); ci = TColor::GetColor("#00ff00"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(1); entry->SetMarkerColor(1); entry->SetMarkerStyle(1); entry->SetMarkerSize(1); leg->Draw(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }