6 const char *
file1 =
"/sphenix/user/jpinkenburg/ShowerSize/ntuple/neutron_eta0_4GeV.root";
8 TFile *
f1 = TFile::Open(file1);
11 cout << file1 <<
" not found" << endl;
15 TNtuple *de1 = (TNtuple *) f1->Get(
"de");
16 TCanvas *c1 =
new TCanvas();
17 TH2F *
h2 =
new TH2F(
"neutron",
"Particle Shower Sizes",nchan,min,max,nchan,min,max);
18 h2->SetXTitle(
"dtheta");
19 h2->SetYTitle(
"dphi");
20 h2->SetZTitle(
"dE/event");
21 h2->GetXaxis()->SetTitleOffset(2);
22 h2->GetYaxis()->SetTitleOffset(2);
23 h2->GetZaxis()->SetTitleOffset(1.2);
26 de1->Project(
"neutron",
"dphi:dtheta",
"(ID<=2)*edep/10000.",
"",nevents);
30 de1->Project(
"neutron",
"dphi:dtheta",
"(ID<=2)*edep/10000.",
"");
34 const char *
file2 =
"/sphenix/user/jpinkenburg/ShowerSize/ntuple/gamma_eta0_4GeV.root";
35 TFile *
f2 = TFile::Open(file2);
38 cout << file2 <<
" not found" << endl;
43 TNtuple *de2 = (TNtuple *) f2->Get(
"de");
44 cout << nevents << endl;
45 TH2F *
h2a =
new TH2F(
"gamma",
"Particle Shower Sizes",nchan,min,max,nchan,min,max);
46 h2a->SetXTitle(
"dtheta");
47 h2a->SetYTitle(
"dphi");
48 h2a->SetZTitle(
"dE/event");
49 h2a->GetXaxis()->SetTitleOffset(2);
50 h2a->GetYaxis()->SetTitleOffset(2);
51 h2a->GetZaxis()->SetTitleOffset(1.2);
54 de2->Project(
"gamma",
"dphi:dtheta",
"(ID<=2)*edep/10000.",
"",nevents);
58 de2->Project(
"gamma",
"dphi:dtheta",
"(ID<=2)*edep/10000.",
"");
62 h2a->Draw(
"surf same");
65 TFile *
f3 = TFile::Open(
"neutron_gamma_edep_4gev.root",
"UPDATE");
88 TCanvas *c1 =
new TCanvas();
89 TFile *fin = TFile::Open(
"neutron_gamma_edep_4gev.root");
90 TH2 *gamma = (TH2F *) fin->Get(
"gamma");
91 TH2 *neutron = (TH2F *) fin->Get(
"neutron");
94 gamma->SetLineColor(3);
95 gamma->SetTitle(
"Shower Size");
96 gamma->GetXaxis()->SetTitle(
"#Delta#Theta [rad]");
97 gamma->GetXaxis()->SetNdivisions(505);
98 gamma->GetYaxis()->SetTitle(
"#Delta#Phi [rad]");
99 gamma->GetYaxis()->SetNdivisions(505);
100 gamma->GetZaxis()->SetTitle(
"Deposited Energy [GeV]");
101 gamma->GetZaxis()->SetTitleOffset(1.3);
102 neutron->SetLineColor(2);
103 neutron->SetStats(0);
107 gamma->DrawClone(
"surf");
108 neutron->DrawClone(
"surf same");
109 TLegend *legrda =
new TLegend(0.54,0.66,0.9,0.79,NULL,
"brNDC");
110 legrda->SetLineColor(1);
111 legrda->SetLineStyle(1);
112 legrda->SetLineWidth(1);
113 legrda->SetFillColor(10);
114 legrda->SetFillStyle(1001);
115 legrda->SetBorderSize(0);
116 legrda->SetTextSize(0.039);
117 gamma->SetLineWidth(2);
118 neutron->SetLineWidth(2);
119 legrda->AddEntry(gamma,
"4 GeV Photon Shower");
120 legrda->AddEntry(neutron,
"4 GeV Neutron Shower");
122 c1->Print(
"showers.png");