Geant4  10.00.p03
IORTAnalysisManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // This is the *BASIC* version of IORT, a Geant4-based application
27 //
28 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
29 // Contributor Authors: S.Guatelli(e)
30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
31 //
32 // (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
33 // (b) IBFM-CNR , Segrate (Milano), Italy
34 // (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
35 // (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
36 // (e) University of Wallongong, Australia
37 //
38 // *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
40 
41 #ifndef HADRONTHERAPYANALYSISMANAGER_HH
42 #define HADRONTHERAPYANALYSISMANAGER_HH 1
43 
44 #include "globals.hh"
45 
46 
47 #ifdef G4ANALYSIS_USE_ROOT
48 #include "TROOT.h"
49 #include "TFile.h"
50 #include "TNtuple.h"
51 #include "TH1F.h"
52 #endif
53 
57 
62 {
63 private:
71 
72 public:
74 
79 
80 #ifdef G4ANALYSIS_USE_ROOT
81 
84  void Clear();
88  G4bool IsTheTFile();
92  void book();
96  void SetAnalysisFileName(G4String);
97 
101  void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId,
102  G4double energyDeposit);
103 
104  void BraggPeak(G4int, G4double);
105 
106  void SecondaryProtonEnergyDeposit(G4int slice, G4double energy);
108 
109  void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy);
111 
112  void SecondaryAlphaEnergyDeposit(G4int slice, G4double energy);
114 
115  void SecondaryGammaEnergyDeposit(G4int slice, G4double energy);
117 
118  void SecondaryElectronEnergyDeposit(G4int slice, G4double energy);
120 
121  void SecondaryTritonEnergyDeposit(G4int slice, G4double energy);
123 
124  void SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy);
126 
127  void SecondaryPionEnergyDeposit(G4int slice, G4double energy);
129 
130  void electronEnergyDistribution(G4double secondaryParticleKineticEnergy);
132 
133  void gammaEnergyDistribution(G4double secondaryParticleKineticEnergy);
135 
136  void deuteronEnergyDistribution(G4double secondaryParticleKineticEnergy);
138 
139  void tritonEnergyDistribution(G4double secondaryParticleKineticEnergy);
141 
142  void alphaEnergyDistribution(G4double secondaryParticleKineticEnergy);
144 
145  void heliumEnergy(G4double secondaryParticleKineticEnergy);
147 
148  void hydrogenEnergy(G4double secondaryParticleKineticEnergy);
150 
151  //Kinetic energy by voxel, mass number A and atomic number Z.
152  void FillKineticFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double kinEnergy);
153 
154  //Kinetic energy by voxel, mass number A and atomic number Z of only primary particles
155  void FillKineticEnergyPrimaryNTuple(G4int i, G4int j, G4int k, G4double kinEnergy);
156 
158  void FillVoxelFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double energy, G4double fluence);
159 
160  void FillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ);
162 
163  void FillLetFragmentTuple(G4int i, G4int j, G4int k, G4int A, G4double Z, G4double letT, G4double letD);
165 
166  void genericIonInformation(G4int, G4double, G4int, G4double);
167 
168  void ThintargetBeamDisp(G4double,G4double);
169 
170  void startNewEvent();
172 
173  void setGeometryMetaData(G4double, G4double, G4double);
175 
176  void setBeamMetaData(G4double, G4double);
178 
179  void flush();
181 private:
182  TH1F *createHistogram1D(const TString name, const TString title, int bins, double xmin, double xmax) {
183  TH1F *histo = new TH1F(name, title, bins, xmin, xmax);
184  histo->SetLineWidth(2);
185  return histo;
186  }
187 
188 private:
189 #endif
192 #ifdef G4ANALYSIS_USE_ROOT
193  G4String analysisFileName;
194  TFile *theTFile;
195  TH1F *histo1;
196  TH1F *histo2;
197  TH1F *histo3;
198  TH1F *histo4;
199  TH1F *histo5;
200  TH1F *histo6;
201  TH1F *histo7;
202  TH1F *histo8;
203  TH1F *histo9;
204  TH1F *histo10;
205  TH1F *histo11;
206  TH1F *histo12;
207  TH1F *histo13;
208  TH1F *histo14;
209  TH1F *histo15;
210  TH1F *histo16;
211 
212  TNtuple *kinFragNtuple;
213  TNtuple *kineticEnergyPrimaryNtuple;
214 
215  // ntuple containing the fluence of all the particle in any voxel
216  TNtuple *doseFragNtuple;
217 
218  // ntuple containing the fluence of all the particle in any voxel
219  TNtuple *fluenceFragNtuple;
220 
221  // ntuple containing the fluence of all the particle in any voxel
222  TNtuple *letFragNtuple;
223 
224  TNtuple *theROOTNtuple;
225  TNtuple *theROOTIonTuple;
226  TNtuple *fragmentNtuple; // fragments
227  TNtuple *metaData;
228  G4long eventCounter; // Simulation metadata
229  G4double detectorDistance;
230  G4double phantomDepth;
231  G4double beamEnergy;
232  G4double energyError;
233  G4double phantomCenterDistance;
234 #endif
235 };
236 #endif
237 
238 
239 
G4String name
Definition: TRTMaterials.hh:40
A messenger object of this class is created by the AnalysisManager.
void Clear(Node *)
long G4long
Definition: G4Types.hh:80
A class for connecting the simulation to an analysis package.
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
static const G4double A[nN]
static IORTAnalysisManager * GetInstance()
Get the pointer to the analysis manager.
G4double energy(const ThreeVector &p, const G4double m)
IORTAnalysisManager()
Analysis manager is a singleton object (there is only one instance).
double G4double
Definition: G4Types.hh:76
IORTAnalysisFileMessenger * fMess
static IORTAnalysisManager * instance