#include #include #include #include #include #include #include using namespace std; TCanvas * c1 = new TCanvas("c1", "c1", 1100, 1100); TCanvas * c2 = new TCanvas("c2", "c2", 1200, 250); TCanvas * c3 = new TCanvas("c3", "c3", 1100, 90); TCanvas * c4 = new TCanvas("c4", "c4", 180, 32); TCanvas * c5 = new TCanvas("c5", "c5", 180, 22); TCanvas * c6 = new TCanvas("c6", "c6", 400, 300); //TH1D* histo(TH2* h2, const char* name = "histo", double fact = -1, bool ratio = false); TH1D* histo(TH2* h2, const char* name = "histo", double min=0, double max=-1); TH2D* plot(TH2D* h2, TH2D* h2S, TCanvas* canvas, int min=0, double fact=-1, const char* Xlabel="", const char* Ylabel="", const char* Title="", bool Xlog=false, bool Ylog=false, bool Zlog=false, double rmin=-1, double rmax=-1, const char* filename=""); TH2D* divider(TH2D* H3, TH2D* H3S, Int_t t3, TH2D* H4, TH2D* H4S, Int_t t4, TCanvas* canvas, const char* Xlabel="", const char* Ylabel="", const char* Title="", bool Xlog=false, bool Ylog=false, bool Zlog=false, double rmin=-1, double rmax=-1, const char* filename=""); TH2D* Cut(TH2D* H4, TH2D* H4R, const char* name, double thrs, bool larger=true); // void function(TFile* f3, TFile* f4, // string h, string s, Int_t thrs); TH2D* plot(TH2D* h2, TH2D* h2S, TCanvas* canvas, int min, double fact, const char* Xlabel, const char* Ylabel, const char* Title, bool Xlog, bool Ylog, bool Zlog, double rmin, double rmax, const char* filename){ cout << h2->GetName() << endl; canvas->cd(); if(Xlog) canvas->SetLogx(1); else canvas->SetLogx(0); if(Ylog) canvas->SetLogy(1); else canvas->SetLogy(0); if(Zlog) canvas->SetLogz(1); else canvas->SetLogz(0); cout << h2->GetMinimum(0) << ' ' << h2->GetMaximum() << endl; char cc[64]; sprintf(cc, "%s_R", h2->GetTitle()); TH2D* h2c = new TH2D(cc, cc, h2->GetNbinsX(), h2->GetXaxis()->GetBinLowEdge(1), h2->GetXaxis()->GetBinUpEdge(h2->GetNbinsX()), h2->GetNbinsY(), h2->GetYaxis()->GetBinLowEdge(1), h2->GetYaxis()->GetBinUpEdge(h2->GetNbinsY())); for(int x = 1; x <= h2S->GetXaxis()->GetNbins(); x++){ for(int y = 1; y <= h2S->GetXaxis()->GetNbins(); y++){ // std::cout << h2S->GetXaxis()->GetNbins() << std::endl; if(min < h2S->GetBinContent(x, y)) // std::cout << h2->GetBinContent(x, y) << endl; h2c->SetBinContent(x, y, h2->GetBinContent(x, y)); } } h2c->Scale(fact); if((rmin > 0) || (rmax > 0)) h2c->GetZaxis()->SetRangeUser(rmin, rmax); else h2c->GetZaxis()->SetRangeUser(h2c->GetMinimum(0), h2c->GetMaximum()); h2c->SetContour(99); h2c->SetXTitle(Xlabel); h2c->SetYTitle(Ylabel); h2c->SetTitle(Title); TPaletteAxis *palette = new TPaletteAxis(h2c->GetXaxis()->GetBinCenter(h2->GetNbinsX())*1.025, h2c->GetYaxis()->GetBinCenter(1), h2c->GetXaxis()->GetBinCenter(h2->GetNbinsX())*1.0375, h2c->GetYaxis()->GetBinCenter(h2->GetNbinsY()), h2c); palette->SetLabelColor(1); palette->SetLabelFont(42); palette->SetLabelOffset(0.005); palette->SetLabelSize(0.035); palette->SetTitleOffset(1); palette->SetTitleSize(0.035); palette->SetFillColor(100); palette->SetFillStyle(1001); h2c->GetListOfFunctions()->Add(palette,"br"); h2c->Draw("colz"); canvas->Print(filename, "pdf"); return h2c; } // TH1D* histo(TH2* h2, const char* name){ TH1D* histo(TH2* h2, const char* name, double min, double max){ double dynamics = TMath::Ceil(h2->GetMaximum()); cout << dynamics << endl; double Min = min; double Max = max; if(min < 0) Min = 1; if(max < 0) Max = dynamics; TH1D* histo = new TH1D(name, name, 10*dynamics, Min, Max); for(int x = 1; x <= h2->GetXaxis()->GetNbins(); x++) for(int y = 1; y <= h2->GetXaxis()->GetNbins(); y++) histo->Fill(h2->GetBinContent(x, y)); return histo; } int main(){ gStyle->SetOptStat(0); /* //G3 stuff TFile* _file_g3 = new TFile("RadMap_Out_Final_Geant3.15GeV.root"); TH2D* g3_h1 = (TH2D*) _file_g3->Get("FullEdepZX_Histo_ZX_0"); TH2D* g3_h1s = (TH2D*) _file_g3->Get("FullEdepZX_StatHisto_ZX_0");//200 TH2D* g3_h2 = (TH2D*) _file_g3->Get("FullDoseZX_Histo_ZX_0"); TH2D* g3_h2s = (TH2D*) _file_g3->Get("FullDoseZX_StatHisto_ZX_0");//200 TH2D* g3_h3 = (TH2D*) _file_g3->Get("FullDoseZY_Histo_ZY_0"); TH2D* g3_h3s = (TH2D*) _file_g3->Get("FullDoseZY_StatHisto_ZY_0");//200 TH2D* g3_h4 = (TH2D*) _file_g3->Get("FullEdepSciLi2XY0_Histo_XY_0"); TH2D* g3_h4s = (TH2D*) _file_g3->Get("FullEdepSciLi2XY0_StatHisto_XY_0");//50 TH2D* g3_h5 = (TH2D*) _file_g3->Get("FullEdepSciLi2XY1_Histo_XY_14.3"); TH2D* g3_h5s = (TH2D*) _file_g3->Get("FullEdepSciLi2XY1_StatHisto_XY_14.3");//50 TH2D* g3_h6 = (TH2D*) _file_g3->Get("FullEdepSciLi2XY2_Histo_XY_14.3"); TH2D* g3_h6s = (TH2D*) _file_g3->Get("FullEdepSciLi2XY2_StatHisto_XY_14.3");//30 TH2D* g3_h7 = (TH2D*) _file_g3->Get("FullEdepSciLi2XY3_Histo_XY_14.3"); TH2D* g3_h7s = (TH2D*) _file_g3->Get("FullEdepSciLi2XY3_StatHisto_XY_14.3");//20 TH2D* g3_h8 = (TH2D*) _file_g3->Get("FullEdepSciLi2XY4_Histo_XY_14.3"); TH2D* g3_h8s = (TH2D*) _file_g3->Get("FullEdepSciLi2XY4_StatHisto_XY_14.3");//10 TH2D* g3_h9 = (TH2D*) _file_g3->Get("FullEdepSciLi0_Histo_ZX_14.3"); TH2D* g3_h9s = (TH2D*) _file_g3->Get("FullEdepSciLi0_StatHisto_ZX_14.3");//10 TH2D* g3_h10 = (TH2D*) _file_g3->Get("FullDoseSciLi0_Histo_ZX_14.3"); TH2D* g3_h10s = (TH2D*) _file_g3->Get("FullDoseSciLi0_StatHisto_ZX_14.3");//10 TH2D* g3_h11 = (TH2D*) _file_g3->Get("FullDoseSciLi1_Histo_ZX_14.3"); TH2D* g3_h11s = (TH2D*) _file_g3->Get("FullDoseSciLi1_StatHisto_ZX_14.3");//10 TH2D* g3_h12 = (TH2D*) _file_g3->Get("NeutronEdepZX_Histo_ZX_0"); TH2D* g3_h12s = (TH2D*) _file_g3->Get("NeutronEdepZX_StatHisto_ZX_0");//10 TH2D* g3_h13 = (TH2D*) _file_g3->Get("NeutronDoseZX_Histo_ZX_0"); TH2D* g3_h13s = (TH2D*) _file_g3->Get("NeutronDoseZX_StatHisto_ZX_0");//10 TH1D* g3_h1d = histo(g3_h1s, "g3_h1d"); TH1D* g3_h2d = histo(g3_h2s, "g3_h2d"); TH1D* g3_h3d = histo(g3_h3s, "g3_h3d"); TH1D* g3_h4d = histo(g3_h4s, "g3_h4d"); TH1D* g3_h5d = histo(g3_h5s, "g3_h5d"); TH1D* g3_h6d = histo(g3_h6s, "g3_h6d"); TH1D* g3_h7d = histo(g3_h7s, "g3_h7d"); TH1D* g3_h8d = histo(g3_h8s, "g3_h8d"); TH1D* g3_h9d = histo(g3_h9s, "g3_h9d"); TH1D* g3_h10d = histo(g3_h10s, "g3_h10d"); TH1D* g3_h11d = histo(g3_h11s, "g3_h11d"); TH1D* g3_h12d = histo(g3_h12s, "g3_h13d"); TH1D* g3_h13d = histo(g3_h13s, "g3_h13d"); //////////////////////////////////////////////////////////////u TH2D* g3_h1h2 = plot(g3_h1 , g3_h1s , c6 , 0, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J]", false, false, true, -1, -1, "figures.pdf("); TH2D* g3_h1h2a = plot(g3_h1 , g3_h1s , c6 , 130, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h2h2 = plot(g3_h2 , g3_h2s , c6 , 130, 1.61e14/1000., "Z [cm]", "X [cm]", "Full Absorbed Dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h3h2 = plot(g3_h3 , g3_h3s , c6 , 130, 1.61e14/1000., "Z [cm]", "Y [cm]", "Full Absorbed Dose (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h4h2 = plot(g3_h4 , g3_h4s , c1 , 50, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (Z[-40cm, 110cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h5h2 = plot(g3_h5 , g3_h5s , c1 , 50, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h6h2 = plot(g3_h6 , g3_h6s , c3 , 50, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h7h2 = plot(g3_h7 , g3_h7s , c4 , 3, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h8h2 = plot(g3_h8 , g3_h8s , c4 , 5, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h9h2 = plot(g3_h9 , g3_h9s , c6 , 5, 1.61e14/1000., "Z [cm]", "X [cm]", "Full deposited energy (3.2cm wide ZX slice (Y[46cm, 49.2cm])) [J]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h10h2 = plot(g3_h10 , g3_h10s , c6 , 3, 1.61e14/1000., "Z [cm]", "X [cm]", "Full absorbed dose (3.2cm wide ZX slice (Y[46cm, 49.2cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g3_h11h2 = plot(g3_h11 , g3_h11s , c6 , 3, 1.61e14/1000., "Z [cm]", "X [cm]", "Full absorbed dose (2.2cm wide ZX slice (Y[46.5cm, 48.7cm])) [Gy]", false, false, true,-1, -1, "figures.pdf"); TH2D* g3_h12h2 = plot(g3_h12 , g3_h12s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Energy Deposit by Neutrons (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [J]", false, false, true,-1, -1, "figures.pdf"); TH2D* g3_h13h2 = plot(g3_h13 , g3_h13s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Absorbed Dose by Neutrons (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [J]", false, false, true,-1, -1, "figures.pdf"); */ ////////////////////////////////////////////////////// //G4 stuff TFile* _file_g4 = new TFile("RadMap_Out_Final_Geant4.15GeV.root"); TH2D* g4_h1 = (TH2D*) _file_g4->Get("FullEdepZX_Histo_ZX_0"); TH2D* g4_h1s = (TH2D*) _file_g4->Get("FullEdepZX_StatHisto_ZX_0");//200 TH2D* g4_h2 = (TH2D*) _file_g4->Get("FullDoseZX_Histo_ZX_0"); TH2D* g4_h2s = (TH2D*) _file_g4->Get("FullDoseZX_StatHisto_ZX_0");//200 TH2D* g4_h3 = (TH2D*) _file_g4->Get("FullDoseZY_Histo_ZY_0"); TH2D* g4_h3s = (TH2D*) _file_g4->Get("FullDoseZY_StatHisto_ZY_0");//200 TH2D* g4_h4 = (TH2D*) _file_g4->Get("FullEdepSciLi2XY0_Histo_XY_0"); TH2D* g4_h4s = (TH2D*) _file_g4->Get("FullEdepSciLi2XY0_StatHisto_XY_0");//200 TH2D* g4_h5 = (TH2D*) _file_g4->Get("FullEdepSciLi2XY1_Histo_XY_14.3"); TH2D* g4_h5s = (TH2D*) _file_g4->Get("FullEdepSciLi2XY1_StatHisto_XY_14.3");//200 TH2D* g4_h6 = (TH2D*) _file_g4->Get("FullEdepSciLi2XY2_Histo_XY_14.3"); TH2D* g4_h6s = (TH2D*) _file_g4->Get("FullEdepSciLi2XY2_StatHisto_XY_14.3");//40 TH2D* g4_h7 = (TH2D*) _file_g4->Get("FullEdepSciLi2XY3_Histo_XY_14.3"); TH2D* g4_h7s = (TH2D*) _file_g4->Get("FullEdepSciLi2XY3_StatHisto_XY_14.3");//20 TH2D* g4_h8 = (TH2D*) _file_g4->Get("FullEdepSciLi2XY4_Histo_XY_14.3"); TH2D* g4_h8s = (TH2D*) _file_g4->Get("FullEdepSciLi2XY4_StatHisto_XY_14.3");//10 TH2D* g4_h9 = (TH2D*) _file_g4->Get("FullEdepSciLi0_Histo_ZX_14.3"); TH2D* g4_h9s = (TH2D*) _file_g4->Get("FullEdepSciLi0_StatHisto_ZX_14.3");//20 TH2D* g4_h10 = (TH2D*) _file_g4->Get("FullDoseSciLi0_Histo_ZX_14.3"); TH2D* g4_h10s = (TH2D*) _file_g4->Get("FullDoseSciLi0_StatHisto_ZX_14.3");//20 TH2D* g4_h11 = (TH2D*) _file_g4->Get("FullDoseSciLi1_Histo_ZX_14.3"); TH2D* g4_h11s = (TH2D*) _file_g4->Get("FullDoseSciLi1_StatHisto_ZX_14.3");//20 TH2D* g4_h12 = (TH2D*) _file_g4->Get("NeutronEdepZX_Histo_ZX_0"); TH2D* g4_h12s = (TH2D*) _file_g4->Get("NeutronEdepZX_StatHisto_ZX_0");//10 TH2D* g4_h13 = (TH2D*) _file_g4->Get("NeutronDoseZX_Histo_ZX_0"); TH2D* g4_h13s = (TH2D*) _file_g4->Get("NeutronDoseZX_StatHisto_ZX_0");//10 TH2D* g4_h14 = (TH2D*) _file_g4->Get("FullEdepZXa_Histo_ZX_0"); TH2D* g4_h14s = (TH2D*) _file_g4->Get("FullEdepZXa_StatHisto_ZX_0");//200 TH2D* g4_h15 = (TH2D*) _file_g4->Get("FullDoseZXa_Histo_ZX_0"); TH2D* g4_h15s = (TH2D*) _file_g4->Get("FullDoseZXa_StatHisto_ZX_0");//200 TH2D* g4_h16 = (TH2D*) _file_g4->Get("FullDoseZYa_Histo_ZY_0"); TH2D* g4_h16s = (TH2D*) _file_g4->Get("FullDoseZYa_StatHisto_ZY_0");//200 TH2D* g4_h17 = (TH2D*) _file_g4->Get("FullEdepZXb_Histo_ZX_0"); TH2D* g4_h17s = (TH2D*) _file_g4->Get("FullEdepZXb_StatHisto_ZX_0");//200 TH2D* g4_h18 = (TH2D*) _file_g4->Get("FullDoseZXb_Histo_ZX_0"); TH2D* g4_h18s = (TH2D*) _file_g4->Get("FullDoseZXb_StatHisto_ZX_0");//200 TH2D* g4_h19 = (TH2D*) _file_g4->Get("FullDoseZYb_Histo_ZY_0"); TH2D* g4_h19s = (TH2D*) _file_g4->Get("FullDoseZYb_StatHisto_ZY_0");//200 TH2D* g4_h20 = (TH2D*) _file_g4->Get("FullEdepZXc_Histo_ZX_0"); TH2D* g4_h20s = (TH2D*) _file_g4->Get("FullEdepZXc_StatHisto_ZX_0");//200 TH2D* g4_h21 = (TH2D*) _file_g4->Get("FullDoseZXc_Histo_ZX_0"); TH2D* g4_h21s = (TH2D*) _file_g4->Get("FullDoseZXc_StatHisto_ZX_0");//200 TH2D* g4_h22 = (TH2D*) _file_g4->Get("FullDoseZYc_Histo_ZY_0"); TH2D* g4_h22s = (TH2D*) _file_g4->Get("FullDoseZYc_StatHisto_ZY_0");//200 TH2D* g4_hxx = (TH2D*) _file_g4->Get("FullDoseXY0_Histo_XY_0"); TH2D* g4_hxxs = (TH2D*) _file_g4->Get("FullDoseXY0_StatHisto_XY_0"); TH2D* g4_hyy = (TH2D*) _file_g4->Get("FullDoseFP0_Histo_ZX_0"); TH2D* g4_hyys = (TH2D*) _file_g4->Get("FullDoseFP0_StatHisto_ZX_0"); TH2D* g4_hyy2 = (TH2D*) _file_g4->Get("FullDoseFP1_Histo_ZY_0"); TH2D* g4_hyy2s = (TH2D*) _file_g4->Get("FullDoseFP1_StatHisto_ZY_0"); TH2D* g4_hzz = (TH2D*) _file_g4->Get("FullDoseFPXY_Histo_XY_0"); TH2D* g4_hzzs = (TH2D*) _file_g4->Get("FullDoseFPXY_StatHisto_XY_0"); TH2D* g4_hzz2 = (TH2D*) _file_g4->Get("FullDoseFPXY2_Histo_XY_0"); TH2D* g4_hzz2s = (TH2D*) _file_g4->Get("FullDoseFPXY2_StatHisto_XY_0"); TH2D* g4_hzz3 = (TH2D*) _file_g4->Get("FullDoseFPXY3_Histo_XY_0"); TH2D* g4_hzz3s = (TH2D*) _file_g4->Get("FullDoseFPXY3_StatHisto_XY_0"); TH2D* g4_hzz4 = (TH2D*) _file_g4->Get("FullDoseFPXY4_Histo_XY_0"); TH2D* g4_hzz4s = (TH2D*) _file_g4->Get("FullDoseFPXY4_StatHisto_XY_0"); TH2D* g4_hzz5 = (TH2D*) _file_g4->Get("FullDoseFPXY5_Histo_XY_0"); TH2D* g4_hzz5s = (TH2D*) _file_g4->Get("FullDoseFPXY5_StatHisto_XY_0"); TH2D* g4_mass = (TH2D*) _file_g4->Get("MassFPXY_Histo_XY_0"); TH2D* g4_masss = (TH2D*) _file_g4->Get("MassFPXY_StatHisto_XY_0"); TH2D* g4_mass2 = (TH2D*) _file_g4->Get("MassFPXY2_Histo_XY_0"); TH2D* g4_mass2s = (TH2D*) _file_g4->Get("MassFPXY2_StatHisto_XY_0"); TH2D* g4_ener = (TH2D*) _file_g4->Get("EnergyFPXY_Histo_XY_0"); TH2D* g4_eners = (TH2D*) _file_g4->Get("EnergyFPXY_StatHisto_XY_0"); /* TH1D* g4_h1d = histo(g4_h1s, "g4_h1d"); c1->cd(); c1->SetLogx(1); c1->SetLogy(1); g3_h1d->Draw(); g4_h1d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h2d = histo(g4_h2s, "g4_h2d"); g3_h2d->Draw(); g4_h2d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h3d = histo(g4_h3s, "g4_h3d"); g3_h3d->Draw(); g4_h3d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h4d = histo(g4_h4s, "g4_h4d"); g3_h4d->Draw(); g4_h4d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h5d = histo(g4_h5s, "g4_h5d"); g3_h5d->Draw(); g4_h5d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h6d = histo(g4_h6s, "g4_h6d"); g3_h6d->Draw(); g4_h6d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h7d = histo(g4_h7s, "g4_h7d"); g3_h7d->Draw(); g4_h7d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h8d = histo(g4_h8s, "g4_h8d"); g3_h8d->Draw(); g4_h8d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h9d = histo(g4_h9s, "g4_h9d"); g3_h9d->Draw(); g4_h9d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h10d = histo(g4_h10s, "g4_h10d"); g3_h10d->Draw(); g4_h10d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h11d = histo(g4_h11s, "g4_h11d"); g3_h11d->Draw(); g4_h11d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h12d = histo(g4_h12s, "g4_h13d"); g3_h12d->Draw(); g4_h12d->Draw("same"); c1->Print("figures.pdf", "pdf"); TH1D* g4_h13d = histo(g4_h13s, "g4_h13d"); g3_h13d->Draw(); g4_h13d->Draw("same"); c1->Print("figures.pdf", "pdf"); */ //////////////////////////////////////////////////////////////u TH2D* g4_h1h2 = plot(g4_h1 , g4_h1s , c6 , 0, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf("); TH2D* g4_h1h2a = plot(g4_h1 , g4_h1s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h2h2 = plot(g4_h2 , g4_h2s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Full Absorbed Dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h3h2 = plot(g4_h3 , g4_h3s , c6 , 10, 1.61e14/1000., "Z [cm]", "Y [cm]", "Full Absorbed Dose (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h4h2 = plot(g4_h4 , g4_h4s , c1 , 10, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (Z[-40cm, 110cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h5h2 = plot(g4_h5 , g4_h5s , c1 , 10, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h6h2 = plot(g4_h6 , g4_h6s , c3 , 10, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h7h2 = plot(g4_h7 , g4_h7s , c4 , 10, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h8h2 = plot(g4_h8 , g4_h8s , c4 , 10, 1.61e14/1000., "X [cm]", "Y [cm]", "Full deposited energy (150cm wide XY slice (X[-40cm, 110cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h9h2 = plot(g4_h9 , g4_h9s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Full deposited energy (3.2cm wide ZX slice (Y[46cm, 49.2cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h10h2 = plot(g4_h10 , g4_h10s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Full absorbed dose (3.2cm wide ZX slice (Y[46cm, 49.2cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h11h2 = plot(g4_h11 , g4_h11s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Full absorbed dose (2.2cm wide ZX slice (Y[46.5cm, 48.7cm])) [Gy]", false, false, true,-1, -1, "figures.pdf"); TH2D* g4_h12h2 = plot(g4_h12 , g4_h12s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Energy Deposit by Neutrons (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [J/cm^3]", false, false, true,-1, -1, "figures.pdf"); TH2D* g4_h13h2 = plot(g4_h13 , g4_h13s , c6 , 10, 1.61e14/1000., "Z [cm]", "X [cm]", "Absorbed Dose by Neutrons (1cm wide ZY slice (X[-0.5cm, 0.5cm])) [J/cm3]", false, false, true,-1, -1, "figures.pdf"); TH2D* g4_h14h2 = plot(g4_h14 , g4_h14s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h15h2 = plot(g4_h15 , g4_h15s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full Dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h16h2 = plot(g4_h16 , g4_h16s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h17h2 = plot(g4_h17 , g4_h17s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h18h2 = plot(g4_h18 , g4_h18s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h19h2 = plot(g4_h19 , g4_h19s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h20h2 = plot(g4_h20 , g4_h20s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h21h2 = plot(g4_h21 , g4_h21s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_h22h2 = plot(g4_h22 , g4_h22s , c6 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full deposited energy (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [J/cm3]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_xxh2 = plot(g4_hxx , g4_hxxs , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full absorbed dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf("); TH2D* g4_yyh2 = plot(g4_hyy , g4_hyys , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_yyh22 = plot(g4_hyy2 , g4_hyy2s , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "Z [cm]", "X [cm]", "Full dose (1cm wide ZX slice (Y[-0.5cm, 0.5cm])) [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_zzh2 = plot(g4_hzz , g4_hzzs , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "X [cm]", "Y [cm]", "Full dose in the Forward-End-Cap [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_zzh22 = plot(g4_hzz2 , g4_hzz2s , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "X [cm]", "Y [cm]", "Full dose in the Forward-End-Cap [Gy]", false, false, true, -1, -1, "figures.pdf"); // TH2D* g4_zzh32 = plot(g4_hzz3 , g4_hzz3s , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs // "X [cm]", "Y [cm]", "Full dose in the Forward-End-Cap [Gy]", // false, false, true, // -1, -1, // "figures.pdf"); // TH2D* g4_zzh42 = plot(g4_hzz4 , g4_hzz4s , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs // "X [cm]", "Y [cm]", "Full dose in the Forward-End-Cap [Gy]", // false, false, true, // -1, -1, // "figures.pdf"); // TH2D* g4_zzh52 = plot(g4_hzz5 , g4_hzz5s , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs // "X [cm]", "Y [cm]", "Full dose in the Forward-End-Cap [Gy]", // false, false, true, // -1, -1, // "figures.pdf"); c1->cd(); g4_mass->Divide(g4_masss); g4_mass->SetTitle("Mass"); g4_mass->Draw("colz"); c1->Print("figures.pdf", "pdf"); g4_mass2->Divide(g4_mass2s); g4_mass2->SetTitle("Mass"); g4_mass2->Draw("colz"); c1->Print("figures.pdf", "pdf"); TH2D* g4_hener = plot(g4_ener , g4_eners , c1 , 10, 1.61e14/1000.,//1000 files was added together, in each files the quantities are normalized per evenrs "X [cm]", "Y [cm]", "Full energy deposit Forward-End-Cap [Gy]", false, false, true, -1, -1, "figures.pdf"); TH2D* g4_hener2 = g4_ener->Clone(); g4_hener2->Divide(g4_mass2); g4_hener2->Scale(1.61e14/1000.); g4_hener2->SetTitle("Dose2"); g4_hener2->Draw("colz"); c1->Print("figures.pdf", "pdf"); /////////////////////////////////////////////////////////// // TH2D* g3g4r_h1 = divider(g3_h1h2, g3_h1s, 130, // g4_h1h2, g4_h1s, 10, // c6, // "Z [cm]", "X [cm]", "Ratio of the deposited energies (G3/G4)", // false, false, true, // -1, -1, // "figures.pdf"); // TH1D* g3g4r_h1d = histo(g3g4r_h1, "g3g4r_h1", 0.1, 10); // TText t1(4, 80, "Mean: 1.14; RMS: 0.72"); // c1->cd(); // // c1->SetLogy(1); // // c1->SetLogx(1); // gStyle->SetOptStat("mr"); // g3g4r_h1d->Draw(); // // g3g4r_h1d->SaveAs("Histo1.C"); // t1.Draw(); // c1->Print("figures.pdf", "pdf"); // gStyle->SetOptStat(0); // TH2D* g3g4r_h2 = divider(g3_h2h2, g3_h2s, 130, // g4_h2h2, g4_h2s, 10, // c6, // "Z [cm]", "X [cm]", "Ratio of the absorbed doses (G3/G4)", // false, false, true, // -1, -1, // "figures.pdf"); // TH1D* g3g4r_h2d = histo(g3g4r_h2, "g3g4r_h2", 0.1, 10); // t1 = TText(4, 80, "Mean: 1.44; RMS: 1.22"); // c1->cd(); // // c1->SetLogy(1); // // c1->SetLogx(1); // gStyle->SetOptStat("mr"); // g3g4r_h2d->Draw(); // // g3g4r_h2d->SaveAs("Histo2.C"); // t1.Draw(); c1->Print("figures.pdf)", "pdf"); return 0; } TH2D* divider(TH2D* H3, TH2D* H3S, Int_t t3, TH2D* H4, TH2D* H4S, Int_t t4, TCanvas* canvas, const char* Xlabel, const char* Ylabel, const char* Title, bool Xlog, bool Ylog, bool Zlog, double rmin, double rmax, const char* filename){ canvas->cd(); if(Xlog) canvas->SetLogx(1); else canvas->SetLogx(0); if(Ylog) canvas->SetLogy(1); else canvas->SetLogy(0); if(Zlog) canvas->SetLogz(1); else canvas->SetLogz(0); char cc[64]; sprintf(cc, "%s_R", H3->GetTitle()); TH2D* hresult = new TH2D(cc, cc, H3->GetNbinsX(), H3->GetXaxis()->GetBinLowEdge(1), H3->GetXaxis()->GetBinUpEdge(H3->GetNbinsX()), H3->GetNbinsY(), H3->GetYaxis()->GetBinLowEdge(1), H3->GetYaxis()->GetBinUpEdge(H3->GetNbinsY())); for(int x = 1; x <= H3S->GetXaxis()->GetNbins(); x++){ for(int y = 1; y <= H3S->GetXaxis()->GetNbins(); y++){ if((H3S->GetBinContent(x, y) > t3) && (H4S->GetBinContent(x, y) > t4)) { double ratio = H4->GetBinContent(x, y)/H3->GetBinContent(x, y); hresult->SetBinContent(x, y, ratio); } } } if((rmin > 0) || (rmax > 0)) hresult->GetZaxis()->SetRangeUser(rmin, rmax); else hresult->GetZaxis()->SetRangeUser(hresult->GetMinimum(0), hresult->GetMaximum()); hresult->SetContour(99); hresult->SetXTitle(Xlabel); hresult->SetYTitle(Ylabel); hresult->SetTitle(Title); TPaletteAxis *palette = new TPaletteAxis(hresult->GetXaxis()->GetBinCenter(H3->GetNbinsX())*1.025, hresult->GetYaxis()->GetBinCenter(1), hresult->GetXaxis()->GetBinCenter(H3->GetNbinsX())*1.0375, hresult->GetYaxis()->GetBinCenter(H3->GetNbinsY()), hresult); palette->SetLabelColor(1); palette->SetLabelFont(42); palette->SetLabelOffset(0.005); palette->SetLabelSize(0.035); palette->SetTitleOffset(1); palette->SetTitleSize(0.035); palette->SetFillColor(100); palette->SetFillStyle(1001); hresult->GetListOfFunctions()->Add(palette,"br"); hresult->Draw("colz"); canvas->Print(filename, "pdf"); return hresult; } TH2D* Cut(TH2D* H4, TH2D* H4R, const char* name, double thrs, bool larger){ TH2D* hresult = new TH2D(name, name, H4->GetNbinsX(), H4->GetXaxis()->GetBinLowEdge(1), H4->GetXaxis()->GetBinUpEdge(H4->GetNbinsX()), H4->GetNbinsY(), H4->GetYaxis()->GetBinLowEdge(1), H4->GetYaxis()->GetBinUpEdge(H4->GetNbinsY())); for(int x = 1; x <= H4R->GetXaxis()->GetNbins(); x++){ for(int y = 1; y <= H4R->GetXaxis()->GetNbins(); y++){ bool true = false; if((thrs < H4->GetBinContent(x, y)) && larger) hresult->SetBinContent(x, y, H4->GetBinContent(x, y)); if((H4->GetBinContent(x, y) < thrs) && !larger) hresult->SetBinContent(x, y, H4->GetBinContent(x, y)); } } return hresult; } // void function(TFile* f3, TFile* f4, // string h, string s, Int_t thrs){ // // TH2D* h3 = (TH2D*)f3->Get(h.c_str()); // // TH2D* h3s = (TH2D*)f3->Get(s.c_str()); // // TH2D* h4 = (TH2D*)f4->Get(h.c_str()); // // TH2D* h4s = (TH2D*)f4->Get(s.c_str()); // // divider(h3, h3s, h4, h4s, thrs); // // delete h3; // // delete h3s; // // delete h4; // // delete h4s; // }