figCorrLeftES.cxx 7.12 KB
Newer Older
1 2 3 4 5 6 7 8 9
//canvas c1: Fig. 12 in first submitted version
//canvas c2: Fig. 13 in first submitted version
//canvas c3: Fig. 14 in first submitted version
//canvas c4: Fig. 15 in first submitted version

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

void figCorrLeftES(Bool_t saveFigs = 0)
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
{

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

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

	TH1F *hCurr = 0;

	hCurr = (TH1F*)fr->Get("heeT3_5_4560");
	hExp[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("heeT3_5_6075");
	hExp[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("heeT3_5_7590");
	hExp[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("heeT3_5_90120");
	hExp[3] = new TH1F(*hCurr);

	hCurr = (TH1F*)fr->Get("hseT3_5_4560");
	hSim[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hseT3_5_6075");
	hSim[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hseT3_5_7590");
	hSim[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hseT3_5_90120");
	hSim[3] = new TH1F(*hCurr);

	hCurr = (TH1F*)fr->Get("hieT3_5_4560");
	hInput[0] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hieT3_5_6075");
	hInput[1] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hieT3_5_7590");
	hInput[2] = new TH1F(*hCurr);
	hCurr = (TH1F*)fr->Get("hieT3_5_90120");
	hInput[3] = new TH1F(*hCurr);



	TCanvas *c1 = new TCanvas();
	c1->ToggleEditor();
//	c1->SetWindowSize(800, 1200);
	c1->SetWindowSize(800, 800);
	c1->Divide(2, 2, .001, .001);

55
	cout << "Fig. 12" << endl;
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

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

//		cout << i << endl;

		hSim[i]->SetTitle("");
		hSim[i]->SetLineColor(kGray+1);
		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);

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

76 77 78
		hExp[i]->Chi2Test(hSim[i], "P");
	}
	c1->Update();
79 80 81 82 83 84 85 86 87 88 89 90 91 92

	TCanvas *c2 = new TCanvas();
	c2->ToggleEditor();
	c2->SetWindowSize(800, 1227);
	c2->Divide(2, 3, .001, .001);

//	TFile *fr3 = new TFile("figures/PRCepsilonY.root");

	TH1F *hCorrExp[6];
	TH1F *hCorrSim[6];
	TH1F *hCorrInput[6];

	TString hName;

93 94
	cout << "Fig. 13" << endl;

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

		hName.Form("heeT3_%d_7590", i);
		hCurr = (TH1F*)fr->Get(hName.Data());
		hCorrExp[i] = new TH1F(*hCurr);

		hName.Form("hseT3_%d_7590", i);
		hCurr = (TH1F*)fr->Get(hName.Data());
		hCorrSim[i] = new TH1F(*hCurr);

		hName.Form("hieT3_%d_7590", i);
		hCurr = (TH1F*)fr->Get(hName.Data());
		hCorrInput[i] = new TH1F(*hCurr);

		hCorrInput[i]->SetLineWidth(2);
		hCorrSim[i]->SetTitle("");
		hCorrSim[i]->GetXaxis()->SetNdivisions(505);

		hCorrSim[i]->GetYaxis()->SetRangeUser(0., 1390.);
		hCorrSim[i]->GetYaxis()->SetNdivisions(406);
		hCorrSim[i]->GetYaxis()->SetTitle("");

		hCorrSim[i]->Draw("");
		hCorrExp[i]->Draw("E same");
		hCorrInput[i]->Draw("same");

122 123 124
		hCorrExp[i]->Chi2Test(hCorrSim[i], "P");
	}
	c2->Update();
125 126 127 128


	TCanvas *c3 = new TCanvas();
	c3->ToggleEditor();
129 130
//	c3->SetWindowSize(800, 1227);
	c3->SetWindowSize(800, 1200);
131 132 133 134 135 136 137
	c3->Divide(2, 3, .001, .001);

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

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

140 141 142

//	TString hName;
	cout << "Fig. 14" << endl;
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158

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

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

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

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

159 160 161 162 163 164 165 166
		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));
		}

167 168 169 170 171 172 173 174 175 176 177 178
		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]->Draw("");
179
		hAlphaSim[i]->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)");
180
		hAlphaExp[i]->Draw("E same");
181 182 183 184 185 186 187 188 189 190 191
//		hAlphaInput[i]->Draw("same");
		hAlphaInputCorr[i]->SetLineColor(kRed);
		hAlphaInputCorr[i]->SetLineWidth(2);
		hAlphaInputCorr[i]->Scale(0.5);
		hAlphaInputCorr[i]->Smooth();
		hAlphaInputCorr[i]->Draw("same");

//		cout << "Chi2: " << hAlphaSim[i]->Chi2Test()endl;
		hAlphaExp[i]->Chi2Test(hAlphaSim[i], "P");
//		hAlphaSim[i]->Chi2Test(hAlphaInputCorr[i], "P");

192
	}
193
	c3->Update();
194 195 196 197 198 199 200 201 202 203 204 205 206 207




	TCanvas *c4 = new TCanvas();
	c4->ToggleEditor();
	c4->SetWindowSize(800, 1227);
	c4->Divide(2, 3, .001, .001);

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

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

210 211

	cout << "Fig. 15" << endl;
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227

	for (Int_t i = 0; i < 6; i++) {
		c4->cd(i+1);

		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);

228 229 230 231 232 233 234 235
		hAlphaInput90120Corr[i] = new TH1F(*hAlphaInput90120[i]);
		Double_t binContent = 0;
		for (Int_t binN = 1; binN <= 15; binN++) {
			binContent = hAlphaInput90120Corr[i]->GetBinContent(binN);
			hAlphaInput90120Corr[i]->SetBinContent(binN, binContent + hAlphaInput90120Corr[i]->GetBinContent(31-binN));
			hAlphaInput90120Corr[i]->SetBinContent(31-binN, hAlphaInput90120Corr[i]->GetBinContent(binN));
		}

236 237 238 239 240 241 242 243
		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);

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

		hAlphaSim90120[i]->Draw("");
248
		hAlphaSim90120[i]->GetXaxis()->SetTitle("#it{#theta}_{#alpha} (rad)");
249
		hAlphaExp90120[i]->Draw("E same");
250 251 252 253 254 255
//		hAlphaInput90120[i]->Draw("same");
		hAlphaInput90120Corr[i]->SetLineColor(kRed);
		hAlphaInput90120Corr[i]->SetLineWidth(2);
		hAlphaInput90120Corr[i]->Scale(0.5);
		hAlphaInput90120Corr[i]->Smooth();
		hAlphaInput90120Corr[i]->Draw("same");
256

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

259 260 261 262 263 264 265 266
	}
	c4->Update();
	c1->Update();

	if (saveFigs) {
//		c1->SaveAs("figures/ESepsilonTleft.eps");
//		c2->SaveAs("figures/ESepsilonT7590left.eps");
		c3->SaveAs("figures/ESThetaAleft7590.eps");
267
		c4->SaveAs("figures/ESThetaAleft90120.eps");
268
	}
269 270

}