figPresCorrRightES.cxx 2.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
//canvas c3: Fig. 16 in first submitted version

void figPresCorrRightES(const Bool_t saveFigs = 0)
{

	const Int_t canMap[6] = {1,4,3,6,2,5};


	TCanvas *c1 = new TCanvas();
	c1->Update();

	TH1F *hCurr = 0;

	TCanvas *c3 = new TCanvas();
	c3->ToggleEditor();
	c3->SetWindowSize(1500, 1000);
	c3->Divide(3, 2, .001, .001);

	TFile *fr2 = new TFile("figures/PRCthetaARightES.root");

	TH1F *hAlphaExp[6];
	TH1F *hAlphaSim[6];
	TH1F *hAlphaInput[6];
	TH1F *hAlphaInputCorr[6];

	TString hName;

	for (Int_t i = 0; i < 6; i++) {
		c3->cd(canMap[i]);

		hName.Form("hethetaAT4_%d_7590", i);
		hCurr = (TH1F*)fr2->Get(hName.Data());
		hAlphaExp[i] = new TH1F(*hCurr);

		hName.Form("hsthetaAT4_%d_7590", i);
		hCurr = (TH1F*)fr2->Get(hName.Data());
		hAlphaSim[i] = new TH1F(*hCurr);

		hName.Form("hithetaAT4_%d_7590", i);
		hCurr = (TH1F*)fr2->Get(hName.Data());
		hAlphaInput[i] = new TH1F(*hCurr);

		hAlphaInputCorr[i] = new TH1F(*hAlphaInput[i]);
		Double_t binContent = 0;
		for (Int_t binN = 1; binN <= 15; binN++) {
			binContent = hAlphaInputCorr[i]->GetBinContent(binN);
			hAlphaInputCorr[i]->SetBinContent(binN, binContent + hAlphaInputCorr[i]->GetBinContent(31-binN));
			hAlphaInputCorr[i]->SetBinContent(31-binN, hAlphaInputCorr[i]->GetBinContent(binN));
		}

		hAlphaInput[i]->SetLineWidth(2);
		hAlphaSim[i]->SetTitle("");
		hAlphaSim[i]->GetXaxis()->SetNdivisions(506);
		hAlphaSim[i]->GetXaxis()->SetLabelSize(0.07);
		hAlphaSim[i]->GetXaxis()->SetLabelOffset(0.002);
		hAlphaSim[i]->GetXaxis()->SetTitleSize(0.08);
		hAlphaSim[i]->GetXaxis()->SetTitleOffset(0.74);

		hAlphaSim[i]->GetYaxis()->SetRangeUser(0., 690.);
		hAlphaSim[i]->GetYaxis()->SetTitle("");

		hAlphaSim[i]->SetFillColor(kGray+1);
		hAlphaSim[i]->SetLineColor(kGray+1);

		hAlphaSim[i]->Draw("");
		hAlphaSim[i]->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)");
		hAlphaExp[i]->Draw("E same");
//		hAlphaInput[i]->Draw("same");
		hAlphaInputCorr[i]->SetLineColor(kRed);
		hAlphaInputCorr[i]->SetLineWidth(2);
		hAlphaInputCorr[i]->Scale(0.5);
		hAlphaInputCorr[i]->Smooth();
		hAlphaInputCorr[i]->Draw("same");

		hAlphaExp[i]->Chi2Test(hAlphaSim[i], "P");

	}
	c3->Update();
	c1->Update();

	delete c1;

	if (saveFigs) {
		c3->SaveAs("figures/ESThetaAright7590.png");
	}


}