36 #include "Analysis.hh"
51 fincident_map =
new TH2D(
"incident map",
"Incident Distributuon",
54 fincident_map-> GetXaxis()-> SetTitle(
"X (cm)");
55 fincident_map-> GetYaxis()-> SetTitle(
"Y (cm)");
56 fincident_map-> SetStats(0);
58 fincident_x_hist =
new TH1D(
"incident x",
"Incident X", 100, -5., 5.);
59 fincident_x_hist-> GetXaxis()-> SetTitle(
"X (cm)");
60 fincident_x_hist-> SetFillColor(kRed);
62 fdose_map =
new TH2D(
"dose map",
"Dose Distribution",
65 fdose_map-> GetXaxis()-> SetTitle(
"Z (cm)");
66 fdose_map-> GetYaxis()-> SetTitle(
"X (cm)");
67 fdose_map-> SetStats(0);
69 fdose_hist =
new TH1D(
"dose",
"Dose Distribution", 500, 0., 50.);
70 fdose_hist-> GetXaxis()-> SetTitle(
"Z (cm)");
71 fdose_hist-> GetYaxis()-> SetTitle(
"Dose (GeV)");
72 fdose_hist-> SetFillColor(kBlue);
73 fdose_hist-> SetStats(0);
80 delete fincident_x_hist;
94 fincident_map-> Reset();
95 fincident_x_hist-> Reset();
105 TFile* file =
new TFile(fname.c_str(),
"RECREATE",
"Geant4 ROOT analysis");
107 fincident_map-> Write();
108 fincident_x_hist-> Write();
110 fdose_hist-> Write();
122 if ( ! fincidentFlag ) {
123 fincident_map-> Fill(p.
x()/
cm, p.
y()/
cm);
124 fincident_x_hist-> Fill(p.
x()/
cm);
126 fincidentFlag =
true;
136 if ( std::abs(p.
y()) < dxy ) {
137 fdose_map-> Fill((p.
z()+Z0)/
cm, p.
x()/
cm, dedx/
GeV);
139 if ( std::abs(p.
x()) < dxy ) {
140 fdose_hist-> Fill((p.
z()+Z0)/
cm, dedx/
GeV);
void FillDose(const G4ThreeVector &p, G4double dedx)
static Analysis * GetAnalysis()
void Save(const G4String &fname)
void FillIncident(const G4ThreeVector &p)