Commit a05f531c authored by Vratislav Chudoba's avatar Vratislav Chudoba

Macros for IZV RAS figures added.

parent 0fe80e68
This diff is collapsed.
//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];
TString panel[4] = {"a)", "b)", "c)", "d)"};
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");
t1[i] = new TText(0.18,0.87,panel[i].Data());
t1[i]->SetNDC();
t1[i]->SetTextFont(132);
t1[i]->SetTextSize(0.07);
t1[i]->Draw();
}
c1->Update();
if (saveFigs) {
// c2->SaveAs("figures/PresGSepsilonTright7590.png");
c1->SaveAs("figures/Fig2izvIntCorrsEvolution.png");
c1->SaveAs("figures/Fig2izvIntCorrsEvolution.eps");
}
return;
}
//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");
}
}
//Figure 3 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 figIZVCorrRightGS(const Bool_t saveFigs = 0)
{
const Int_t canMap[6] = {1,4,3,6,2,5};
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("heeT1_2_4560");
hExp[0] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("heeT1_2_6075");
hExp[1] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("heeT1_2_7590");
hExp[2] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("heeT1_2_90120");
hExp[3] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hseT1_2_4560");
hSim[0] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hseT1_2_6075");
hSim[1] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hseT1_2_7590");
hSim[2] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hseT1_2_90120");
hSim[3] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hieT1_2_4560");
hInput[0] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hieT1_2_6075");
hInput[1] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hieT1_2_7590");
hInput[2] = new TH1F(*hCurr);
hCurr = (TH1F*)fr1->Get("hieT1_2_90120");
hInput[3] = new TH1F(*hCurr);
TCanvas *c2 = new TCanvas("c2", "Fig. 3, IZV RAS");
c2->ToggleEditor();
c2->SetWindowSize(1500, 1000);
c2->Divide(3, 2, .001, .001);
TH1F *hCorrExp[6];
TH1F *hCorrSim[6];
TH1F *hCorrInput[6];
TString hName;
cout << "Fig. 3" << endl;
TText *t1[6];
TString panel[6] = {"a)", "b)", "c)", "d)", "e)", "f)"};
for (Int_t i = 0; i < 6; i++) {
c2->cd(canMap[i]);
hName.Form("heeT1_%d_7590", i);
hCurr = (TH1F*)fr1->Get(hName.Data());
hCorrExp[i] = new TH1F(*hCurr);
hName.Form("hseT1_%d_7590", i);
hCurr = (TH1F*)fr1->Get(hName.Data());
hCorrSim[i] = new TH1F(*hCurr);
hName.Form("hieT1_%d_7590", i);
hCurr = (TH1F*)fr1->Get(hName.Data());
hCorrInput[i] = new TH1F(*hCurr);
hCorrInput[i]->SetLineColor(kBlack);
hCorrInput[i]->SetLineStyle(2);
hCorrInput[i]->Smooth();
hCorrSim[i]->SetTitle("");
hCorrSim[i]->GetXaxis()->SetNdivisions(505);
hCorrSim[i]->GetYaxis()->SetRangeUser(0., 850.);
hCorrSim[i]->GetYaxis()->SetNdivisions(505);
hCorrSim[i]->GetYaxis()->SetTitle("");
hCorrSim[i]->SetLineColor(kGray+1);
// hCorrSim[i]->SetFillColor(kGray+1);
hCorrSim[i]->GetXaxis()->CenterTitle(0);
hCorrSim[i]->Draw("hist");
hCorrExp[i]->Draw("E same");
hCorrInput[i]->Draw("hist same");
hCorrExp[i]->Chi2Test(hCorrSim[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();
}
c2->Update();
if (saveFigs) {
// c2->SaveAs("figures/PresGSepsilonTright7590.png");
c2->SaveAs("figures/Fig3izvIntCorrs.png");
c2->SaveAs("figures/Fig3izvIntCorrs.eps");
}
}
//Figure 1 IZV RAS
#if !defined(__CLING__) #if !defined(__CLING__)
#include "TFile.h" #include "TFile.h"
...@@ -7,7 +9,7 @@ ...@@ -7,7 +9,7 @@
#endif #endif
void figSpectraIZV() void figSpectraIZV(const Bool_t saveFigs = 0)
{ {
// TFile *fr = new TFile("figures/spectra.root", "READ"); // TFile *fr = new TFile("figures/spectra.root", "READ");
...@@ -45,7 +47,7 @@ void figSpectraIZV() ...@@ -45,7 +47,7 @@ void figSpectraIZV()
TCanvas *c1 = new TCanvas(); TCanvas *c1 = new TCanvas("c1", "Fig. 1, IZV RAS");
c1->ToggleEditor(); c1->ToggleEditor();
// c1->SetWindowSize(800, 1200); // c1->SetWindowSize(800, 1200);
// c1->SetWindowSize(800, 800); // c1->SetWindowSize(800, 800);
...@@ -74,21 +76,19 @@ void figSpectraIZV() ...@@ -74,21 +76,19 @@ void figSpectraIZV()
if (i==0) hSim[i]->GetYaxis()->SetRangeUser(0,13000); if (i==0) hSim[i]->GetYaxis()->SetRangeUser(0,13000);
// t1[i] = new TText(0.61,10829.39,"d)");
t1[i] = new TText(0.18,0.87,panel[i].Data()); t1[i] = new TText(0.18,0.87,panel[i].Data());
t1[i]->SetNDC(); t1[i]->SetNDC();
t1[i]->SetTextFont(132); t1[i]->SetTextFont(132);
t1[i]->SetTextSize(0.07); t1[i]->SetTextSize(0.07);
t1[i]->Draw(); t1[i]->Draw();
// t1[i]->DrawTextNDC(.5, .5, "ajdas");
} }
// TText *t1 = new TText(0.61,10829.39,"d)"); if (saveFigs) {
//// t1->SetTextColor(kRed); // c2->SaveAs("figures/PresGSepsilonTright7590.png");
// t1->SetTextFont(132);
// t1->SetTextSize(0.07);
// t1->Draw();
// c1->SaveAs("figures/spectra.eps"); c1->SaveAs("figures/Fig1izvSpectra.png");
c1->SaveAs("figures/Fig1izvSpectra.eps");
}
return;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment