Geant4 Cross Reference |
1 { 1 { 2 gROOT->Reset(); 2 gROOT->Reset(); 3 3 4 // Draw histos filled by Geant4 simulation 4 // Draw histos filled by Geant4 simulation 5 // 5 // 6 6 7 double minE = 40; 7 double minE = 40; 8 double maxE = 10000; 8 double maxE = 10000; 9 double minY = 1e-2; //c1 9 double minY = 1e-2; //c1 10 double maxY = 1e+2; //c1 10 double maxY = 1e+2; //c1 11 double minY1 = 1e-8; //c2 11 double minY1 = 1e-8; //c2 12 double maxY1 = 1; //c2 12 double maxY1 = 1; //c2 13 13 14 //file open 14 //file open 15 // 15 // 16 TFile f("testem6_0.root"); 16 TFile f("testem6_0.root"); 17 17 18 //CrossSectionPerAtom 18 //CrossSectionPerAtom 19 // 19 // 20 TH1D* h7 = (TH1D*)f.Get("h7"); //ee to MuMu 20 TH1D* h7 = (TH1D*)f.Get("h7"); //ee to MuMu 21 TH1D* h8 = (TH1D*)f.Get("h8"); //ee to gamm 21 TH1D* h8 = (TH1D*)f.Get("h8"); //ee to gammagamma 22 TH1D* h9 = (TH1D*)f.Get("h9"); //ee to Hadr 22 TH1D* h9 = (TH1D*)f.Get("h9"); //ee to Hadrons 23 TH1D* h10 = (TH1D*)f.Get("h10"); //ee to gam 23 TH1D* h10 = (TH1D*)f.Get("h10"); //ee to gammagamma(theory) 24 TH1D* h11 = (TH1D*)f.Get("h11"); //ee to MuM 24 TH1D* h11 = (TH1D*)f.Get("h11"); //ee to MuMu(theory) 25 //CrossSectionPerVolume 25 //CrossSectionPerVolume 26 // 26 // 27 TH1D* h12 = (TH1D*)f.Get("h12"); //eBrem 27 TH1D* h12 = (TH1D*)f.Get("h12"); //eBrem 28 TH1D* h13 = (TH1D*)f.Get("h13"); //eIoni 28 TH1D* h13 = (TH1D*)f.Get("h13"); //eIoni 29 TH1D* h14 = (TH1D*)f.Get("h14"); //ee to MuM 29 TH1D* h14 = (TH1D*)f.Get("h14"); //ee to MuMu 30 TH1D* h15 = (TH1D*)f.Get("h15"); //ee to gam 30 TH1D* h15 = (TH1D*)f.Get("h15"); //ee to gammagamma 31 TH1D* h16 = (TH1D*)f.Get("h16"); //ee to Had 31 TH1D* h16 = (TH1D*)f.Get("h16"); //ee to Hadrons 32 //R ratio 32 //R ratio 33 // 33 // 34 TH1D* h17 = (TH1D*)f.Get("h17"); //R 34 TH1D* h17 = (TH1D*)f.Get("h17"); //R 35 35 36 //c1 36 //c1 37 // 37 // 38 TCanvas* c1 = new TCanvas("c1", " "); 38 TCanvas* c1 = new TCanvas("c1", " "); 39 gPad->SetLogy(); 39 gPad->SetLogy(); 40 h7->SetMinimum(minY); 40 h7->SetMinimum(minY); 41 h7->SetMaximum(maxY); 41 h7->SetMaximum(maxY); 42 h7->GetXaxis()->SetLimits(std::log10(minE),s 42 h7->GetXaxis()->SetLimits(std::log10(minE),std::log10(maxE)); 43 h7->SetTitle("Comparison of e+ Annihilation 43 h7->SetTitle("Comparison of e+ Annihilation Processes(totcrsPerAtom)"); 44 h7->GetXaxis()->SetTickLength(0); 44 h7->GetXaxis()->SetTickLength(0); 45 h7->GetXaxis()->SetLabelOffset(999); 45 h7->GetXaxis()->SetLabelOffset(999); 46 h7->GetYaxis()->SetTitle("microbarn"); 46 h7->GetYaxis()->SetTitle("microbarn"); 47 47 48 h7->SetLineColor(kRed); 48 h7->SetLineColor(kRed); 49 h9->SetLineColor(kBlue); 49 h9->SetLineColor(kBlue); 50 h11->SetMarkerColor(kRed); 50 h11->SetMarkerColor(kRed); 51 h11->SetMarkerStyle(22); 51 h11->SetMarkerStyle(22); 52 h10->SetMarkerStyle(22); 52 h10->SetMarkerStyle(22); 53 53 54 c1->cd(); 54 c1->cd(); 55 h7->Draw("HIST"); 55 h7->Draw("HIST"); 56 h8->Draw("HIST SAME"); 56 h8->Draw("HIST SAME"); 57 h9->Draw("HIST SAME"); 57 h9->Draw("HIST SAME"); 58 h10->Draw("HIST P SAME"); 58 h10->Draw("HIST P SAME"); 59 h11->Draw("HIST P SAME"); 59 h11->Draw("HIST P SAME"); 60 60 61 TGaxis *xaxis = new TGaxis(std::log10(minE), 61 TGaxis *xaxis = new TGaxis(std::log10(minE),minY,std::log10(maxE),minY,minE,maxE,510,"G"); 62 xaxis->SetTitle("GeV"); 62 xaxis->SetTitle("GeV"); 63 xaxis->Draw(); 63 xaxis->Draw(); 64 64 65 gStyle->SetOptStat(0); 65 gStyle->SetOptStat(0); 66 66 67 TLegend* leg = new TLegend(0.78,0.59,0.98,0. 67 TLegend* leg = new TLegend(0.78,0.59,0.98,0.76); 68 leg->AddEntry(h8,"to 2 gammas","l"); 68 leg->AddEntry(h8,"to 2 gammas","l"); 69 leg->AddEntry(h7,"to MuPair","l"); 69 leg->AddEntry(h7,"to MuPair","l"); 70 leg->AddEntry(h9,"to Hadrons","l"); 70 leg->AddEntry(h9,"to Hadrons","l"); 71 leg->Draw(); 71 leg->Draw(); 72 72 73 //c2 73 //c2 74 // 74 // 75 TCanvas* c2 = new TCanvas("c2", " "); 75 TCanvas* c2 = new TCanvas("c2", " "); 76 c2->cd(); 76 c2->cd(); 77 77 78 gPad->SetLogy(); 78 gPad->SetLogy(); 79 h15->SetMinimum(minY1); 79 h15->SetMinimum(minY1); 80 h15->SetMaximum(maxY1); 80 h15->SetMaximum(maxY1); 81 h15->GetXaxis()->SetLimits(std::log10(minE), 81 h15->GetXaxis()->SetLimits(std::log10(minE),std::log10(maxE)); 82 h15->SetTitle("Comparison of EM Processes(to 82 h15->SetTitle("Comparison of EM Processes(totcrsPerVolume)"); 83 h15->GetXaxis()->SetTickLength(0); 83 h15->GetXaxis()->SetTickLength(0); 84 h15->GetXaxis()->SetLabelOffset(999); 84 h15->GetXaxis()->SetLabelOffset(999); 85 h15->GetYaxis()->SetTitle("1/mm"); 85 h15->GetYaxis()->SetTitle("1/mm"); 86 86 87 h12->SetLineColor(6); 87 h12->SetLineColor(6); 88 h13->SetLineColor(kGreen); 88 h13->SetLineColor(kGreen); 89 h14->SetLineColor(kRed); 89 h14->SetLineColor(kRed); 90 h16->SetLineColor(kBlue); 90 h16->SetLineColor(kBlue); 91 91 92 c2->cd(); 92 c2->cd(); 93 h15->Draw("HIST"); 93 h15->Draw("HIST"); 94 h13->Draw("HIST SAME"); 94 h13->Draw("HIST SAME"); 95 h14->Draw("HIST SAME"); 95 h14->Draw("HIST SAME"); 96 h12->Draw("HIST SAME"); 96 h12->Draw("HIST SAME"); 97 h16->Draw("HIST SAME"); 97 h16->Draw("HIST SAME"); 98 98 99 TGaxis *xaxis1 = new TGaxis(std::log10(minE) 99 TGaxis *xaxis1 = new TGaxis(std::log10(minE),minY1,std::log10(maxE),minY1,minE,maxE,510,"G"); 100 xaxis1->SetTitle("GeV"); 100 xaxis1->SetTitle("GeV"); 101 xaxis1->Draw(); 101 xaxis1->Draw(); 102 102 103 gStyle->SetOptStat(0); 103 gStyle->SetOptStat(0); 104 104 105 TLegend* leg1 = new TLegend(0.78,0.59,0.98,0 105 TLegend* leg1 = new TLegend(0.78,0.59,0.98,0.76); 106 leg1->AddEntry(h15,"to 2 gammas","l"); 106 leg1->AddEntry(h15,"to 2 gammas","l"); 107 leg1->AddEntry(h14,"to MuPair","l"); 107 leg1->AddEntry(h14,"to MuPair","l"); 108 leg1->AddEntry(h16,"to Hadrons","l"); 108 leg1->AddEntry(h16,"to Hadrons","l"); 109 leg1->AddEntry(h12,"Bremsstrahlung","l"); 109 leg1->AddEntry(h12,"Bremsstrahlung","l"); 110 leg1->AddEntry(h13,"Ionization","l"); 110 leg1->AddEntry(h13,"Ionization","l"); 111 leg1->Draw(); 111 leg1->Draw(); 112 } 112 } 113 113