Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
+4 -14
View File
@@ -55,9 +55,7 @@
#include "BrachyAnalysisManager.hh"
#endif
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#include "BrachyDetectorConstruction.hh"
#include "BrachyPhysicsList.hh"
@@ -70,10 +68,7 @@
#include "G4UImessenger.hh"
#include "G4ScoringManager.hh"
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
#include "G4ScoringManager.hh"
#include "BrachyUserScoreWriter.hh"
@@ -89,7 +84,7 @@ int main(int argc ,char ** argv)
#endif
G4cout << "***********************" << G4endl;
G4cout << "*** " << G4Random::getTheSeed() << " ***" << G4endl;
G4cout << "*** Seed: " << G4Random::getTheSeed() << " ***" << G4endl;
G4cout << "***********************" << G4endl;
// Access to the Scoring Manager pointer
@@ -117,26 +112,21 @@ int main(int argc ,char ** argv)
pRunManager->SetUserInitialization(actions);
//Initialize G4 kernel
pRunManager -> Initialize();
// pRunManager -> Initialize();
//// Initialize the Visualization component
#ifdef G4VIS_USE
// Visualization manager
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
// get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc == 1) // Define UI session for interactive mode.
{
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
G4cout << " UI session starts ..." << G4endl;
UImanager -> ApplyCommand("/control/execute VisualisationMacro.mac");
ui -> SessionStart();
delete ui;
#endif
}
else // Batch mode
{
@@ -146,9 +136,9 @@ int main(int argc ,char ** argv)
}
// Job termination
#ifdef G4VIS_USE
delete visManager;
#endif
#ifdef ANALYSIS_USE
// Close the output ROOT file with the results
+11 -5
View File
@@ -20,18 +20,24 @@ endif()
#
include(${Geant4_USE_FILE})
# Setup of ROOT ANALYSIS : optional.
option(WITH_ANALYSIS_USE "Build example with analysis objects" OFF)
if(WITH_ANALYSIS_USE)
add_definitions(-DANALYSIS_USE)
find_package(ROOT QUIET)
if(ROOT_FOUND)
option(WITH_ANALYSIS_USE "Build example with analysis objects" ON)
else()
option(WITH_ANALYSIS_USE "Build example with analysis objects" OFF)
endif()
if(WITH_ANALYSIS_USE)
# ROOT was found already..
add_definitions(-DANALYSIS_USE)
endif()
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR} )
#----------------------------------------------------------------------------
if(WITH_ANALYSIS_USE)
EXECUTE_PROCESS(COMMAND root-config --cflags OUTPUT_VARIABLE ROOT_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
@@ -62,7 +68,7 @@ set(brachy_SCRIPTS
IodineSourceMacro.mac LeipzigSourceMacro.mac VisualisationMacro.mac
macro.C iridium_source_primary.mac iodine_source_primary.mac iridium_source_leipzig_primary.mac
plot_primary.C iodine_decay.mac FlexiSourceMacro.mac
TG43_relative_dose.C TG186SourceMacro.mac TG186_iridium_decay.mac
TG186SourceMacro.mac TG186_iridium_decay.mac OncuraIodineSourceMacro.mac
)
foreach(_script ${brachy_SCRIPTS})
@@ -1,3 +1,4 @@
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
@@ -1,5 +1,4 @@
# --------------------------------------------------------------
# $Id: GNUmakefile 69765 2013-05-14 10:11:22Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
+25 -1
View File
@@ -1,5 +1,4 @@
-------------------------------------------------------------------
$Id: History 109983 2018-05-14 07:17:24Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -9,6 +8,31 @@ $Id: History 109983 2018-05-14 07:17:24Z gcosmo $
Category History file
---------------------
30.11.2018 - G. Cosmo;brachy-V10-04-07.
Fixed compilation warning for shadowing variables/parameters
in BrachyAnalysisManager, BrachyPrimaryGeneratorAction and
BrachyUserScoreWriter.
29.11.2018 - G. Folger;brachy-V10-04-06.
Fix Visualisation.mac to leave verbosity at errors
(warning is a 'magic' word failing a test
29.11.2018 - G. Folger;brachy-V10-04-05.
Attempt to use Root optionally in CMakeLists.txt.
28.11.2018 - S. Guatelli;brachy-V10-04-04.
Added directory test_macro and included more ROOT analysis files.
25.10.2018 - S. Guatelli;brachy-V10-04-03. CMakeList updated
24.10.2018 - S. Guatelli;brachy-V10-04-02.
Included macros for the regression testing of Geant4.
Option to switch EM physics list included
04.09.2018 - S. Guatelli and A. Le;brachy-V10-04-01.
Included new brachy source (I-125 Oncura 6711 source).
G4_VIS_USE and G4_UI_USE deleted.
10.05.2018 - B. Morgan; brachy-V10-04-00
Include G4Types before use of G4MULTITHREADED. For forward
compatibility with move to #defines over -D for G4 preprocessor
@@ -1,3 +1,4 @@
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
@@ -1,3 +1,4 @@
/run/initialize
/control/verbose 1
/run/verbose 0
/event/verbose 0
@@ -0,0 +1,39 @@
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#### Define the geometry of the Oncura I-125 source
/source/switch Oncura
# Generation of primary field
# Generate radioactive decay of iodine
/gps/particle ion
/gps/ion 53 125 53 0.
/gps/energy 0. keV
/gps/pos/type Surface
/gps/pos/shape Cylinder
/gps/pos/radius 0.247 mm
/gps/pos/halfz 1.397 mm
/gps/pos/centre 0. 0. 0. mm
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_5
#
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
#
#
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_5 eDep EnergyDeposition_Oncura.out
#
+27 -17
View File
@@ -7,7 +7,7 @@
---------------------
The brachytherapy example is currently maintained and upgraded by Susanna Guatelli (1) and Dean Cutajar (1), with the support of
The brachytherapy example is currently maintained and upgraded by Susanna Guatelli (1), Albert Le (1) and Dean Cutajar (1), with the support of
Luciano Pandola (2)
1. Centre For Medical Radiation Physics (CMRP), University of Wollongong, NSW, Australia.
@@ -29,7 +29,7 @@ S. George, S. Agostinelli, F. Foppiano, S. Garelli, M. G. Pia, M. Tropeano
Brachytherapy example simulates the energy deposit in a water phantom, produced by:
1) Iridium sources (Flexisource and TG186).
2) Iodine source (Bebig Isoseed I-125).
2) Iodine sources (Bebig Isoseed and Oncura 6711 I-125).
3) Leipzig Applicator with an iridium source (model from the Istituto Tumori, Genova, Italy).
The Flexisource, an Ir-192 source manufactured by Nucletron, an Elekta company, is a source commonly used for high dose rate brachytherapy treatments.
@@ -49,16 +49,19 @@ In particular in this example it is shown how to:
- define the physics by means of a Geant4 Modular Physics List
- save results in an analysis ROOT file
- calculate the dose rate distribution along the main axis of the source
- compare the calculated dose rate distribution to reference data. In the case of the example, the dose rate
distribution of a Flexisource is compared to D. Granero, J. Pérez-Calatayud, E. Casal, et al,
"A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
- compare the calculated dose rate distribution to reference data.
In the case of the example, the dose rate distribution of a Flexisource is compared to D. Granero,
J. Pérez-Calatayud, E. Casal, et al,"A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
The dose rate distribution of the Oncura 6711 I-125 source is compared to J. Dolan, Z. Lia, J. F. Williamson, "Monte Carlo and experimental
dosimetry of an I-125 brachytherapy seed", Med. Phys. 33(12), 2006.
The example can be executed in multithreading mode.
------------------------------------------------------------------------
----> 1.Experimental set-up.
The default source is a Ir-192 Flexisource set in the center of a water phantom with size 30 cm.
The default source is a Ir-192 Flexisource set in the center of a water phantom with size 30 cm.
The phantom is set in the World volume filled with air.
The primary radiation field is defined by means of the GeneralParticleSource
@@ -79,10 +82,12 @@ The installation of ROOT is required (http://root.cern.ch/drupal/).
----> 3.How to run the example.
- Batch mode:
$G4WORKDIR/bin/Linux-g++/Brachy FlexiSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy FlexiSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy LeipzigSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy IridiumSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy IodiumSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy LeipzigSourceMacro.mac
$G4WORKDIR/bin/Linux-g++/Brachy IodiumSourceMacro.mac (model of the Bebig Isoseed I-125)
$G4WORKDIR/bin/Linux-g++/Brachy OncuraIodineSourceMacro.mac (model of the Oncura 6711 I-125)
$G4WORKDIR/bin/Linux-g++/Brachy LeipzigSourceMacro.mac
- Interative mode:
3) $G4WORKDIR/bin/Linux-g++/Brachy
@@ -104,16 +109,16 @@ iodine_source_primary.mac and iridium_source_primary.mac
2) Model the radioactive Decay. The primary particle is the radionuclide.
This option is modelled in iodine_decay.mac and TG186_iridium_decay.mac
The GPS macros are executed in VisualisationMacro.mac 9default, FlexiSourceMacro.mac, IodineSourceMacro.mac, LeipzigSourceMacro.mac
The GPS macros are executed in VisualisationMacro.mac by default, FlexiSourceMacro.mac, IodineSourceMacro.mac, LeipzigSourceMacro.mac
- The Flexisource is the default source of the example.
- In VisualisationMacro.mac the source is the default one. iridium_source_primary.mac is executed to define the radiation field emerging from the iridium core.
- In FlexiSourceMacro.mac the Flexi ir source geometry is selected via interactive command. The radiation field is defined in the iridium_source_primary.mac.
- In FlexiSourceMacro.mac the Flexi Ir source geometry is selected via interactive command. The radiation field is defined in the iridium_source_primary.mac.
- In IodineSourceMacro.mac, the Bebig Isoseed I-125 brachytherapy source is modelled. The radiation field is modelled in terms of emitted photons in iodine_source_primary.mac.
Alternatively the radioactive decay of I can be modelled using teh macro iodine_decay.mac.
- In LeipzigSourceMacro.mac, A Leipzig applicator (design provided by Istituto Tumori, Genova) is modelled. The iridium_source_leipzig_primary.mac defines the radiation field of the Ir core.
- The TG186SourceMacro.mac models the reference bIr brachytherapy source. The radiation field can be either defined with the iridium_source_primary.mac (spectrum of the emitted photons) or with TG186_iridium_decay.mac (model of the Ir decay).
- OncuraIodineSourceMacro.mac models both the geometry and the radioactive decay of the Oncura 6711 I-125 source.
--------------------------------------------------------------------------------
----> 5. Physics List
@@ -141,9 +146,10 @@ The output is:
By default:
EnergyDeposition_Flexi.out contains the Edep when the Flexi source is selected.
EnergyDeposition_iodine.out contains the Edep when Iodine source is selected.
EnergyDeposition_iodine.out contains the Edep when Iodine Bebig Isoseed source is selected.
EnergyDeposition_TG186.out contains the Edep when the TG186 source is selected.
EnergyDeposition_Leipzig.out contains the Edep when the Iridium source with Leipzig applicator is selected.
EnergyDeposition_Oncura.out contains the Edep when the Iodine Oncura 6711 source is selected.
- brachytherapy.root, containing
- a 2D histogram with the energy deposition in the phantom. The macro macro.C is provided as example
@@ -151,7 +157,7 @@ The output is:
The ROOT file will be created if the example is built with the WITH_ANALYSIS_USE=ON option (see section 2).
- 1D histogram withe the plot of energy spectrum of gamma emitted by the radioactive decay when gamma are generated directly as
primary particles or whenthey derive from Radioactive Decay(see section 4).
plot_primary.C is provided as example to open brachytherapy.root and to plot the energy spectra
plot_primary.C is provided as example to open brachytherapy.root and to plot the energy spectra
-------------------------------------------------------------------------------
----> 8.Visualisation
@@ -167,13 +173,12 @@ in the brachytherapy.root file.
The ROOT macro TG43_relative_dose.C has brachytherapy.root as input file. It calculates the dose rate distribution along the main axis of
the brachytherapy source. The dose rate is normalised to 1 at 1 cm distance from the centre.
The output file is geant4_dose.txt with two columns:
distance from the centre (cm) dose rate distribution
distance from the centre (cm) dose rate distribution
The user can then compare the dose rate distribution calculated with the example to reference data.
Directory "comparison":
As an example, the dose rate distribution calculated with the Flexisource is compared to reference data from D. Granero, J. Pérez-Calatayud, E. Casal, et al,
"A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
As an example, the dose rate distribution calculated with the Flexisource is compared to reference data from D. Granero, J. Pérez-Calatayud, E. Casal, et al, "A dosimetric study on the Ir-192 high dose rate Flexisource", Med. Phys. 33 (12), 2006, 4578-82.
The compare.C is a ROOT macro which reads the dose rate distribution calculated with the Flexisource (geant4.txt generated with the advanced example and 280 M histories ) against the reference.
@@ -182,3 +187,8 @@ The directory "comparison" contains:
- the data obtained in Geant4.10.3: geant4.txt, 280 M events. geant4.txt is obtained when executing the macro TG43_relative_dose.C
- comparison.C - macro to read geant4.txt and granero.txt and compare them in the same plot
-----> 10. Regression testing of Geant4
- the macros to run are in test_macro
- the results should be processed with analysis.C
@@ -1,4 +1,5 @@
# The iridium source is the default option
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
@@ -62,7 +62,7 @@
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush
@@ -4,7 +4,7 @@
############################################
**************************************************************
Geant4 version Name: geant4-10-05-beta-01 (29-June-2018)
Geant4 version Name: geant4-10-05-ref-00 (7-December-2018)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -13,15 +13,8 @@
**************************************************************
***********************
*** 1 ***
*** Seed: 1 ***
***********************
Checking overlaps for volume phys_steel_shell ... OK!
Checking overlaps for volume phys_air_gap ... OK!
Checking overlaps for volume phys_End1_steel_shell ... OK!
Checking overlaps for volume phys_End2_steel_shell ... OK!
Checking overlaps for volume phys_cable ... OK!
Checking overlaps for volume phys_iridium_core ... OK!
G4PhysicsListHelper::AddTransportation()--- G4CoupledTransportation is used
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
@@ -69,6 +62,13 @@ End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
Checking overlaps for volume phys_steel_shell ... OK!
Checking overlaps for volume phys_air_gap ... OK!
Checking overlaps for volume phys_End1_steel_shell ... OK!
Checking overlaps for volume phys_End2_steel_shell ... OK!
Checking overlaps for volume phys_cable ... OK!
Checking overlaps for volume phys_iridium_core ... OK!
--- G4CoupledTransportation is used
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
@@ -233,7 +233,7 @@ G4ScoringBox : boxMesh_4 --- Shape: Box mesh
### === Deexcitation model UAtomDeexcitation is activated for 1 region:
DefaultRegionForTheWorld 1 1 0
### === Auger cascade flag: 1
### === Ignore cuts flag: 0
### === Ignore cuts flag: 1
phot: for gamma SubType= 12 BuildTable= 0
LambdaPrime table from 200 keV to 100 TeV in 174 bins
@@ -244,13 +244,14 @@ compt: for gamma SubType= 13 BuildTable= 1
Lambda table from 100 eV to 1 MeV, 20 bins per decade, spline: 1
LambdaPrime table from 1 MeV to 100 TeV in 160 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
LivermoreCompton : Emin= 0 eV Emax= 100 TeV FluoActive
LivermoreCompton : Emin= 0 eV Emax= 1 GeV FluoActive
KleinNishina : Emin= 1 GeV Emax= 100 TeV FluoActive
conv: for gamma SubType= 14 BuildTable= 1
Lambda table from 1.022 MeV to 100 TeV, 20 bins per decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
LivermoreConversion : Emin= 0 eV Emax= 80 GeV
BetheHeitlerLPM : Emin= 80 GeV Emax= 100 TeV AngularGenUrban
BetheHeitler5D : Emin= 0 eV Emax= 1 GeV AngularGenUrban
BetheHeitlerLPM : Emin= 1 GeV Emax= 100 TeV AngularGenUrban
Rayl: for gamma SubType= 11 BuildTable= 1
Lambda table from 100 eV to 100 keV, 20 bins per decade, spline: 0
@@ -259,15 +260,15 @@ Rayl: for gamma SubType= 11 BuildTable= 1
LivermoreRayleigh : Emin= 0 eV Emax= 100 TeV CullenGenerator
msc: for e- SubType= 10
RangeFactor= 0.02, stepLimitType: 3, latDisplacement: 1, skin= 1, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 2, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 MeV Table with 120 bins Emin= 100 eV Emax= 100 MeV
GoudsmitSaunderson : Emin= 0 eV Emax= 100 MeV Table with 120 bins Emin= 100 eV Emax= 100 MeV
WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Table with 120 bins Emin= 100 MeV Emax= 100 TeV
eIoni: for e- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
finalRange(mm)= 0.01, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
LowEnergyIoni : Emin= 0 eV Emax= 100 keV deltaVI
MollerBhabha : Emin= 100 keV Emax= 100 TeV deltaVI
@@ -277,8 +278,15 @@ eBrem: for e- SubType= 3
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000
===== EM models for the G4Region DefaultRegionForTheWorld ======
LowEnBrem : Emin= 0 eV Emax= 1 GeV AngularGen2BS
eBremLPM : Emin= 1 GeV Emax= 100 TeV DipBustGen
eBremSB : Emin= 0 eV Emax= 1 GeV AngularGen2BS
eBremLPM : Emin= 1 GeV Emax= 100 TeV AngularGen2BS
ePairProd: for e- SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
Sampling table 25x1001 from 0.1 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
ePairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for e-, integral: 1 SubType= 1 BuildTable= 1
Lambda table from 100 MeV to 100 TeV, 20 bins per decade, spline: 1
@@ -287,15 +295,15 @@ CoulombScat: for e-, integral: 1 SubType= 1 BuildTable= 1
eCoulombScattering : Emin= 100 MeV Emax= 100 TeV
msc: for e+ SubType= 10
RangeFactor= 0.02, stepLimitType: 3, latDisplacement: 1, skin= 1, geomFactor= 2.5
RangeFactor= 0.2, stepLimitType: 2, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 MeV Table with 120 bins Emin= 100 eV Emax= 100 MeV
GoudsmitSaunderson : Emin= 0 eV Emax= 100 MeV Table with 120 bins Emin= 100 eV Emax= 100 MeV
WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Table with 120 bins Emin= 100 MeV Emax= 100 TeV
eIoni: for e+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
finalRange(mm)= 0.1, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
finalRange(mm)= 0.01, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.01
===== EM models for the G4Region DefaultRegionForTheWorld ======
MollerBhabha : Emin= 0 eV Emax= 100 TeV deltaVI
@@ -305,7 +313,14 @@ eBrem: for e+ SubType= 3
LPM flag: 1 for E > 1 GeV, VertexHighEnergyTh(GeV)= 100000
===== EM models for the G4Region DefaultRegionForTheWorld ======
eBremSB : Emin= 0 eV Emax= 1 GeV AngularGen2BS
eBremLPM : Emin= 1 GeV Emax= 100 TeV DipBustGen
eBremLPM : Emin= 1 GeV Emax= 100 TeV AngularGen2BS
ePairProd: for e+ SubType= 4
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
Sampling table 25x1001 from 0.1 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
ePairProd : Emin= 0 eV Emax= 100 TeV
annihil: for e+, integral: 1 SubType= 5 BuildTable= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
@@ -344,6 +359,12 @@ hPairProd: for proton SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for proton, integral: 1 SubType= 1 BuildTable= 1
Lambda table from threshold to 100 TeV, 20 bins per decade, spline: 1
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
nuclearStopping: for proton SubType= 8 BuildTable= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU49NucStopping : Emin= 0 eV Emax= 1 MeV
@@ -374,7 +395,7 @@ Max 2J for sampling of angular correlations 10
Atomic de-excitation enabled 1
Auger electron emission enabled 1
Auger cascade enabled 1
Check EM cuts disabled for atomic de-excitation 0
Check EM cuts disabled for atomic de-excitation 1
Use Bearden atomic level energies 0
=======================================================================
@@ -386,7 +407,7 @@ msc: for alpha SubType= 10
ionIoni: for alpha SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
Lambda tables from threshold to 100 TeV, 20 bins per decade, spline: 1
finalRange(mm)= 0.01, dRoverRange= 0.1, integral: 1, fluct: 1, linLossLimit= 0.02
finalRange(mm)= 0.05, dRoverRange= 0.2, integral: 1, fluct: 1, linLossLimit= 0.02
===== EM models for the G4Region DefaultRegionForTheWorld ======
BraggIon : Emin= 0 eV Emax= 7.9452 MeV deltaVI
BetheBloch : Emin= 7.9452 MeV Emax= 100 TeV deltaVI
@@ -422,6 +443,12 @@ hPairProd: for anti_proton SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for anti_proton, integral: 1 SubType= 1 BuildTable= 1
Lambda table from threshold to 100 TeV, 20 bins per decade, spline: 1
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
nuclearStopping: for anti_proton SubType= 8 BuildTable= 0
===== EM models for the G4Region DefaultRegionForTheWorld ======
ICRU49NucStopping : Emin= 0 eV Emax= 1 MeV
@@ -429,7 +456,7 @@ nuclearStopping: for anti_proton SubType= 8 BuildTable= 0
msc: for kaon+ SubType= 10
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
hIoni: for kaon+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
@@ -453,10 +480,16 @@ hPairProd: for kaon+ SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for kaon+, integral: 1 SubType= 1 BuildTable= 1
Lambda table from threshold to 100 TeV, 20 bins per decade, spline: 1
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for kaon- SubType= 10
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
hIoni: for kaon- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
@@ -480,6 +513,12 @@ hPairProd: for kaon- SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for kaon-, integral: 1 SubType= 1 BuildTable= 1
Used Lambda table of kaon+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for mu+ SubType= 10
RangeFactor= 0.2, step limit type: 0, lateralDisplacement: 1, polarAngleLimit(deg)= 180
===== EM models for the G4Region DefaultRegionForTheWorld ======
@@ -543,7 +582,7 @@ muPairProd: for mu- SubType= 4
muPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for mu-, integral: 1 SubType= 1 BuildTable= 1
Lambda table from threshold to 100 TeV, 20 bins per decade, spline: 1
Used Lambda table of mu+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
@@ -551,7 +590,7 @@ CoulombScat: for mu-, integral: 1 SubType= 1 BuildTable= 1
msc: for pi+ SubType= 10
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
hIoni: for pi+ SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
@@ -575,10 +614,16 @@ hPairProd: for pi+ SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for pi+, integral: 1 SubType= 1 BuildTable= 1
Lambda table from threshold to 100 TeV, 20 bins per decade, spline: 1
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
msc: for pi- SubType= 10
RangeFactor= 0.2, stepLimitType: 0, latDisplacement: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
UrbanMsc : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
WentzelVIUni : Emin= 0 eV Emax= 100 TeV Table with 240 bins Emin= 100 eV Emax= 100 TeV
hIoni: for pi- SubType= 2
dE/dx and range tables from 100 eV to 100 TeV in 240 bins
@@ -602,6 +647,12 @@ hPairProd: for pi- SubType= 4
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV
CoulombScat: for pi-, integral: 1 SubType= 1 BuildTable= 1
Used Lambda table of pi+
ThetaMin(p) < Theta(degree) < 180 pLimit(GeV^1)= 0.139531
===== EM models for the G4Region DefaultRegionForTheWorld ======
eCoulombScattering : Emin= 0 eV Emax= 100 TeV
========= Table of registered couples ==============================
Index : 0 used in the geometry : Yes
@@ -1,10 +1,13 @@
{
void Read(TString source, TString physics_list){
// Create output file geant4_dose.txt with the dose rate distribution, calculated
// with the simulation results containted in brachytherapy.root
gROOT -> Reset();
TFile f("brachytherapy.root");
TString fileName="brachytherapy_"+source+"_"+physics_list+".root";
std::cout<< "Reading " << fileName << std::endl;
//const char * c = fileName.c_str();
TFile f(fileName);
Double_t Seed_length = 0.35; //seed length in cm
Double_t EnergyMap[401]; //2D map of total energy in "radial distance (mm)" and "angle (5 degrees)"
@@ -31,9 +34,9 @@ for (int k=0; k< numberOfBins; k++)
{
for (int m=0; m< numberOfBins; m++)
{
Double_t xx_histo = h20.GetXaxis()->GetBinCenter(k);
Double_t yy_histo = h20.GetYaxis()->GetBinCenter(m);
Double_t edep_histo=h20.GetBinContent(k, m);
Double_t xx_histo = h20->GetXaxis()->GetBinCenter(k);
Double_t yy_histo = h20->GetYaxis()->GetBinCenter(m);
Double_t edep_histo=h20->GetBinContent(k, m);
radius = sqrt(xx_histo*xx_histo+yy_histo*yy_histo);
// if ((edep_histo!=0) && radius < 12. && radius > 9) std::cout << "histo: " << xx_histo << ", " << yy_histo
// << ", radius: " << radius <<", edep: "<< edep_histo << std::endl;
@@ -51,8 +54,6 @@ for (int k=0; k< numberOfBins; k++)
}}
std::cout << "Energy Map Complete" << std::endl;
//Create Normalised Dose Map
std::cout << "The energy deposition at the reference point is " << EnergyMap[40] << std::endl;
Double_t tempNormValue = EnergyMap[40]/Voxels[40];
@@ -60,8 +61,10 @@ Double_t tempNormValue = EnergyMap[40]/Voxels[40];
std::cout << "Dose rate ditribution (distances in cm)" << std::endl;
ofstream myfile;
myfile.open ("geant4_dose.txt");
TString outputFileName ="geant4_dose_"+ source+"_"+physics_list+".txt";
//const char * cOutputFileName = fileName.c_str();
myfile.open(outputFileName);
std::cout << "file " << outputFileName << " is created "<<std::endl;
for (int i=0; i<=400; i++)
{
@@ -73,7 +76,7 @@ for (int i=0; i<=400; i++)
if (R> 0.05)
{
cout << R << " " << normDose[i] << endl;
// cout << R << " " << normDose[i] << endl;
myfile << R << " " << normDose[i] << "\n";
}
}
@@ -0,0 +1,38 @@
{
// For Flexi source
// eventually convert from ASCII output files to ROOT files
/*
gROOT->ProcessLine(".L convert.C");
ReadASCII("EnergyDeposition_Flexi_livermore.out", "brachytherapy_Flexi_livermore.root");
ReadASCII("EnergyDeposition_Flexi_penelope.out", "brachytherapy_Flexi_penelope.root");
ReadASCII("EnergyDeposition_Flexi_opt0.out", "brachytherapy_Flexi_opt0.root");
ReadASCII("EnergyDeposition_Flexi_opt3.out", "brachytherapy_Flexi_opt3.root");
ReadASCII("EnergyDeposition_Flexi_opt4.out", "brachytherapy_Flexi_opt4.root");
*/
// g(r) is calculated from the root files
gROOT->ProcessLine(".L TG43_relative_dose.C");
Read("Flexi", "livermore");
Read("Flexi", "penelope");
Read("Flexi", "opt0");
Read("Flexi", "opt3");
Read("Flexi", "opt4");
//gROOT->ProcessLine(".x compare.C");
// or...
// plot all results with the alternative EM physics constructors
gROOT->ProcessLine(".x compare_all.C");
// use compare.C when only one physics approach is used
// For Oncura source
/*gROOT->ProcessLine(".L TG43_relative_dose.C");
Read("Oncura", "livermore");
Read("Oncura", "penelope");
Read("Oncura", "opt0");
Read("Oncura", "opt3");
Read("Oncura", "opt4");
gROOT->ProcessLine(".x compare_6711.C");
//or ...
// gROOT->ProcessLine(".x compare_6711_all.C");
*/
}
@@ -0,0 +1,9 @@
{
gROOT->ProcessLine(".L TG43_relative_dose.C");
Read("Oncura", "livermore");
Read("Oncura", "penelope");
Read("Oncura", "opt0");
Read("Oncura", "opt4");
gROOT->ProcessLine(".x compare_6711.C");
}
@@ -0,0 +1,73 @@
{
// Read reference data in dolan.txt
FILE * fg1=fopen("dolan.txt", "r");
Int_t n_points_dolan = 8;
Float_t x1[n_points_dolan], y1[n_points_dolan];
Float_t x, y;
Int_t ncols_dolan;
Int_t nlines1 = 0;
while(1)
{
ncols_dolan = fscanf(fg1, "%f %f", &x, &y);
if (ncols_dolan<0) break;
x1[nlines1]= x;
y1[nlines1] = y;
nlines1++;
}
fclose(fg1);
// Read the results of the brachyadvanced example
// OncuraSourceMacro.mac with 20 B events
FILE *fg2=fopen("geant4_6711_dose.txt", "r");
Int_t n_points_geant4 = 398;
Float_t x2[n_points_geant4], y2[n_points_geant4];
Int_t ncols_geant4;
Int_t nlines2 = 0;
while(1)
{
ncols_geant4 = fscanf(fg2, "%f %f", &x, &y);
if (ncols_geant4<0) break;
x2[nlines2] = x;
y2[nlines2] = y;
nlines2++;
}
fclose(fg2);
TGraph *gr1 = new TGraph (nlines1, x1, y1);
TGraph *gr2 = new TGraph (nlines2, x2, y2);
TCanvas *c1 = new TCanvas("c1", "Graph Draw Options", 200, 10, 600, 400);
gPad->SetLogy();
// Draw the graph with axis, continuous line, and put a '*' at each point
gr1->SetTitle("Dose rate distribution");
gr1->GetXaxis()->SetTitle("Distance from the centre (cm)");
gr1->GetYaxis()->SetTitle("Normalised dose rate distribution");
gr1->SetLineWidth(1);
gr1->SetMarkerColor(1);
gr1->SetMarkerStyle(20);
gr1->Draw("AP");
gr2->SetLineWidth(1);
gr2->SetMarkerColor(2);
gr2->SetMarkerStyle(21);
gr2->SetMarkerSize(0.5);
gr2->SetLineColor(2);
gr2->Draw("CP");
TLegend *leg = new TLegend(0.3, 0.5, 0.6, 0.8);
leg->SetFillColor(0);
leg->AddEntry(gr1, "Reference data", "lp");
leg->AddEntry(gr2, "Geant4 - 20B Events", "lp");
leg->Draw();
}
@@ -0,0 +1,258 @@
{
// Read reference data in dolan.txt
FILE * fg1=fopen("dolan.txt", "r");
Int_t n_points_dolan = 8;
Float_t x1[n_points_dolan], y1[n_points_dolan];
Float_t x, y;
Int_t ncols_dolan;
Int_t nlines1 = 0;
while(1)
{
ncols_dolan = fscanf(fg1, "%f %f", &x, &y);
if (ncols_dolan<0) break;
x1[nlines1]= x;
y1[nlines1] = y;
nlines1++;
}
fclose(fg1);
FILE *fg2=fopen("geant4_dose_Oncura_livermore.txt", "r");
Int_t n_points_geant4 = 398;
Float_t x2[n_points_geant4], y2[n_points_geant4], ratio_liv[n_points_dolan];
Int_t ncols_geant4;
Int_t nlines2 = 0;
while(1)
{
ncols_geant4 = fscanf(fg2, "%f %f", &x, &y);
if (ncols_geant4<0) break;
x2[nlines2] = x;
y2[nlines2] = y;
for (int i=0; i<n_points_dolan; i++)
{
if (x1[i]==x2[nlines2])
{
ratio_liv[i]= y2[nlines2]/y1[i];
// std::cout << "dolan: " << x1[i] << "," << y1[i]
// << ", livermore: "<< x2[nlines2] << "," << y2[nlines2]
// << " ratio:" << ratio_liv[i] << std::endl;
}
}
nlines2++;
}
fclose(fg2);
FILE *fg3=fopen("geant4_dose_Oncura_penelope.txt", "r");
Float_t x3[n_points_geant4], y3[n_points_geant4], ratio_pen[n_points_dolan];
Int_t ncols_geant4_penelope;
Int_t nlines3 =0;
while(1)
{
ncols_geant4_penelope = fscanf(fg3,"%f %f",&x, &y);
if (ncols_geant4_penelope<0) break;
// std::cout << "x " << x << std::endl;
x3[nlines3]=x;
y3[nlines3]=y;
for (int i=0; i<n_points_dolan; i++)
{
if (x1[i]==x3[nlines3])
{
ratio_pen[i]= y3[nlines3]/y1[i];
// std::cout << "dolan: " << x1[i] << "," << y1[i]
// << ", penelope: "<< x3[nlines3] << "," << y3[nlines3]
// << " ratio:" << ratio_pen[i] << std::endl;
}
}
nlines3++;
}
fclose(fg3);
FILE *fg4=fopen("geant4_dose_Oncura_opt0.txt", "r");
Float_t x4[n_points_geant4], y4[n_points_geant4], ratio_opt0[n_points_dolan];
Int_t ncols_geant4_opt0;
Int_t nlines4 =0;
while(1)
{
ncols_geant4_opt0 = fscanf(fg4,"%f %f",&x, &y);
if (ncols_geant4_opt0<0) break;
// std::cout << "x " << x << std::endl;
x4[nlines4]=x;
y4[nlines4]=y;
for (int i=0; i<n_points_dolan; i++)
{
if (x1[i]==x4[nlines4])
{
ratio_opt0[i]= y4[nlines4]/y1[i];
// std::cout << "dolan: " << x1[i] << "," << y1[i]
// << ", opt0: "<< x4[nlines4] << "," << y4[nlines4]
// << " ratio:" << ratio_opt0[i] << std::endl;
}
}
nlines4++;
}
fclose(fg4);
FILE *fg5=fopen("geant4_dose_Oncura_opt3.txt", "r");
Float_t x5[n_points_geant4], y5[n_points_geant4], ratio_opt3[n_points_dolan];
Int_t ncols_geant4_opt3;
Int_t nlines5 =0;
while(1)
{
ncols_geant4_opt3 = fscanf(fg5,"%f %f",&x, &y);
if (ncols_geant4_opt3<0) break;
// std::cout << "x " << x << std::endl;
x5[nlines5]=x;
y5[nlines5]=y;
for (int i=0; i<n_points_dolan; i++)
{
if (x1[i]==x5[nlines5])
{
ratio_opt3[i]= y5[nlines5]/y1[i];
std::cout << "dolan: " << x1[i] << "," << y1[i]
<< ", opt3: "<< x5[nlines5] << "," << y5[nlines5]
<< " ratio:" << ratio_opt3[i] << std::endl;
}
}
nlines5++;
}
fclose(fg5);
FILE *fg6=fopen("geant4_dose_Oncura_opt4.txt", "r");
Float_t x6[n_points_geant4], y6[n_points_geant4], ratio_opt4[n_points_dolan];
Int_t ncols_geant4_opt4;
Int_t nlines6 =0;
while(1)
{
ncols_geant4_opt4 = fscanf(fg6,"%f %f",&x, &y);
if (ncols_geant4_opt4<0) break;
// std::cout << "x " << x << std::endl;
x6[nlines6]=x;
y6[nlines6]=y;
for (int i=0; i<n_points_dolan; i++)
{
if (x1[i]==x6[nlines6])
{
ratio_opt4[i]= y6[nlines6]/y1[i];
// std::cout << "dolan: " << x1[i] << "," << y1[i]
// << ", opt4: "<< x6[nlines6] << "," << y6[nlines6]
// << " ratio:" << ratio_opt4[i] << std::endl;
}
}
nlines6++;
}
fclose(fg6);
TGraph *gr1 = new TGraph (nlines1, x1, y1);
TGraph *gr2 = new TGraph (nlines2, x2, y2);
TGraph *gr3 = new TGraph (nlines3, x3, y3);
TGraph *gr4 = new TGraph (nlines4, x4, y4);
TGraph *gr5 = new TGraph (nlines5, x5, y5);
TGraph *gr6 = new TGraph (nlines6, x6, y6);
std::cout<< "Livermore" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
std::cout << x1[j] << ", " << ratio_liv[j] << std::endl;
}
std::cout<< "penelope" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
std::cout << x1[j] << ", " << ratio_pen[j] << std::endl;
}
std::cout<< "opt0" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
std::cout << x1[j] << ", " << ratio_opt0[j] << std::endl;
}
std::cout<< "opt3" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
std::cout << x1[j] << ", " << ratio_opt3[j] << std::endl;
}
std::cout<< "opt4" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
std::cout << x1[j] << ", " << ratio_opt4[j] << std::endl;
}
TCanvas *c1 = new TCanvas("c1", "Graph Draw Options", 200, 10, 600, 400);
gPad->SetLogy();
// Draw the graph with axis, continuous line, and put a '*' at each point
gr1->SetTitle("Dose rate distribution");
gr1->GetXaxis()->SetTitle("Distance from the centre (cm)");
gr1->GetYaxis()->SetTitle("Normalised dose rate distribution");
gr1->SetLineWidth(1);
gr1->SetMarkerColor(1);
gr1->SetMarkerStyle(20);
gr1->Draw("AP");
gr2->SetLineWidth(1);
gr2->SetMarkerColor(2);
gr2->SetMarkerStyle(21);
gr2->SetMarkerSize(0.5);
gr2->SetLineColor(2);
gr2->Draw("CP");
gr3->SetLineWidth(0.3);
gr3->SetMarkerColor(3);
gr3->SetMarkerStyle(21);
gr3->SetMarkerSize(0.2);
gr3->SetLineColor(3);
gr3->Draw("CP");
gr4->SetLineWidth(0.3);
gr4->SetMarkerColor(4);
gr4->SetMarkerStyle(21);
gr4->SetMarkerSize(0.2);
gr4->SetLineColor(4);
gr4->Draw("CP");
gr5->SetLineWidth(0.3);
gr5->SetMarkerColor(6);
gr5->SetMarkerStyle(21);
gr5->SetMarkerSize(0.2);
gr5->SetLineColor(6);
gr5->Draw("CP");
gr6->SetLineWidth(0.3);
gr6->SetMarkerColor(8);
gr6->SetMarkerStyle(21);
gr6->SetMarkerSize(0.2);
gr6->SetLineColor(8);
gr6->Draw("CP");
TLegend *leg = new TLegend(0.3, 0.5, 0.6, 0.8);
leg->SetFillColor(0);
leg->AddEntry(gr1, "Reference data", "lp");
leg->AddEntry(gr2, "Geant4 - Oncura - Livermore", "lp");
leg->AddEntry(gr3, "Geant4 - Penelope", "lp");
leg->AddEntry(gr4, "Geant4 - Standard opt0", "lp");
leg->AddEntry(gr5, "Geant4 - Standard opt3", "lp");
leg->AddEntry(gr6, "Geant4 - Standard opt4", "lp");
leg->Draw();
}
@@ -0,0 +1,315 @@
{
// Read reference data in granero.txt
FILE *fg1=fopen("granero.txt", "r");
Int_t n_points_granero =13;
Float_t x1[n_points_granero], y1[n_points_granero], ratio_liv[n_points_granero];
Float_t x, y;
Int_t ncols_granero;
Int_t nlines1 =0;
while(1)
{
ncols_granero = fscanf(fg1,"%f %f",&x, &y);
if (ncols_granero<0) break;
// std::cout << "x " << x << std::endl;
x1[nlines1]=x;
y1[nlines1]=y;
nlines1++;
}
fclose(fg1);
// Read the results of the brachytherapy advanced example
// FlexiSorceMacro.mac - livermore
FILE *fg2=fopen("geant4_dose_Flexi_livermore.txt", "r");
Int_t n_points_geant4 =398;
Float_t x2[n_points_geant4], y2[n_points_geant4];
Int_t ncols_geant4_liv;
Int_t nlines2 =0;
while(1)
{
ncols_geant4_liv = fscanf(fg2,"%f %f",&x, &y);
if (ncols_geant4_liv<0) break;
// std::cout << "x " << x << std::endl;
x2[nlines2]=x;
y2[nlines2]=y;
for (int i=0; i<n_points_granero; i++)
{
if (x1[i]==x2[nlines2])
{
ratio_liv[i]= y2[nlines2]/y1[i];
// std::cout << "granero: " << x1[i] << "," << y1[i]
// << ", livermore: "<< x2[nlines2] << "," << y2[nlines2]
// << " ratio:" << ratio_liv[i] << std::endl;
}
}
nlines2++;
}
fclose(fg2);
// Read the results of the brachytherapy advanced example
// penelope
FILE *fg3=fopen("geant4_dose_Flexi_penelope.txt", "r");
Float_t x3[n_points_geant4], y3[n_points_geant4], ratio_pen[n_points_granero];
Int_t ncols_geant4_penelope;
Int_t nlines3 =0;
while(1)
{
ncols_geant4_penelope = fscanf(fg3,"%f %f",&x, &y);
if (ncols_geant4_penelope<0) break;
// std::cout << "x " << x << std::endl;
x3[nlines3]=x;
y3[nlines3]=y;
for (int i=0; i<n_points_granero; i++)
{
if (x1[i]==x3[nlines3])
{
ratio_pen[i]= y3[nlines3]/y1[i];
// std::cout << "granero: " << x1[i] << "," << y1[i]
// << ", penelope: "<< x3[nlines3] << "," << y3[nlines3]
// << " ratio:" << ratio_pen[i] << std::endl;
}
}
nlines3++;
}
fclose(fg3);
// FlexiSorceMacro.mac - opt 0
FILE *fg4=fopen("geant4_dose_Flexi_opt0.txt", "r");
Float_t x4[n_points_geant4], y4[n_points_geant4], ratio_opt0[n_points_granero];
Int_t ncols_geant4_opt0;
Int_t nlines4 =0;
while(1)
{
ncols_geant4_opt0 = fscanf(fg4,"%f %f",&x, &y);
if (ncols_geant4_opt0<0) break;
// std::cout << "x " << x << std::endl;
x4[nlines4]=x;
y4[nlines4]=y;
for (int i=0; i<n_points_granero; i++)
{
if (x1[i]==x4[nlines4])
{
ratio_opt0[i]= y4[nlines4]/y1[i];
// std::cout << "granero: " << x1[i] << "," << y1[i]
// << ", opt0: "<< x4[nlines4] << "," << y4[nlines4]
// << " ratio:" << ratio_opt0[i] << std::endl;
}
}
nlines4++;
}
fclose(fg4);
// FlexiSorceMacro.mac - opt 3
FILE *fg5=fopen("geant4_dose_Flexi_opt3.txt", "r");
Float_t x5[n_points_geant4], y5[n_points_geant4], ratio_opt3[n_points_granero];
Int_t ncols_geant4_opt3;
Int_t nlines5 =0;
while(1)
{
ncols_geant4_opt3 = fscanf(fg5,"%f %f",&x, &y);
if (ncols_geant4_opt3<0) break;
// std::cout << "x " << x << std::endl;
x5[nlines5]=x;
y5[nlines5]=y;
for (int i=0; i<n_points_granero; i++)
{
if (x1[i]==x5[nlines5])
{
ratio_opt3[i]= y5[nlines5]/y1[i];
/* std::cout << "granero: " << x1[i] << "," << y1[i]
<< ", opt3: "<< x5[nlines5] << "," << y5[nlines5]
<< " ratio:" << ratio_opt3[i] << std::endl;*/
}
}
nlines5++;
}
fclose(fg5);
// FlexiSorceMacro.mac - opt 4
FILE *fg6=fopen("geant4_dose_Flexi_opt4.txt", "r");
Float_t x6[n_points_geant4], y6[n_points_geant4], ratio_opt4[n_points_granero];
Int_t ncols_geant4_opt4;
Int_t nlines6 =0;
while(1)
{
ncols_geant4_opt4 = fscanf(fg6,"%f %f",&x, &y);
if (ncols_geant4_opt4<0) break;
// std::cout << "x " << x << std::endl;
x6[nlines6]=x;
y6[nlines6]=y;
for (int i=0; i<n_points_granero; i++)
{
if (x1[i]==x6[nlines6])
{
ratio_opt4[i]= y6[nlines6]/y1[i];
/* std::cout << "granero: " << x1[i] << "," << y1[i]
<< ", opt4: "<< x6[nlines6] << "," << y6[nlines6]
<< " ratio:" << ratio_opt4[i] << std::endl;*/
}
}
nlines6++;
}
fclose(fg6);
TGraph *gr1 = new TGraph (nlines1, x1, y1);
TGraph *gr2 = new TGraph (nlines2, x2, y2);
TGraph *gr3 = new TGraph (nlines3, x3, y3);
TGraph *gr4 = new TGraph (nlines4, x4, y4);
TGraph *gr5 = new TGraph (nlines5, x5, y5);
TGraph *gr6 = new TGraph (nlines6, x6, y6);
std::cout<< "Livermore" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
if ((ratio_liv[j] > 1.03) || (ratio_liv[j] < 0.97)) std::cout<< "Difference above 3% :"<< x1[j] << ", " << ratio_liv[j] << std::endl;
}
std::cout<< "penelope" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
if ((ratio_pen[j] > 1.03) || (ratio_pen[j] < 0.97)) std::cout<< "Difference above 3% :" << x1[j] << ", " << ratio_pen[j] << std::endl;
}
std::cout<< "opt0" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
if ((ratio_opt0[j] > 1.03) || (ratio_opt0[j] < 0.97)) std::cout<< "Difference above 3% :" << x1[j] << ", " << ratio_opt0[j] << std::endl;
}
std::cout<< "opt3" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
if ((ratio_opt3[j] > 1.03) || (ratio_opt3[j] < 0.97)) std::cout<< "Difference above 3% :" << x1[j] << ", " << ratio_opt3[j] << std::endl;
}
std::cout<< "opt4" << std::endl;
for (Int_t j=0; j < nlines1; j++)
{
if ((ratio_opt4[j] > 1.03) || (ratio_opt4[j] < 0.97)) std::cout<< "Difference above 3% :" << x1[j] << ", " << ratio_opt4[j] << std::endl;
}
TGraph *gr1_ratio = new TGraph (nlines1, x1, ratio_liv);
TGraph *gr2_ratio = new TGraph (nlines1, x1, ratio_pen);
TGraph *gr3_ratio = new TGraph (nlines1, x1, ratio_opt0);
TGraph *gr4_ratio = new TGraph (nlines1, x1, ratio_opt3);
TGraph *gr5_ratio = new TGraph (nlines1, x1, ratio_opt4);
// draw the graph with axis, continuous line, and put
// a * at each point
gr1->SetTitle("Dose rate distribution");
gr1-> GetXaxis()->SetTitle("Distance from the centre (cm)");
gr1->GetYaxis()->SetTitle("Normalised dose rate distribution");
gr1->SetLineWidth(1);
gr1->SetMarkerColor(1);
gr1->SetMarkerStyle(20);
gr1->Draw("AP");
gr2->SetLineWidth(0.3);
gr2->SetMarkerColor(2);
gr2->SetMarkerStyle(21);
gr2->SetMarkerSize(0.2);
gr2->SetLineColor(2);
gr2->Draw("CP");
gr3->SetLineWidth(0.3);
gr3->SetMarkerColor(3);
gr3->SetMarkerStyle(21);
gr3->SetMarkerSize(0.2);
gr3->SetLineColor(3);
gr3->Draw("CP");
gr4->SetLineWidth(0.3);
gr4->SetMarkerColor(4);
gr4->SetMarkerStyle(21);
gr4->SetMarkerSize(0.2);
gr4->SetLineColor(4);
gr4->Draw("CP");
gr5->SetLineWidth(0.3);
gr5->SetMarkerColor(6);
gr5->SetMarkerStyle(21);
gr5->SetMarkerSize(0.2);
gr5->SetLineColor(6);
gr5->Draw("CP");
gr6->SetLineWidth(0.3);
gr6->SetMarkerColor(9);
gr6->SetMarkerStyle(21);
gr6->SetMarkerSize(0.2);
gr6->SetLineColor(9);
gr6->Draw("CP");
TLegend *leg = new TLegend(0.3, 0.5, 0.6, 0.8);
leg->SetFillColor(0);
leg->AddEntry(gr1, "Reference data", "lp");
leg->AddEntry(gr2, "Geant4 - Livermore", "lp");
leg->AddEntry(gr3, "Geant4 - Penelope", "lp");
leg->AddEntry(gr4, "Geant4 - opt0", "lp");
leg->AddEntry(gr5, "Geant4 - opt3", "lp");
leg->AddEntry(gr6, "Geant4 - opt4", "lp");
leg->Draw();
c1 -> Print("Flexi_dose_rate_distribution.jpg");
// ratio plot
gr1_ratio->SetTitle("Dose rate distribution - RATIO");
gr1_ratio-> GetXaxis()->SetTitle("Distance from the centre (cm)");
gr1_ratio->GetYaxis()->SetTitle("Ratio");
gr1_ratio->SetLineWidth(1);
gr2_ratio->SetMarkerSize(0.8);
gr1_ratio->SetMarkerColor(1);
gr1_ratio->SetMarkerStyle(20);
gr1_ratio->Draw("AP");
gr2_ratio->SetLineWidth(0.3);
gr2_ratio->SetMarkerColor(2);
gr2_ratio->SetMarkerStyle(20);
gr2_ratio->SetMarkerSize(0.8);
gr2_ratio->SetLineColor(2);
gr2_ratio->Draw("P");
gr3_ratio->SetLineWidth(0.3);
gr3_ratio->SetMarkerColor(3);
gr3_ratio->SetMarkerStyle(20);
gr3_ratio->SetMarkerSize(0.8);
gr3_ratio->SetLineColor(3);
gr3_ratio->Draw("P");
gr4_ratio->SetLineWidth(0.3);
gr4_ratio->SetMarkerColor(4);
gr4_ratio->SetMarkerStyle(20);
gr4_ratio->SetMarkerSize(0.8);
gr4_ratio->SetLineColor(4);
gr4_ratio->Draw("P");
gr5_ratio->SetLineWidth(0.3);
gr5_ratio->SetMarkerColor(6);
gr5_ratio->SetMarkerStyle(21);
gr5_ratio->SetMarkerSize(1);
gr5_ratio->SetLineColor(6);
gr5_ratio->Draw("P");
TLegend *leg = new TLegend(0.3, 0.5, 0.6, 0.8);
leg->SetFillColor(0);
leg->AddEntry(gr1_ratio, "Geant4 - Livermore", "lp");
leg->AddEntry(gr2_ratio, "Geant4 - Penelope", "lp");
leg->AddEntry(gr3_ratio, "Geant4 - opt0", "lp");
leg->AddEntry(gr4_ratio, "Geant4 - opt3", "lp");
leg->AddEntry(gr5_ratio, "Geant4 - opt4", "lp");
leg->Draw();
c1 -> Print("Flexi_dose_rate_distribution_ratio.jpg");
}
@@ -0,0 +1,26 @@
void ReadASCII(TString source_file_ascii, TString output_file_root)
{
// This macro converts the results of the simulation stored in ASCII files to ROOT files.
ifstream in;
in.open(source_file_ascii);
Float_t x,y,z, edep;
Int_t nlines = 0;
TFile *f = new TFile(output_file_root,"RECREATE");
TH2F *h20 = new TH2F("h20","h20",801,-100.125,100.125, 801, -100.125, 100.125);
while (1) {
in >> x >> y >> z >> edep;
if (!in.good()) break;
// if (edep !=0.) printf("x=%8f, y=%8f, edep=%8f\n",x,y,edep);
h20->Fill(x,y,edep);
nlines++;
}
printf(" found %d points\n",nlines);
in.close();
f->Write();
}
@@ -0,0 +1,9 @@
0.25 16.22894
0.5 4.219884
1 1
1.5 0.403667
2 0.202228
3 0.069957
4 0.029868
5 0.014289
@@ -0,0 +1,398 @@
0.075 97.8831
0.1 64.8343
0.125 45.6426
0.15 35.0557
0.175 27.6371
0.2 22.333
0.225 17.9853
0.25 14.6579
0.275 12.4651
0.3 10.6469
0.325 9.27029
0.35 8.09888
0.375 7.11041
0.4 6.26272
0.425 5.54229
0.45 4.94365
0.475 4.48353
0.5 4.04224
0.525 3.66408
0.55 3.36217
0.575 3.06678
0.6 2.85364
0.625 2.59989
0.65 2.40406
0.675 2.25277
0.7 2.07523
0.725 1.93671
0.75 1.7985
0.775 1.68269
0.8 1.5862
0.825 1.47646
0.85 1.39997
0.875 1.30774
0.9 1.24337
0.925 1.1717
0.95 1.1104
0.975 1.05224
1 1
1.025 0.941169
1.05 0.895355
1.075 0.857264
1.1 0.816115
1.125 0.770715
1.15 0.742036
1.175 0.707683
1.2 0.673875
1.225 0.649353
1.25 0.621536
1.275 0.590711
1.3 0.566205
1.325 0.545477
1.35 0.524319
1.375 0.497073
1.4 0.483812
1.425 0.469173
1.45 0.450797
1.475 0.434489
1.5 0.413064
1.525 0.40331
1.55 0.392264
1.575 0.373361
1.6 0.357637
1.625 0.351233
1.65 0.338029
1.675 0.323434
1.7 0.314693
1.725 0.308325
1.75 0.290771
1.775 0.280906
1.8 0.275833
1.825 0.265431
1.85 0.259054
1.875 0.252458
1.9 0.239474
1.925 0.23515
1.95 0.227119
1.975 0.222233
2 0.214953
2.025 0.20833
2.05 0.200738
2.075 0.198124
2.1 0.188285
2.125 0.185153
2.15 0.180076
2.175 0.173461
2.2 0.171245
2.225 0.166202
2.25 0.161251
2.275 0.158729
2.3 0.152551
2.325 0.147518
2.35 0.1446
2.375 0.141888
2.4 0.137821
2.425 0.135113
2.45 0.128425
2.475 0.12624
2.5 0.123117
2.525 0.120522
2.55 0.120029
2.575 0.115891
2.6 0.113524
2.625 0.107605
2.65 0.106011
2.675 0.105758
2.7 0.102996
2.725 0.0989559
2.75 0.0968507
2.775 0.0920968
2.8 0.0921967
2.825 0.0916657
2.85 0.0892332
2.875 0.0881417
2.9 0.0845164
2.925 0.082311
2.95 0.0812722
2.975 0.0774972
3 0.0767664
3.025 0.0753449
3.05 0.0716005
3.075 0.0735166
3.1 0.0710071
3.125 0.0686763
3.15 0.0687
3.175 0.0675772
3.2 0.0651626
3.225 0.0639702
3.25 0.0601031
3.275 0.0601078
3.3 0.0609665
3.325 0.0582266
3.35 0.0566836
3.375 0.0569012
3.4 0.0558207
3.425 0.0547453
3.45 0.0529047
3.475 0.0531173
3.5 0.0502012
3.525 0.049896
3.55 0.0480687
3.575 0.048212
3.6 0.0472225
3.625 0.0456206
3.65 0.0455496
3.675 0.0446149
3.7 0.0422784
3.725 0.0415637
3.75 0.0416078
3.775 0.0399578
3.8 0.0398809
3.825 0.0388724
3.85 0.03804
3.875 0.0381476
3.9 0.0363184
3.925 0.0359256
3.95 0.0340751
3.975 0.0345144
4 0.0344696
4.025 0.0335737
4.05 0.0329867
4.075 0.0329369
4.1 0.0315704
4.125 0.031338
4.15 0.0298683
4.175 0.0315873
4.2 0.0288346
4.225 0.0280856
4.25 0.0283705
4.275 0.0271974
4.3 0.0279721
4.325 0.0258866
4.35 0.0267648
4.375 0.0257557
4.4 0.0254244
4.425 0.0247643
4.45 0.0253467
4.475 0.0249144
4.5 0.0240234
4.525 0.0230208
4.55 0.0227411
4.575 0.0224449
4.6 0.022391
4.625 0.0219134
4.65 0.0210113
4.675 0.0213152
4.7 0.0210675
4.725 0.0209145
4.75 0.0198179
4.775 0.0192276
4.8 0.0190355
4.825 0.0189633
4.85 0.0183362
4.875 0.0191545
4.9 0.0180313
4.925 0.0178014
4.95 0.0170582
4.975 0.0164874
5 0.016467
5.025 0.0161937
5.05 0.01677
5.075 0.0158697
5.1 0.0158773
5.125 0.0160007
5.15 0.0157589
5.175 0.0156237
5.2 0.0149023
5.225 0.0142349
5.25 0.0143854
5.275 0.0142064
5.3 0.0142025
5.325 0.0137559
5.35 0.0130526
5.375 0.0130022
5.4 0.0130055
5.425 0.0125513
5.45 0.0127281
5.475 0.0126238
5.5 0.0126627
5.525 0.0118488
5.55 0.0114788
5.575 0.0117876
5.6 0.0111262
5.625 0.0118155
5.65 0.0111284
5.675 0.0111473
5.7 0.0103334
5.725 0.011123
5.75 0.0105247
5.775 0.0100163
5.8 0.0101033
5.825 0.00966312
5.85 0.00969339
5.875 0.00972281
5.9 0.0093975
5.925 0.00915147
5.95 0.00928708
5.975 0.00927625
6 0.00909425
6.025 0.00900216
6.05 0.00850987
6.075 0.00853985
6.1 0.00790768
6.125 0.00796157
6.15 0.00765651
6.175 0.00794464
6.2 0.00770637
6.225 0.00790731
6.25 0.00762979
6.275 0.00771008
6.3 0.00726219
6.325 0.00738032
6.35 0.00736721
6.375 0.00715063
6.4 0.00683751
6.425 0.00666425
6.45 0.00659973
6.475 0.00688233
6.5 0.00617861
6.525 0.00689568
6.55 0.00623387
6.575 0.00626105
6.6 0.00611682
6.625 0.00624718
6.65 0.00568721
6.675 0.00605136
6.7 0.00606899
6.725 0.00576317
6.75 0.00557372
6.775 0.00543931
6.8 0.00528529
6.825 0.00524691
6.85 0.00544699
6.875 0.00549379
6.9 0.0055007
6.925 0.00478698
6.95 0.00463922
6.975 0.00495719
7 0.00506129
7.025 0.00494812
7.05 0.00478794
7.075 0.00459179
7.1 0.0044824
7.125 0.00457714
7.15 0.00468149
7.175 0.0045146
7.2 0.00442745
7.225 0.00431013
7.25 0.00434222
7.275 0.00427403
7.3 0.0039537
7.325 0.00407066
7.35 0.00395438
7.375 0.00400279
7.4 0.0037411
7.425 0.00379792
7.45 0.00380062
7.475 0.00361323
7.5 0.00376226
7.525 0.00357729
7.55 0.00364535
7.575 0.00333614
7.6 0.00367617
7.625 0.00356046
7.65 0.0034105
7.675 0.00344064
7.7 0.00338426
7.725 0.00338961
7.75 0.00311852
7.775 0.00324699
7.8 0.00321997
7.825 0.00290712
7.85 0.00314188
7.875 0.00297011
7.9 0.0030052
7.925 0.00295912
7.95 0.00297089
7.975 0.00307473
8 0.00291783
8.025 0.00257723
8.05 0.00290136
8.075 0.0027446
8.1 0.00262246
8.125 0.00258447
8.15 0.00256551
8.175 0.00255361
8.2 0.00270513
8.225 0.00247792
8.25 0.00245789
8.275 0.00248513
8.3 0.00241545
8.325 0.00228783
8.35 0.00220653
8.375 0.00214931
8.4 0.00240072
8.425 0.00218172
8.45 0.00221083
8.475 0.00204897
8.5 0.00210066
8.525 0.00199627
8.55 0.00214793
8.575 0.00202793
8.6 0.001794
8.625 0.0019668
8.65 0.00194913
8.675 0.00177753
8.7 0.00183504
8.725 0.00191314
8.75 0.00180285
8.775 0.00185224
8.8 0.00188381
8.825 0.00184675
8.85 0.00168307
8.875 0.00178999
8.9 0.00174933
8.925 0.00175088
8.95 0.00152059
8.975 0.00161852
9 0.00153061
9.025 0.00162707
9.05 0.00162693
9.075 0.00152702
9.1 0.00156223
9.125 0.00149584
9.15 0.00158281
9.175 0.00146927
9.2 0.0014502
9.225 0.00159982
9.25 0.00144068
9.275 0.00144619
9.3 0.00137039
9.325 0.00150438
9.35 0.00128109
9.375 0.00130612
9.4 0.00128726
9.425 0.00129481
9.45 0.00122142
9.475 0.00135272
9.5 0.00117283
9.525 0.00117074
9.55 0.00127442
9.575 0.00140039
9.6 0.00121678
9.625 0.00132427
9.65 0.00113775
9.675 0.00109736
9.7 0.00103224
9.725 0.00111672
9.75 0.00120731
9.775 0.00112413
9.8 0.00108195
9.825 0.00113868
9.85 0.00100492
9.875 0.00108758
9.9 0.000896458
9.925 0.000835999
9.95 0.000990956
9.975 0.0011341
10 0.000895694
@@ -30,6 +30,7 @@
// ****************************************
// This class manages the geometry of the simulation experimental set-up
//
// S. Guatelli, A. Le
#ifndef BrachyDetectorConstruction_H
#define BrachyDetectorConstruction_H 1
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyDetectorConstructionI.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
// ****************************************
// * *
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyDetectorConstructionLeipzig.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
//
// ************************************************
@@ -0,0 +1,96 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Code developed by:
// S.Guatelli, D. Cutajar, A. Le
//
//
// *******************************************
// * *
// * BrachyDetectorConstructionOncura6711.hh *
// * *
// ********************************************
//
// Management of the iodine source
//
#ifndef BrachyDetectorConstruction6711_H
#define BrachyDetectorConstruction6711_H 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
class G4LogicalVolume;
class G4Tubs;
class G4Box;
class G4Sphere;
class G4VPhysicalVolume;
class BrachyMaterial;
class G4VisAttributes;
class BrachyDetectorConstructionOncura6711
{
public:
BrachyDetectorConstructionOncura6711();
~BrachyDetectorConstructionOncura6711();
void ConstructOncura6711(G4VPhysicalVolume*);
// Model the Oncura 6711 reference source
void CleanOncura6711();
// Destroy the Oncura6711 reference source in the experimental set-up
private:
G4Tubs* OncuraCapsule ;
G4LogicalVolume* OncuraCapsuleLog;
G4VPhysicalVolume* OncuraCapsulePhys;
G4Sphere* OncuraCapsuleTip1;
G4LogicalVolume* OncuraCapsuleTip1Log;
G4VPhysicalVolume* OncuraCapsuleTip1Phys;
G4Sphere* OncuraCapsuleTip2;
G4LogicalVolume* OncuraCapsuleTip2Log;
G4VPhysicalVolume* OncuraCapsuleTip2Phys;
G4Tubs* OncuraAirGap;
G4LogicalVolume* OncuraAirGapLog;
G4VPhysicalVolume* OncuraAirGapPhys;
G4Tubs* OncuraSilverCore;
G4LogicalVolume* OncuraSilverCoreLog;
G4VPhysicalVolume* OncuraSilverCorePhys;
BrachyMaterial* pMat;
G4VisAttributes* OncuraCapsuleShellVisAtt;
G4VisAttributes* OncuraCapsuleTipVisAtt;
G4VisAttributes* OncuraSilverCoreVisAtt;
};
#endif
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyDetectorConstructionIr.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
// ****************************************
// * *
@@ -30,7 +30,6 @@
// * *
// *****************************************
//
// $Id: BrachyDetectorMessenger.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
//
#ifndef BrachyDetectorMessenger_h
@@ -23,9 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Code developed by: Susanna Guatelli
// Code developed by: Susanna Guatelli, Albert Le
//
// $Id: BrachyFactory.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
// **********************************
// * *
@@ -34,7 +34,6 @@
// S.Guatelli
//
//
// $Id: BrachyFactoryI.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyFactoryLeipzig.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
// **********************************
// * *
@@ -0,0 +1,61 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// **********************************
// * *
// * BrachyFactoryOncura6711.hh *
// * *
// **********************************
//
// Author: D. Cutajar, A. Le
//
#ifndef BrachyFactoryOncura6711_h
#define BrachyFactoryOncura6711_h 1
#include "BrachyFactory.hh"
#include "G4RunManager.hh"
class G4ParticleGun;
class G4Run;
class G4Event;
class BrachyFactory;
class BrachyDetectorConstructionOncura6711;
// This class manages the creation of iodine source
// brachytherapy ...
class BrachyFactoryOncura6711 : public BrachyFactory
{
public:
BrachyFactoryOncura6711();
~BrachyFactoryOncura6711();
void CreateSource(G4VPhysicalVolume*);
void CleanSource();
private:
BrachyDetectorConstructionOncura6711* Oncura6711IodineSource;
};
#endif
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyFactoryIr.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
// **********************************
// * *
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyMaterial.hh 100821 2016-11-02 15:21:34Z gcosmo $
//
// **********************************
// * *
@@ -32,7 +31,7 @@
// * *
// **********************************
//
//Code developed by: Susanna Guatelli
//Code developed by: Susanna Guatelli, Albert Le
//
// This class manages the elements and materials
//
@@ -69,5 +68,6 @@ private:
G4Material*Vacuum;
G4Material* bone;
G4Material* muscle;
G4Material* matAg;
};
#endif
@@ -38,6 +38,8 @@ Author: Susanna Guatelli
#include "G4EmConfigurator.hh"
#include "globals.hh"
class BrachyPhysicsListMessenger;
// Modular physics used in this application
class BrachyPhysicsList: public G4VModularPhysicsList
{
@@ -45,15 +47,17 @@ public:
BrachyPhysicsList();
~BrachyPhysicsList();
void ConstructParticle();
// void AddPhysicsList(const G4String& name);
void AddPhysicsList(const G4String& name);
void ConstructProcess();
protected:
void SetCuts();
private:
G4VPhysicsConstructor* emPhysicsList;
G4VPhysicsConstructor* decPhysicsList;
G4VPhysicsConstructor* radDecayPhysicsList;
G4VPhysicsConstructor* fEmPhysicsList;
G4VPhysicsConstructor* fDecPhysicsList;
G4VPhysicsConstructor* fRadDecayPhysicsList;
BrachyPhysicsListMessenger* fMessenger;
G4String fEmName;
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef BrachyPhysicsListMessenger_h
#define BrachyPhysicsListMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class BrachyPhysicsList;
class G4UIdirectory;
class G4UIcmdWithAString;
class BrachyPhysicsListMessenger: public G4UImessenger
{
public:
BrachyPhysicsListMessenger(BrachyPhysicsList* );
~BrachyPhysicsListMessenger();
virtual
void SetNewValue(G4UIcommand*, G4String);
private:
BrachyPhysicsList* fPhysicsList;
G4UIdirectory* fPhysDir;
G4UIcmdWithAString* fListCmd;
};
#endif
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyPrimaryGeneratorAction.hh 84280 2014-10-13 07:21:10Z gcosmo $
//
// ********************************************
// * *
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: BrachyRunAction.hh 69765 2013-05-14 10:11:22Z gcosmo $
//
//
//
@@ -24,7 +24,6 @@
// ********************************************************************
//
// -------------------------------------------------------------------
// $Id: SteppingAction.hh,v 1.2 2010/10/06 14:39:41 sincerti Exp $
// -------------------------------------------------------------------
// Code by Susanna Guatelli
//
@@ -30,10 +30,7 @@ Author: Susanna Guatelli
// The analysis was included in this application following the extended Geant4
// example analysis/AnaEx01
#include <stdlib.h>
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
#include "G4UnitsTable.hh"
BrachyAnalysisManager* BrachyAnalysisManager::instance = 0;
@@ -98,15 +95,3 @@ void BrachyAnalysisManager::save()
}
#endif
}
@@ -27,7 +27,7 @@
// GEANT 4 - Brachytherapy example
// --------------------------------------------------------------
//
// Code developed by:S. Guatelli, D. Cutajar
// Code developed by: S. Guatelli, D. Cutajar, A. Le
// Past developers: S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano
//
//
@@ -57,6 +57,7 @@
#include "BrachyFactoryTG186.hh"
#include "BrachyFactoryI.hh"
#include "BrachyFactoryFlexi.hh"
#include "BrachyFactoryOncura6711.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
@@ -129,6 +130,9 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
case 4:
factory = new BrachyFactoryFlexi();
break;
case 5:
factory = new BrachyFactoryOncura6711();
break;
default:
factory = new BrachyFactoryFlexi();
break;
@@ -144,16 +148,29 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
void BrachyDetectorConstruction::SelectBrachytherapicSeed(G4String val)
{
if (val == "Iodine") detectorChoice = 1;
else{
if(val=="Leipzig") detectorChoice = 2;
else{
if(val=="TG186") detectorChoice = 3;
else{
if(val=="Flexi") detectorChoice = 4;
else G4cout << val << "is not available!!!!" <<G4endl;
}
}
if (val == "Iodine")
detectorChoice = 1;
else
{
if(val=="Leipzig")
detectorChoice = 2;
else
{
if(val=="TG186")
detectorChoice = 3;
else
{
if(val=="Flexi")
detectorChoice = 4;
else
{
if(val=="Oncura")
detectorChoice = 5;
else
G4cout << val << "is not available!!!!" << G4endl;
}
}
}
}
G4cout << "Now the source is " << val << G4endl;
}
@@ -36,7 +36,6 @@
// * *
// ****************************************
//
// $Id: BrachyDetectorConstructionI.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
@@ -38,7 +38,6 @@
// *******************************************
//
//
// $Id: BrachyDetectorConstructionLeipzig.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
// Code by S. Guatelli
//
@@ -0,0 +1,205 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// --------------------------------------------------------------
// GEANT 4 - Brachytherapy example
// --------------------------------------------------------------
//
// Code developed by:
// D. Cutajar, A. Le
//
// ********************************************
// * *
// * BrachyDetectorConstructionOncura6711.cc *
// * *
// ********************************************
//
//
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionOncura6711.hh"
#include "G4Sphere.hh"
#include "G4RunManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
BrachyDetectorConstructionOncura6711::BrachyDetectorConstructionOncura6711()
:
OncuraCapsule(0),OncuraCapsuleLog(0),
OncuraCapsulePhys(0),
OncuraCapsuleTip1(0),OncuraCapsuleTip1Log(0),
OncuraCapsuleTip1Phys(0),
OncuraCapsuleTip2(0),OncuraCapsuleTip2Log(0),
OncuraCapsuleTip2Phys(0),
OncuraAirGap(0),OncuraAirGapLog(0),
OncuraAirGapPhys(0),
OncuraSilverCore(0), OncuraSilverCoreLog(0),
OncuraSilverCorePhys(0),
OncuraCapsuleShellVisAtt(0),OncuraCapsuleTipVisAtt(0),
OncuraSilverCoreVisAtt(0)
{
pMat = new BrachyMaterial();
}
BrachyDetectorConstructionOncura6711::~BrachyDetectorConstructionOncura6711()
{
delete pMat;
}
void BrachyDetectorConstructionOncura6711::ConstructOncura6711(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Material* titaniumMat = pMat -> GetMat("titanium");
G4Material* airMat = pMat -> GetMat("Air");
G4Material* silverMat = pMat -> GetMat("Silver");
//Capsule shell
OncuraCapsule = new G4Tubs("OncuraCapsule",0,0.4*mm,1.875*mm,0.*deg,360.*deg);
OncuraCapsuleLog = new G4LogicalVolume(OncuraCapsule,titaniumMat,"OncuraCapsuleLog", 0,0,0);
OncuraCapsulePhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraCapsulePhys", OncuraCapsuleLog,
mother, false,
0, true);
//Capsule tips
OncuraCapsuleTip1 = new G4Sphere("OncuraCapsuleTip1", 0, 0.4*mm, 0., 360*deg, 0., 90*deg);
OncuraCapsuleTip1Log = new G4LogicalVolume(OncuraCapsuleTip1, titaniumMat, "OncuraCapsuleTip1Log",0,0,0);
OncuraCapsuleTip1Phys = new G4PVPlacement(0, G4ThreeVector(0,0,1.875*mm),
"OncuraCapsuleTip1Phys", OncuraCapsuleTip1Log,
mother, false,
0, true);
OncuraCapsuleTip2 = new G4Sphere("OncuraCapsuleTip2", 0, 0.4*mm, 0., 360*deg, 90*deg, 90*deg);
OncuraCapsuleTip2Log = new G4LogicalVolume(OncuraCapsuleTip2, titaniumMat, "OncuraCapsuleTip2Log",0,0,0);
OncuraCapsuleTip2Phys = new G4PVPlacement(0, G4ThreeVector(0,0,-1.875*mm),
"OncuraCapsuleTip2Phys", OncuraCapsuleTip2Log,
mother, false,
0, true);
//Airgap
OncuraAirGap = new G4Tubs("OncuraAirGap",0,0.33*mm,1.825*mm,0.*deg,360.*deg);
OncuraAirGapLog = new G4LogicalVolume(OncuraAirGap, airMat, "OncuraAirGapLog");
OncuraAirGapPhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraAirGapPhys", OncuraAirGapLog,
OncuraCapsulePhys, false,
0, true);
//Silver core
OncuraSilverCore = new G4Tubs("OncuraSilverCore",0,0.25*mm,1.4*mm,0.*deg,360.*deg);
OncuraSilverCoreLog = new G4LogicalVolume(OncuraSilverCore, silverMat, "silverCoreLog");
OncuraSilverCorePhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraSilverCorePhys", OncuraSilverCoreLog,
OncuraAirGapPhys, false,
0, true);
OncuraCapsuleShellVisAtt = new G4VisAttributes(red);
OncuraCapsuleShellVisAtt -> SetVisibility(true);
OncuraCapsuleShellVisAtt -> SetForceWireframe(true);
OncuraCapsuleLog -> SetVisAttributes(OncuraCapsuleShellVisAtt);
OncuraCapsuleTipVisAtt = new G4VisAttributes(red);
OncuraCapsuleTipVisAtt -> SetVisibility(true);
OncuraCapsuleTipVisAtt -> SetForceSolid(true);
OncuraCapsuleTip1Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
OncuraCapsuleTip2Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
OncuraSilverCoreVisAtt = new G4VisAttributes(magenta);
OncuraSilverCoreVisAtt -> SetVisibility(true);
OncuraSilverCoreVisAtt -> SetForceSolid(true);
OncuraSilverCoreLog -> SetVisAttributes(OncuraSilverCoreVisAtt);
}
void BrachyDetectorConstructionOncura6711::CleanOncura6711()
{
delete OncuraSilverCoreVisAtt;
OncuraSilverCoreVisAtt = 0;
delete OncuraCapsuleTipVisAtt;
OncuraCapsuleTipVisAtt = 0;
delete OncuraCapsuleShellVisAtt;
OncuraCapsuleShellVisAtt = 0;
delete OncuraSilverCorePhys;
OncuraSilverCorePhys = 0;
delete OncuraSilverCoreLog;
OncuraSilverCoreLog = 0;
delete OncuraSilverCore;
OncuraSilverCore = 0;
delete OncuraAirGapPhys;
OncuraAirGapPhys = 0;
delete OncuraAirGapLog;
OncuraAirGapLog = 0;
delete OncuraAirGap;
OncuraAirGap = 0;
delete OncuraCapsuleTip2Phys;
OncuraCapsuleTip2Phys = 0;
delete OncuraCapsuleTip2Log;
OncuraCapsuleTip2Log = 0;
delete OncuraCapsuleTip2;
OncuraCapsuleTip2 = 0;
delete OncuraCapsuleTip1Phys;
OncuraCapsuleTip1Phys = 0;
delete OncuraCapsuleTip1Log;
OncuraCapsuleTip1Log = 0;
delete OncuraCapsuleTip1;
OncuraCapsuleTip1 = 0;
delete OncuraCapsulePhys;
OncuraCapsulePhys = 0;
delete OncuraCapsuleLog;
OncuraCapsuleLog = 0;
delete OncuraCapsule;
OncuraCapsule = 0;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -37,7 +37,6 @@
// * *
// ****************************************
//
// $Id: BrachyDetectorConstructionTG186.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
@@ -25,7 +25,7 @@
//
//
// Code developed by:
// S.Guatelli
// S.Guatelli, A. Le
//
// *********************************
// * *
@@ -34,7 +34,6 @@
// *********************************
//
//
// $Id: BrachyDetectorMessenger.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
//
@@ -58,7 +57,7 @@ BrachyDetectorMessenger::BrachyDetectorMessenger( BrachyDetectorConstruction* De
sourceCmd -> SetGuidance("Assign the selected geometry to G4RunManager.");
sourceCmd -> SetParameterName("choice",true);
sourceCmd -> SetDefaultValue(" ");
sourceCmd -> SetCandidates("TG186 Flexi Iodine Leipzig");
sourceCmd -> SetCandidates("TG186 Flexi Iodine Leipzig Oncura");
sourceCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
}
@@ -78,7 +77,7 @@ void BrachyDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue
// Switch the source in the phantom
if( command == sourceCmd )
{
if(newValue=="Iodine" || newValue=="TG186"|| newValue=="Leipzig" || newValue== "Flexi")
if(newValue=="Iodine" || newValue=="TG186"|| newValue=="Leipzig" || newValue== "Flexi" || newValue== "Oncura")
{
detector -> SelectBrachytherapicSeed(newValue);
detector -> SwitchBrachytherapicSeed();
@@ -25,7 +25,7 @@
//
//
// Code developed by:
// S.Guatelli
// S.Guatelli, A. Le
//
// *******************************
@@ -34,7 +34,6 @@
// * *
// *******************************
//
// $Id: BrachyFactory.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
// Factory of brachytherapic sources
//
@@ -32,7 +32,6 @@
// * *
// *******************************
//
// $Id: BrachyFactoryI.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "BrachyFactoryI.hh"
#include "BrachyDetectorConstructionI.hh"
@@ -32,7 +32,6 @@
// * *
// *******************************
//
// $Id: BrachyFactoryLeipzig.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "globals.hh"
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Code developed by:
// S.Guatelli, D. Cutajar, A. Le
//
// ********************************
// * *
// * BrachyFactoryOncura6711.cc *
// * *
// ********************************
//
//
//
#include "globals.hh"
#include "BrachyFactoryOncura6711.hh"
#include "G4ParticleTable.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionOncura6711.hh"
BrachyFactoryOncura6711:: BrachyFactoryOncura6711()
{
Oncura6711IodineSource = new BrachyDetectorConstructionOncura6711();
}
BrachyFactoryOncura6711:: ~BrachyFactoryOncura6711()
{
delete Oncura6711IodineSource;
}
void BrachyFactoryOncura6711::CreateSource(G4VPhysicalVolume* mother)
{
Oncura6711IodineSource -> ConstructOncura6711(mother);
}
void BrachyFactoryOncura6711::CleanSource()
{
Oncura6711IodineSource -> CleanOncura6711();
Oncura6711IodineSource = 0;
}
@@ -32,7 +32,6 @@
// * *
// *******************************
//
// $Id: BrachyFactoryIr.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "globals.hh"
#include "BrachyFactoryTG186.hh"
@@ -24,7 +24,7 @@
// ********************************************************************
//
// Code developed by:
// S.Guatelli
// S.Guatelli, A. Le
//
// *******************************
// * *
@@ -32,7 +32,6 @@
// * *
// *******************************
//
// $Id: BrachyMaterial.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "globals.hh"
#include "Randomize.hh"
@@ -69,7 +68,6 @@ void BrachyMaterial::DefineMaterials()
G4Element* elN = new G4Element("Nitrogen","N",Z = 7.,A);
A = 16.00*g/mole;
G4Element* elO = new G4Element("Oxygen","O",Z = 8.,A);
A=26.98*g/mole;
@@ -145,6 +143,12 @@ void BrachyMaterial::DefineMaterials()
d = 4.50*g/cm3;
Titanium = new G4Material("titanium" ,Z = 22.,A,d);
//silver
A = 107.87*g/mole;
d = 10.49*g/cm3;
Z = 22.0;
matAg = new G4Material("Silver", Z, A, d);
// Air material
d = 1.290*mg/cm3;
matAir = new G4Material("Air",d,2);
@@ -35,6 +35,11 @@ Author: Susanna Guatelli
//
#include "G4EmStandardPhysics_option4.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option1.hh"
#include "G4EmStandardPhysics_option2.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "G4DecayPhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4EmPenelopePhysics.hh"
@@ -49,46 +54,96 @@ Author: Susanna Guatelli
#include "G4ParticleDefinition.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyPhysicsListMessenger.hh"
BrachyPhysicsList::BrachyPhysicsList(): G4VModularPhysicsList()
{
SetVerboseLevel(1);
// EM physics: 3 alternatives
emPhysicsList = new G4EmLivermorePhysics();
// or
//emPhysicsList = new G4EmStandardPhysics_option4(1);
// or
// emPhysicsList = new G4EmPenelopePhysics();
// EM physics: default
fEmPhysicsList = new G4EmLivermorePhysics();
fEmName="emlivermore";
// Add Decay
decPhysicsList = new G4DecayPhysics();
radDecayPhysicsList = new G4RadioactiveDecayPhysics();
fDecPhysicsList = new G4DecayPhysics();
fRadDecayPhysicsList = new G4RadioactiveDecayPhysics();
fMessenger = new BrachyPhysicsListMessenger(this);
}
BrachyPhysicsList::~BrachyPhysicsList()
{
delete decPhysicsList;
delete radDecayPhysicsList;
delete emPhysicsList;
delete fMessenger;
delete fDecPhysicsList;
delete fRadDecayPhysicsList;
delete fEmPhysicsList;
}
void BrachyPhysicsList::ConstructParticle()
{
decPhysicsList -> ConstructParticle();
fDecPhysicsList -> ConstructParticle();
}
void BrachyPhysicsList::ConstructProcess()
{
AddTransportation();
emPhysicsList -> ConstructProcess();
fEmPhysicsList -> ConstructProcess();
// decay physics list
decPhysicsList -> ConstructProcess();
radDecayPhysicsList -> ConstructProcess();
fDecPhysicsList -> ConstructProcess();
fRadDecayPhysicsList -> ConstructProcess();
}
void BrachyPhysicsList::AddPhysicsList(const G4String& name)
{
if (name == fEmName) return;
if (name == "emstandard_opt0"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "emstandard_opt1"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option1();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "emstandard_opt2"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option2();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "emstandard_opt3"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option3();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "emstandard_opt4"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option4();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "empenelope"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmPenelopePhysics();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else if (name == "emlivermore"){
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmLivermorePhysics();
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
}
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is activated"
<< G4endl;
}
void BrachyPhysicsList::SetCuts()
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
#include "BrachyPhysicsListMessenger.hh"
#include "BrachyPhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
BrachyPhysicsListMessenger::BrachyPhysicsListMessenger(BrachyPhysicsList* pPhys)
:G4UImessenger(),
fPhysicsList(pPhys),fPhysDir(0),fListCmd(0)
{
fPhysDir = new G4UIdirectory("/testem/phys/");
fPhysDir->SetGuidance("physics list commands");
fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
fListCmd->AvailableForStates(G4State_PreInit);
}
BrachyPhysicsListMessenger::~BrachyPhysicsListMessenger()
{
delete fListCmd;
delete fPhysDir;
}
void BrachyPhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == fListCmd )
{ fPhysicsList->AddPhysicsList(newValue);}
}
@@ -37,7 +37,6 @@
// * *
// ********************************************
//
// $Id: BrachyPrimaryGeneratorAction.cc 84280 2014-10-13 07:21:10Z gcosmo $
//
#include "globals.hh"
@@ -47,7 +46,8 @@
#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"
#include "G4RunManager.hh"
#include "G4SystemOfUnits.hh"
#include <CLHEP/Units/SystemOfUnits.h>
#ifdef ANALYSIS_USE
#include "BrachyAnalysisManager.hh"
@@ -75,7 +75,7 @@ void BrachyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
G4double energy = gun -> GetParticleEnergy();
analysis -> FillPrimaryParticleHistogram(energy/keV);
analysis -> FillPrimaryParticleHistogram(energy/CLHEP::keV);
}
#endif
}
@@ -38,7 +38,6 @@
// * *
// *******************************
//
// $Id: BrachyRunAction.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "BrachyRunAction.hh"
@@ -24,8 +24,6 @@
// ********************************************************************
//
//
// $Id: SteppingAction.cc,v 1.10 2006/06/29 16:24:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-02-ref-04 $
//
//
// Author: Susanna Guatelli (guatelli@ge.infn.it)
@@ -33,7 +33,8 @@ Original code from geant4/examples/extended/runAndEvent/RE03, by M. Asai
#include <map>
#include <fstream>
#include "BrachyUserScoreWriter.hh"
#include "G4SystemOfUnits.hh"
#include <CLHEP/Units/SystemOfUnits.h>
#ifdef ANALYSIS_USE
#include "BrachyAnalysisManager.hh"
@@ -113,7 +114,7 @@ for(int x = 0; x < fNMeshSegments[0]; x++) {
G4int numberOfVoxel_z =fNMeshSegments[2];
// If the voxel width is changed in the macro file,
// the voxel width variable must be updated
G4double voxelWidth = 0.25 *mm;
G4double voxelWidth = 0.25 *CLHEP::mm;
//
G4double xx = ( - numberOfVoxel_x + 1+ 2*x )* voxelWidth/2;
G4double yy = ( - numberOfVoxel_y + 1+ 2*y )* voxelWidth/2;
@@ -126,13 +127,15 @@ for(int x = 0; x < fNMeshSegments[0]; x++) {
// Print in the ASCII output file the information
ofile << xx << " " << yy << " " << zz <<" "
<<(value->second->sum_wx())/keV << G4endl;
<<(value->second->sum_wx())/CLHEP::keV << G4endl;
#ifdef ANALYSIS_USE
// Save the same information in the output analysis file
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
if(zz> -0.125 *mm && zz < 0.125*mm) analysis -> FillH2WithEnergyDeposition(xx,yy, (value->second->sum_wx())/keV);
if(zz> -0.125 *CLHEP::mm && zz < 0.125*CLHEP::mm)
analysis -> FillH2WithEnergyDeposition(xx,yy,
(value->second->sum_wx())/CLHEP::keV);
#endif
}}}}
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emlivermore
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_livermore.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt0
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt0.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt3
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt3.out
#
@@ -0,0 +1,30 @@
/testem/phys/addPhysics emstandard_opt4
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_opt4.out
#
@@ -0,0 +1,29 @@
/testem/phys/addPhysics empenelope
/run/initialize
/control/verbose 1
/tracking/verbose 0
/run/verbose 0
/event/verbose 0
#
/source/switch Flexi
###### Generation of primary field
#### Generate gamma deriving from radioactive decay
/control/execute iridium_source_primary.mac
# Scoring mesh is used to calculate
# the energy deposition in the phantom
/score/create/boxMesh boxMesh_4
#
# the voxels are 0.25 mm wide.
/score/mesh/boxSize 10.0125 10.0125 0.0125 cm
/score/mesh/nBin 801 801 1
/score/quantity/energyDeposit eDep
#
/score/close
#
/score/list
/run/beamOn 1000000000
#
# Dump scores to a file
#
/score/dumpQuantityToFile boxMesh_4 eDep EnergyDeposition_Flexi_penelope.out
#
@@ -0,0 +1,129 @@
/gps/ene/type Arb
/gps/hist/type arb
/gps/hist/point 0.0614 1e-8
/gps/hist/point 0.0615 0.412
/gps/hist/point 0.0616 1e-8
/gps/hist/point 0.0629 1e-8
/gps/hist/point 0.063 0.7039
/gps/hist/point 0.0631 1e-8
/gps/hist/point 0.0650 1e-8
/gps/hist/point 0.0651 1.1309
/gps/hist/point 0.0652 1e-8
/gps/hist/point 0.0667 1e-8
/gps/hist/point 0.0668 1.9178
/gps/hist/point 0.0669 1e-8
/gps/hist/point 0.0710 1e-8
/gps/hist/point 0.0711 0.0827
/gps/hist/point 0.0712 1e-8
/gps/hist/point 0.0713 1e-8
/gps/hist/point 0.0714 0.1600
/gps/hist/point 0.0715 1e-8
/gps/hist/point 0.0733 1e-8
/gps/hist/point 0.0734 0.0560
/gps/hist/point 0.0735 1e-8
/gps/hist/point 0.0753 1e-8
/gps/hist/point 0.0754 0.2292
/gps/hist/point 0.0755 1e-8
/gps/hist/point 0.0756 1e-8
/gps/hist/point 0.0757 0.4408
/gps/hist/point 0.0758 1e-8
/gps/hist/point 0.0777 1e-8
/gps/hist/point 0.0778 0.1570
/gps/hist/point 0.0779 1e-8
/gps/hist/point 0.1103 1e-8
/gps/hist/point 0.1104 0.0042
/gps/hist/point 0.1105 1e-8
/gps/hist/point 0.1362 1e-8
/gps/hist/point 0.1363 0.0860
/gps/hist/point 0.1364 1e-8
/gps/hist/point 0.1769 1e-8
/gps/hist/point 0.1770 0.0018
/gps/hist/point 0.1771 1e-8
/gps/hist/point 0.2012 1e-8
/gps/hist/point 0.2013 0.1624
/gps/hist/point 0.2014 1e-8
/gps/hist/point 0.2057 1e-8
/gps/hist/point 0.2058 1.1468
/gps/hist/point 0.2059 1e-8
/gps/hist/point 0.2802 1e-8
/gps/hist/point 0.2803 0.0039
/gps/hist/point 0.2804 1e-8
/gps/hist/point 0.2832 1e-8
/gps/hist/point 0.2833 0.0913
/gps/hist/point 0.2834 1e-8
/gps/hist/point 0.2959 1e-8
/gps/hist/point 0.2960 12.3498
/gps/hist/point 0.2961 1e-8
/gps/hist/point 0.3084 1e-8
/gps/hist/point 0.3085 12.7626
/gps/hist/point 0.3086 1e-8
/gps/hist/point 0.3164 1e-8
/gps/hist/point 0.3165 35.5660
/gps/hist/point 0.3166 1e-8
/gps/hist/point 0.3291 1e-8
/gps/hist/point 0.3292 0.0060
/gps/hist/point 0.3293 1e-8
/gps/hist/point 0.3744 1e-8
/gps/hist/point 0.3745 0.2493
/gps/hist/point 0.3746 1e-8
/gps/hist/point 0.4164 1e-8
/gps/hist/point 0.4165 0.2877
/gps/hist/point 0.4166 1e-8
/gps/hist/point 0.4204 1e-8
/gps/hist/point 0.4205 0.0237
/gps/hist/point 0.4206 1e-8
/gps/hist/point 0.4680 1e-8
/gps/hist/point 0.4681 20.5587
/gps/hist/point 0.4682 1e-8
/gps/hist/point 0.4845 1e-8
/gps/hist/point 0.4846 1.0942
/gps/hist/point 0.4847 1e-8
/gps/hist/point 0.4852 1e-8
/gps/hist/point 0.4853 0.0010
/gps/hist/point 0.4854 1e-8
/gps/hist/point 0.4890 1e-8
/gps/hist/point 0.4891 0.1504
/gps/hist/point 0.4892 1e-8
/gps/hist/point 0.5885 1e-8
/gps/hist/point 0.5886 1.9423
/gps/hist/point 0.5887 1e-8
/gps/hist/point 0.5934 1e-8
/gps/hist/point 0.5935 0.0181
/gps/hist/point 0.5936 1e-8
/gps/hist/point 0.5993 1e-8
/gps/hist/point 0.5994 0.0017
/gps/hist/point 0.5995 1e-8
/gps/hist/point 0.6043 1e-8
/gps/hist/point 0.6044 3.5361
/gps/hist/point 0.6045 1e-8
/gps/hist/point 0.6124 1e-8
/gps/hist/point 0.6125 2.2962
/gps/hist/point 0.6126 1e-8
/gps/hist/point 0.7038 1e-8
/gps/hist/point 0.7039 0.0018
/gps/hist/point 0.7040 1e-8
/gps/hist/point 0.7657 1e-8
/gps/hist/point 0.7658 0.0006
/gps/hist/point 0.7659 1e-8
/gps/hist/point 0.8844 1e-8
/gps/hist/point 0.8845 0.1251
/gps/hist/point 0.8846 1e-8
/gps/hist/point 1.0614 1e-8
/gps/hist/point 1.0615 0.0228
/gps/hist/point 1.0616 1e-8
/gps/hist/point 1.0898 1e-8
/gps/hist/point 1.0899 0.0005
/gps/hist/point 1.0890 1e-8
/gps/hist/point 1.3781 1e-8
/gps/hist/point 1.3782 0.0005
/gps/hist/point 1.3783 1e-8
/gps/hist/inter Lin
/gps/particle gamma
/gps/pos/type Volume
/gps/pos/shape Cylinder
/gps/pos/radius 0.30 mm
/gps/pos/halfz 1.75 mm
/gps/pos/centre 0. 0. 0. mm
/gps/ang/type iso