Commit 5cf02059 authored by Vratislav Chudoba's avatar Vratislav Chudoba

New scripts for PRC figures.

parent d140c06e
This diff is collapsed.
//canvas c3: Fig. 16 in first submitted version
void figCorrRightES(Bool_t saveFigs = 0)
{
/*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);
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");
}
c1->SaveAs("figures/ESepsilonTleft.eps");
// return;
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;
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");
}
c2->SaveAs("figures/ESepsilonT7590left.eps");*/
// return;
TCanvas *c1 = new TCanvas();
c1->Update();
TH1F *hCurr = 0;
TCanvas *c3 = new TCanvas();
c3->ToggleEditor();
c3->SetWindowSize(800, 1227);
c3->Divide(2, 3, .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(i+1);
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]->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.eps");
}
/*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];
TString hName;
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);
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]->Draw("");
hAlphaExp90120[i]->Draw("E same");
hAlphaInput90120[i]->Draw("same");
}
c4->SaveAs("figures/ESThetaAleft90120.eps");*/
}
void figKinematics()
{
// gSystem->Load("/home/vratik/workspace/daf/trunk/libUtilities.so");
// gSystem->Load("/home/vratik/workspace/daf/trunk/libEvent.so");
TStopwatch sw;
sw.Start();
// const Bool_t savePictures = 1;
const Bool_t savePictures = 0;
TString pictureName;
TString picturePath = "figures/";
// TString pictFormat = ".jpg";
// TString pictFormat = ".eps";
TString pictFormat = ".gif";
const Bool_t kKinematics = 1;
// if (kKinematics) {
TCanvas *cKin = new TCanvas("kinematicsBe", "kinematics of (p,n) reaction");
cKin->ToggleEditor();
cKin->SetWindowSize(1500, 1000);
// TFile fr("../simulace/kin.root");
TFile *fr = new TFile("./kin.root");
TTree *tr = (TTree*)fr->Get("kin");
tr->SetMarkerStyle(20);
tr->SetMarkerSize(0.4);
TH2F *hKin = new TH2F("hKin", "", 1000, 0., 30., 1000, 4., 56.);
// TCut cP = "p.fImpulse.Theta()*TMath::RadToDeg()>100";
// TCut cP = "p.fImpulse.Theta()*TMath::RadToDeg()>0";
// tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", "col");
// hKin->Print();
// return;
// tr->SetMarkerColor(kRed);
// tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", "scat");
tr->Draw("(p1.fImpulse.T()-p1.fMass)/p1.fA:p1.fImpulse.Theta()*TMath::RadToDeg()>>hKin", "", "");
hKin->SetMarkerColor(kRed);
hKin->SetMarkerStyle(20);
hKin->SetMarkerSize(0.4);
tr->SetMarkerColor(kRed);
tr->Draw("(p2.fImpulse.T()-p2.fMass)/p2.fA:p2.fImpulse.Theta()*TMath::RadToDeg()", "", "same");
tr->SetMarkerColor(kGreen);
tr->Draw("(4_He.fImpulse.T()-4_He.fMass)/4_He.fA:4_He.fImpulse.Theta()*TMath::RadToDeg()", "", "same");
tr->SetMarkerColor(kBlue);
tr->Draw("(6_Be.fImpulse.T()-6_Be.fMass)/6_Be.fA:6_Be.fImpulse.Theta()*TMath::RadToDeg()", "", "same");
hKin->GetXaxis()->SetTitle("#it{#theta}_{lab} (deg)");
hKin->GetXaxis()->CenterTitle();
hKin->GetXaxis()->SetTitleSize(0.07);
hKin->GetXaxis()->SetTitleOffset(0.79);
hKin->GetXaxis()->SetLabelSize(0.05);
hKin->GetYaxis()->SetTitle("#it{E}_{lab} (AMeV)");
hKin->GetYaxis()->CenterTitle();
hKin->GetYaxis()->SetTitleSize(0.07);
hKin->GetYaxis()->SetTitleOffset(0.79);
hKin->GetYaxis()->SetLabelSize(0.05);
cKin->cd();
cKin->Update();
TCanvas *c1 = new TCanvas();
c1->Update();
delete c1;
cKin->Update();
if (savePictures) {
// gStyle->SetCanvasDefW(649);
// gStyle->SetCanvasDefH(727);
pictureName.Form("%s%s%s", picturePath.Data(), cKin->GetName(), pictFormat.Data());
// cKin->SaveAs(pictureName.Data());
cKin->SaveAs("figures/PresKinematics.png");
cKin->cd();
// cKin->Close();
}
// }
}
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