{ TFile *f1 = TFile::Open("UnderAllNW_VWBar18_VWPosAndTDCHistogramWithWithoutNWForGatingof12.root"); gStyle->SetOptStat(0); TH1D *d1 = (TH1D*)f->Get("tdcpeak1"); TH1D *d2 = (TH1D*)f->Get("tdcpeak"); TH1D *d3 = (TH1D*)f->Get("position1"); TH1D *d4 = (TH1D*)f->Get("position"); TH1D *r1 = (TH1D*)d1->Clone("r1"); TH1D *r2 = (TH1D*)d3->Clone("r2"); r1->Reset(); r1->Divide(d1,d2); r1->SetTitle("Gating of 12"); r1->GetXaxis()->SetRangeUser(-10,25); r1->GetYaxis()->SetRangeUser(0,35); r1->SetLineColor(kRed); r2->Reset(); r2->Divide(d3,d4); r1->Draw(); //r2->Draw("hist same"); TF1 *f2 = new TF1("f2","x",250,0); TGaxis *A1 = new TGaxis(-10,35,25,35,"f2",510,"-L",5); A1->SetLabelSize(0.024); A1->SetLabelOffset(0.00001); A1->SetTitle("distance[cm]"); A1->SetTitleSize(0.035); A1->SetLabelSize(0.032); A1->SetTitleOffset(1.2); A1->Draw(); // r2->Draw("hist same");