//canvas c1: new Figure for revised version using std::cout; using std::endl; void figBestFitLeftES(Bool_t saveFigs = 0) { TH1F *hCurr = 0; TString hName; TFile *fr2 = new TFile("figures/PRCthetaA.root"); TH1F *hAlphaExp7590[6]; TH1F *hAlphaSim7590[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT3_%d_7590", i); hCurr = (TH1F*)fr2->Get(hName.Data()); hAlphaExp7590[i] = new TH1F(*hCurr); hName.Form("hsthetaAT3_%d_7590", i); hCurr = (TH1F*)fr2->Get(hName.Data()); hAlphaSim7590[i] = new TH1F(*hCurr); } TH1F *hAlphaExp90120[6]; TH1F *hAlphaSim90120[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT3_%d_90120", i); hCurr = (TH1F*)fr2->Get(hName.Data()); hAlphaExp90120[i] = new TH1F(*hCurr); hName.Form("hsthetaAT3_%d_90120", i); hCurr = (TH1F*)fr2->Get(hName.Data()); hAlphaSim90120[i] = new TH1F(*hCurr); } TFile *fr4560 = new TFile("figures/BestFit4560.root"); TH1F *hAlphaExp4560[6]; TH1F *hAlphaSim4560[6]; TH1F *hAlphaExp4560low[6]; TH1F *hAlphaSim4560low[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT3_%d_4560", i); hCurr = (TH1F*)fr4560->Get(hName.Data()); hAlphaExp4560[i] = new TH1F(*hCurr); hName.Form("hsthetaAT3_%d_4560", i); hCurr = (TH1F*)fr4560->Get(hName.Data()); hAlphaSim4560[i] = new TH1F(*hCurr); hName.Form("hethetaAT2_%d_4560", i); hCurr = (TH1F*)fr4560->Get(hName.Data()); hAlphaExp4560low[i] = new TH1F(*hCurr); hName.Form("hsthetaAT2_%d_4560", i); hCurr = (TH1F*)fr4560->Get(hName.Data()); hAlphaSim4560low[i] = new TH1F(*hCurr); } TFile *fr90120 = new TFile("figures/BestFit90120.root"); TH1F *hAlphaExp90120low[6]; TH1F *hAlphaSim90120low[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT2_%d_90120", i); hCurr = (TH1F*)fr90120->Get(hName.Data()); hAlphaExp90120low[i] = new TH1F(*hCurr); hName.Form("hsthetaAT2_%d_90120", i); hCurr = (TH1F*)fr90120->Get(hName.Data()); hAlphaSim90120low[i] = new TH1F(*hCurr); } TFile *fr7590 = new TFile("figures/BestFit7590.root"); TH1F *hAlphaExp7590low[6]; TH1F *hAlphaSim7590low[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT2_%d_7590", i); hCurr = (TH1F*)fr7590->Get(hName.Data()); hAlphaExp7590low[i] = new TH1F(*hCurr); hName.Form("hsthetaAT2_%d_7590", i); hCurr = (TH1F*)fr7590->Get(hName.Data()); hAlphaSim7590low[i] = new TH1F(*hCurr); } TFile *fr6075 = new TFile("figures/BestFit6075.root"); TH1F *hAlphaExp6075[6]; TH1F *hAlphaSim6075[6]; TH1F *hAlphaExp6075low[6]; TH1F *hAlphaSim6075low[6]; for (Int_t i = 0; i < 6; i++) { hName.Form("hethetaAT3_%d_6075", i); hCurr = (TH1F*)fr6075->Get(hName.Data()); hAlphaExp6075[i] = new TH1F(*hCurr); hName.Form("hsthetaAT3_%d_6075", i); hCurr = (TH1F*)fr6075->Get(hName.Data()); hAlphaSim6075[i] = new TH1F(*hCurr); hName.Form("hethetaAT2_%d_6075", i); hCurr = (TH1F*)fr6075->Get(hName.Data()); hAlphaExp6075low[i] = new TH1F(*hCurr); hName.Form("hsthetaAT2_%d_6075", i); hCurr = (TH1F*)fr6075->Get(hName.Data()); hAlphaSim6075low[i] = new TH1F(*hCurr); } //////////////////////// // 2.5 - 3.1 MeV //////////////////////// TCanvas *c1 = new TCanvas("c1", "Combined fits 2.5 - 3.1 MeV", 800, 800); c1->ToggleEditor(); c1->Divide(2, 2, .001, .001); cout << "new Figure" << endl; c1->cd(1); TH1F *hAlphaComb4560 = new TH1F(*hAlphaSim4560[3]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb4560->Add(hAlphaSim4560[2], 0.1); hAlphaComb4560->Scale(0.9); hAlphaComb4560->SetTitle(""); hAlphaComb4560->GetYaxis()->SetRangeUser(0., 480.); hAlphaComb4560->GetYaxis()->SetTitle(""); hAlphaComb4560->GetYaxis()->SetNdivisions(30505); hAlphaComb4560->GetXaxis()->SetNdivisions(506); hAlphaComb4560->GetXaxis()->SetLabelSize(0.07); hAlphaComb4560->GetXaxis()->SetLabelOffset(0.002); hAlphaComb4560->GetXaxis()->SetTitleSize(0.07); hAlphaComb4560->GetXaxis()->SetTitleOffset(0.74); hAlphaComb4560->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb4560->Draw("same"); hAlphaExp4560[4]->Draw("E same"); hAlphaExp4560[4]->Chi2Test(hAlphaComb4560, "P"); c1->cd(2); TH1F *hAlphaComb6075 = new TH1F(*hAlphaSim6075[3]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb6075->Add(hAlphaSim6075[2], 0.3); hAlphaComb6075->Scale(0.8); hAlphaComb6075->SetTitle(""); hAlphaComb6075->GetYaxis()->SetRangeUser(0., 650.); hAlphaComb6075->GetYaxis()->SetTitle(""); hAlphaComb6075->GetYaxis()->SetNdivisions(30505); hAlphaComb6075->GetXaxis()->SetNdivisions(506); hAlphaComb6075->GetXaxis()->SetLabelSize(0.07); hAlphaComb6075->GetXaxis()->SetLabelOffset(0.002); hAlphaComb6075->GetXaxis()->SetTitleSize(0.07); hAlphaComb6075->GetXaxis()->SetTitleOffset(0.74); hAlphaComb6075->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb6075->Draw("same"); hAlphaExp6075[4]->Draw("E same"); hAlphaExp6075[4]->Chi2Test(hAlphaComb6075, "P"); c1->cd(3); TH1F *hAlphaComb7590 = new TH1F(*hAlphaSim7590[3]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb7590->Add(hAlphaSim7590[2], 0.2); hAlphaComb7590->Scale(0.9); hAlphaComb7590->SetTitle(""); hAlphaComb7590->GetYaxis()->SetRangeUser(0., 499.); hAlphaComb7590->GetYaxis()->SetTitle(""); hAlphaComb7590->GetYaxis()->SetNdivisions(30505); hAlphaComb7590->GetXaxis()->SetNdivisions(506); hAlphaComb7590->GetXaxis()->SetLabelSize(0.07); hAlphaComb7590->GetXaxis()->SetLabelOffset(0.002); hAlphaComb7590->GetXaxis()->SetTitleSize(0.07); hAlphaComb7590->GetXaxis()->SetTitleOffset(0.74); hAlphaComb7590->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb7590->Draw("same"); hAlphaExp7590[4]->Draw("E same"); hAlphaExp7590[4]->Chi2Test(hAlphaComb7590, "P"); c1->cd(4); TH1F *hAlphaComb90120 = new TH1F(*hAlphaSim90120[5]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb90120->Add(hAlphaSim90120[3], 1); hAlphaComb90120->Scale(0.5); hAlphaComb90120->SetTitle(""); hAlphaComb90120->GetYaxis()->SetRangeUser(0., 399.); hAlphaComb90120->GetYaxis()->SetTitle(""); hAlphaComb90120->GetYaxis()->SetNdivisions(30505); hAlphaComb90120->GetXaxis()->SetNdivisions(506); hAlphaComb90120->GetXaxis()->SetLabelSize(0.07); hAlphaComb90120->GetXaxis()->SetLabelOffset(0.002); hAlphaComb90120->GetXaxis()->SetTitleSize(0.07); hAlphaComb90120->GetXaxis()->SetTitleOffset(0.74); hAlphaComb90120->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb90120->Draw("same"); hAlphaExp90120[4]->Draw("E same"); hAlphaExp90120[4]->Chi2Test(hAlphaComb90120, "P"); // return; //////////////////////// // 1.9 - 2.5 MeV //////////////////////// TCanvas *c2 = new TCanvas("c2", "Combined fits 1.9 - 2.5 MeV", 800, 800); c2->ToggleEditor(); c2->Divide(2, 2, .001, .001); cout << endl << endl << endl << "new Figure for lower energy interval" << endl; c2->cd(1); TH1F *hAlphaComb4560low = new TH1F(*hAlphaSim4560low[5]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb4560low->Add(hAlphaSim4560low[4], 0.1); hAlphaComb4560low->Add(hAlphaSim4560low[2], 0.1); hAlphaComb4560low->Add(hAlphaSim4560low[3], 1); hAlphaComb4560low->Scale(0.5); hAlphaComb4560low->SetTitle(""); hAlphaComb4560low->GetYaxis()->SetRangeUser(0., 300.); hAlphaComb4560low->GetYaxis()->SetTitle(""); hAlphaComb4560low->GetYaxis()->SetNdivisions(30505); hAlphaComb4560low->GetXaxis()->SetNdivisions(506); hAlphaComb4560low->GetXaxis()->SetLabelSize(0.07); hAlphaComb4560low->GetXaxis()->SetLabelOffset(0.002); hAlphaComb4560low->GetXaxis()->SetTitleSize(0.07); hAlphaComb4560low->GetXaxis()->SetTitleOffset(0.74); hAlphaComb4560low->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); // hAlphaComb4560low->GetYaxis()->SetRangeUser(0., 650.); // hAlphaComb4560low->GetYaxis()->SetTitle(""); hAlphaComb4560low->Draw(""); // hAlphaComb4560low->Draw("same"); hAlphaExp4560low[4]->Draw("E same"); hAlphaExp4560low[4]->Chi2Test(hAlphaComb4560low, "P"); c2->cd(2); TH1F *hAlphaComb6075low = new TH1F(*hAlphaSim6075low[3]); // hAlphaComb7590->Add(hAlphaSim[5], 1); hAlphaComb6075low->Add(hAlphaSim6075low[2], 0.1); hAlphaComb6075low->Scale(0.9); hAlphaComb6075low->SetTitle(""); hAlphaComb6075low->GetYaxis()->SetRangeUser(0., 400.); hAlphaComb6075low->GetYaxis()->SetTitle(""); hAlphaComb6075low->GetYaxis()->SetNdivisions(30505); hAlphaComb6075low->GetXaxis()->SetNdivisions(506); hAlphaComb6075low->GetXaxis()->SetLabelSize(0.07); hAlphaComb6075low->GetXaxis()->SetLabelOffset(0.002); hAlphaComb6075low->GetXaxis()->SetTitleSize(0.07); hAlphaComb6075low->GetXaxis()->SetTitleOffset(0.74); hAlphaComb6075low->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb6075low->Draw("same"); hAlphaExp6075low[4]->Draw("E same"); hAlphaExp6075low[4]->Chi2Test(hAlphaComb6075low, "P"); c2->cd(3); TH1F *hAlphaComb7590low = new TH1F(*hAlphaSim7590low[3]); // hAlphaComb7590low->Add(hAlphaSim7590low[2], 0.2); // hAlphaComb7590low->Scale(0.8); hAlphaComb7590low->SetTitle(""); hAlphaComb7590low->GetYaxis()->SetRangeUser(0., 300.); hAlphaComb7590low->GetYaxis()->SetTitle(""); hAlphaComb7590low->GetYaxis()->SetNdivisions(30505); hAlphaComb7590low->GetXaxis()->SetNdivisions(506); hAlphaComb7590low->GetXaxis()->SetLabelSize(0.07); hAlphaComb7590low->GetXaxis()->SetLabelOffset(0.002); hAlphaComb7590low->GetXaxis()->SetTitleSize(0.07); hAlphaComb7590low->GetXaxis()->SetTitleOffset(0.74); hAlphaComb7590low->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb7590low->Draw("same"); hAlphaExp7590low[4]->Draw("E same"); hAlphaExp7590low[4]->Chi2Test(hAlphaComb7590low, "P"); c2->cd(4); TH1F *hAlphaComb90120low = new TH1F(*hAlphaSim90120low[5]); hAlphaComb90120low->Add(hAlphaSim90120low[4], 0.1); hAlphaComb90120low->Scale(0.8); hAlphaComb90120low->SetTitle(""); hAlphaComb90120low->GetYaxis()->SetRangeUser(0., 300.); hAlphaComb90120low->GetYaxis()->SetTitle(""); hAlphaComb90120low->GetYaxis()->SetNdivisions(30505); hAlphaComb90120low->GetXaxis()->SetNdivisions(506); hAlphaComb90120low->GetXaxis()->SetLabelSize(0.07); hAlphaComb90120low->GetXaxis()->SetLabelOffset(0.002); hAlphaComb90120low->GetXaxis()->SetTitleSize(0.07); hAlphaComb90120low->GetXaxis()->SetTitleOffset(0.74); hAlphaComb90120low->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)"); hAlphaComb90120low->Draw("same"); hAlphaExp90120low[4]->Draw("E same"); hAlphaExp90120low[4]->Chi2Test(hAlphaComb90120low, "P"); c1->Update(); if (saveFigs) { } }