12 void ratioplotOld( ) {
15 TH1F *h1 =
new TH1F(
"h1",
"Two gaussian plots and their ratio;x title; h1 and h2 gaussian histograms", 100, -5, 5);
16 TH1F *h2 =
new TH1F(
"h2",
"h2", 100, -5, 5);
17 h1->FillRandom(
"gaus");
18 h2->FillRandom(
"gaus");
21 TCanvas *c =
new TCanvas(
"c",
"canvas", 800, 800);
24 TPad *pad1 =
new TPad(
"pad1",
"pad1", 0, 0.3, 1, 1.0);
25 pad1->SetBottomMargin(0);
35 h1->GetYaxis()->SetLabelSize(0.);
36 TGaxis *axis =
new TGaxis( -5, 20, -5, 220, 20,220,510,
"");
37 axis->SetLabelFont(43);
38 axis->SetLabelSize(15);
43 TPad *pad2 =
new TPad(
"pad2",
"pad2", 0, 0.05, 1, 0.3);
44 pad2->SetTopMargin(0);
45 pad2->SetBottomMargin(0.2);
51 TH1F *h3 = (TH1F*)h1->Clone(
"h3");
52 h3->SetLineColor(kBlack);
58 h3->SetMarkerStyle(21);
62 h1->SetLineColor(kBlue+1);
66 h1->GetYaxis()->SetTitleSize(20);
67 h1->GetYaxis()->SetTitleFont(43);
68 h1->GetYaxis()->SetTitleOffset(1.55);
71 h2->SetLineColor(kRed);
78 h3->GetYaxis()->SetTitle(
"ratio h1/h2 ");
79 h3->GetYaxis()->SetNdivisions(505);
80 h3->GetYaxis()->SetTitleSize(20);
81 h3->GetYaxis()->SetTitleFont(43);
82 h3->GetYaxis()->SetTitleOffset(1.55);
83 h3->GetYaxis()->SetLabelFont(43);
84 h3->GetYaxis()->SetLabelSize(15);
87 h3->GetXaxis()->SetTitleSize(20);
88 h3->GetXaxis()->SetTitleFont(43);
89 h3->GetXaxis()->SetTitleOffset(4.);
90 h3->GetXaxis()->SetLabelFont(43);
91 h3->GetXaxis()->SetLabelSize(15);