void Ratio() { TFile* fa = new TFile("n=2, S = 0 + S = 1.root", "READ"); TProfile* A = (TProfile*) fa->Get("hprof5"); TFile* fb = new TFile("n=3, S = 0 + S = 1.root", "READ"); TProfile* B = (TProfile*) fb->Get("hprof6"); TH1D *h1 = A->ProjectionX(); TH1D *h2 = B->ProjectionX(); h1->Divide(h2); h1->Draw(); /*auto c1 = new TCanvas("c1", "Ratio b/w n = 2 and n = 3"); //TCanvas *c1 = new TCanvas(); A->Sumw2(); A->GetXaxis()->SetTitle("Impact parameter b (in fm)"); A->GetYaxis()->SetTitle("Eccentricity"); auto rp = new TRatioPlot(A, B); c1->SetTicks(0, 1); rp->Draw(); rp->GetLowYaxis()->SetNdivisions(505); c1->Update();*/ /*c1->cd(); //A->SetMarkerStyle(kFullCircle); //B->SetMarkerStyle(kFullSquare); C->SetMarkerStyle(kFullTriangleUp); D->SetMarkerStyle(kFullTriangleDown); hprof6->SetStats(0); hprof6->GetXaxis()->SetTitle("Impact Parameter b (in fm)"); hprof6->GetYaxis()->SetTitle("Eccentricity"); hprof6->Draw(); //A->Draw("SAMES PMC"); //B->Draw("SAMES PMC"); C->Draw("SAMES PMC"); D->Draw("SAMES PMC"); c1->BuildLegend(); TFile* f2 = new TFile("n=3, S = 0 + S = 1.root", "CREATE"); hprof6->Write();*/ }