36 #include "Analysis.hh"
56 fincident_map =
new TH2D(
"incident map",
"Incident Distributuon",
59 fincident_map-> GetXaxis()->
SetTitle(
"X (cm)");
60 fincident_map-> GetYaxis()->
SetTitle(
"Y (cm)");
61 fincident_map-> SetStats(0);
63 fincident_x_hist =
new TH1D(
"incident x",
"Incident X", 100, -5., 5.);
64 fincident_x_hist-> GetXaxis()->
SetTitle(
"X (cm)");
65 fincident_x_hist-> SetFillColor(kRed);
67 fdose_map =
new TH2D(
"dose map",
"Dose Distribution",
70 fdose_map-> GetXaxis()->
SetTitle(
"Z (cm)");
71 fdose_map-> GetYaxis()->
SetTitle(
"X (cm)");
72 fdose_map-> SetStats(0);
74 fdose_hist =
new TH1D(
"dose",
"Dose Distribution", 500, 0., 50.);
75 fdose_hist-> GetXaxis()->
SetTitle(
"Z (cm)");
76 fdose_hist-> GetYaxis()->
SetTitle(
"Dose (GeV)");
77 fdose_hist-> SetFillColor(kBlue);
78 fdose_hist-> SetStats(0);
85 delete fincident_x_hist;
99 fincident_map-> Reset();
100 fincident_x_hist-> Reset();
102 fdose_hist-> Reset();
111 TFile* file =
new TFile(fname.c_str(),
"RECREATE",
"Geant4 ROOT analysis");
113 fincident_map-> Write();
114 fincident_x_hist-> Write();
116 fdose_hist-> Write();
128 if ( ! fincidentFlag ) {
129 fincident_map-> Fill(p.
x()/
cm, p.
y()/
cm);
130 fincident_x_hist-> Fill(p.
x()/
cm);
132 fincidentFlag =
true;
142 if ( std::abs(p.
y()) < dxy ) {
143 fdose_map-> Fill((p.
z()+Z0)/
cm, p.
x()/
cm, dedx/
GeV);
145 if ( std::abs(p.
x()) < dxy ) {
146 fdose_hist-> Fill((p.
z()+Z0)/
cm, dedx/
GeV);
static constexpr double mm
void FillDose(const G4ThreeVector &p, G4double dedx)
#define G4MUTEX_INITIALIZER
static Analysis * GetAnalysis()
static constexpr double cm
void Save(const G4String &fname)
G4bool SetTitle(G4ToolsBaseHisto &baseHisto, const G4String &title)
void FillIncident(const G4ThreeVector &p)
static constexpr double GeV
G4ThreadLocal Analysis * the_analysis