void hitsPerSL5319() { //=========Macro generated from canvas: c/c //========= (Sun Jan 13 14:42:01 2019) by ROOT version6.02/13 TCanvas *c = new TCanvas("c", "c",0,0,800,600); c->Range(-1.125,-1.29375,5.125,11.64375); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); TH1D *seg_nhits_SL1_SL120 = new TH1D("seg_nhits_SL1_SL120","Number of hits in each SL",5,-0.5,4.5); seg_nhits_SL1_SL120->SetBinContent(4,8); seg_nhits_SL1_SL120->SetBinContent(5,1); seg_nhits_SL1_SL120->SetMaximum(10.35); seg_nhits_SL1_SL120->SetEntries(9); seg_nhits_SL1_SL120->SetDirectory(0); seg_nhits_SL1_SL120->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#9900ff"); seg_nhits_SL1_SL120->SetLineColor(ci); seg_nhits_SL1_SL120->SetLineWidth(2); seg_nhits_SL1_SL120->GetXaxis()->SetTitle("# Hits per segment in SL"); seg_nhits_SL1_SL120->GetXaxis()->SetLabelFont(42); seg_nhits_SL1_SL120->GetXaxis()->SetLabelSize(0.035); seg_nhits_SL1_SL120->GetXaxis()->SetTitleSize(0.035); seg_nhits_SL1_SL120->GetXaxis()->SetTitleFont(42); seg_nhits_SL1_SL120->GetYaxis()->SetTitle("# Segments"); seg_nhits_SL1_SL120->GetYaxis()->SetLabelFont(42); seg_nhits_SL1_SL120->GetYaxis()->SetLabelSize(0.035); seg_nhits_SL1_SL120->GetYaxis()->SetTitleSize(0.035); seg_nhits_SL1_SL120->GetYaxis()->SetTitleOffset(1.45); seg_nhits_SL1_SL120->GetYaxis()->SetTitleFont(42); seg_nhits_SL1_SL120->GetZaxis()->SetLabelFont(42); seg_nhits_SL1_SL120->GetZaxis()->SetLabelSize(0.035); seg_nhits_SL1_SL120->GetZaxis()->SetTitleSize(0.035); seg_nhits_SL1_SL120->GetZaxis()->SetTitleFont(42); seg_nhits_SL1_SL120->Draw("hist"); TH1D *seg_nhits_SL2_SL121 = new TH1D("seg_nhits_SL2_SL121","",5,-0.5,4.5); seg_nhits_SL2_SL121->SetBinContent(1,9); seg_nhits_SL2_SL121->SetEntries(9); seg_nhits_SL2_SL121->SetDirectory(0); seg_nhits_SL2_SL121->SetStats(0); ci = TColor::GetColor("#ff9933"); seg_nhits_SL2_SL121->SetLineColor(ci); seg_nhits_SL2_SL121->SetLineWidth(2); seg_nhits_SL2_SL121->GetXaxis()->SetLabelFont(42); seg_nhits_SL2_SL121->GetXaxis()->SetLabelSize(0.035); seg_nhits_SL2_SL121->GetXaxis()->SetTitleSize(0.035); seg_nhits_SL2_SL121->GetXaxis()->SetTitleFont(42); seg_nhits_SL2_SL121->GetYaxis()->SetLabelFont(42); seg_nhits_SL2_SL121->GetYaxis()->SetLabelSize(0.035); seg_nhits_SL2_SL121->GetYaxis()->SetTitleSize(0.035); seg_nhits_SL2_SL121->GetYaxis()->SetTitleFont(42); seg_nhits_SL2_SL121->GetZaxis()->SetLabelFont(42); seg_nhits_SL2_SL121->GetZaxis()->SetLabelSize(0.035); seg_nhits_SL2_SL121->GetZaxis()->SetTitleSize(0.035); seg_nhits_SL2_SL121->GetZaxis()->SetTitleFont(42); seg_nhits_SL2_SL121->Draw("hist,same"); TH1D *seg_nhits_SL3_SL122 = new TH1D("seg_nhits_SL3_SL122","",5,-0.5,4.5); seg_nhits_SL3_SL122->SetBinContent(1,9); seg_nhits_SL3_SL122->SetEntries(9); seg_nhits_SL3_SL122->SetDirectory(0); seg_nhits_SL3_SL122->SetStats(0); ci = TColor::GetColor("#00ff66"); seg_nhits_SL3_SL122->SetLineColor(ci); seg_nhits_SL3_SL122->SetLineWidth(2); seg_nhits_SL3_SL122->GetXaxis()->SetLabelFont(42); seg_nhits_SL3_SL122->GetXaxis()->SetLabelSize(0.035); seg_nhits_SL3_SL122->GetXaxis()->SetTitleSize(0.035); seg_nhits_SL3_SL122->GetXaxis()->SetTitleFont(42); seg_nhits_SL3_SL122->GetYaxis()->SetLabelFont(42); seg_nhits_SL3_SL122->GetYaxis()->SetLabelSize(0.035); seg_nhits_SL3_SL122->GetYaxis()->SetTitleSize(0.035); seg_nhits_SL3_SL122->GetYaxis()->SetTitleFont(42); seg_nhits_SL3_SL122->GetZaxis()->SetLabelFont(42); seg_nhits_SL3_SL122->GetZaxis()->SetLabelSize(0.035); seg_nhits_SL3_SL122->GetZaxis()->SetTitleSize(0.035); seg_nhits_SL3_SL122->GetZaxis()->SetTitleFont(42); seg_nhits_SL3_SL122->Draw("hist,same"); TLegend *leg = new TLegend(0.2,0.85,0.8,0.9,NULL,"brNDC"); leg->SetBorderSize(1); leg->SetLineColor(1); leg->SetLineStyle(1); leg->SetLineWidth(1); leg->SetFillColor(0); leg->SetFillStyle(1001); TLegendEntry *entry=leg->AddEntry("seg_nhits_SL1_SL1","SL1","l"); ci = TColor::GetColor("#9900ff"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("seg_nhits_SL2_SL1","SL2","l"); ci = TColor::GetColor("#ff9933"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); entry=leg->AddEntry("seg_nhits_SL3_SL1","SL3","l"); ci = TColor::GetColor("#00ff66"); entry->SetLineColor(ci); entry->SetLineStyle(1); entry->SetLineWidth(2); entry->SetMarkerColor(1); entry->SetMarkerStyle(21); entry->SetMarkerSize(1); entry->SetTextFont(42); leg->Draw(); TPaveText *pt = new TPaveText(0.73,0.9,0.9,0.95,"brNDC"); pt->SetFillColor(0); pt->SetTextAlign(12); pt->SetTextFont(42); pt->SetTextSize(0.05); TText *AText = pt->AddText("Run 5319"); pt->Draw(); pt = new TPaveText(0.2657538,0.94,0.7342462,0.995,"blNDC"); pt->SetName("title"); pt->SetBorderSize(0); pt->SetFillColor(0); pt->SetFillStyle(0); pt->SetTextFont(42); AText = pt->AddText("Number of hits in each SL"); pt->Draw(); c->Modified(); c->cd(); c->SetSelected(c); }