figIZVCorrGS.cxx 2.46 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
//Figure 2 IZV RAS

#if !defined(__CLING__)

#include "TFile.h"
#include "TCanvas.h"
#include "TH1F.h"
#include "TText.h"

#endif

void figIZVCorrGS(const Bool_t saveFigs = 0)
{

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

	TH1F *hExp[4];
	TH1F *hSim[4];
	TH1F *hInput[4];

	TH1F *hCurr = 0;

	hCurr = (TH1F*)fr1->Get("heeT0_0_4560");
	hExp[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("heeT0_5_6075");
	hExp[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("heeT0_5_7590");
	hExp[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("heeT0_0_90120");
	hExp[3] = new TH1F(*hCurr);

	hCurr = (TH1F*)fr1->Get("hseT0_0_4560");
	hSim[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hseT0_5_6075");
	hSim[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hseT0_5_7590");
	hSim[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hseT0_0_90120");
	hSim[3] = new TH1F(*hCurr);

	hCurr = (TH1F*)fr1->Get("hieT0_0_4560");
	hInput[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hieT0_5_6075");
	hInput[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hieT0_5_7590");
	hInput[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr1->Get("hieT0_0_90120");
	hInput[3] = new TH1F(*hCurr);



	TCanvas *c1 = new TCanvas("c1", "Fig. 2, IZV RAS");
	c1->ToggleEditor();
//	c1->SetWindowSize(800, 1200);
	c1->SetWindowSize(1800, 450);
	c1->Divide(4, 1, .001, .001);

	TText *t1[4];
60
	TString panel[4] = {"a", "b", "c", "d"};
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

	for (Int_t i = 0; i < 4; i++) {
		c1->cd(i+1);

//		cout << i << endl;

		hSim[i]->SetTitle("");
		hSim[i]->SetLineColor(kGray);
//		hSim[i]->SetFillColor(kGray+1);
		hSim[i]->GetXaxis()->SetNdivisions(405);
		hSim[i]->GetYaxis()->SetTitle("");
		if (i == 0 || i == 1) {
			hSim[i]->GetYaxis()->SetNdivisions(1005);
		}
//		hInput[i]->SetLineWidth(2);
		hInput[i]->SetLineColor(kBlack);
		hInput[i]->SetLineStyle(2);

//		hSim[i]->Smooth();

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

		hSim[i]->Draw("");
		hExp[i]->Draw("E same");
		hInput[i]->Draw("same");
		hInput[i]->Smooth();

		hExp[i]->Chi2Test(hSim[i], "P");

90 91
//		t1[i] = new TText(0.18,0.87,panel[i].Data());
		t1[i] = new TText(0.5,0.92,panel[i].Data());
92
		t1[i]->SetNDC();
93
		t1[i]->SetTextFont(12);
94 95 96 97 98
		t1[i]->SetTextSize(0.07);
		t1[i]->Draw();
	}
	c1->Update();

99
	cout << saveFigs << endl;
100 101 102 103 104 105 106 107 108 109 110

	if (saveFigs) {
//		c2->SaveAs("figures/PresGSepsilonTright7590.png");

		c1->SaveAs("figures/Fig2izvIntCorrsEvolution.png");
		c1->SaveAs("figures/Fig2izvIntCorrsEvolution.eps");
	}

	return;

}