figIZVCorrLeftES.cxx 3.33 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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
//Figure 4 IZV RAS

#if !defined(__CLING__)

#include "TFile.h"
#include "TCanvas.h"
#include "TH1F.h"
#include "TText.h"
#include <iostream>

#endif

using std::cout;
using std::endl;

void figIZVCorrLeftES(const Bool_t saveFigs = 0)
{

//	gStyle->SetLabelFont();

	TFile *fr = new TFile("figures/PRCepsilonT.root", "READ");

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

	TH1F *hCurr = 0;

	TString hName;

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

	TCanvas *c4 = new TCanvas("c4", "Fig. 4, IZV RAS");
	c4->ToggleEditor();
//	c4->SetWindowSize(800, 1227);
//	c4->Divide(2, 3, .001, .001);
	c4->SetWindowSize(1500, 1000);
	c4->Divide(3, 2, .001, .001);

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

	TH1F *hAlphaExp90120[6];
	TH1F *hAlphaSim90120[6];
	TH1F *hAlphaInput90120[6];
	TH1F *hAlphaInput90120Corr[6];


	cout << "Fig. 4" << endl;

	TText *t1[6];
	TString panel[6] = {"a)", "b)", "c)", "d)", "e)", "f)"};

	for (Int_t i = 0; i < 6; i++) {
		c4->cd(canMap[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);

		hName.Form("hithetaAT3_%d_90120", i);
		hCurr = (TH1F*)fr2->Get(hName.Data());
		hAlphaInput90120[i] = new TH1F(*hCurr);

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

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

		hAlphaSim90120[i]->GetYaxis()->SetRangeUser(0., 650.);
		hAlphaSim90120[i]->GetYaxis()->SetTitle("");

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

		hAlphaSim90120[i]->GetXaxis()->CenterTitle(0);

		hAlphaSim90120[i]->Draw("hist");
		hAlphaSim90120[i]->GetXaxis()->SetTitle("#it{#theta}_{#alpha}, rad");
//		hAlphaInput90120Corr[i]->Draw("same");
		hAlphaExp90120[i]->Draw("E same");
//		hAlphaInput90120[i]->Draw("same");
		hAlphaInput90120Corr[i]->SetLineColor(kBlack);
		hAlphaInput90120Corr[i]->SetLineStyle(2);
		hAlphaInput90120Corr[i]->Scale(0.5);
		hAlphaInput90120Corr[i]->Smooth();
		hAlphaInput90120Corr[i]->Draw("hist same");
//		hAlphaInput90120[i]->Draw("same");
//		hAlphaInput90120Corr[i]->

		hAlphaExp90120[i]->Chi2Test(hAlphaSim90120[i], "P");

		t1[i] = new TText(0.18,0.87,panel[i].Data());
		//		t1[i] = new TText(0.5,0.95,panel[i].Data());
		t1[i]->SetNDC();
		t1[i]->SetTextFont(132);
		t1[i]->SetTextSize(0.07);
		t1[i]->Draw();

	}
	c4->Update();


	if (saveFigs) {
		c4->SaveAs("figures/Fig4izvExtCorrs.png");
		c4->SaveAs("figures/Fig4izvExtCorrs.eps");
	}

}