Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -0,0 +1,21 @@
//$Id$
///\file "radioactivedecay/.README"
///\brief Examples radioactivedecay README page
/*! \page Examples_radioactivedecay Category "radioactivedecay"
Examples in this directory demonstrate the use of some features of the
Radioactive-Decay hadronic model in Geant4.
\link Examplerdecay01 rdecay01 \endlink
This example allows to display basic features of the radioactive decay
of a nuclei: energy spectrum of emitted particles, time of life, activity.
\link Examplerdecay02 rdecay02 \endlink
This example illustrates more advanced features of the package:
selected decay channels, time window, bias and variance reduction technique.
*/
@@ -0,0 +1,6 @@
#---Adding all radioactivedecay examples subdirectories explicitly
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
add_subdirectory(rdecay01)
add_subdirectory(rdecay02)
@@ -17,6 +17,18 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
November 25, 2012 I. Hrivnacova - exRadioactivedecay-V09-05-01
- Updated documentation:
- Fixed .README files for artefacts from Markdown support
- Removed/updated obsolete instructions (how to compile & link)
September 25, 2012 I. Hrivnacova - exRadioactivedecay-V09-05-00
- Updated CMakeLists.txt files:
adding visualization, optional external packages (rdecay02 ), copying macros,
install target and comment lines
- Added explicit includes of G4SystemOfUnits.hh and G4PhysicalConstants.hh
- Replaced tabulators with space characters
November 4, 2011 L. Desorgher - exradioactive-V09-04-00
- Create this History file
- Add macro files and user data files in rdecay02 to illustrate the possibility for a user to define its own
@@ -0,0 +1,126 @@
//$Id$
///\file "radioactivedecay/rdecay01/.README"
///\brief Example rdecay01 README page
/*! \page Examplerdecay01 Example rdecay01
Survey G4RadioactiveDecay process. See Physics Reference Manual, chapter 36.
See also http://ie.lbl.gov/decay.html
\section rdecay01_s1 Geometry construction
It is a simple box which represente an 'infinite' homogeneous medium.
\section rdecay01_s2 Physics list
PhysicsList.cc defines only G4RadioactiveDecay, G4Transportation processes,
and relevant particle definitions.
Therefore, once created, particles or ions travel as geantino.
\section rdecay01_s3 Primary generator
Default kinematic is an ion (Ne24), at rest, at coordinate origin.
Can be changed with particleGun commands.
\section rdecay01_s4 Physics
As said above, all particles and ions behave as geantino, eg. no energy loss.
A flag:
\verbatim
/rdecay01/fullChain (false or true)
\endverbatim
allows to limit to single decay (default) or full decay chain.
In case of full decay chain, G4TrackStatus of ions is set to fStopButAlive
in order to force decay at rest.
At each decay, one counts and plots energy spectrum of created particles and
ions, and energy-momentum balance of that decay.
Total time of life of decay chain is plotted. Activity is computed.
Few macros are given in example. Debug.mac is to be run in interactive mode.
\section rdecay01_s5 User data files
Users can redefine RadioactiveDecay and PhotonEvaporation data, via commands:
\verbatim
/grdm/setRadioactiveDecayFile
/grdm/setPhotoEvaporationFile
\endverbatim
Examples of such files are given in subdirectory UserData. \n
Formats are described in readme \n
Examples in macros Cf238.mac and No252.mac
\section rdecay01_s6 Visualisation
Visualization Manager is set in the main () (see rdecay01.cc).
Initialisation of the drawing is done via the commands
/vis/.. in the macro vis.mac. This macro is automatically read from the main
in case of interactive running mode.
- e- red
- e+ blue
- nu_e white
- anti_nu_e white
- gamma green
- alpha yellow
- GenericIon grey
\section rdecay01_s7 How to start ?
- Execute rdecay01 in 'batch' mode from macro files
\verbatim
% rdecay01 singleDecay.mac
\endverbatim
- Execute rdecay01 in 'interactive mode' with visualization
\verbatim
% rdecay01
....
Idle> ---> type your commands. For instance:
Idle> /control/execute debug.mac
....
Idle> /run/beamOn 1
....
Idle> exit
\endverbatim
\section rdecay01_s8 Histograms
rdecay01 produces several 1D histograms which are saved as
rdecay01.root by default.
- 1 : energy spectrum: e+ e-
- 2 : energy spectrum: nu_e anti_nu_ev
- 3 : energy spectrum: gamma
- 4 : energy spectrum: alpha
- 5 : energy spectrum: ions
- 6 : total kinetic energy (Q)
- 7 : momentum balance
- 8 : total time of life of decay chain
The histograms are managed by G4AnalysiManager and its Messenger.
The histos can be individually activated with the command :
\verbatim
/analysis/h1/set id nbBins valMin valMax unit
\endverbatim
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
One can control the name of the histograms file with the command:
\verbatim
/analysis/setFileName name (default rdecay1)
\endverbatim
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
\verbatim
/analysis/h1/setAscii id
\endverbatim
All selected histos will be written on a file name.ascii (default rdecay1)
*/
@@ -1,12 +1,58 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(rdecay01)
set(name rdecay01)
project(${name})
find_package(Geant4 REQUIRED)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR})
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(rdecay01 rdecay01.cc ${sources} ${headers})
target_link_libraries(rdecay01 ${Geant4_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build rdecay01. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(rdecay01_SCRIPTS
Cf238.mac Co60.mac debug.mac electronicCapture.mac fullChain.mac No252.mac rdecay01.in singleDecay.mac vis.mac
)
foreach(_script ${rdecay01_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS rdecay01 DESTINATION bin)
add_executable(${name} EXCLUDE_FROM_ALL ${name}.cc ${sources})
target_link_libraries(${name} ${Geant4_LIBRARIES})
@@ -0,0 +1,14 @@
# to read user's data file
#
/grdm/setRadioactiveDecayFile 98 238 UserData/UserRadData_z98.a238
#
/gun/particle ion
/gun/ion 98 238
#
/rdecay01/fullChain true
#
/tracking/verbose 2
#
###/run/beamOn 1
#
/run/beamOn 20
@@ -11,14 +11,13 @@
#
/tracking/verbose 0
#
/rdecay01/histo/setFileName Co60
/rdecay01/histo/setFileType root
/rdecay01/histo/setHisto 1 150 0. 1500 keV #e+ e-
/rdecay01/histo/setHisto 2 150 0. 1500 keV #neutrino
/rdecay01/histo/setHisto 3 150 0. 1500 keV #gamma
/rdecay01/histo/setHisto 6 100 0. 2500 keV #EkinTot (Q)
/rdecay01/histo/setHisto 7 150 0. 15e3 keV #P balance
/rdecay01/histo/setHisto 8 100 0. 100. year #time of life
/analysis/setFileName Co60
/analysis/h1/set 1 150 0. 1500 keV #e+ e-
/analysis/h1/set 2 150 0. 1500 keV #neutrino
/analysis/h1/set 3 150 0. 1500 keV #gamma
/analysis/h1/set 6 100 0. 2500 keV #EkinTot (Q)
/analysis/h1/set 7 150 0. 15e3 keV #P balance
/analysis/h1/set 8 100 0. 100. year #time of life
#
/rdecay01/event/printModulo 100000
#
@@ -10,8 +10,6 @@ endif
.PHONY: all
all: lib bin
#### G4ANALYSIS_USE := true
include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/binmake.gmk
@@ -14,6 +14,70 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
14-11-12 I. Hrivnacova (rdecay01-V09-05-14)
- Fixed order of instantiating G4VisExecutive and G4UIExecutive
(required when Qt driver is activated).
28-10-12 mma (rdecay01-V09-05-13)
- update README and .README
07-10-12 mma (rdecay01-V09-05-12)
- use G4AnalysisManager
02-10-12 V.Ivantchenko (rdecay01-V09-05-11)
- PhysicsList - removed initialisation of de-excitation, because it can
be called only after initialisation of geometry and not when
processes are instantiated
22-09-12 mma
- DetectorConstruction : fWorldSize = 2 cm
05-05-12 mma (rdecay01-V09-05-10)
- add macro No252.mac to demonstrate UserEvapData file
- update readme
03-05-12 mma (rdecay01-V09-05-09)
- add macro Cf238.mac to demonstrate UserRadData file
26-03-12 mma (rdecay01-V09-05-08)
- all classes : apply G4 coding conventions
23-02-12 mma (rdecay01-V09-05-07)
- HistoManager : GetFileType()
11-02-12 mma (rdecay01-V09-05-06)
- HistoManager : new handle namespace and fileName[2]
no subdirectory in histos file
25-01-12 mma (rdecay01-V09-05-05)
- HistoManager : add protections for histo file management
15-01-12 mma (rdecay01-V09-05-04)
- HistoManager : histId and histPt
- SetHisto() : simplification of Unit handling (HistoManager and HistoMessenger)
- HistoManager and HistoMessenger : coding conventions
13-01-12 mma (rdecay01-V09-05-03)
- Functions Normalize() and saveAscii() re-activated
- RunAction.cc : normalize histos 1 to 5
10-01-12 mma (rdecay01-V09-05-02)
- HistoManager.hh and .cc : migrate to new g4tools histogramming system
Do not need aida anymore, nor G4ANALYSIS_USE
- Functions Normalize() and saveAscii() temporarily empty
- HistoMessenger.hh and .cc : suppress fileType command
- Update Readme and all macros accordingly
02-01-12 mma (rdecay01-V09-05-01)
- PhysicsList : use G4PhysicsHelper
- RunAction : cosmetic in Activity calculation
- fullChain.mac : example of command /grdm/nuleusLimits
- new macro electronicCapture.mac
19-12-11 V.Ivanchenko (rdecay01-V09-05-00)
- RunAction : added protections against division by zero
- PhysicsList : added atomic deexcitation
08-11-11 mma (rdecay01-V09-04-06)
- modify SteppingVerbose for OutOfWorld
@@ -1,78 +0,0 @@
$Id: InstallAida.txt,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
-----------------------------------------------------------
--------------
Install AIDA
--------------
To use histograms, at least one of the AIDA implementations should be
available.
You can use various file formats to write histograms (hbook, root, AIDA-XML).
1 - OpenScientist (lal/in2p3)
-------------------------
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
OpenScientist_batch is a small package ( ~ 6MB), easy to install.
It provides an AIDA interface to write files in ROOT or PAW format.
Download and gunzip (for Linux system) :
http://openscientist.lal.in2p3.fr/download/16.3/osc_batch-v16r3-Linux-i386-gcc_323.zip
(or more recent version, or Windows or Mac system)
Installation:
prompt%> cd osc_batch/v16r3 (or more recent version)
prompt%> ./install
prompt%> source aida-setup.csh
(on Windows : dos%> call <<OpenScientist install path>/aida-setup.bat)
2 - RAIDA (desy)
------------
It is a ROOT based AIDA interface. It can be downloaded from
http://ilcsoft.desy.de/portal/software_packages/raida/index_eng.html
3 - iAIDA
-----
Another package including AIDA (an evolution of the former cern PI project)
is the iAIDA package: http://iaida.dynalias.net
Once you have installed iAIDA in a specified local area $MYIAIDA, it is
required to add the installation path to $PATH, i.e. for example, for
release 1.0.11 of iAIDA:
setenv PATH ${PATH}:$MYIAIDA/bin
Before running the example the command should be issued:
eval `aida-config --runtime csh`
4 - JAIDA (slac)
------------
JAIDA is an implementation of AIDA in Java. To use it, one needs Java
as well as AIDAJNI, a connector between AIDA-C++ and AIDA-Java.
Available for: Linux-g++2, Linux-g++3, WIN32-VC, SUN-CC,
Darwin-g++2, Darwin-g++3
To compile and link with JAIDA using AIDAJNI, make sure you have:
1. JAIDA version 3.2.0, see http://java.freehep.org/jaida
2. set enviroment variable JAIDA_HOME to your JAIDA installation
3. source the aida-setup script $JAIDA_HOME/bin/aida-setup.[sh|csh|win32]
4. AIDAJNI version 3.0.4 or 3.2.0, or better: see http://java.freehep.org/aidajni
5. set environment variable AIDAJNI_HOME to your AIDAJNI installation
6. set environment variable JDK_HOME to your Java Standard Development Kit (1.4.x or up).
7. source the aidajni-setup script $AIDAJNI_HOME/bin/$G4SYSTEM/aidajni-setup.[sh|csh|win32]
now execute:
source setup-analysis (.csh, .sh, .win32)
gmake clean
gmake
@@ -0,0 +1,14 @@
# to read user's data file
#
/grdm/setPhotoEvaporationFile 102 252 UserData/UserEvapData_z102.a252
#
/gun/particle ion
/gun/ion 102 252 0 3.2070e+02
#
/rdecay01/fullChain true
#
###/tracking/verbose 2
#
###/run/beamOn 1
#
/run/beamOn 100000
@@ -19,7 +19,7 @@ $Id: README,v 1.2 2010-09-17 11:21:45 maire Exp $
2- Physics list
------------
PhysicsList.cc defines only G4RadioactiveDecay, Transportation processes,
PhysicsList.cc defines only G4RadioactiveDecay, G4Transportation processes,
and relevant particle definitions.
Therefore, once created, particles or ions travel as geantino.
@@ -36,7 +36,7 @@ $Id: README,v 1.2 2010-09-17 11:21:45 maire Exp $
A flag, /rdecay01/fullChain (false or true), allows to limit to
single decay (default) or full decay chain.
In case of full decay chain, TrackStatus of ions is set to fStopButAlive
In case of full decay chain, G4TrackStatus of ions is set to fStopButAlive
in order to force decay at rest.
At each decay, one counts and plots energy spectrum of created particles and
@@ -45,6 +45,15 @@ $Id: README,v 1.2 2010-09-17 11:21:45 maire Exp $
Total time of life of decay chain is plotted. Activity is computed.
Few macros are given in example. Debug.mac is to be run in interactive mode.
4-a User data files
-------------------
Users can redefine RadioactiveDecay and PhotonEvaporation data, via commands:
/grdm/setRadioactiveDecayFile
/grdm/setPhotoEvaporationFile
Examples of such files are given in subdirectory UserData.
Formats are described in readme
Examples in macros Cf238.mac and No252.mac
5- Visualisation
-------------
@@ -65,14 +74,10 @@ $Id: README,v 1.2 2010-09-17 11:21:45 maire Exp $
6- How to start ?
--------------
- compile and link to generate an executable
% cd rdecay01
% gmake
- execute rdecay01 in 'batch' mode from macro files
- Execute rdecay01 in 'batch' mode from macro files
% rdecay01 singleDecay.mac
- execute rdecay01 in 'interactive mode' with visualization
- Execute rdecay01 in 'interactive mode' with visualization
% rdecay01
....
Idle> ---> type your commands. For instance:
@@ -97,31 +102,18 @@ $Id: README,v 1.2 2010-09-17 11:21:45 maire Exp $
7 : momentum balance
8 : total time of life of decay chain
The histograms are managed by the HistoManager class and its Messenger.
The histograms are managed by G4AnalysisManager and its Messenger.
The histos can be individually activated with the command :
/rdecay1/histo/setHisto id nbBins valMin valMax unit
/analysis/h1/set id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
One can control the name of the histograms file with the command:
/rdecay1/histo/setFileName name (default particleGun)
/analysis/setFileName name (default rdecay1)
It is possible to choose the format of the histogram file (hbook, root, XML)
with the command /rdecay1/histo/setFileType (root by default)
It is possible to choose the format of the histogram file : root (default),
xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
/rdecay1/histo/printHisto id
All selected histos will be written on a file name.ascii (default RDecay1)
/analysis/h1/setAscii id
All selected histos will be written on a file name.ascii (default rdecay1)
Note that, by default, histograms are disabled. To activate them, uncomment
the flag G4ANALYSIS_USE in GNUmakefile.
Before compilation of the example it is optimal to clean up old files:
gmake histclean
gmake
8- Using histograms
----------------
To use histograms, at least one of the AIDA implementations should be
available. See the file InstallAida.txt
@@ -0,0 +1,81 @@
The photo-evaporation database contains nuclear deexcitation data starting
from a given nuclear level. Each file contains data for a given isotope,
identified by Z and A.
The database must first be downloaded from
http://geant4.web.cern.ch/geant4/support/download.shtml
and stored in a local directory. The environment variable
G4LEVELGAMMADATA must then be set to point to this directory.
**************************************************
Each line describes a de-excitation *step* from a given energy level to a lower
one (which might be the ground state). It contains data for gamma de-excitation
and internal conversion. Notice that if multiple de-excitation
channels are allowed for the starting energy level, these channels will be
described in more lines (all having the same starting level).
Each line contains 17 columns:
1) Energy of the starting nuclear level (keV)
As mentioned before, it is possible to have more lines describing the same
starting level, in the case where multiple de-excitation schemes are
allowed.
2) Energy of the transition (keV)
This is the energy difference between the initial and the final level.
3) Gamma transition probability (Ig in %)
Note1: if the probability is less than minProbability = 1e-8%, it is forced
to be 1e-8%.
Note2: see column 7 how total branching ratio is computed.
4) Polarity
Spin-parity variation in the transition
[never used in real simulation]
5) Level half-life (s)
6) Angular Momentum
Spin of the initial level
[never used in real simulation]
7) Total internal conversion coefficient : alpha = Ic/Ig
Note1: total transition is the sum of gamma de-excitation and internal
conversion. Therefore total branching ratio is proportional to
(1+alpha)*Ig
Note2: total branching ratios from a given level do not always sum up to
100%. They are re-normalized internally.
Note3: relative probabilities for gamma de-excitation and internal conversion
are 1/(1+alpha) and alpha/(1+alpha) respectively
8-17) Partial conversion probabilities for
K-shell
L1-3 shells
M1-5 shells
Outer shells (shellID = 9 is used, when applicable)
Note: if the nuclear excitation energy does not match any of the known levels,
the *nearest* level is always considered. In G4RadioactiveDecay,
metastable states are treated correctly if the excitation energy is
within 2.0 keV of the values in $G4RADIOACTIVEDATA.
For instance: take file $G4LEVELGAMMADATA/z28.a60 (Ni-60)
Co-60 radioactive decay populates the 1332.5080-keV level of
Ni-60 (0.12%) or the 2505.7480-keV level of Ni-60 (99.88%).
Deexcitation from the 2505.7480-keV level is described in lines
6-8 of $G4LEVELGAMMADATA/z28.a60 (Ni-60)
Here, internal conversion coefficients are negligeable (column 7)
Therefore the nucleus will release
1) 347 keV with 7.6e-3% probability, ending up in the 2158-keV level
(following de-excitation hence takes place, lines 2-4 of the file)
2) 1173 keV with 100% probability, ending up in the 1332-keV
excited state (following de-excitation hence takes place, line 1)
3) 2505 keV with 2e-6% probability ending up in the ground state.
@@ -0,0 +1,24 @@
Lines beginning with either a 'W' or a '#' are comments
Lines beginning with a 'P' are a header which describes a level of the
nucleus. The first number is the excitation energy in keV, the second is the
half life in seconds
Indented lines under the 'P' lines are decay modes for that
excitation. There are two type of records here, distinguished by the
number of columns.
If there are 3 columns only, this is a header which describes all
decays of that type from this level.
The first column is the decay mode, the second column is zero, and the
third column in the branching ratio to this mode, as a fraction of
unity. Therefore, the third columns of all the 3-column records under
a given 'P' line should sum to 1.0.
If there are four columns, this is a record which describes a subset
of the decay type, specific to a given lower level in the daughter
species. The first column is the decay type, the second column is the
excitation level of the daughter (in keV), and the third column is the
branching ratio as a percentage (! note... not a fraction of unity) of
the total branching ratio which came from the 3-column record for this
decay.
@@ -0,0 +1,10 @@
4.640000e+01 4.640000e+01 0.000e+00 2+ 0.00e+00 2.00 1.334e+02 0.000e+00 1.460e-02 3.899e-01 3.101e-01 4.855e-03 1.092e-01 9.159e-02 1.566e-03 7.442e-04 7.750e-02
1.538000e+02 1.074000e+02 0.000e+00 2+ 0.00e+00 4.00 8.561e-01 0.000e+00 2.493e-02 4.321e-01 2.577e-01 8.370e-03 1.205e-01 7.698e-02 1.313e-03 5.622e-04 7.753e-02
3.207000e+02 1.669000e+02 3.800e+01 2+ 0.00e+00 6.00 3.090e+00 3.323e-02 4.463e-02 4.465e-01 2.008e-01 1.395e-02 1.245e-01 6.031e-02 1.023e-03 4.036e-04 7.470e-02
5.445000e+02 2.238000e+02 6.200e+01 2+ 0.00e+00 8.00 9.700e-01 1.155e-01 6.455e-02 4.166e-01 1.533e-01 1.892e-02 1.159e-01 4.609e-02 7.805e-04 2.958e-04 6.793e-02
8.217000e+02 2.772000e+02 1.000e+02 2+ 0.00e+00 10.00 4.560e-01 2.026e-01 8.070e-02 3.738e-01 1.188e-01 2.268e-02 1.039e-01 3.573e-02 6.033e-04 2.253e-04 6.090e-02
1.150100e+03 3.284000e+02 4.400e+01 2+ 0.00e+00 12.00 2.640e-01 2.805e-01 9.309e-02 3.316e-01 9.378e-02 2.542e-02 9.209e-02 2.821e-02 4.751e-04 1.768e-04 5.462e-02
1.525600e+03 3.755000e+02 2.800e+01 2+ 0.00e+00 14.00 1.780e-01 3.452e-01 1.022e-01 2.948e-01 7.582e-02 2.737e-02 8.185e-02 2.281e-02 3.825e-04 1.429e-04 4.943e-02
1.942300e+03 4.167000e+02 3.300e+01 2+ 0.00e+00 16.00 1.340e-01 3.978e-01 1.091e-01 2.640e-01 6.260e-02 2.879e-02 7.325e-02 1.882e-02 3.142e-04 1.183e-04 4.523e-02
2.395500e+03 4.532000e+02 1.300e+01 2+ 0.00e+00 18.00 1.070e-01 4.297e-01 1.127e-01 2.450e-01 5.546e-02 2.947e-02 6.792e-02 1.667e-02 2.775e-04 1.051e-04 4.268e-02
2.879200e+03 4.837000e+02 1.200e+01 2+ 0.00e+00 20.00 9.100e-02 4.614e-01 1.163e-01 2.259e-01 4.846e-02 3.018e-02 6.263e-02 1.456e-02 2.412e-04 9.221e-05 4.015e-02
@@ -0,0 +1,8 @@
# 238CF (2.645 Y)
# Excitation Halflife Mode Daughter Ex Intensity Q
#
# File written by L.Desorgher 03/11/2011
#
P 0.0000 8.347e+07
Alpha 0.0000 1.0000e+00
Alpha 0.0000 1.0000e+02 8055.
@@ -3,11 +3,9 @@
/tracking/verbose 2
#
/gun/particle ion
##/gun/ion 10 24
/gun/ion 77 192
/gun/ion 95 241
###/gun/ion 43 99 0 142.7
#
/rdecay01/fullChain false
#
###/random/resetEngineFrom ir192/run1evt3.rndm
/rdecay01/fullChain true
#
/run/beamOn 1
@@ -0,0 +1,14 @@
/control/verbose 2
/run/verbose 1
/tracking/verbose 2
#
/gun/particle ion
/gun/ion 26 55
###/gun/ion 25 53
###/gun/ion 55 131
#
/rdecay01/fullChain true
#
/rdecay01/event/printModulo 1
#
/run/beamOn 1
@@ -6,18 +6,22 @@
#
/rdecay01/fullChain true
#
/rdecay01/histo/setFileName run2
###/rdecay01/histo/setFileType hbook
/rdecay01/histo/setFileType root
/rdecay01/histo/setHisto 1 100 0. 4000 keV #e+ e-
/rdecay01/histo/setHisto 2 100 0. 4000 keV #neutrino
/rdecay01/histo/setHisto 3 100 0. 4000 keV #gamma
/rdecay01/histo/setHisto 4 100 0. 10 MeV #alpha
/rdecay01/histo/setHisto 5 100 0. 200 keV #recoil ion
/rdecay01/histo/setHisto 6 100 0 8 MeV #EkinTot (Q)
/rdecay01/histo/setHisto 7 100 0. 300 MeV #P balance
/rdecay01/histo/setHisto 8 100 0. 1.e+11 y #time of life
/analysis/setFileName run2
/analysis/h1/set 1 100 0. 4000 keV #e+ e-
/analysis/h1/set 2 100 0. 4000 keV #neutrino
/analysis/h1/set 3 100 0. 4000 keV #gamma
/analysis/h1/set 4 100 0. 10 MeV #alpha
/analysis/h1/set 5 100 0. 200 keV #recoil ion
/analysis/h1/set 6 100 0 8 MeV #EkinTot (Q)
/analysis/h1/set 7 100 0. 300 MeV #P balance
/analysis/h1/set 8 100 0. 1.e+11 y #time of life
#
/rdecay01/event/printModulo 10000
#
/run/beamOn 100000
#limit the chain
#
###/grdm/nucleusLimits 234 238 90 92
#
###/run/beamOn 1
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
//
// $Id: DetectorConstruction.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,14 +46,15 @@ class DetectorConstruction : public G4VUserDetectorConstruction
DetectorConstruction();
~DetectorConstruction();
virtual
G4VPhysicalVolume* Construct();
G4double GetWorldSize() {return worldSize;};
G4double GetWorldSize() {return fWorldSize;};
private:
G4double worldSize;
G4double fWorldSize;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EventAction.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/include/EventAction.hh
/// \brief Definition of the EventAction class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,16 +48,16 @@ class EventAction : public G4UserEventAction
~EventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
void SetPrintModulo(G4int val) {printModulo = val;};
void AddDecayChain(G4String val) {decayChain += val;};
void SetPrintModulo(G4int val) {fPrintModulo = val;};
void AddDecayChain(G4String val) {fDecayChain += val;};
private:
G4int printModulo;
G4String decayChain;
EventMessenger* eventMessenger;
G4int fPrintModulo;
G4String fDecayChain;
EventMessenger* fEventMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EventMessenger.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/include/EventMessenger.hh
/// \brief Definition of the EventMessenger class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -47,14 +49,14 @@ class EventMessenger: public G4UImessenger
EventMessenger(EventAction*);
~EventMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
EventAction* eventAction;
EventAction* fEventAction;
G4UIdirectory* Dir;
G4UIdirectory* eventDir;
G4UIcmdWithAnInteger* PrintCmd;
G4UIdirectory* fDir;
G4UIdirectory* fEventDir;
G4UIcmdWithAnInteger* fPrintCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,8 +24,7 @@
// ********************************************************************
//
//
// $Id: HistoManager.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,65 +34,20 @@
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace AIDA {
class IAnalysisFactory;
class ITree;
class IHistogram1D;
}
class HistoMessenger;
const G4int MaxHisto = 9;
#include "g4root.hh"
//#include "g4xml.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager();
void SetFileName (const G4String& name) { fileName[0] = name;};
void SetFileType (const G4String& name) { fileType = name;};
void SetFileOption (const G4String& name) { fileOption = name;};
void book();
void save();
void SetHisto (G4int,G4int,G4double,G4double,const G4String& unit="none");
void FillHisto(G4int id, G4double e, G4double weight = 1.0);
void Normalize(G4int id, G4double fac);
void RemoveHisto (G4int);
void PrintHisto (G4int);
G4bool HistoExist (G4int id) {return exist[id];}
G4double GetHistoUnit(G4int id) {return Unit[id];}
G4double GetBinWidth (G4int id) {return Width[id];}
HistoManager();
~HistoManager();
private:
G4String fileName[2];
G4String fileType;
G4String fileOption;
AIDA::IAnalysisFactory* af;
AIDA::ITree* tree;
AIDA::IHistogram1D* histo[MaxHisto];
G4bool exist[MaxHisto];
G4String Label[MaxHisto];
G4String Title[MaxHisto];
G4int Nbins[MaxHisto];
G4double Vmin [MaxHisto];
G4double Vmax [MaxHisto];
G4double Unit [MaxHisto];
G4double Width[MaxHisto];
G4bool ascii[MaxHisto];
G4bool factoryOn;
HistoMessenger* histoMessenger;
private:
void saveAscii();
void Book();
G4String fFileName;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,75 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: HistoMessenger.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoMessenger_h
#define HistoMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager;
class G4UIdirectory;
class G4UIcommand;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoMessenger: public G4UImessenger
{
public:
HistoMessenger(HistoManager* );
~HistoMessenger();
void SetNewValue(G4UIcommand* ,G4String );
private:
HistoManager* histoManager;
G4UIdirectory* histoDir;
G4UIcmdWithAString* factoryCmd;
G4UIcmdWithAString* typeCmd;
G4UIcmdWithAString* optionCmd;
G4UIcommand* histoCmd;
G4UIcmdWithAnInteger* prhistoCmd;
G4UIcmdWithAnInteger* rmhistoCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/PhysicsList.hh
/// \brief Definition of the PhysicsList class
//
// $Id: PhysicsList.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,9 +48,9 @@ class PhysicsList: public G4VUserPhysicsList
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
virtual void ConstructParticle();
virtual void ConstructProcess();
virtual void SetCuts();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
//
// $Id: PrimaryGeneratorAction.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -48,11 +50,11 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
~PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() { return particleGun;} ;
virtual void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() { return fParticleGun;} ;
private:
G4ParticleGun* particleGun;
G4ParticleGun* fParticleGun;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/RunAction.hh
/// \brief Definition of the RunAction class
//
// $Id: RunAction.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,11 +48,11 @@ class PrimaryGeneratorAction;
class RunAction : public G4UserRunAction
{
public:
RunAction(HistoManager*, PrimaryGeneratorAction*);
RunAction(PrimaryGeneratorAction*);
~RunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
void ParticleCount(G4String, G4double);
void Balance(G4double,G4double);
@@ -58,18 +60,18 @@ class RunAction : public G4UserRunAction
void PrimaryTiming(G4double);
private:
HistoManager* histoManager;
PrimaryGeneratorAction* primary;
HistoManager* fHistoManager;
PrimaryGeneratorAction* fPrimary;
std::map<G4String,G4int> particleCount;
std::map<G4String,G4double> Emean;
std::map<G4String,G4double> Emin;
std::map<G4String,G4double> Emax;
G4int decayCount, timeCount;
G4double EkinTot[3];
G4double Pbalance[3];
G4double EventTime[3];
G4double PrimaryTime;
std::map<G4String,G4int> fParticleCount;
std::map<G4String,G4double> fEmean;
std::map<G4String,G4double> fEmin;
std::map<G4String,G4double> fEmax;
G4int fDecayCount, fTimeCount;
G4double fEkinTot[3];
G4double fPbalance[3];
G4double fEventTime[3];
G4double fPrimaryTime;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/SteppingVerbose.hh
/// \brief Definition of the SteppingVerbose class
//
// $Id: SteppingVerbose.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,8 +46,8 @@ public:
SteppingVerbose();
~SteppingVerbose();
void StepInfo();
void TrackingStarted();
virtual void StepInfo();
virtual void TrackingStarted();
};
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/include/TrackingAction.hh
/// \brief Definition of the TrackingAction class
//
// $Id: TrackingAction.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,7 +38,6 @@
#include "G4UserTrackingAction.hh"
#include "globals.hh"
class HistoManager;
class RunAction;
class EventAction;
class TrackingMessenger;
@@ -46,22 +47,21 @@ class TrackingMessenger;
class TrackingAction : public G4UserTrackingAction {
public:
TrackingAction(HistoManager*, RunAction*, EventAction*);
TrackingAction(RunAction*, EventAction*);
~TrackingAction();
void PreUserTrackingAction(const G4Track*);
void PostUserTrackingAction(const G4Track*);
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
void SetFullChain(G4bool flag) { fullChain = flag;};
private:
HistoManager* histoManager;
RunAction* run;
EventAction* event;
TrackingMessenger* trackMessenger;
RunAction* fRun;
EventAction* fEvent;
TrackingMessenger* fTrackMessenger;
G4double charge, mass;
G4bool fullChain;
G4double fCharge, fMass;
G4bool fullChain;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: TrackingMessenger.hh,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/include/TrackingMessenger.hh
/// \brief Definition of the TrackingMessenger class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,12 +48,11 @@ class TrackingMessenger: public G4UImessenger
TrackingMessenger(TrackingAction*);
~TrackingMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
TrackingAction* trackingAction;
G4UIcmdWithABool* TrackingCmd;
TrackingAction* fTrackingAction;
G4UIcmdWithABool* fTrackingCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -3,13 +3,29 @@
// Draw histos filled by Geant4 simulation
//
TFile f = TFile("rdecay01.root");
TFile f = TFile("run1.root");
////TFile f = TFile("Co57.root");
TCanvas* c1 = new TCanvas("c1", " ");
c1->SetLogy(0);
c1->SetLogy(1);
c1->cd();
c1->Update();
TH1D* hist1 = (TH1D*)f.Get("1");
hist1->Draw("HIST");
TH1D* hist2 = (TH1D*)f.Get("2");
hist2->Draw("HIST");
TH1D* hist3 = (TH1D*)f.Get("3");
hist3->Draw("HIST");
hist3->Draw("HIST");
TH1D* hist6 = (TH1D*)f.Get("6");
hist6->Draw("HIST");
TH1D* hist7 = (TH1D*)f.Get("7");
hist7->Draw("HIST");
TH1D* hist8 = (TH1D*)f.Get("8");
hist8->Draw("HIST");
}
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/rdecay01.cc
/// \brief Main program of the radioactivedecay/rdecay01 example
//
// $Id: rdecay01.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -41,7 +43,6 @@
#include "EventAction.hh"
#include "TrackingAction.hh"
#include "SteppingVerbose.hh"
#include "HistoManager.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
@@ -71,11 +72,10 @@ int main(int argc,char** argv) {
// set user action classes
//
HistoManager* histo = new HistoManager();
PrimaryGeneratorAction* prim = new PrimaryGeneratorAction();
RunAction* run = new RunAction(histo,prim);
RunAction* run = new RunAction(prim);
EventAction* event = new EventAction();
TrackingAction* track = new TrackingAction(histo,run,event);
TrackingAction* track = new TrackingAction(run,event);
runManager->SetUserAction(run);
runManager->SetUserAction(prim);
@@ -86,7 +86,12 @@ int main(int argc,char** argv) {
runManager->Initialize();
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
G4UImanager* UI = G4UImanager::GetUIpointer();
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
#endif
if (argc!=1) // batch mode
{
@@ -97,26 +102,22 @@ int main(int argc,char** argv) {
else // define visualization and UI terminal for interactive mode
{
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
#ifdef G4VIS_USE
G4VisManager* visManager = new G4VisExecutive;
visManager->Initialize();
UI->ApplyCommand("/control/execute vis.mac");
#endif
#ifdef G4UI_USE
G4UIExecutive * ui = new G4UIExecutive(argc,argv);
ui->SessionStart();
delete ui;
ui->SessionStart();
delete ui;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
}
#ifdef G4VIS_USE
delete visManager;
#endif
// job termination
//
delete histo;
delete runManager;
return 0;
@@ -1,128 +0,0 @@
############################################
!!! WARNING - FPE detection is activated !!!
############################################
*************************************************************
Geant4 version Name: geant4-09-05-ref-00 (2-December-2011)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
/run/verbose 2
#
/gun/particle ion
/gun/ion 10 24
#
/rdecay01/fullChain false
#
/rdecay01/histo/setFileName run1
###/rdecay01/histo/setFileType hbook
/rdecay01/histo/setFileType root
/rdecay01/histo/setHisto 1 100 0. 2000 keV
----> SetHisto 1: energy spectrum: e+ e- (keV); 100 bins from 0 keV to 2000 keV
/rdecay01/histo/setHisto 2 100 0. 2000 keV
----> SetHisto 2: energy spectrum: nu_e anti_nu_e (keV); 100 bins from 0 keV to 2000 keV
/rdecay01/histo/setHisto 3 100 0. 1000 keV
----> SetHisto 3: energy spectrum: gamma (keV); 100 bins from 0 keV to 1000 keV
/rdecay01/histo/setHisto 5 100 0. 200 eV
----> SetHisto 5: energy spectrum: ions (eV); 100 bins from 0 eV to 200 eV
/rdecay01/histo/setHisto 6 100 1. 2.5 MeV
----> SetHisto 6: total kinetic energy (Q) (MeV); 100 bins from 1 MeV to 2.5 MeV
/rdecay01/histo/setHisto 7 100 0. 1 eV
----> SetHisto 7: momentum balance (eV); 100 bins from 0 eV to 1 eV
/rdecay01/histo/setHisto 8 100 0. 70 min
----> SetHisto 8: total time of life of decay chain (min); 100 bins from 0 min to 70 min
#
/rdecay01/event/printModulo 10000
#
/run/beamOn 100000
Region <DefaultRegionForTheWorld> -- -- appears in <World> world volume
This region is in the mass world.
Root logical volume(s) : World
Pointers : G4VUserRegionInformation[0], G4UserLimits[0], G4FastSimulationManager[0], G4UserSteppingAction[0]
Materials : G4_AIR
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Region <DefaultRegionForParallelWorld> -- -- is not associated to any world.
Root logical volume(s) :
Pointers : G4VUserRegionInformation[0], G4UserLimits[0], G4FastSimulationManager[0], G4UserSteppingAction[0]
Materials :
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
========= Table of registered couples ==============================
Index : 0 used in the geometry : Yes recalculation needed : No
Material : G4_AIR
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 100 keV
Region(s) which use this couple :
DefaultRegionForTheWorld
====================================================================
Start closing geometry.
G4GeometryManager::ReportVoxelStats -- Voxel Statistics
Total memory consumed for geometry optimisation: 0 kByte
Total CPU time elapsed for geometry optimisation: 0 seconds
Start Run processing.
end of event 0 : Ne24[0.0] ---> Na24[472.2]
end of event 10000 : Ne24[0.0] ---> Na24[472.2]
end of event 20000 : Ne24[0.0] ---> Na24[472.2]
end of event 30000 : Ne24[0.0] ---> Na24[1346.6]
end of event 40000 : Ne24[0.0] ---> Na24[472.2]
end of event 50000 : Ne24[0.0] ---> Na24[472.2]
end of event 60000 : Ne24[0.0] ---> Na24[472.2]
end of event 70000 : Ne24[0.0] ---> Na24[472.2]
end of event 80000 : Ne24[0.0] ---> Na24[472.2]
end of event 90000 : Ne24[0.0] ---> Na24[472.2]
Run terminated.
Run Summary
Number of events processed : 100000
User=2.56s Real=2.6s Sys=0s
======================== run summary ======================
The run was 100000 Ne24[0.0] of 0 eV
===========================================================
Nb of generated particles:
Na24[1346.6]: 7943 Emean = 27.49 eV ( 0.06607 eV --> 53.72 eV )
Na24[472.2]: 92057 Emean = 72.73 eV ( 0.005133 eV --> 134.8 eV )
Ne24[0.0]: 100000 Emean = 0 eV ( 0 eV --> 0 eV )
anti_nu_e: 100000 Emean = 1.128 MeV ( 27.83 keV --> 1.998 MeV)
e-: 100000 Emean = 800.7 keV ( 82.78 eV --> 1.97 MeV)
Ekin Total (Q): mean = 1.928 MeV ( 1.123 MeV --> 1.998 MeV)
Momentum balance (excluding gamma desexcitation): mean = 0.01527 eV ( 0 eV --> 0.5493 eV )
Total time of life : mean = 4.899 min half-life = 3.396 min ( 10.4 ms --> 50.72 min)
Activity of Ne24[0.0] = 8.537e+19 Bq/g (2.307e+09 Ci/g)
UserDetectorConstruction deleted.
UserPhysicsList deleted.
UserRunAction deleted.
UserPrimaryGenerator deleted.
G4 kernel has come to Quit state.
EventManager deleted.
UImanager deleted.
Units table cleared.
StateManager deleted.
RunManagerKernel is deleted.
RunManager is deleting.
@@ -6,16 +6,14 @@
#
/rdecay01/fullChain false
#
/rdecay01/histo/setFileName run1
###/rdecay01/histo/setFileType hbook
/rdecay01/histo/setFileType root
/rdecay01/histo/setHisto 1 100 0. 2000 keV #e+ e-
/rdecay01/histo/setHisto 2 100 0. 2000 keV #neutrino
/rdecay01/histo/setHisto 3 100 0. 1000 keV #gamma
/rdecay01/histo/setHisto 5 100 0. 200 eV #recoil ion
/rdecay01/histo/setHisto 6 100 1. 2.5 MeV #EkinTot (Q)
/rdecay01/histo/setHisto 7 100 0. 1 eV #P balance
/rdecay01/histo/setHisto 8 100 0. 70 min #time of life
/analysis/setFileName run1
/analysis/h1/set 1 100 0. 2000 keV #e+ e-
/analysis/h1/set 2 100 0. 2000 keV #neutrino
/analysis/h1/set 3 100 0. 1000 keV #gamma
/analysis/h1/set 5 100 0. 200 eV #recoil ion
/analysis/h1/set 6 100 1. 2.5 MeV #EkinTot (Q)
/analysis/h1/set 7 100 0. 1 eV #P balance
/analysis/h1/set 8 100 0. 70 min #time of life
#
/rdecay01/event/printModulo 10000
#
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
// $Id: DetectorConstruction.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,12 +38,13 @@
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
{
worldSize = 2*um;
fWorldSize = 2*mm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -63,22 +66,22 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
// World
//
G4Box*
solidWorld = new G4Box("World", //its name
worldSize/2,worldSize/2,worldSize/2); //its size
solidWorld = new G4Box("World", //its name
fWorldSize/2,fWorldSize/2,fWorldSize/2);//its size
G4LogicalVolume*
logicWorld = new G4LogicalVolume(solidWorld, //its solid
Air, //its material
"World"); //its name
logicWorld = new G4LogicalVolume(solidWorld, //its solid
Air, //its material
"World"); //its name
G4VPhysicalVolume*
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
//
//always return the physical World
//
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EventAction.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/src/EventAction.cc
/// \brief Implementation of the EventAction class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,23 +40,23 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction()
:printModulo(10000),eventMessenger(0)
:fPrintModulo(10000),fEventMessenger(0)
{
eventMessenger = new EventMessenger(this);
fEventMessenger = new EventMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::~EventAction()
{
delete eventMessenger;
delete fEventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::BeginOfEventAction(const G4Event*)
{
decayChain = " ";
fDecayChain = " ";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -64,9 +66,9 @@ void EventAction::EndOfEventAction(const G4Event* evt)
G4int evtNb = evt->GetEventID();
//printing survey
//
if (evtNb%printModulo == 0)
if (evtNb%fPrintModulo == 0)
G4cout << "\n end of event " << std::setw(6) << evtNb
<< " :" + decayChain << G4endl;
<< " :" + fDecayChain << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: EventMessenger.cc,v 1.2 2010-09-17 11:21:45 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/src/EventMessenger.cc
/// \brief Implementation of the EventMessenger class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,36 +41,36 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventMessenger::EventMessenger(EventAction* EvAct)
:eventAction(EvAct)
:fEventAction(EvAct)
{
Dir = new G4UIdirectory("/rdecay01/");
Dir->SetGuidance("this example");
fDir = new G4UIdirectory("/rdecay01/");
fDir->SetGuidance("this example");
eventDir = new G4UIdirectory("/rdecay01/event/");
eventDir ->SetGuidance("event control");
fEventDir = new G4UIdirectory("/rdecay01/event/");
fEventDir ->SetGuidance("event control");
PrintCmd = new G4UIcmdWithAnInteger("/rdecay01/event/printModulo",this);
PrintCmd->SetGuidance("Print events modulo n");
PrintCmd->SetParameterName("EventNb",false);
PrintCmd->SetRange("EventNb>0");
PrintCmd->AvailableForStates(G4State_Idle);
fPrintCmd = new G4UIcmdWithAnInteger("/rdecay01/event/printModulo",this);
fPrintCmd->SetGuidance("Print events modulo n");
fPrintCmd->SetParameterName("EventNb",false);
fPrintCmd->SetRange("EventNb>0");
fPrintCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventMessenger::~EventMessenger()
{
delete PrintCmd;
delete eventDir;
delete Dir;
delete fPrintCmd;
delete fEventDir;
delete fDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if (command == PrintCmd)
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
if (command == fPrintCmd)
{fEventAction->SetPrintModulo(fPrintCmd->GetNewIntValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,253 +24,67 @@
// ********************************************************************
//
//
// $Id: HistoManager.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HistoManager.hh"
#include "HistoMessenger.hh"
#include "G4UnitsTable.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/AIDA.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
:af(0),tree(0),factoryOn(false)
: fFileName("rdecay01")
{
#ifdef G4ANALYSIS_USE
// Creating the analysis factory
af = AIDA_createAnalysisFactory();
if(!af) {
G4cout << " HistoManager::HistoManager() :"
<< " problem creating the AIDA analysis factory."
<< G4endl;
}
#endif
fileName[0] = "rdecay1";
fileType = "root";
fileOption = "";
// histograms
for (G4int k=0; k<MaxHisto; k++) {
histo[k] = 0;
exist[k] = false;
Unit[k] = 1.0;
Width[k] = 1.0;
ascii[k] = false;
}
histoMessenger = new HistoMessenger(this);
Book();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
delete histoMessenger;
delete G4AnalysisManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::Book()
{
// Create or get analysis manager
// The choice of analysis technology is done via selection of a namespace
// in HistoManager.hh
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetFileName(fFileName);
analysisManager->SetVerboseLevel(1);
analysisManager->SetActivation(true); //enable inactivation of histograms
#ifdef G4ANALYSIS_USE
delete af;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::book()
{
#ifdef G4ANALYSIS_USE
if(!af) return;
// Creating a tree mapped to an hbook file.
fileName[1] = fileName[0] + "." + fileType;
G4bool readOnly = false;
G4bool createNew = true;
AIDA::ITreeFactory* tf = af->createTreeFactory();
tree = tf->create(fileName[1], fileType, readOnly, createNew, fileOption);
delete tf;
if(!tree) {
G4cout << "HistoManager::book() :"
<< " problem creating the AIDA tree with "
<< " storeName = " << fileName[1]
<< " storeType = " << fileType
<< " readOnly = " << readOnly
<< " createNew = " << createNew
<< " options = " << fileOption
<< G4endl;
return;
}
// Creating a histogram factory, whose histograms will be handled by the tree
AIDA::IHistogramFactory* hf = af->createHistogramFactory(*tree);
// create selected histograms
for (G4int k=0; k<MaxHisto; k++) {
if (exist[k]) {
histo[k] = hf->createHistogram1D( Label[k], Title[k],
Nbins[k], Vmin[k], Vmax[k]);
factoryOn = true;
}
}
delete hf;
if (factoryOn)
G4cout << "\n----> Histogram Tree is opened in " << fileName[1] << G4endl;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::save()
{
#ifdef G4ANALYSIS_USE
if (factoryOn) {
saveAscii(); // Write ascii file, if any
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
G4cout << "\n----> Histogram Tree is saved in " << fileName[1] << G4endl;
delete tree;
tree = 0;
factoryOn = false;
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::FillHisto(G4int ih, G4double e, G4double weight)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::FillHisto() : histo " << ih
<< "does not exist; e= " << e << " w= " << weight << G4endl;
return;
}
#ifdef G4ANALYSIS_USE
if(exist[ih]) histo[ih]->fill(e/Unit[ih], weight);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetHisto(G4int ih,
G4int nbins, G4double valmin, G4double valmax, const G4String& unit)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::SetHisto() : histo " << ih
<< "does not exist" << G4endl;
return;
}
const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7" , "8" };
// Define histograms start values
const G4int kMaxHisto = 9;
const G4String id[] = {"0","1","2","3","4","5","6","7","8"};
const G4String title[] =
{ "dummy", //0
"energy spectrum: e+ e-", //1
"energy spectrum: nu_e anti_nu_e", //2
"energy spectrum: gamma", //3
"energy spectrum: alpha", //4
"energy spectrum: ions", //5
"total kinetic energy (Q)", //6
"momentum balance", //7
"total time of life of decay chain" //8
};
{ "dummy", //0
"energy spectrum (%): e+ e-", //1
"energy spectrum (%): nu_e anti_nu_e", //2
"energy spectrum (%): gamma", //3
"energy spectrum (%): alpha", //4
"energy spectrum (%): ions", //5
"total kinetic energy (Q)", //6
"momentum balance", //7
"total time of life of decay chain" //8
};
// Default values (to be reset via /analysis/h1/set command)
G4int nbins = 100;
G4double vmin = 0.;
G4double vmax = 100.;
G4String titl = title[ih];
G4double vmin = valmin, vmax = valmax;
Unit[ih] = 1.;
if (unit != "none") {
titl = title[ih] + " (" + unit + ")";
Unit[ih] = G4UnitDefinition::GetValueOf(unit);
vmin = valmin/Unit[ih]; vmax = valmax/Unit[ih];
// Create all histograms as inactivated
// as we have not yet set nbins, vmin, vmax
for (G4int k=0; k<kMaxHisto; k++) {
G4int ih = analysisManager->CreateH1(id[k], title[k], nbins, vmin, vmax);
analysisManager->SetActivation(G4VAnalysisManager::kH1, ih, false);
}
exist[ih] = true;
Label[ih] = id[ih];
Title[ih] = titl;
Nbins[ih] = nbins;
Vmin[ih] = vmin;
Vmax[ih] = vmax;
Width[ih] = (valmax-valmin)/nbins;
G4cout << "----> SetHisto " << ih << ": " << titl << "; "
<< nbins << " bins from "
<< vmin << " " << unit << " to " << vmax << " " << unit << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::Normalize(G4int ih, G4double fac)
{
if (ih >= MaxHisto) {
G4cout << "---> warning from HistoManager::Normalize() : histo " << ih
<< " fac= " << fac << G4endl;
return;
}
#ifdef G4ANALYSIS_USE
if(exist[ih]) histo[ih]->scale(fac);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::RemoveHisto(G4int ih)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::RemoveHisto() : histo " << ih
<< "does not exist" << G4endl;
return;
}
histo[ih] = 0; exist[ih] = false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::PrintHisto(G4int ih)
{
if (ih < MaxHisto) { ascii[ih] = true; ascii[0] = true; }
else
G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
<< "does not exist" << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include <fstream>
void HistoManager::saveAscii()
{
#ifdef G4ANALYSIS_USE
if (!ascii[0]) return;
G4String name = fileName[0] + ".ascii";
std::ofstream File(name, std::ios::out);
File.setf( std::ios::scientific, std::ios::floatfield );
//write selected histograms
for (G4int ih=0; ih<MaxHisto; ih++) {
if (exist[ih] && ascii[ih]) {
File << "\n 1D histogram " << ih << ": " << Title[ih]
<< "\n \n \t X \t\t Y" << G4endl;
for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
File << " " << iBin << "\t"
<< 0.5*(histo[ih]->axis().binLowerEdge(iBin) +
histo[ih]->axis().binUpperEdge(iBin)) << "\t"
<< histo[ih]->binHeight(iBin)
<< G4endl;
}
}
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,145 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: HistoMessenger.cc,v 1.2 2010-09-17 11:21:46 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HistoMessenger.hh"
#include <sstream>
#include "HistoManager.hh"
#include "G4UIdirectory.hh"
#include "G4UIcommand.hh"
#include "G4UIparameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoMessenger::HistoMessenger(HistoManager* manager)
:histoManager (manager)
{
histoDir = new G4UIdirectory("/rdecay01/histo/");
histoDir->SetGuidance("histograms control");
factoryCmd = new G4UIcmdWithAString("/rdecay01/histo/setFileName",this);
factoryCmd->SetGuidance("set name for the histograms file");
typeCmd = new G4UIcmdWithAString("/rdecay01/histo/setFileType",this);
typeCmd->SetGuidance("set histograms file type: hbook, root, XML");
typeCmd->SetCandidates("hbook root XML");
optionCmd = new G4UIcmdWithAString("/rdecay01/histo/setFileOption",this);
optionCmd->SetGuidance("set option for the histograms file");
histoCmd = new G4UIcommand("/rdecay01/histo/setHisto",this);
histoCmd->SetGuidance("Set bining of the histo number ih :");
histoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
//
G4UIparameter* ih = new G4UIparameter("ih",'i',false);
ih->SetGuidance("histo number : from 1 to MaxHisto");
ih->SetParameterRange("ih>0");
histoCmd->SetParameter(ih);
//
G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
nbBins->SetGuidance("number of bins");
nbBins->SetParameterRange("nbBins>0");
histoCmd->SetParameter(nbBins);
//
G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
valMin->SetGuidance("valMin, expressed in unit");
histoCmd->SetParameter(valMin);
//
G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
valMax->SetGuidance("valMax, expressed in unit");
histoCmd->SetParameter(valMax);
//
G4UIparameter* unit = new G4UIparameter("unit",'s',true);
unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
unit->SetDefaultValue("none");
histoCmd->SetParameter(unit);
prhistoCmd = new G4UIcmdWithAnInteger("/rdecay01/histo/printHisto",this);
prhistoCmd->SetGuidance("print histo #id on ascii file");
prhistoCmd->SetParameterName("id",false);
prhistoCmd->SetRange("id>0");
rmhistoCmd = new G4UIcmdWithAnInteger("/rdecay01/histo/removeHisto",this);
rmhistoCmd->SetGuidance("desactivate histo #id");
rmhistoCmd->SetParameterName("id",false);
rmhistoCmd->SetRange("id>0");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoMessenger::~HistoMessenger()
{
delete rmhistoCmd;
delete prhistoCmd;
delete histoCmd;
delete optionCmd;
delete typeCmd;
delete factoryCmd;
delete histoDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
if (command == factoryCmd)
histoManager->SetFileName(newValues);
if (command == typeCmd)
histoManager->SetFileType(newValues);
if (command == optionCmd)
histoManager->SetFileOption(newValues);
if (command == histoCmd)
{ G4int ih,nbBins; G4double vmin,vmax; char unts[30];
const char* t = newValues;
std::istringstream is(t);
is >> ih >> nbBins >> vmin >> vmax >> unts;
G4String unit = unts;
G4double vUnit = 1. ;
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
histoManager->SetHisto (ih,nbBins,vmin*vUnit,vmax*vUnit,unit);
}
if (command == prhistoCmd)
histoManager->PrintHisto(prhistoCmd->GetNewIntValue(newValues));
if (command == rmhistoCmd)
histoManager->RemoveHisto(rmhistoCmd->GetNewIntValue(newValues));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
// $Id: PhysicsList.cc,v 1.2 2010-10-11 14:31:39 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,8 +36,11 @@
#include "G4UnitsTable.hh"
#include "G4ParticleTypes.hh"
#include "G4IonConstructor.hh"
#include "G4ProcessManager.hh"
#include "G4PhysicsListHelper.hh"
#include "G4RadioactiveDecay.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -93,11 +98,19 @@ void PhysicsList::ConstructProcess()
G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
radioactiveDecay->SetHLThreshold(-1.*s);
radioactiveDecay->SetICM(true); //Internal Conversion
radioactiveDecay->SetARM(false); //Atomic Rearangement
radioactiveDecay->SetICM(true); //Internal Conversion
radioactiveDecay->SetARM(false); //Atomic Rearangement
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
G4ProcessManager* pmanager = G4GenericIon::GenericIon()->GetProcessManager();
pmanager->AddProcess(radioactiveDecay, 0, -1, 1);
// Deexcitation (in case of Atomic Rearangement)
//
G4UAtomicDeexcitation* de = new G4UAtomicDeexcitation();
de->SetFluo(true);
de->SetAuger(true);
de->SetPIXE(false);
G4LossTableManager::Instance()->SetAtomDeexcitation(de);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/PrimaryGeneratorAction.cc
/// \brief Implementation of the PrimaryGeneratorAction class
//
// $Id: PrimaryGeneratorAction.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,6 +38,7 @@
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4Geantino.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -43,37 +46,37 @@
PrimaryGeneratorAction::PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
fParticleGun = new G4ParticleGun(n_particle);
particleGun->SetParticleEnergy(0*eV);
particleGun->SetParticlePosition(G4ThreeVector(0.,0.,0.));
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
fParticleGun->SetParticleEnergy(0*eV);
fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,0.));
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete particleGun;
delete fParticleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
if (particleGun->GetParticleDefinition() == G4Geantino::Geantino()) {
if (fParticleGun->GetParticleDefinition() == G4Geantino::Geantino()) {
G4int Z = 10, A = 24;
G4double ionCharge = 0.*eplus;
G4double excitEnergy = 0.*keV;
G4ParticleDefinition* ion
= G4ParticleTable::GetParticleTable()->GetIon(Z,A,excitEnergy);
particleGun->SetParticleDefinition(ion);
particleGun->SetParticleCharge(ionCharge);
fParticleGun->SetParticleDefinition(ion);
fParticleGun->SetParticleCharge(ionCharge);
}
//create vertex
//
particleGun->GeneratePrimaryVertex(anEvent);
fParticleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/RunAction.cc
/// \brief Implementation of the RunAction class
//
// $Id: RunAction.cc,v 1.2 2010-10-11 14:31:39 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -37,18 +39,24 @@
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(HistoManager* histo, PrimaryGeneratorAction* kin)
:histoManager(histo), primary(kin)
{ }
RunAction::RunAction(PrimaryGeneratorAction* kin)
:fPrimary(kin)
{
fHistoManager = new HistoManager();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{ }
{
delete fHistoManager;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,13 +64,16 @@ void RunAction::BeginOfRunAction(const G4Run*)
{
//initialize arrays
//
decayCount = timeCount = 0;
for (G4int i=0; i<3; i++) EkinTot[i] = Pbalance[i] = EventTime[i] = 0. ;
PrimaryTime = 0.;
fDecayCount = fTimeCount = 0;
for (G4int i=0; i<3; i++) fEkinTot[i] = fPbalance[i] = fEventTime[i] = 0. ;
fPrimaryTime = 0.;
//histograms
//
histoManager->book();
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if ( analysisManager->IsActive() ) {
analysisManager->OpenFile();
}
//inform the runManager to save random number seed
//
@@ -73,48 +84,48 @@ void RunAction::BeginOfRunAction(const G4Run*)
void RunAction::ParticleCount(G4String name, G4double Ekin)
{
particleCount[name]++;
Emean[name] += Ekin;
fParticleCount[name]++;
fEmean[name] += Ekin;
//update min max
if (particleCount[name] == 1) Emin[name] = Emax[name] = Ekin;
if (Ekin < Emin[name]) Emin[name] = Ekin;
if (Ekin > Emax[name]) Emax[name] = Ekin;
if (fParticleCount[name] == 1) fEmin[name] = fEmax[name] = Ekin;
if (Ekin < fEmin[name]) fEmin[name] = Ekin;
if (Ekin > fEmax[name]) fEmax[name] = Ekin;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::Balance(G4double Ekin, G4double Pbal)
{
decayCount++;
EkinTot[0] += Ekin;
fDecayCount++;
fEkinTot[0] += Ekin;
//update min max
if (decayCount == 1) EkinTot[1] = EkinTot[2] = Ekin;
if (Ekin < EkinTot[1]) EkinTot[1] = Ekin;
if (Ekin > EkinTot[2]) EkinTot[2] = Ekin;
if (fDecayCount == 1) fEkinTot[1] = fEkinTot[2] = Ekin;
if (Ekin < fEkinTot[1]) fEkinTot[1] = Ekin;
if (Ekin > fEkinTot[2]) fEkinTot[2] = Ekin;
Pbalance[0] += Pbal;
fPbalance[0] += Pbal;
//update min max
if (decayCount == 1) Pbalance[1] = Pbalance[2] = Pbal;
if (Pbal < Pbalance[1]) Pbalance[1] = Pbal;
if (Pbal > Pbalance[2]) Pbalance[2] = Pbal;
if (fDecayCount == 1) fPbalance[1] = fPbalance[2] = Pbal;
if (Pbal < fPbalance[1]) fPbalance[1] = Pbal;
if (Pbal > fPbalance[2]) fPbalance[2] = Pbal;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EventTiming(G4double time)
{
timeCount++;
EventTime[0] += time;
if (timeCount == 1) EventTime[1] = EventTime[2] = time;
if (time < EventTime[1]) EventTime[1] = time;
if (time > EventTime[2]) EventTime[2] = time;
fTimeCount++;
fEventTime[0] += time;
if (fTimeCount == 1) fEventTime[1] = fEventTime[2] = time;
if (time < fEventTime[1]) fEventTime[1] = time;
if (time > fEventTime[2]) fEventTime[2] = time;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::PrimaryTiming(G4double ptime)
{
PrimaryTime += ptime;
fPrimaryTime += ptime;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -122,12 +133,12 @@ void RunAction::PrimaryTiming(G4double ptime)
void RunAction::EndOfRunAction(const G4Run* run)
{
G4int nbEvents = run->GetNumberOfEvent();
if (nbEvents == 0) return;
if (nbEvents == 0) { return; }
G4ParticleDefinition* particle = primary->GetParticleGun()
G4ParticleDefinition* particle = fPrimary->GetParticleGun()
->GetParticleDefinition();
G4String partName = particle->GetParticleName();
G4double eprimary = primary->GetParticleGun()->GetParticleEnergy();
G4double eprimary = fPrimary->GetParticleGun()->GetParticleEnergy();
G4cout << "\n ======================== run summary ======================";
G4cout << "\n The run was " << nbEvents << " " << partName << " of "
@@ -143,75 +154,91 @@ void RunAction::EndOfRunAction(const G4Run* run)
G4cout << " Nb of generated particles: \n" << G4endl;
std::map<G4String,G4int>::iterator it;
for (it = particleCount.begin(); it != particleCount.end(); it++) {
for (it = fParticleCount.begin(); it != fParticleCount.end(); it++) {
G4String name = it->first;
G4int count = it->second;
G4double eMean = Emean[name]/count;
G4double eMin = Emin[name], eMax = Emax[name];
G4double eMean = fEmean[name]/count;
G4double eMin = fEmin[name], eMax = fEmax[name];
G4cout << " " << std::setw(13) << name << ": " << std::setw(7) << count
<< " Emean = " << std::setw(wid) << G4BestUnit(eMean, "Energy")
<< "\t( " << G4BestUnit(eMin, "Energy")
<< " --> " << G4BestUnit(eMax, "Energy")
<< ")" << G4endl;
<< "\t( " << G4BestUnit(eMin, "Energy")
<< " --> " << G4BestUnit(eMax, "Energy")
<< ")" << G4endl;
}
//energy momentum balance
//
G4double Ebmean = EkinTot[0]/decayCount;
G4double Pbmean = Pbalance[0]/decayCount;
if (fDecayCount > 0) {
G4double Ebmean = fEkinTot[0]/fDecayCount;
G4double Pbmean = fPbalance[0]/fDecayCount;
G4cout << "\n Ekin Total (Q): mean = "
<< std::setw(wid) << G4BestUnit(Ebmean, "Energy")
<< "\t( " << G4BestUnit(EkinTot[1], "Energy")
<< " --> " << G4BestUnit(EkinTot[2], "Energy")
<< ")" << G4endl;
G4cout << "\n Momentum balance (excluding gamma desexcitation): mean = "
<< std::setw(wid) << G4BestUnit(Pbmean, "Energy")
<< "\t( " << G4BestUnit(Pbalance[1], "Energy")
<< " --> " << G4BestUnit(Pbalance[2], "Energy")
<< ")" << G4endl;
G4cout << "\n Ekin Total (Q): mean = "
<< std::setw(wid) << G4BestUnit(Ebmean, "Energy")
<< "\t( " << G4BestUnit(fEkinTot[1], "Energy")
<< " --> " << G4BestUnit(fEkinTot[2], "Energy")
<< ")" << G4endl;
G4cout << "\n Momentum balance (excluding gamma desexcitation): mean = "
<< std::setw(wid) << G4BestUnit(Pbmean, "Energy")
<< "\t( " << G4BestUnit(fPbalance[1], "Energy")
<< " --> " << G4BestUnit(fPbalance[2], "Energy")
<< ")" << G4endl;
}
//total time of life
//
G4double Tmean = EventTime[0]/timeCount;
G4double halfLife = Tmean*std::log(2.);
if (fTimeCount > 0) {
G4double Tmean = fEventTime[0]/fTimeCount;
G4double halfLife = Tmean*std::log(2.);
G4cout << "\n Total time of life : mean = "
<< std::setw(wid) << G4BestUnit(Tmean, "Time")
<< " half-life = "
<< std::setw(wid) << G4BestUnit(halfLife, "Time")
<< " ( " << G4BestUnit(EventTime[1], "Time")
<< " --> " << G4BestUnit(EventTime[2], "Time")
<< ")" << G4endl;
G4cout << "\n Total time of life : mean = "
<< std::setw(wid) << G4BestUnit(Tmean, "Time")
<< " half-life = "
<< std::setw(wid) << G4BestUnit(halfLife, "Time")
<< " ( " << G4BestUnit(fEventTime[1], "Time")
<< " --> " << G4BestUnit(fEventTime[2], "Time")
<< ")" << G4endl;
}
//activity of primary ion
//
G4double pTimeMean = PrimaryTime/nbEvents;
G4double pTimeMean = fPrimaryTime/nbEvents;
G4double molMass = particle->GetAtomicMass()*g/mole;
G4double nAtoms = Avogadro/molMass;
G4double ActivPerAtom = 1./pTimeMean;
G4double ActivPerMass = ActivPerAtom*nAtoms;
G4double nAtoms_perUnitOfMass = Avogadro/molMass;
G4double Activity_perUnitOfMass = 0.0;
if (pTimeMean > 0.0)
{ Activity_perUnitOfMass = nAtoms_perUnitOfMass/pTimeMean; }
G4cout << "\n Activity of " << partName << " = "
<< std::setw(wid) << ActivPerMass*g/becquerel
<< " Bq/g (" << ActivPerMass*g/curie
<< " Ci/g) \n"
<< G4endl;
// remove all contents in particleCount
<< std::setw(wid) << Activity_perUnitOfMass*g/becquerel
<< " Bq/g (" << Activity_perUnitOfMass*g/curie
<< " Ci/g) \n"
<< G4endl;
// remove all contents in fParticleCount
//
particleCount.clear();
Emean.clear(); Emin.clear(); Emax.clear();
fParticleCount.clear();
fEmean.clear(); fEmin.clear(); fEmax.clear();
// restore default precision
//
G4cout.precision(dfprec);
//save histograms
//
histoManager->save();
//normalize and save histograms
//
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
G4double factor = 100./nbEvents;
analysisManager->ScaleH1(1,factor);
analysisManager->ScaleH1(2,factor);
analysisManager->ScaleH1(3,factor);
analysisManager->ScaleH1(4,factor);
analysisManager->ScaleH1(5,factor);
if ( analysisManager->IsActive() ) {
analysisManager->Write();
analysisManager->CloseFile();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/SteppingVerbose.cc
/// \brief Implementation of the SteppingVerbose class
//
// $Id: SteppingVerbose.cc,v 1.1 2010-09-16 16:26:13 gcosmo Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -58,26 +60,26 @@ void SteppingVerbose::StepInfo()
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName();
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName();
const G4VProcess* process
= fStep->GetPostStepPoint()->GetProcessDefinedStep();
@@ -89,28 +91,28 @@ void SteppingVerbose::StepInfo()
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << "\n :----- List of secondaries ----------------"
<< G4endl;
G4cout << "\n :----- List of secondaries ----------------"
<< G4endl;
G4cout.precision(4);
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " "
<< std::setw(13)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
<< ": energy ="
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< " time ="
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
G4cout << G4endl;
}
G4cout << " "
<< std::setw(13)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
<< ": energy ="
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< " time ="
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
G4cout << G4endl;
}
G4cout << " :------------------------------------------\n"
<< G4endl;
G4cout << " :------------------------------------------\n"
<< G4endl;
}
}
@@ -129,25 +131,25 @@ G4int prec = G4cout.precision(3);
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName()
<< " initStep" << G4endl;
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName()
<< " initStep" << G4endl;
}
G4cout.precision(prec);
}
@@ -23,9 +23,11 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay01/src/TrackingAction.cc
/// \brief Implementation of the TrackingAction class
//
// $Id: TrackingAction.cc,v 1.2 2010-10-11 14:31:39 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -43,19 +45,18 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingAction::TrackingAction(HistoManager* histo,
RunAction* RA, EventAction* EA)
:histoManager(histo),run(RA),event(EA)
TrackingAction::TrackingAction(RunAction* RA, EventAction* EA)
:fRun(RA),fEvent(EA)
{
fullChain = false;
trackMessenger = new TrackingMessenger(this);
fTrackMessenger = new TrackingMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingAction::~TrackingAction()
{
delete trackMessenger;
delete fTrackMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -64,8 +65,8 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
{
G4ParticleDefinition* particle = track->GetDefinition();
G4String name = particle->GetParticleName();
charge = particle->GetPDGCharge();
mass = particle->GetPDGMass();
fCharge = particle->GetPDGCharge();
fMass = particle->GetPDGMass();
G4double Ekin = track->GetKineticEnergy();
G4int ID = track->GetTrackID();
@@ -74,7 +75,7 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
//count particles
//
run->ParticleCount(name, Ekin);
fRun->ParticleCount(name, Ekin);
//energy spectrum
//
@@ -85,19 +86,19 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
particle == G4AntiNeutrinoE::AntiNeutrinoE()) ih = 2;
else if (particle == G4Gamma::Gamma()) ih = 3;
else if (particle == G4Alpha::Alpha()) ih = 4;
else if (charge > 2.) ih = 5;
if (ih) histoManager->FillHisto(ih, Ekin);
else if (fCharge > 2.) ih = 5;
if (ih) G4AnalysisManager::Instance()->FillH1(ih, Ekin);
//fullChain: stop ion and print decay chain
//
if (charge > 2.) {
if (fCharge > 2.) {
G4Track* tr = (G4Track*) track;
if (fullChain) tr->SetTrackStatus(fStopButAlive);
if (ID == 1) event->AddDecayChain(name);
else event->AddDecayChain(" ---> " + name);
if (ID == 1) fEvent->AddDecayChain(name);
else fEvent->AddDecayChain(" ---> " + name);
}
//example of saving random number seed of this event, under condition
//example of saving random number seed of this fEvent, under condition
//
////condition = (ih == 3);
if (condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
@@ -109,13 +110,15 @@ void TrackingAction::PostUserTrackingAction(const G4Track* track)
{
//keep only ions
//
if (charge < 3. ) return;
if (fCharge < 3. ) return;
G4AnalysisManager* analysis = G4AnalysisManager::Instance();
//get time
//
G4double time = track->GetGlobalTime();
G4int ID = track->GetTrackID();
if (ID == 1) run->PrimaryTiming(time); //time of life of primary ion
if (ID == 1) fRun->PrimaryTiming(time); //time of life of primary ion
//energy and momentum balance (from secondaries)
//
@@ -134,20 +137,20 @@ void TrackingAction::PostUserTrackingAction(const G4Track* track)
G4Track* trk = (*secondaries)[itr];
EkinTot += trk->GetKineticEnergy();
//exclude gamma desexcitation from momentum balance
if (trk->GetDefinition() != G4Gamma::Gamma())
Pbalance += trk->GetMomentum();
if (trk->GetDefinition() != G4Gamma::Gamma())
Pbalance += trk->GetMomentum();
}
G4double Pbal = Pbalance.mag();
run->Balance(EkinTot,Pbal);
histoManager->FillHisto(6,EkinTot);
histoManager->FillHisto(7,Pbal);
fRun->Balance(EkinTot,Pbal);
analysis->FillH1(6,EkinTot);
analysis->FillH1(7,Pbal);
}
//no secondaries --> end of chain
//
if (!nbtrk) {
run->EventTiming(time); //total time of life
histoManager->FillHisto(8,time);
fRun->EventTiming(time); //total time of life
analysis->FillH1(8,time);
}
}
@@ -23,8 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: TrackingMessenger.cc,v 1.2 2010-09-17 11:21:46 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file radioactivedecay/rdecay01/src/TrackingMessenger.cc
/// \brief Implementation of the TrackingMessenger class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -37,27 +39,27 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingMessenger::TrackingMessenger(TrackingAction* trackA)
:trackingAction(trackA)
:fTrackingAction(trackA)
{
TrackingCmd = new G4UIcmdWithABool("/rdecay01/fullChain",this);
TrackingCmd->SetGuidance("allow full decay chain");
TrackingCmd->SetParameterName("flag",true);
TrackingCmd->SetDefaultValue(true);
fTrackingCmd = new G4UIcmdWithABool("/rdecay01/fullChain",this);
fTrackingCmd->SetGuidance("allow full decay chain");
fTrackingCmd->SetParameterName("flag",true);
fTrackingCmd->SetDefaultValue(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TrackingMessenger::~TrackingMessenger()
{
delete TrackingCmd;
delete fTrackingCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackingMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if (command == TrackingCmd)
{ trackingAction->SetFullChain(TrackingCmd->GetNewBoolValue(newValue));}
if (command == fTrackingCmd)
{ fTrackingAction->SetFullChain(fTrackingCmd->GetNewBoolValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,306 @@
//$Id$
///\file "radioactivedecay/rdecay02/.README"
///\brief Example rdecay02 README page
/*! \page Examplerdecay02 Example rdecay02
Rdecay02 is created to show how to use the G4RadioactiveDecay process to simulate the decays of
radioactive isotopes as well as the induced radioactivity resulted from nuclear interactions.
In this example a simple geometry consists of a cylindric target placed in the centre of a tube detector
is constructed. Various primary event generation and tallying options are available. Further documentations
are available at
http://reat.space.qinetiq.com/septimess/exrdm
\section rdecay02_s1 GEOMETRY
Material: There are 7 pre-defined materials:
- "Vacuum" "Air" "Silicon" "Aluminium" "Lead" "Germanium" and "CsI"
User can add a new material at the "PreIni" state, using the command
\verbatim
/geometry/material/add
\endverbatim
For the geometry, the world is filled with "Air" and there are two components in it
- Target: A cylinder placed at the origin along the z-axis. The default size of the cylinder is
0.5 cm radius and 1 cm in length, and its default material is "CsI".
- Detector:A tube cerntred at the origin along the z-axis, with inner radius matching the
radius of the target. The default thickness of the tube is 2 cm and it is
5 cm long. The default material is "Germanium".
The user can change the target/detector size and material at the at the "PreIni" state, using the
commands in the directory
\verbatim
/exrdm/det
\endverbatim
\section rdecay02_s2 PHYSICS
The following physics processes are included by default:
- Standard electromagnetic:
- photo-electric effect
- Compton scattering
- pair production
- bremsstrahlung
- ionization
- multiple scattering
- annihilation
- Decay
- Radioactive Decay
By default it is applied through out the geometry. The user can limit it to just the target by
commands
\verbatim
/grdm/noVolumes
/grdm/selectVolume Target
\endverbatim
- Hadronic processes:
Hadronic processes are not invoked by default. They can be activated by the user at the "PreIni"
state via the command
\verbatim
/exrdm/phys/SelectPhysics
\endverbatim
The options are:
- "Hadron" - Physicslist comsists of Binary_Cascade, HP_Neutron, QGSP, and LHEP, or
the standdard hadron physics list avaible in the G4 distribution, i.e.
"QGSP_BERT", "QGSP_BIC", "QGSP_HP", "LHEP_BERT", "LHEP_BERT_HP", "LHEP_BIC",
"LHEP_BIC_HP".
\section rdecay02_s3 EVENT
The event generator is based on the G4GeneralParticleSource (GPS) which allows the user to
control all aspects of the initial states of the events. In this example, however, only simple features
of the GPS are employed to generate the incident beam or the initial radio-isotopes. By default the
incident particle is travelling along the + z-axis and the incident position is at the -Z end
of the geometry.
\section rdecay02_s4 DETECTOR RESPONSE
No Geant4 HITS and SD are defined in this example. If the variable "G4ANALYSIS_USE" is defined, all
the relevant information of the simulation is collected at the "UserSteppingAction" stage. These
include:
- Emission particles in the RadioactiveDecay process:
- particle PDGcode,
- particle kinetic energy,
- particle creation time,
- particle weight. \n
Note: the residual nuclei is not considered as an emitted particle.
- Radio-Isotopes. All the radioactive isotopes produced in the simulation:
- isotope PDGcode,
- isotope creation time,
- isotope weight.
- Energy depositions in the target and detector by prodicts of the RadioactiveDecay process:
- energy depostion (positive volue for target and negative for detector),
- time,
- weight.
\section rdecay02_s5 VISUALIZATION
Visualisation of the geometry and the tracks is possible with many of the G4 visualisation packages. An
example of display the geometry and tracks using VRML is given in the macro file macros/vis.mac.
\section rdecay02_s6 ANALYSIS
This example implements an AIDA-compliant analysis system as well as the ROOT system, for accumulating
and output histograms and ntuples.
When the example is built with CMake the analysis system is activated automatically
when the AIDA-compliant analysis system and/or the ROOT system is found.
When the example is built with GNUmake and the user has an AIDA-compliant tool such
as AIDAJNI, ANAPHE, OpenScientist or PI installed, the analysis part of this example can
be activated by
\verbatim
setenv G4ANALYSIS_USE 1
\endverbatim
before building the executable.
The user can also use the executable with the ROOT system, if it is available. This is done by
\verbatim
setenv G4ANALYSIS_USE_ROOT 1
\endverbatim
again before the compilation. The AIDA and ROOT systems can be used individually, or in parallel
at the same time!
If no analysis system is activated, there is no output file produced apart from the screen dump.
A file called "exrdm.aida" is produced by default for AIDA system and "exrdm.root" if the ROOT
system is selected.
The user can change the name of this output file with the command
\verbatim
/histo/fileName new-filename
\endverbatim
The output AIDA file by default is in xml format. The AIDA system allows the use of other file format
such as "root" and "hbook". User can change the output format to "hbook" or "root" using the command
/histo/fileType.e.g.
\verbatim
/histo/fileType hbook
/histo/fileType root
\endverbatim
When "root" format is selected for the AIDA system, the output AIDA file name is changed to
fileName_aida.root. This is to separate it from the the ROOT system output file fileName.root, in case
both systems are used.
The output file, in "aida" or "hbook" or "root" format, conatins the 3 ntuples (100,200,300) which have
been described in section 4. In addition, there are 7 histograms in the file:
- histogram 10: The Pulse Height Spectrum (PHS) of the target.
- histogram 11: The PHS of the detector.
- histogram 12: The combined PHS of the target and detector.
- histogram 13: The anti-coincidece PHS of the target.
- histogram 14: The anti-coincidece PHS of the detector.
- histogram 15: The coincidece PHS between the target and detector.
- histogram 16: The emitted particle energy spectrum.
The binnings of each histogram can be changed with the command
\verbatim
/histo/setHisto
\endverbatim
It is assumed the detector and target pulses both have an integration time of 1 microsecond, and the
gate is 2 microsecond for the coincidence spectrum. The target and detctor have a threshold of 10 keV
in the anti-/coincidence modes.
Histograms 10-15 were derived from the same data stored in ntuple-300(the energy depositions), while
Histogram 16 is obtained with data in ntuple-100 (the emission particles). The user should be able to
reproduce these histograms, or new histograms, with the ntuple data in an off-line analyis tool.
\section rdecay02_s7 GETTING STARTED
i) Build the exRDM executable:
- A) With CMake
- Build the executable (in your CMAKE build directory):
\verbatim
cd to_rdecay02_build
make
\endverbatim
- B) With GNUmake
- If you have an AIDA-compliant analysis system installed than you shall switch on the analysis part of
example by
\verbatim
setenv G4ANALYSIS_USE 1
\endverbatim
in addition if you want to add the ROOT link to the ROOT system, do
\verbatim
setenv G4ANALYSIS_USE_ROOT 1
\endverbatim
\n
- Otherwise make sure the G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT are not definded
\verbatim
unsetenv G4ANALYSIS_USE
unsetenv G4ANALYSIS_USE_ROOT
\endverbatim
\n
- Build the exRDM executable:
\verbatim
cd to rdecay02
gmake clean
gmake
\endverbatim
The executable, named rdecay02, will be in $G4WORKDIR/bin/$G4SYSTEM/ directory.
ii) Run the executable: while in the rdecay02 build directory (A) or its source
directory (B) do
\verbatim
rdecay02 rdecay02.in
\endverbatim
If all goes well, the execution shall be terminated in a few seconds. If G4ANALYSIS_USE is defined, one
should see a "proton.aida" file created. If G4ANALYSIS_USE_ROOT is defined, there will be
a proton.root file in the same directory.
\section rdecay02_s8 FURTHER EXAMPLES
There are a number of g4mac files in the ./macros subdirectory, to show the features of the
G4RadioactiveDecay process. Most of them will lead to the creation of an aida file in the same name
of the micro file, which can be examed and analysed with an analysis tool such as OpenScientist ,or JAS3.
- vrml.mac: to visulise the geometry and the incident of one 100 MeV Cf240 isotope and its decay. A vrml
file (g4_xx.vrml) is created at the end. If a default vrml viewer has been set, one shall
see the geometru and track displayed automatically.
- u238c.mac: shows the decays of the U238 chain in analogue MC mode.
- th234c-b.mac: shows the decays of Th234 in variance reduction MC mode. All its secondaies in along the
decay chains are generated. The default source profile and decay biasing schemes are used
to determine the decay times and weights of the secondaries.
- proton-1gev.mac: simulation of 1 GeV protons incident on a lead target. The decays of the radio-siotopes
created in the proton-lead interactions are simulated with RadioactiveDecay in analogue
MC mode.
- proton-b.mac: same as proton-1geV.mac, but the decays of the radio-siotopes created in the proton-lead
interactions are simulated with RadioactiveDecay in variance reduction MC mode. The isotopes
and those along the decay chains are forced to decay in the time windows specified by the
user in file measures.data, and the weights of the decay products are determined by the
beam profile as defined in the beam.data file and their decay times.
- one-iso.mac: simple macro file to show how to simulate the decay of a specific radio-isotope. User can
edit it to simulate which ever isotope he/she likes to try.
- neutron.mac: macrofile to show the incident of low energy neutrons on an user specified NaI target and
the decays of the induced radio-isotopes. This shows how to define a new material in exrdm.
- ne24.mac: this shows the decays of Ne-24 to Na-24 in variance reduction MC mode. Further decays of Na-24
are not simulated by applying the nucleuslimits in RadioactiveDecay. Two runs are carried out.
One with the bracjing ratio biasing applied and one without.
- multiple-source.mac: to show the decays of different isotopes uniformly distributed through the target
volume in a single run.
- isotopes.mac: to show the decays of a number of different isotopes in a single macro file.
- f24.mac: to show the different treatments one can apply to the decays of F24. i) the complete decay chain
from F24 to Mg24, in analogue mode; ii) the complete chain, but in variance reduction mode;
iii) restrict to the decay of F24 only in analogue mode; iv) restrict to the decay of F24 only but
in variance reduction mode.
- as74.mac: The decays of As74 which has a rather complicated decay scheme. i) in analogue MC mode; ii) in
variance reduction MC mode.
- test.mac: macro used to check if the right physics processes are assigned to different particles.
- UserRadDataPb210Test.mac : show how the user can define its own radioactive decay datafile
- UserEvapDataBiTest.mac : show how the user can define its own photo evaporation datafile
- No252.mac : show how to simulate Radoactive decay for nuclei with Z>100 based on user datafile
\section rdecay02_s9 Important Remark on the use of Atomic relaxation
Since the Geant4.9.5 release, even if the atomic relaxation is switched on
in radioactive decay module (default case) it is also necessary to add the macro lines:
\verbatim
/process/em/fluo true
/process/em/auger true
\endverbatim
otherwise no atomic relaxation will take place.
The example macros have been updated accordingly!
*/
@@ -1,12 +1,76 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(rdecay02)
set(name rdecay02)
project(${name})
find_package(Geant4 REQUIRED)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR})
file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
#----------------------------------------------------------------------------
# Find AIDA (optional package)
#
find_package(AIDA)
if(AIDA_FOUND)
add_definitions(-DG4ANALYSIS_USE)
endif()
#----------------------------------------------------------------------------
# Find ROOT (optional package)
#
find_package(ROOT)
if(ROOT_FOUND)
add_definitions(-DG4ANALYSIS_USE_ROOT)
endif()
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR}
${AIDA_INCLUDE_DIR}
${ROOT_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(rdecay02 rdecay02.cc ${sources} ${headers})
target_link_libraries(rdecay02 ${Geant4_LIBRARIES} ${AIDA_LIBRARIES} ${ROOT_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build rdecay02. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(rdecay02_SCRIPTS
rdecay02.in rdecay02.out
)
foreach(_script ${rdecay02_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS rdecay02 DESTINATION bin)
add_executable(${name} EXCLUDE_FROM_ALL ${name}.cc ${sources})
target_link_libraries(${name} ${Geant4_LIBRARIES})
@@ -14,6 +14,31 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
28/11/2012 Gabriele Cosmo (rdecay02-V09-05-05)
- Fixed cases of variable shadowing.
14/11/2012 Ivana Hrivnacova (rdecay02-V09-05-04)
- Minor fix in CMake build
24/10/2012 Alberto Ribon (rdecay02-V09-05-03)
- Migrated to the new stopping physics.
25/09/2012 Ivana Hrivnacova
- Fixed AIDA dependent code
13/06/2012 Laurent Desorgher (rdecay02-V09-05-02)
- Update/Review of the code according to coding guide lines 2.1-3.1
01/05/2012 Laurent Desorgher (rdecay02-V09-05-01)
- Adding of tuple RDecayProducts registering Z,A,time,energy, PID,weight of each radioactive decay product
- Changes in UserRadDataCf238Test.mac and UserRadData_z82.a210 to check
that the mean life time given in UserRadData_z82.a210 is properly taken into account in the code.
- Merge the modification of Fan Lei for the activation computation in the new tag
04/04/2012 Laurent Desorgher (rdecay02-V09-05-00)
- Update/Review of the code according to coding guide lines 1.3, 1.4, and 1.5
23/11/2011 - L.Desorgher (rdecay02-V09-04-04)
-Add the commands "/process/em/fluo true" "/process/em/auger true"
@@ -88,7 +88,7 @@
- Emission particles in the RadioactiveDecay process:
particle PDGcode,
partilce kinetic energy,
particle kinetic energy,
particle creation time,
particle weight.
@@ -112,8 +112,13 @@
6. ANALYSIS:
This example implements an AIDA-compliant analysis system as well as the ROOT system, for accumulating
and output histograms and ntuples. If the the user has an AIDA-compliant tool such as
AIDAJNI, ANAPHE, OpenScientist or PI installed, the analysis part of this example can
and output histograms and ntuples.
When the example is built with CMake the analysis system is activated automatically
when the AIDA-compliant analysis system and/or the ROOT system is found.
When the example is built with GNUmake and the user has an AIDA-compliant tool such
as AIDAJNI, ANAPHE, OpenScientist or PI installed, the analysis part of this example can
be activated by
setenv G4ANALYSIS_USE 1
@@ -170,8 +175,19 @@
reproduce these histograms, or new histograms, with the ntuple data in an off-line analyis tool.
7. GETTING STARTED:
i) Build the exRDM executable:
i) If you have an AIDA-compliant analysis system installed than you shall switch on the analysis part of
A) With CMake
Build the executable (in your CMAKE build directory):
cd to_rdecay02_build
make
B) With GNUmake
- If you have an AIDA-compliant analysis system installed than you shall switch on the analysis part of
example by
setenv G4ANALYSIS_USE 1
@@ -180,12 +196,12 @@
setenv G4ANALYSIS_USE_ROOT 1
Otherwise make sure the G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT are not definded
- Otherwise make sure the G4ANALYSIS_USE and G4ANALYSIS_USE_ROOT are not definded
unsetenv G4ANALYSIS_USE
unsetenv G4ANALYSIS_USE_ROOT
ii) Build the exRDM executable:
- Build the exRDM executable:
cd to rdecay02
gmake clean
@@ -193,7 +209,8 @@
The executable, named rdecay02, will be in $G4WORKDIR/bin/$G4SYSTEM/ directory.
iii) Run the executable: while in the rdecay02 directory do
ii) Run the executable: while in the rdecay02 build directory (A) or its
source directory (B) do directory do
rdecay02 rdecay02.in
@@ -270,4 +287,4 @@
The example macros have been updated accordingly!
@@ -23,6 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmAnalysisManager.hh
/// \brief Definition of the exrdmAnalysisManager class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef exrdmAnalysisManager_h
#define exrdmAnalysisManager_h 1
@@ -40,13 +48,11 @@
//----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "globals.hh"
#include "exrdmEnergyDeposition.hh"
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class exrdmHisto;
@@ -56,8 +62,8 @@ class exrdmAnalysisManager
public:
// With description
static exrdmAnalysisManager* getInstance();
static void dispose();
static exrdmAnalysisManager* GetInstance();
static void Dispose();
private:
@@ -66,7 +72,7 @@ private:
public: // Without description
void bookHisto();
void BookHisto();
void BeginOfRun();
void EndOfRun(G4int);
@@ -77,60 +83,55 @@ public: // Without description
void AddParticle(G4double, G4double, G4double, G4double);
void AddIsotope(G4double, G4double, G4double);
void AddEnergy(G4double, G4double, G4double);
void AddDecayProduct(G4double pid,G4int Z, G4int A,
G4double energy, G4double time,G4double weight);
void SetVerbose(G4int val) {verbose = val;};
G4int GetVerbose() const {return verbose;};
void SetVerbose(G4int val) {fVerbose = val;};
G4int GetVerbose() const {return fVerbose;};
void SetFirstEventToDebug(G4int val) {nEvt1 = val;};
G4int FirstEventToDebug() const {return nEvt1;};
void SetLastEventToDebug(G4int val) {nEvt2 = val;};
G4int LastEventToDebug() const {return nEvt2;};
void SetFirstEventToDebug(G4int val) {fNEvt1 = val;};
G4int FirstEventToDebug() const {return fNEvt1;};
void SetLastEventToDebug(G4int val) {fNEvt2 = val;};
G4int LastEventToDebug() const {return fNEvt2;};
void SetMaxEnergyforHisto(G4double val) {histEMax = val;};
G4double GetMaxEnergyforHisto() const {return histEMax;};
void SetMinEnergyforHisto(G4double val) {histEMin = val;};
G4double GetMinEnergyforHisto() const {return histEMin;};
void SetNumBinforHisto(G4int val) {histNBin = val;};
G4int GeNumBinforHisto() const {return histNBin;};
void SetMaxEnergyforHisto(G4double val) {fHistEMax = val;};
G4double GetMaxEnergyforHisto() const {return fHistEMax;};
void SetMinEnergyforHisto(G4double val) {fHistEMin = val;};
G4double GetMinEnergyforHisto() const {return fHistEMin;};
void SetNumBinforHisto(G4int val) {fHistNBin = val;};
G4int GeNumBinforHisto() const {return fHistNBin;};
void SetThresholdEnergyforTarget(G4double val) {targetThresE = val;};
G4double GetThresholdEnergyforTarget () const {return targetThresE;};
void SetThresholdEnergyforDetector(G4double val) {detectorThresE = val;};
G4double GetThresholdEnergyforDetector () const {return detectorThresE;};
void SetPulseWidth(G4double val) {pulseWidth = val;};
G4double GetPulseWidth () const {return pulseWidth;};
void SetThresholdEnergyforTarget(G4double val) {fTargetThresE = val;};
G4double GetThresholdEnergyforTarget () const {return fTargetThresE;};
void SetThresholdEnergyforDetector(G4double val) {fDetectorThresE = val;};
G4double GetThresholdEnergyforDetector () const {return fDetectorThresE;};
void SetPulseWidth(G4double val) {fPulseWidth = val;};
G4double GetPulseWidth () const {return fPulseWidth;};
private:
// MEMBERS
static exrdmAnalysisManager* fManager;
G4int verbose;
G4int nEvt1;
G4int nEvt2;
G4int fVerbose;
G4int fNEvt1;
G4int fNEvt2;
G4double histEMax;
G4double histEMin;
G4int histNBin;
/*
G4bool histTarget;
G4bool histDetector;
G4bool histCoin;
G4bool histAntiCD;
G4bool histAntiCT;
G4bool histEmission;
G4bool ntupleEmission;
G4bool ntupleIsotope;
*/
G4double targetThresE;
G4double detectorThresE;
G4double pulseWidth;
G4double fHistEMax;
G4double fHistEMin;
G4int fHistNBin;
G4double fTargetThresE;
G4double fDetectorThresE;
G4double fPulseWidth;
// energy depositions for an event
std::vector <exrdmEnergyDeposition> Edepo;
std::vector <exrdmEnergyDeposition> fEdepo;
//
exrdmHisto* histo;
exrdmHisto* fHisto;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmDetectorConstruction.hh
/// \brief Definition of the exrdmDetectorConstruction class
//
#ifndef exrdmDetectorConstruction_h
#define exrdmDetectorConstruction_h 1
@@ -45,14 +48,14 @@ class exrdmDetectorConstruction : public G4VUserDetectorConstruction
public:
exrdmDetectorConstruction();
~exrdmDetectorConstruction();
virtual ~exrdmDetectorConstruction();
public:
G4VPhysicalVolume* Construct();
virtual G4VPhysicalVolume* Construct();
const
G4VPhysicalVolume* GetDetector() {return physiDetector;};
G4VPhysicalVolume* GetDetector() {return fPhysiDetector;};
G4double GetDetectoFullLength() {return fDetectorLength;};
G4double GetTargetFullLength() {return fTargetLength;};
@@ -61,47 +64,50 @@ class exrdmDetectorConstruction : public G4VUserDetectorConstruction
G4double GetTargetRadius() {return fTargetRadius;};
G4double GetWorldRadius() {return fWorldRadius;};
void setTargetMaterial (G4String);
void setDetectorMaterial(G4String);
void SetTargetMaterial (G4String);
void SetDetectorMaterial(G4String);
void setTargetRadius (G4double value) { fTargetRadius = value; };
void setDetectorThickness(G4double value){ fDetectorThickness = value;};
void setTargetLength (G4double value) { fTargetLength = value; };
void setDetectorLength(G4double value){ fDetectorLength = value;};
void SetTargetRadius (G4double value) { fTargetRadius = value; };
void SetDetectorThickness(G4double value){ fDetectorThickness = value;};
void SetTargetLength (G4double value) { fTargetLength = value; };
void SetDetectorLength(G4double value){ fDetectorLength = value;};
private:
void DefineMaterials();
private:
G4Tubs* solidWorld; // pointer to the solid envelope
G4LogicalVolume* logicWorld; // pointer to the logical envelope
G4VPhysicalVolume* physiWorld; // pointer to the physical envelope
G4Tubs* fSolidWorld; // pointer to the solid envelope
G4LogicalVolume* fLogicWorld; // pointer to the logical envelope
G4VPhysicalVolume* fPhysiWorld; // pointer to the physical envelope
G4Tubs* solidTarget; // pointer to the solid Target
G4LogicalVolume* logicTarget; // pointer to the logical Target
G4VPhysicalVolume* physiTarget; // pointer to the physical Target
G4Tubs* fSolidTarget; // pointer to the solid Target
G4LogicalVolume* fLogicTarget; // pointer to the logical Target
G4VPhysicalVolume* fPhysiTarget; // pointer to the physical Target
G4Tubs* solidDetector; // pointer to the solid Detector
G4LogicalVolume* logicDetector; // pointer to the logical Detector
G4VPhysicalVolume* physiDetector; // pointer to the physical Detector
G4Tubs* fSolidDetector; // pointer to the solid Detector
G4LogicalVolume* fLogicDetector; // pointer to the logical Detector
G4VPhysicalVolume* fPhysiDetector; // pointer to the physical Detector
exrdmDetectorMessenger* detectorMessenger; // pointer to the Messenger
exrdmMaterial* materialsManager; // material manager
exrdmDetectorMessenger* fDetectorMessenger; // pointer to the Messenger
exrdmMaterial* fMaterialsManager; // material manager
G4Material* DefaultMater; // Default material
G4Material* TargetMater; // Target material
G4Material* DetectorMater; // Detector material
G4Material* fDefaultMater; // Default material
G4Material* fTargetMater; // Target material
G4Material* fDetectorMater; // Detector material
G4double fWorldLength; // Full length the world volume
G4double fTargetLength; // Full length of the target
G4double fDetectorLength; // Full length of the Detector
G4double fWorldRadius; // Radius of the world volume
G4double fTargetRadius; // Radius of the target
G4double fDetectorThickness; // Thickness of the Detector
G4Region* targetRegion;
G4Region* detectorRegion;
G4double fTargetLength; // Full length of the target
G4double fTargetRadius; // Radius of the target
G4double fDetectorLength; // Full length of the Detector
G4double fDetectorThickness; // Thickness of the Detector
G4double fWorldLength; // Full length the world volume
G4double fWorldRadius; // Radius of the world volume
G4Region* fTargetRegion;
G4Region* fDetectorRegion;
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmDetectorMessenger.hh
/// \brief Definition of the exrdmDetectorMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef exrdmDetectorMessenger_h
@@ -42,21 +45,21 @@ class exrdmDetectorMessenger: public G4UImessenger
{
public:
exrdmDetectorMessenger(exrdmDetectorConstruction*);
~exrdmDetectorMessenger();
virtual ~exrdmDetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
exrdmDetectorConstruction* myDetector;
exrdmDetectorConstruction* fMyDetector;
G4UIdirectory* exrdmDir;
G4UIdirectory* detDir;
G4UIcmdWithAString* TargMatCmd;
G4UIcmdWithAString* DetectMatCmd;
G4UIcmdWithADoubleAndUnit* TargRadiusCmd;
G4UIcmdWithADoubleAndUnit* DetectThicknessCmd;
G4UIcmdWithADoubleAndUnit* TargLengthCmd;
G4UIcmdWithADoubleAndUnit* DetectLengthCmd;
G4UIdirectory* fExrdmDir;
G4UIdirectory* fDetDir;
G4UIcmdWithAString* fTargMatCmd;
G4UIcmdWithAString* fDetectMatCmd;
G4UIcmdWithADoubleAndUnit* fTargRadiusCmd;
G4UIcmdWithADoubleAndUnit* fDetectThicknessCmd;
G4UIcmdWithADoubleAndUnit* fTargLengthCmd;
G4UIcmdWithADoubleAndUnit* fDetectLengthCmd;
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmEnergyDeposition.hh
/// \brief Definition of the exrdmEnergyDeposition class
//
#ifndef exrdmEnergyDeposition_h
#define exrdmEnergyDeposition_h 1
@@ -43,16 +46,16 @@ class exrdmEnergyDeposition
G4bool operator<=(const exrdmEnergyDeposition &right) const ;
// Operators
G4double GetEnergy() {return Energy;};
G4double GetTime() {return Time;};
G4double GetWeight() {return Weight;};
G4double GetEnergy() {return fEnergy;};
G4double GetTime() {return fTime;};
G4double GetWeight() {return fWeight;};
// Accessors
private:
G4double Energy;
G4double Time;
G4double Weight;
G4double fEnergy;
G4double fTime;
G4double fWeight;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmEventAction.hh
/// \brief Definition of the exrdmEventAction class
//
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -41,17 +44,17 @@ class exrdmEventAction : public G4UserEventAction
{
public:
exrdmEventAction();
~exrdmEventAction();
virtual ~exrdmEventAction();
public:
void BeginOfEventAction(const G4Event* anEvent);
void EndOfEventAction(const G4Event* anEvent);
virtual void BeginOfEventAction(const G4Event* anEvent);
virtual void EndOfEventAction(const G4Event* anEvent);
void SetDrawFlag(G4String val) {drawFlag = val;};
void SetDrawFlag(G4String val) {fDrawFlag = val;};
private:
G4String drawFlag; // control the drawing of event
exrdmEventActionMessenger* eventMessenger;
G4String fDrawFlag; // control the drawing of event
exrdmEventActionMessenger* fEventMessenger;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmEventActionMessenger.hh
/// \brief Definition of the exrdmEventActionMessenger class
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -42,13 +45,13 @@ class exrdmEventActionMessenger: public G4UImessenger
{
public:
exrdmEventActionMessenger(exrdmEventAction*);
~exrdmEventActionMessenger();
virtual ~exrdmEventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
exrdmEventAction* eventAction;
G4UIcmdWithAString* DrawCmd;
exrdmEventAction* fEventAction;
G4UIcmdWithAString* fDrawCmd;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmHisto.hh
/// \brief Definition of the exrdmHisto class
//
#ifndef exrdmHisto_h
#define exrdmHisto_h 1
@@ -66,84 +69,84 @@ public:
~exrdmHisto();
void book();
void Book();
// Book predefined histogramms
void save();
void Save();
// Save histogramms to file
void add1D(const G4String&, const G4String&, G4int nb=100, G4double x1=0.,
void Add1D(const G4String&, const G4String&, G4int nb=100, G4double x1=0.,
G4double x2=1., G4double u=1.);
// In this method histogramms are predefined
void setHisto1D(G4int, G4int, G4double, G4double, G4double);
// It change bins and boundaries
void SetHisto1D(G4int, G4int, G4double, G4double, G4double);
// It change fBins and boundaries
void fillHisto(G4int, G4double, G4double);
void FillHisto(G4int, G4double, G4double);
// exrdmHistogramms are filled
void scaleHisto(G4int, G4double);
void ScaleHisto(G4int, G4double);
void addTuple(const G4String&, const G4String&, const G4String&);
// In this method nTuple is booked
void AddTuple(const G4String&, const G4String&, const G4String&);
// In this method fNTuple is booked
void fillTuple(G4int, const G4String&, G4double);
// Fill nTuple parameter with a double
void FillTuple(G4int, const G4String&, G4double);
// Fill fNTuple parameter with a double
void fillTuple(G4int, G4int, G4double);
// Fill nTuple at a given col with a double
void fillTuple(G4int, const G4String&, G4String&);
// Fill nTuple parameter with a string
void FillTuple(G4int, G4int, G4double);
// Fill fNTuple at a given col with a double
void FillTuple(G4int, const G4String&, G4String&);
// Fill fNTuple parameter with a string
void fillTuple(G4int, const G4String&, G4bool);
// Fill nTuple parameter with a bool
void FillTuple(G4int, const G4String&, G4bool);
// Fill fNTuple parameter with a bool
void addRow(G4int);
void AddRow(G4int);
// Save tuple event
void setFileName(const G4String&);
const G4String& getFileName() const;
void SetFileName(const G4String&);
const G4String& GetFileName() const;
void setFileType(const G4String&);
void SetFileType(const G4String&);
const G4String& FileType() const;
private:
G4String histName;
G4String histType;
G4String fHistName;
G4String fHistType;
G4int nHisto;
G4int nTuple;
G4int verbose;
G4int defaultAct;
G4int fNHisto;
G4int fNTuple;
G4int fVerbose;
G4int fDefaultAct;
#ifdef G4ANALYSIS_USE
std::vector<AIDA::IHistogram1D*> histo;
std::vector<AIDA::ITuple*> ntup;
AIDA::IAnalysisFactory* aida;
AIDA::ITree* tree;
std::vector<AIDA::IHistogram1D*> fHisto;
std::vector<AIDA::ITuple*> fNtup;
AIDA::IAnalysisFactory* fAida;
AIDA::ITree* fTree;
#endif
#ifdef G4ANALYSIS_USE_ROOT
TFile* hfileROOT;
std::vector<TH1D*> ROOThisto;
std::vector<TNtuple*> ROOTntup;
std::vector< std::vector<float> > Rarray;
std::vector<G4int> Rcol;
TFile* fHfileROOT;
std::vector<TH1D*> fROOThisto;
std::vector<TNtuple*> fROOTntup;
std::vector< std::vector<float> > fRarray;
std::vector<G4int> fRcol;
#endif
exrdmHistoMessenger* messenger;
exrdmHistoMessenger* fMessenger;
std::vector<G4int> active;
std::vector<G4int> bins;
std::vector<G4double> xmin;
std::vector<G4double> xmax;
std::vector<G4double> unit;
std::vector<G4String> ids;
std::vector<G4String> titles;
std::vector<G4String> tupleName;
std::vector<G4String> tupleId;
std::vector<G4String> tupleList;
std::vector<G4String> tupleListROOT;
std::vector<G4int> fActive;
std::vector<G4int> fBins;
std::vector<G4double> fXmin;
std::vector<G4double> fXmax;
std::vector<G4double> fUnit;
std::vector<G4String> fIds;
std::vector<G4String> fTitles;
std::vector<G4String> fTupleName;
std::vector<G4String> fTupleId;
std::vector<G4String> fTupleList;
std::vector<G4String> fTupleListROOT;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmHistoMessenger.hh
/// \brief Definition of the exrdmHistoMessenger class
//
#ifndef exrdmHistoMessenger_h
#define exrdmHistoMessenger_h 1
@@ -44,18 +47,18 @@ class exrdmHistoMessenger: public G4UImessenger
public:
exrdmHistoMessenger(exrdmHisto* );
~exrdmHistoMessenger();
virtual ~exrdmHistoMessenger();
void SetNewValue(G4UIcommand* ,G4String );
virtual void SetNewValue(G4UIcommand* ,G4String );
private:
exrdmHisto* histo;
exrdmHisto* fHisto;
G4UIdirectory* histoDir;
G4UIcmdWithAString* factoryCmd;
G4UIcmdWithAString* fileCmd;
G4UIcommand* histoCmd;
G4UIdirectory* fHistoDir;
G4UIcmdWithAString* fActoryCmd;
G4UIcmdWithAString* fIleCmd;
G4UIcommand* fHistoCmd;
};
@@ -23,10 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmMaterial.hh
/// \brief Definition of the exrdmMaterial class
//
#ifndef exrdmMaterial_HH
#define exrdmMaterial_HH
////////////////////////////////////////////////////////////////////////////////
#include "G4Material.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <vector>
class exrdmMaterialMessenger;
@@ -42,13 +46,13 @@ public:
public:
void AddMaterial (G4String, G4String, G4double, G4String,
G4double tem = STP_Temperature,
G4double pres = STP_Pressure);
G4Material* GetMaterial (G4int i) {return Material[i];};
G4double tem = CLHEP::STP_Temperature,
G4double pres = CLHEP::STP_Pressure);
G4Material* GetMaterial (G4int i) {return fMaterial[i];};
G4Material* GetMaterial (G4String name)
{return G4Material::GetMaterial(name);} ;
G4int GetMaterialIndex (G4String);
G4int GetNbOfMaterial () {return Material.size();};
G4int GetNbOfMaterial () {return fMaterial.size();};
void DeleteMaterial (G4int);
void DeleteMaterial (G4String);
@@ -56,17 +60,17 @@ public:
private:
exrdmMaterialMessenger *materialMessenger;
exrdmMaterialMessenger *fMaterialMessenger;
std::vector<G4Material*> Material;
std::vector<G4Element*> Element;
std::vector<G4Isotope*> Isotope;
std::vector<G4Material*> fMaterial;
std::vector<G4Element*> fElement;
std::vector<G4Isotope*> fIsotope;
private:
static const G4String ELU[110];
static const G4String ELL[110];
static const G4String EUU[110];
static const G4double A[110];
static const G4String fELU[110];
static const G4String fELL[110];
static const G4String fEUU[110];
static const G4double fA[110];
};
////////////////////////////////////////////////////////////////////////////////
@@ -23,10 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmMaterialData.hh
/// \brief Definition of the exrdmMaterialData class
//
#include "G4Material.hh"
const G4String exrdmMaterial::ELU[110] =
const G4String exrdmMaterial::fELU[110] =
{
" H","He","Li","Be"," B"," C"," N"," O"," F","Ne",
"Na","Mg","Al","Si"," P"," S","Cl","Ar"," K","Ca",
@@ -40,7 +43,7 @@ const G4String exrdmMaterial::ELU[110] =
"Pa"," U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm",
"Md","No","Lr","Rf","Db","Sg","Bh","Hs","Mt","UN"
};
const G4String exrdmMaterial::ELL[110] =
const G4String exrdmMaterial::fELL[110] =
{
" h","he","li","be"," b"," c"," n"," o"," f","ne",
"na","mg","al","si"," p"," s","cl","ar"," k","ca",
@@ -54,7 +57,7 @@ const G4String exrdmMaterial::ELL[110] =
"pa"," u","np","pu","am","cm","bk","cf","es","fm",
"md","no","lr","rf","db","sg","bh","hs","mt","un"
};
const G4String exrdmMaterial::EUU[110] =
const G4String exrdmMaterial::fEUU[110] =
{
" H","HE","LI","BE"," B"," C"," N"," O"," F","NE",
"NA","MG","AL","SI"," P"," S","CL","AR"," K","CA",
@@ -69,17 +72,19 @@ const G4String exrdmMaterial::EUU[110] =
"MD","NO","LR","RF","DB","SG","BH","HS","MT","UN"
};
const G4double exrdmMaterial::A[110] =
const G4double exrdmMaterial::fA[110] =
{
1.00794,4.002602,6.941,9.012182,10.811,12.0107,14.00674,15.9994,18.9984,20.1797,
22.98977,24.3050,26.9815,28.0855,30.973761,32.066,35.4527,39.948,39.0983,40.078,
44.95591,47.867,50.9415,51.9961,54.938049,55.845,58.9332,58.6934,63.546,65.39,
69.723,72.61,74.9216,78.96,79.904,83.8,85.4678,87.62,88.90585,91.224,
92.90638,95.94,97.9072,101.07,102.9055,106.42,107.8682,112.411,114.818,118.71,
121.76,127.6,126.90447,131.29,132.90545,137.327,138.9055,140.116,140.90765,144.24,
144.9127,150.36,151.964,157.25,158.92534,162.5,164.93032,167.26,168.93421,173.04,
174.967,178.49,180.9479,183.84,186.207,190.23,192.217,195.078,196.96655,200.59,
204.3833,207.2,208.98038,208.9824,209.9871,222.0176,223.0197,226.0254,227.0277,232.038,
231.03588,238.0289,237.0482,244.0642,243.0614,247.0703,247.0703,251.0796,252.083,257.0951,
258.0984,259.1011,262.11,263.1125,262.1144,266.1219,264.1247,269.1341,268.1388,272.1463
1.00794,4.002602,6.941,9.012182,10.811,12.0107,14.00674,15.9994,18.9984,
20.1797,22.98977,24.3050,26.9815,28.0855,30.973761,32.066,35.4527,39.948,
39.0983,40.078,44.95591,47.867,50.9415,51.9961,54.938049,55.845,58.9332,
58.6934,63.546,65.39,69.723,72.61,74.9216,78.96,79.904,83.8,85.4678,87.62,
88.90585,91.224,92.90638,95.94,97.9072,101.07,102.9055,106.42,107.8682,
112.411,114.818,118.71,121.76,127.6,126.90447,131.29,132.90545,137.327,
138.9055,140.116,140.90765,144.24,144.9127,150.36,151.964,157.25,158.92534,
162.5,164.93032,167.26,168.93421,173.04,174.967,178.49,180.9479,183.84,
186.207,190.23,192.217,195.078,196.96655,200.59,
204.3833,207.2,208.98038,208.9824,209.9871,222.0176,223.0197,226.0254,
227.0277,232.038,231.03588,238.0289,237.0482,244.0642,243.0614,247.0703,
247.0703,251.0796,252.083,257.0951,258.0984,259.1011,262.11,263.1125,262.1144,
266.1219,264.1247,269.1341,268.1388,272.1463
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmMaterialMessenger.hh
/// \brief Definition of the exrdmMaterialMessenger class
//
#ifndef exrdmMaterialMessenger_h
#define exrdmMaterialMessenger_h 1
////////////////////////////////////////////////////////////////////////////////
@@ -44,19 +47,19 @@ class exrdmMaterialMessenger: public G4UImessenger
{
public:
exrdmMaterialMessenger(exrdmMaterial* );
~exrdmMaterialMessenger();
virtual ~exrdmMaterialMessenger();
void SetNewValue (G4UIcommand*, G4String);
virtual void SetNewValue (G4UIcommand*, G4String);
private:
exrdmMaterial *materialsManager;
exrdmMaterial *fMaterialsManager;
G4UIdirectory *MaterialDir;
G4UIcmdWithoutParameter *ListCmd;
G4UIcmdWithAnInteger *DeleteIntCmd;
G4UIcmdWithAString *DeleteNameCmd;
G4UIcommand *AddCmd;
G4UIdirectory *fMaterialDir;
G4UIcmdWithoutParameter *fListCmd;
G4UIcmdWithAnInteger *fDeleteIntCmd;
G4UIcmdWithAString *fDeleteNameCmd;
G4UIcommand *fAddCmd;
};
////////////////////////////////////////////////////////////////////////////////
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPhysListEmLowEnergy.hh
/// \brief Definition of the exrdmPhysListEmLowEnergy class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPhysListHadron.hh
/// \brief Definition of the exrdmPhysListHadron class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef exrdmPhysListHadron_h
@@ -51,22 +54,22 @@ class exrdmPhysListHadron : public G4VPhysicsConstructor
public:
// Construct particle and physics
void ConstructParticle() {};
virtual void ConstructParticle() {};
//
void ConstructProcess();
virtual void ConstructProcess();
private:
G4HadronElasticProcess theElasticProcess;
G4ProtonInelasticProcess theProtonInelastic;
G4NeutronInelasticProcess theNeutronInelastic;
G4HadronElasticProcess* theNeutronElasticProcess;
G4HadronFissionProcess* theFissionProcess;
G4HadronCaptureProcess* theCaptureProcess;
G4DeuteronInelasticProcess* theDeuteronInelasticProcess;
G4TritonInelasticProcess* theTritonInelasticProcess;
G4AlphaInelasticProcess* theAlphaInelasticProcess;
G4IonInelasticProcess* theIonInelasticProcess;
G4HadronElasticProcess fTheElasticProcess;
G4ProtonInelasticProcess fTheProtonInelastic;
G4NeutronInelasticProcess fTheNeutronInelastic;
G4HadronElasticProcess* fTheNeutronElasticProcess;
G4HadronFissionProcess* fTheFissionProcess;
G4HadronCaptureProcess* fTheCaptureProcess;
G4DeuteronInelasticProcess* fTheDeuteronInelasticProcess;
G4TritonInelasticProcess* fTheTritonInelasticProcess;
G4AlphaInelasticProcess* fTheAlphaInelasticProcess;
G4IonInelasticProcess* fTheIonInelasticProcess;
};
#endif
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPhysListParticles.hh
/// \brief Definition of the exrdmPhysListParticles class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPhysicsList.hh
/// \brief Definition of the exrdmPhysicsList class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,15 +48,15 @@ public:
exrdmPhysicsList();
virtual ~exrdmPhysicsList();
void ConstructParticle();
virtual void ConstructParticle();
void SetCuts();
virtual void SetCuts();
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForPositron(G4double);
void SelectPhysicsList(const G4String& name);
void ConstructProcess();
virtual void ConstructProcess();
void SetTargetCut(G4double val);
void SetDetectorCut(G4double val);
@@ -66,21 +69,21 @@ private:
exrdmPhysicsList & operator=(const exrdmPhysicsList &right);
exrdmPhysicsList(const exrdmPhysicsList&);
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
G4double fCutForGamma;
G4double fCutForElectron;
G4double fCutForPositron;
G4VPhysicsConstructor* emPhysicsList;
G4VPhysicsConstructor* raddecayList;
G4VPhysicsConstructor* particleList;
G4VPhysicsConstructor* hadPhysicsList;
G4VPhysicsConstructor* fEmPhysicsList;
G4VPhysicsConstructor* fRaddecayList;
G4VPhysicsConstructor* fParticleList;
G4VPhysicsConstructor* fHadPhysicsList;
std::vector<G4VPhysicsConstructor*> hadronPhys;
G4int nhadcomp;
std::vector<G4VPhysicsConstructor*> fHadronPhys;
G4int fNhadcomp;
exrdmPhysicsListMessenger* pMessenger;
G4ProductionCuts* DetectorCuts;
G4ProductionCuts* TargetCuts;
exrdmPhysicsListMessenger* fPMessenger;
G4ProductionCuts* fDetectorCuts;
G4ProductionCuts* fTargetCuts;
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPhysicsListMessenger.hh
/// \brief Definition of the exrdmPhysicsListMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -44,22 +47,22 @@ class exrdmPhysicsListMessenger: public G4UImessenger
public:
exrdmPhysicsListMessenger(exrdmPhysicsList* );
~exrdmPhysicsListMessenger();
virtual ~exrdmPhysicsListMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
exrdmPhysicsList* pPhysicsList;
exrdmPhysicsList* fPPhysicsList;
G4UIdirectory* physDir;
G4UIcmdWithADoubleAndUnit* gammaCutCmd;
G4UIcmdWithADoubleAndUnit* electCutCmd;
G4UIcmdWithADoubleAndUnit* protoCutCmd;
G4UIcmdWithADoubleAndUnit* allCutCmd;
G4UIcmdWithADoubleAndUnit* mCutCmd;
G4UIcmdWithADoubleAndUnit* eCutCmd;
G4UIcmdWithAString* pListCmd;
G4UIdirectory* fPhysDir;
G4UIcmdWithADoubleAndUnit* fGammaCutCmd;
G4UIcmdWithADoubleAndUnit* fElectCutCmd;
G4UIcmdWithADoubleAndUnit* fProtoCutCmd;
G4UIcmdWithADoubleAndUnit* fAllCutCmd;
G4UIcmdWithADoubleAndUnit* fMCutCmd;
G4UIcmdWithADoubleAndUnit* fECutCmd;
G4UIcmdWithAString* fPListCmd;
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmPrimaryGeneratorAction.hh
/// \brief Definition of the exrdmPrimaryGeneratorAction class
//
//
@@ -40,13 +43,13 @@ class exrdmPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
exrdmPrimaryGeneratorAction();
~exrdmPrimaryGeneratorAction();
virtual ~exrdmPrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
virtual void GeneratePrimaries(G4Event* anEvent);
private:
G4GeneralParticleSource* particleGun;
G4GeneralParticleSource* fParticleGun;
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmRunAction.hh
/// \brief Definition of the exrdmRunAction class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -40,11 +43,11 @@ class exrdmRunAction : public G4UserRunAction
{
public:
exrdmRunAction();
~exrdmRunAction();
virtual ~exrdmRunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
private:
};
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/include/exrdmSteppingAction.hh
/// \brief Definition of the exrdmSteppingAction class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef exrdmSteppingAction_h
@@ -40,6 +40,14 @@
/process/inactivate CoulombScat
/process/inactivate Decay
#
#Define user radioactive data
#The data files should be defined before definition of the ion source
#otherwise the mean life time will not be selected correctly
#
/grdm/setRadioactiveDecayFile 82 210 UserRadData_z82.a210
#
#Next lines needed to have atomic relaxation working
#
@@ -54,18 +62,22 @@
/grdm/noVolumes
/grdm/selectVolume Target
/gps/position 0 0 0
/gps/energy 0 keV
/gps/particle ion
/gps/ion 82 210 0 0
/grdm/setRadioactiveDecayFile 82 210 UserRadData_z82.a210
#
# Only some
/histo/fileName userPb210
/tracking/verbose 1
/tracking/verbose 0
/grdm/nucleusLimits 210 210 82 82
/run/beamOn 2
/run/beamOn 10
/run/beamOn 10000
@@ -4,8 +4,8 @@
# File sanitized by Vanderbilt Decay-o-matic
# $Id: repair_decay_files.py,v 1.20 2006/04/24 14:53:36 marcus Exp $
# Fri Oct 6 15:26:26 2006
#
P 0.0000 7.0370e+08
#With modification of the time life
P 0.0000 7.0370e+15
Alpha 0.0000 5.0000e-01
BetaMinus 0.0000 5.0000e-01
Alpha 0.0000 1.9000e-06 3792.0000
@@ -22,15 +22,15 @@
/run/verbose 0
/event/verbose 0
/tracking/verbose 0
/grdm/verbose 0
/grdm/verbose 1
/grdm/noVolumes
/grdm/selectVolume Target
#
#Next lines needed to have atomic relaxation working
#
/process/em/fluo true
/process/em/auger true
/process/em/fluo false
/process/em/auger false
@@ -39,23 +39,25 @@
/gps/energy 0 keV
/gps/particle ion
/gps/ion 9 24 0 0
#/grdm/nucleusLimits 24 24 9 9
#
# complete chain decays
/histo/fileName f24c
/tracking/verbose 0
/run/beamOn 10000
#
# complete chain decays in VR mode
/grdm/analogueMC 0
/histo/fileName f24c-b
/run/beamOn 10000
#/run/beamOn 10000
#
# No daughter decays in analogue MC mode
/histo/fileName f24
/grdm/analogueMC 1
/grdm/nucleusLimits 24 24 9 9
/run/beamOn 10000
#/run/beamOn 10000
# No daughter decays in VR MC mode
/histo/fileName f24-b
/grdm/analogueMC 0
/grdm/BRbias 0
/run/beamOn 10000
#/run/beamOn 10000
@@ -31,23 +31,28 @@
#
#Next lines needed to have atomic relaxation working
#
/process/em/fluo true
/process/em/auger true
/process/em/fluo false
/process/em/auger false
/grdm/analogueMC 0
/grdm/nucleusLimits 24 24 10 10
#/grdm/nucleusLimits 24 24 10 10
/gps/position 0 0 0
/gps/energy 0 keV
/gps/particle ion
/gps/ion 10 24 0 0
#
# Branching ratio biasing on (as default)
/histo/fileName ne24-br-on
/run/beamOn 1000
/grdm/verbose 1
/tracking/verbose 3
/histo/fileName ne24-br-on
/grdm/applyARM false
/grdm/applyICM false
/grdm/BRbias 1
/run/beamOn 10
#
# Branching ratio biasing off
/histo/fileName ne24-br-off
/grdm/BRbias 0
/run/beamOn 1000
#/run/beamOn 1000
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/rdecay02.cc
/// \brief Main program of the radioactivedecay/rdecay02 example
//
#include "G4RunManager.hh"
#include "G4UImanager.hh"
@@ -52,7 +55,7 @@ int main(int argc,char** argv)
G4RunManager* runManager = new G4RunManager;
// Creation of the analysis manager
exrdmAnalysisManager::getInstance();
exrdmAnalysisManager::GetInstance();
// set mandatory initialization classes
@@ -98,7 +101,7 @@ int main(int argc,char** argv)
#ifdef G4VIS_USE
delete visManager;
#endif
exrdmAnalysisManager::dispose();
exrdmAnalysisManager::Dispose();
delete runManager;
return 0;
@@ -4,54 +4,47 @@
############################################
*************************************************************
Geant4 version Name: geant4-09-05-ref-00 (2-December-2011)
Geant4 version Name: geant4-09-06-ref-00 (30-November-2012)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
New histogram will be booked: #H10 <Energy deposit (MeV) in the traget 100 0 15 1
New histogram will be booked: #H11 <Energy deposit (MeV) in the detector 100 0 15 1
New histogram will be booked: #H12 <Total energy spectrum (MeV) of the traget and detector 100 0 15 1
New histogram will be booked: #H13 <Coincidence spectrum (MeV) between the traget and detector 100 0 15 1
New histogram will be booked: #H14 <Anti-coincidence spectrum (MeV) in the traget 100 0 15 1
New histogram will be booked: #H15 <Anti-coincidence spectrum (MeV) in the detector 100 0 15 1
New histogram will be booked: #H16 <Decay emission spectrum (MeV) 100 0 15 1
Vacuum H 1e-25 2.73 1.87245e-14
Material:Vacuum with formula: H added!
Nb of Material = 1
Nb of Isotope = 0
Nb of Element = 1
fMaterial:Vacuum with formula: H added!
Nb of fMaterial = 1
Nb of fIsotope = 0
Nb of fElement = 1
Air N0.78-O0.22 0.00129 273.15 6.32421e+08
Material:Air with formula: N0.78-O0.22 added!
Nb of Material = 2
Nb of Isotope = 0
Nb of Element = 3
fMaterial:Air with formula: N0.78-O0.22 added!
Nb of fMaterial = 2
Nb of fIsotope = 0
Nb of fElement = 3
Aluminium Al 2.7 273.15 6.32421e+08
Material:Aluminium with formula: Al added!
Nb of Material = 3
Nb of Isotope = 0
Nb of Element = 4
fMaterial:Aluminium with formula: Al added!
Nb of fMaterial = 3
Nb of fIsotope = 0
Nb of fElement = 4
Silicon Si 2.329 273.15 6.32421e+08
Material:Silicon with formula: Si added!
Nb of Material = 4
Nb of Isotope = 0
Nb of Element = 5
fMaterial:Silicon with formula: Si added!
Nb of fMaterial = 4
Nb of fIsotope = 0
Nb of fElement = 5
Lead Pb 11.3 273.15 6.32421e+08
Material:Lead with formula: Pb added!
Nb of Material = 5
Nb of Isotope = 0
Nb of Element = 6
fMaterial:Lead with formula: Pb added!
Nb of fMaterial = 5
Nb of fIsotope = 0
Nb of fElement = 6
Germanium Ge 5.323 273.15 6.32421e+08
Material:Germanium with formula: Ge added!
Nb of Material = 6
Nb of Isotope = 0
Nb of Element = 7
fMaterial:Germanium with formula: Ge added!
Nb of fMaterial = 6
Nb of fIsotope = 0
Nb of fElement = 7
CsI Cs-I 4.51 273.15 6.32421e+08
Material:CsI with formula: Cs-I added!
Nb of Material = 7
Nb of Isotope = 0
Nb of Element = 9
fMaterial:CsI with formula: Cs-I added!
Nb of fMaterial = 7
Nb of fIsotope = 0
Nb of fElement = 9
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
@@ -62,15 +55,17 @@ Current available graphics systems are:
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
OpenGLImmediateQt (OGLI, OGLIQt)
OpenGLImmediateX (OGLIX)
OpenGLImmediateXm (OGLIXm, OGLI_FALLBACK, OGLIQt_FALLBACK)
OpenGLStoredQt (OGL, OGLS, OGLSQt)
OpenGLStoredX (OGLSX)
OpenGLStoredXm (OGLSXm, OGL_FALLBACK, OGLS_FALLBACK, OGLSQt_FALLBACK)
RayTracer (RayTracer)
RayTracerX (RayTracerX)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLStoredX (OGL)
OpenGLImmediateX (OGLI)
OpenGLStoredX (OGLS)
OpenGLImmediateX (OGLIX)
OpenGLStoredX (OGLSX)
Registering model factories...
@@ -88,34 +83,126 @@ Registered filter factories:
originVolumeFilter
attributeFilter
You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
Available colours:
black, blue, cyan, gray, green, grey, magenta, red, white, yellow
black, blue, brown, cyan, gray, green, grey, magenta, red, white, yellow
----> The target has been changed to 3 cm of Lead
/afs/cern.ch/sw/geant4/releases/share/data/G4NDL4.0
NeutronHP: /Capture file for Z = 8, A = 18 is not found and NeutronHP will use /afs/cern.ch/sw/geant4/releases/share/data/G4NDL4.0/Capture/CrossSection/8_17_Oxygen
NeutronHP: /Elastic file for Z = 8, A = 18 is not found and NeutronHP will use /afs/cern.ch/sw/geant4/releases/share/data/G4NDL4.0/Elastic/CrossSection/8_17_Oxygen
NeutronHP: /Inelastic file for Z = 8, A = 18 is not found and NeutronHP will use /afs/cern.ch/sw/geant4/releases/share/data/G4NDL4.0/Inelastic/CrossSection/8_17_Oxygen
NeutronHP: /Capture file for Z = 8, A = 18 is not found and NeutronHP will use /afs/cern.ch/sw/geant4/releases/share/data/G4NDL4.0/Capture/CrossSection/8_17_Oxygen
WARNING: model G4LEDeuteronInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LETritonInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAlphaInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LENeutronInelastic is being deprecated and will
disappear in Geant4 version 10.0
/build/cdash/G4/release/slc5-gcc43/data/G4NDL4.2
NeutronHP: /Capture file for Z = 8, A = 18 is not found and NeutronHP will use /build/cdash/G4/release/slc5-gcc43/data/G4NDL4.2/Capture/CrossSection/8_17_Oxygen
NeutronHP: /Elastic file for Z = 8, A = 18 is not found and NeutronHP will use /build/cdash/G4/release/slc5-gcc43/data/G4NDL4.2/Elastic/CrossSection/8_17_Oxygen
NeutronHP: /Inelastic file for Z = 8, A = 18 is not found and NeutronHP will use /build/cdash/G4/release/slc5-gcc43/data/G4NDL4.2/Inelastic/CrossSection/8_17_Oxygen
NeutronHP: /Capture file for Z = 8, A = 18 is not found and NeutronHP will use /build/cdash/G4/release/slc5-gcc43/data/G4NDL4.2/Capture/CrossSection/8_17_Oxygen
WARNING: model G4LEProtonInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEPionPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEPionMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiKaonZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonZeroLInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiKaonZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEKaonZeroSInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiProtonInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiProtonInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiNeutronInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiNeutronInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LELambdaInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HELambdaInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiLambdaInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiLambdaInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LESigmaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HESigmaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiSigmaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiSigmaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LESigmaPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HESigmaPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiSigmaPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiSigmaPlusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEXiMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEXiMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiXiMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiXiMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEXiZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEXiZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiXiZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiXiZeroInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEOmegaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEOmegaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4LEAntiOmegaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
WARNING: model G4HEAntiOmegaMinusInelastic is being deprecated and will
disappear in Geant4 version 10.0
### exrdmPhysicsList::ConstructProcess is done
world cuts are set
Target cuts are set
Detector cuts are set
### === Deexcitation model UAtomDeexcitation is activated for regions:
### === Deexcitation model UAtomDeexcitation is activated for 1 region:
DefaultRegionForTheWorld
### === Deexcitation model UAtomDeexcitation is activated for 1 region:
DefaultRegionForTheWorld
============================================================================================
HADRONIC PROCESSES SUMMARY (verbose level 1)
Hadronic Processes for <GenericIon>
-----------------------------------
ionInelastic Models: Binary Cascade: Emin(GeV)= 0 Emax(GeV)= 20
ionInelastic Models: Binary Light Ion Cascade: Emin(GeV)= 0 Emax(GeV)= 20
ionInelastic Crs sctns: AxenWellischIonH: Emin(GeV)= 0 Emax(GeV)= 100000
TripathiLightIons: Emin(GeV)= 0 Emax(GeV)= 100000
Tripathi: Emin(GeV)= 0 Emax(GeV)= 100000
IonsShen: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
@@ -129,7 +216,8 @@ Detector cuts are set
AntiNeutronInelastic Models: G4LEAntiNeutronInelastic: Emin(GeV)= 0 Emax(GeV)= 25
G4HEAntiNeutronInelastic: Emin(GeV)= 20 Emax(GeV)= 100000
AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
AntiNeutronInelastic Crs sctns: AntiAGlauber: Emin(GeV)= 0 Emax(GeV)= 1.79769e+305
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
Hadronic Processes for <anti_proton>
@@ -143,12 +231,22 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
AntiProtonInelastic Models: G4LEAntiProtonInelastic: Emin(GeV)= 0 Emax(GeV)= 25
G4HEAntiProtonInelastic: Emin(GeV)= 20 Emax(GeV)= 100000
AntiProtonInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
AntiProtonInelastic Crs sctns: AntiAGlauber: Emin(GeV)= 0 Emax(GeV)= 1.79769e+305
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
hFritiofCaptureAtRest
Hadronic Processes for <e+>
-----------------------------------
PositronNuclear Models: G4ElectroVDNuclearModel: Emin(GeV)= 0 Emax(GeV)= 1e+06
PositronNuclear Crs sctns: ElectroNuclearXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
Hadronic Processes for <e->
-----------------------------------
ElectroNuclear Models: CHIPSElectroNuclear: Emin(GeV)= 0 Emax(GeV)= 30000
ElectroNuclear Models: G4ElectroVDNuclearModel: Emin(GeV)= 0 Emax(GeV)= 1e+06
ElectroNuclear Crs sctns: ElectroNuclearXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
@@ -156,7 +254,7 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
Hadronic Processes for <gamma>
-----------------------------------
PhotonInelastic Models: CHIPSGammaNuclear: Emin(GeV)= 0 Emax(GeV)= 3.5
PhotonInelastic Models: BertiniCascade: Emin(GeV)= 0 Emax(GeV)= 3.5
TheoFSGenerator: Emin(GeV)= 3 Emax(GeV)= 100000
PhotonInelastic Crs sctns: PhotoNuclearXS: Emin(GeV)= 0 Emax(GeV)= 100000
@@ -172,7 +270,8 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
KaonPlusInelastic Models: QGSP: Emin(GeV)= 12 Emax(GeV)= 100000
G4LEKaonPlusInelastic: Emin(GeV)= 0 Emax(GeV)= 25
KaonPlusInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
KaonPlusInelastic Crs sctns: ChipsKaonPlusInelasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
Hadronic Processes for <kaon->
@@ -184,8 +283,10 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
KaonMinusInelastic Models: QGSP: Emin(GeV)= 12 Emax(GeV)= 100000
G4LEKaonMinusInelastic: Emin(GeV)= 0 Emax(GeV)= 25
KaonMinusInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
KaonMinusInelastic Crs sctns: ChipsKaonMinusInelasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
hBertiniCaptureAtRest
Hadronic Processes for <lambda>
-----------------------------------
@@ -196,7 +297,8 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
LambdaInelastic Models: G4LELambdaInelastic: Emin(GeV)= 0 Emax(GeV)= 25
G4HELambdaInelastic: Emin(GeV)= 20 Emax(GeV)= 100000
LambdaInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
LambdaInelastic Crs sctns: ChipsHyperonInelasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
Hadronic Processes for <mu->
@@ -206,7 +308,7 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
-----------------------------------
hadElastic Models: hElasticCHIPS: Emin(GeV)= 0 Emax(GeV)= 100000
hadElastic Crs sctns: CHIPSElasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
hadElastic Crs sctns: ChipsNeutronElasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaElastic: Emin(GeV)= 0 Emax(GeV)= 100000
NeutronInelastic Models: QGSP: Emin(GeV)= 12 Emax(GeV)= 100000
@@ -215,9 +317,7 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
NeutronHPInelastic: Emin(GeV)= 0 Emax(GeV)= 0.02
NeutronInelastic Crs sctns: NeutronHPInelasticXS: Emin(GeV)= 0 Emax(GeV)= 0.02
G4CrossSectionPairGG: Emin(GeV)= 0 Emax(GeV)= 100000
G4CrossSectionPairGG: Wellisch-Laidlaw cross sections
below 91 GeV, Glauber-Gribov above
Barashenkov-Glauber: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
nCapture Models: G4LCapture: Emin(GeV)= 0.0199 Emax(GeV)= 20000
@@ -266,21 +366,20 @@ AntiNeutronInelastic Crs sctns: GheishaInelastic: Emin(GeV)= 0 Ema
below 91 GeV, Glauber-Gribov above
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
hBertiniCaptureAtRest
Hadronic Processes for <proton>
-----------------------------------
hadElastic Models: hElasticCHIPS: Emin(GeV)= 0 Emax(GeV)= 100000
hadElastic Crs sctns: CHIPSElasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
hadElastic Crs sctns: ChipsProtonElasticXS: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaElastic: Emin(GeV)= 0 Emax(GeV)= 100000
ProtonInelastic Models: QGSP: Emin(GeV)= 12 Emax(GeV)= 100000
G4LEProtonInelastic: Emin(GeV)= 9.5 Emax(GeV)= 25
Binary Cascade: Emin(GeV)= 0 Emax(GeV)= 9.9
ProtonInelastic Crs sctns: G4CrossSectionPairGG: Emin(GeV)= 0 Emax(GeV)= 100000
G4CrossSectionPairGG: Axen-Wellisch cross sections
below 91 GeV, Glauber-Gribov above
ProtonInelastic Crs sctns: Barashenkov-Glauber: Emin(GeV)= 0 Emax(GeV)= 100000
GheishaInelastic: Emin(GeV)= 0 Emax(GeV)= 100000
============================================================================================
@@ -310,9 +409,26 @@ Index : 2 used in the geometry : Yes recalculation needed : No
====================================================================
Root file: proton.root
ROOT Histo H10 Energy deposit (MeV) in the traget booked
ROOT Histo H11 Energy deposit (MeV) in the detector booked
ROOT Histo H12 Total energy spectrum (MeV) of the traget and detector booked
ROOT Histo H13 Coincidence spectrum (MeV) between the traget and detector booked
ROOT Histo H14 Anti-coincidence spectrum (MeV) in the traget booked
ROOT Histo H15 Anti-coincidence spectrum (MeV) in the detector booked
ROOT Histo H16 Decay emission spectrum (MeV) booked
Creating Ntuple T1 in ROOT file: Emitted Particles
ROOT Ntuple tT1 Emitted Particles PID:Energy:Time:Weight booked
Creating Ntuple T2 in ROOT file: RadioIsotopes
ROOT Ntuple tT2 RadioIsotopes PID:Time:Weight booked
Creating Ntuple T3 in ROOT file: Energy Depositions
ROOT Ntuple tT3 Energy Depositions Energy:Time:Weight booked
Creating Ntuple RDecayProducts in ROOT file: All Products of RDecay
ROOT Ntuple tRDecayProducts All Products of RDecay PID:Z:A:Energy:Time:Weight booked
exrdmAnalysisManager: Histograms are booked and the run has been started
### Run : 0
ROOT: files writing...
ROOT: files closing...
exrdmAnalysisManager: Histograms have been saved!
Graphics systems deleted.
Visualization Manager deleting...
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmAnalysisManager.cc
/// \brief Implementation of the exrdmAnalysisManager class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -33,6 +36,8 @@
#include "exrdmHisto.hh"
#include "G4ProcessTable.hh"
#include "G4RadioactiveDecay.hh"
#include "G4TwoVector.hh"
#include "G4SystemOfUnits.hh"
#include <fstream>
@@ -42,14 +47,14 @@ exrdmAnalysisManager* exrdmAnalysisManager::fManager = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmAnalysisManager* exrdmAnalysisManager::getInstance()
exrdmAnalysisManager* exrdmAnalysisManager::GetInstance()
{
if(!fManager) {
fManager = new exrdmAnalysisManager();
}
return fManager;
}
void exrdmAnalysisManager::dispose()
void exrdmAnalysisManager::Dispose()
{
delete fManager;
fManager = 0;
@@ -58,15 +63,13 @@ void exrdmAnalysisManager::dispose()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmAnalysisManager::exrdmAnalysisManager()
: fVerbose(0), fNEvt1(-1), fNEvt2(-2),
fHistEMax (15.0*MeV), fHistEMin (0.),fHistNBin(100),
fTargetThresE(10*keV), fDetectorThresE(10*keV),fPulseWidth(1.*microsecond)
{
verbose = 0;
nEvt1 = -1;
nEvt2 = -1;
targetThresE = 10*keV;
detectorThresE = 10*keV;
pulseWidth = 1.*microsecond;
histo = new exrdmHisto();
bookHisto();
fEdepo.clear();
fHisto = new exrdmHisto();
BookHisto();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -80,54 +83,63 @@ exrdmAnalysisManager::~exrdmAnalysisManager()
#define HISTDELETE
#endif
#ifdef HISTDELETE
delete histo;
delete fHisto;
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::bookHisto()
void exrdmAnalysisManager::BookHisto()
{
histEMax = 15.0*MeV;
histEMin = .0*MeV;
histNBin = 100;
fHistEMax = 15.0*MeV;
fHistEMin = .0*MeV;
fHistNBin = 100;
histo->add1D("H10",
"Energy deposit (MeV) in the traget",histNBin,histEMin,histEMax,MeV);
histo->add1D("H11",
"Energy deposit (MeV) in the detector",histNBin,histEMin,histEMax,MeV);
histo->add1D("H12",
"Total energy spectrum (MeV) of the traget and detector",histNBin,histEMin,histEMax,MeV);
histo->add1D("H13",
"Coincidence spectrum (MeV) between the traget and detector",histNBin,histEMin,histEMax,MeV);
histo->add1D("H14",
"Anti-coincidence spectrum (MeV) in the traget",histNBin,histEMin,histEMax,MeV);
histo->add1D("H15",
"Anti-coincidence spectrum (MeV) in the detector",histNBin,histEMin,histEMax,MeV);
histo->add1D("H16",
"Decay emission spectrum (MeV)",histNBin,histEMin,histEMax,MeV);
fHisto->Add1D("H10",
"Energy deposit (MeV) in the traget",fHistNBin,fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H11",
"Energy deposit (MeV) in the detector",fHistNBin,fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H12",
"Total energy spectrum (MeV) of the traget and detector",fHistNBin,
fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H13",
"Coincidence spectrum (MeV) between the traget and detector",fHistNBin,
fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H14",
"Anti-coincidence spectrum (MeV) in the traget",fHistNBin,
fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H15",
"Anti-coincidence spectrum (MeV) in the detector",fHistNBin,
fHistEMin,fHistEMax,MeV);
fHisto->Add1D("H16",
"Decay emission spectrum (MeV)",fHistNBin,fHistEMin,fHistEMax,MeV);
// in aida these histos are indiced from 0-6
//
histo->addTuple( "T1", "Emitted Particles","double PID, Energy, Time, Weight" );
histo->addTuple( "T2", "RadioIsotopes","double PID, Time, Weight" );
histo->addTuple( "T3", "Energy Depositions","double Energy, Time, Weight" );
fHisto->AddTuple( "T1", "Emitted Particles",
"double PID, Energy, Time, Weight" );
fHisto->AddTuple( "T2", "RadioIsotopes","double PID, Time, Weight" );
fHisto->AddTuple( "T3", "Energy Depositions","double Energy, Time, Weight" );
fHisto->AddTuple( "RDecayProducts", "All Products of RDecay",
"double PID, Z, A, Energy, Time, Weight" );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::BeginOfRun()
{
histo->book();
fHisto->Book();
G4cout << "exrdmAnalysisManager: Histograms are booked and the run has been started" << G4endl;
G4ProcessTable *pTable = G4ProcessTable::GetProcessTable();
G4RadioactiveDecay * rDecay = (G4RadioactiveDecay *) pTable->FindProcess("RadioactiveDecay", "GenericIon");
G4RadioactiveDecay * rDecay = (G4RadioactiveDecay *)
pTable->FindProcess("RadioactiveDecay", "GenericIon");
if (rDecay != NULL) {
if (!rDecay->IsAnalogueMonteCarlo()) {
std::vector<G4RadioactivityTable*> theTables = rDecay->GetTheRadioactivityTables();
std::vector<G4RadioactivityTable*> theTables =
rDecay->GetTheRadioactivityTables();
for (size_t i = 0 ; i < theTables.size(); i++) {
theTables[i]->GetTheMap()->clear();
G4cout << " Clear the radioactivity map: 0, new size = " << theTables[i]->GetTheMap()->size() << G4endl;
theTables[i]->GetTheMap()->clear();
G4cout << " Clear the radioactivity map: 0, new size = "
<< theTables[i]->GetTheMap()->size() << G4endl;
}
}
}
@@ -138,31 +150,37 @@ void exrdmAnalysisManager::BeginOfRun()
void exrdmAnalysisManager::EndOfRun(G4int nevent)
{
histo->save();
fHisto->Save();
G4cout << "exrdmAnalysisManager: Histograms have been saved!" << G4endl;
// Output the induced radioactivities
// in VR mode only
//
G4ProcessTable *pTable = G4ProcessTable::GetProcessTable();
G4RadioactiveDecay * rDecay = (G4RadioactiveDecay *) pTable->FindProcess("RadioactiveDecay", "GenericIon");
G4RadioactiveDecay * rDecay = (G4RadioactiveDecay *)
pTable->FindProcess("RadioactiveDecay", "GenericIon");
if (rDecay != NULL) {
if (!rDecay->IsAnalogueMonteCarlo()) {
G4String fileName = histo->getFileName() + ".activity" ;
G4String fileName = fHisto->GetFileName() + ".activity" ;
std::ofstream outfile (fileName, std::ios::out );
std::vector<G4RadioactivityTable*> theTables = rDecay->GetTheRadioactivityTables();
std::vector<G4RadioactivityTable*> theTables =
rDecay->GetTheRadioactivityTables();
for (size_t i = 0 ; i < theTables.size(); i++) {
G4double rate;
outfile << "Radioactivities in decay window no. " << i << G4endl;
outfile << "Z \tA \tE \tActivity (decays/window) "<< G4endl;
map<G4ThreeVector,G4double> *aMap = theTables[i]->GetTheMap();
map<G4ThreeVector,G4double>::iterator iter;
for(iter=aMap->begin(); iter != aMap->end(); iter++) {
rate = iter->second;
if ( rate < 0.) rate = 0.; // statically it can be < 0. but it's unphysical
outfile << iter->first.x() <<"\t"<< iter->first.y() <<"\t"<< iter->first.z() << "\t" << rate/nevent << G4endl;
}
outfile << G4endl;
G4double rate, error;
outfile << "Radioactivities in decay window no. " << i << G4endl;
outfile <<
"Z \tA \tE \tActivity (decays/window) \tError (decays/window) "
<< G4endl;
map<G4ThreeVector,G4TwoVector> *aMap = theTables[i]->GetTheMap();
map<G4ThreeVector,G4TwoVector>::iterator iter;
for(iter=aMap->begin(); iter != aMap->end(); iter++) {
rate = iter->second.x()/nevent;
error = std::sqrt(iter->second.y())/nevent;
if ( rate < 0.) rate = 0.; // statically it can be < 0. but it's unphysical
outfile << iter->first.x() <<"\t"<< iter->first.y() <<"\t"
<< iter->first.z() << "\t" << rate <<"\t" << error << G4endl;
}
outfile << G4endl;
}
outfile.close();
}
@@ -172,18 +190,18 @@ void exrdmAnalysisManager::EndOfRun(G4int nevent)
void exrdmAnalysisManager::BeginOfEvent()
{
Edepo.clear();
fEdepo.clear();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::EndOfEvent()
{
if (Edepo.size()) {
std::sort(Edepo.begin(),Edepo.end());
G4double TarE = Edepo[0].GetEnergy();
G4double Time = Edepo[0].GetTime();
G4double TarW = Edepo[0].GetEnergy()*Edepo[0].GetWeight();
if (fEdepo.size()) {
std::sort(fEdepo.begin(),fEdepo.end());
G4double TarE = fEdepo[0].GetEnergy();
G4double Time = fEdepo[0].GetTime();
G4double TarW = fEdepo[0].GetEnergy()*fEdepo[0].GetWeight();
G4double DetE = 0.;
G4double DetW = 0.;
G4double ComW = 0.;
@@ -193,43 +211,43 @@ void exrdmAnalysisManager::EndOfEvent()
TarE = 0.;
TarW = 0.;
}
for (size_t i = 1; i < Edepo.size(); i++) {
if (std::fabs((Edepo[i].GetTime()- Time)/second) <= pulseWidth) {
if ( Edepo[i].GetEnergy() > 0. ) {
TarE += Edepo[i].GetEnergy();
TarW += Edepo[i].GetEnergy()*Edepo[i].GetWeight();
} else {
DetE -= Edepo[i].GetEnergy();
DetW -= Edepo[i].GetEnergy()*Edepo[i].GetWeight();
}
for (size_t i = 1; i < fEdepo.size(); i++) {
if (std::fabs((fEdepo[i].GetTime()- Time)/second) <= fPulseWidth) {
if ( fEdepo[i].GetEnergy() > 0. ) {
TarE += fEdepo[i].GetEnergy();
TarW += fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
} else {
DetE -= fEdepo[i].GetEnergy();
DetW -= fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
}
} else {
// tallying
if (TarE || DetE) ComW = (TarW+DetW)/(TarE+DetE);
if (TarE) TarW /= TarE;
if (DetE) DetW /= DetE;
//
if (TarE) histo->fillHisto(0,TarE,TarW); // target histogram
if (DetE) histo->fillHisto(1,DetE,DetW); // Detector histogram
if (TarE+DetE) histo->fillHisto(2,DetE+TarE,ComW); // Total histogram
if (DetE >= detectorThresE && TarE >= targetThresE )
histo->fillHisto(3,DetE,DetW); // coincidence histogram
if (TarE >= targetThresE && DetE < detectorThresE)
histo->fillHisto(4,TarE,TarW); // target anti-coincidence histogram
if (TarE < targetThresE && DetE >= detectorThresE)
histo->fillHisto(5,DetE,DetW); // detector anti-coincidence histogram
//
//reset
TarE = Edepo[i].GetEnergy();
Time = Edepo[i].GetTime();
TarW = Edepo[i].GetEnergy()*Edepo[i].GetWeight();
DetE = 0.;
DetW = 0.;
if (TarE < 0) {
DetE = -TarE;
DetW = -TarW;
TarE = 0.;
TarW = 0.;
}
// tallying
if (TarE || DetE) ComW = (TarW+DetW)/(TarE+DetE);
if (TarE) TarW /= TarE;
if (DetE) DetW /= DetE;
//
if (TarE) fHisto->FillHisto(0,TarE,TarW); // target histogram
if (DetE) fHisto->FillHisto(1,DetE,DetW); // Detector histogram
if (TarE+DetE) fHisto->FillHisto(2,DetE+TarE,ComW); // Total histogram
if (DetE >= fDetectorThresE && TarE >= fTargetThresE )
fHisto->FillHisto(3,DetE,DetW); // coincidence histogram
if (TarE >= fTargetThresE && DetE < fDetectorThresE)
fHisto->FillHisto(4,TarE,TarW); // target anti-coincidence histogram
if (TarE < fTargetThresE && DetE >= fDetectorThresE)
fHisto->FillHisto(5,DetE,DetW); // detector anti-coincidence histogram
//
//reset
TarE = fEdepo[i].GetEnergy();
Time = fEdepo[i].GetTime();
TarW = fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
DetE = 0.;
DetW = 0.;
if (TarE < 0) {
DetE = -TarE;
DetW = -TarW;
TarE = 0.;
TarW = 0.;
}
}
}
//tally the last hit
@@ -237,15 +255,15 @@ void exrdmAnalysisManager::EndOfEvent()
if (TarE) TarW /= TarE;
if (DetE) DetW /= DetE;
//
if (TarE) histo->fillHisto(0,TarE,TarW); // target histogram
if (DetE) histo->fillHisto(1,DetE,DetW); // Detector histogram
if (TarE+DetE) histo->fillHisto(2,DetE+TarE,ComW); // Total histogram
if (DetE >= detectorThresE && TarE >= targetThresE )
histo->fillHisto(3,DetE,DetW); // coincidence histogram
if (TarE >= targetThresE && DetE < detectorThresE)
histo->fillHisto(4,TarE,TarW); // target anti-coincidence histogram
if (TarE < targetThresE && DetE >= detectorThresE)
histo->fillHisto(5,DetE,DetW); // detector anti-coincidence histogram
if (TarE) fHisto->FillHisto(0,TarE,TarW); // target histogram
if (DetE) fHisto->FillHisto(1,DetE,DetW); // Detector histogram
if (TarE+DetE) fHisto->FillHisto(2,DetE+TarE,ComW); // Total histogram
if (DetE >= fDetectorThresE && TarE >= fTargetThresE )
fHisto->FillHisto(3,DetE,DetW); // coincidence histogram
if (TarE >= fTargetThresE && DetE < fDetectorThresE)
fHisto->FillHisto(4,TarE,TarW); // target anti-coincidence histogram
if (TarE < fTargetThresE && DetE >= fDetectorThresE)
fHisto->FillHisto(5,DetE,DetW); // detector anti-coincidence histogram
// now add zero energy to separat events
AddEnergy(0.,0.,0.);
}
@@ -253,50 +271,66 @@ void exrdmAnalysisManager::EndOfEvent()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmAnalysisManager::AddEnergy(G4double edep, G4double weight, G4double time)
void exrdmAnalysisManager::AddEnergy(G4double edep, G4double weight,
G4double time)
{
if(1 < verbose) {
if(1 < fVerbose) {
G4cout << "exrdmAnalysisManager::AddEnergy: e(keV)= " << edep/keV
<< " weight = " << weight << " time (s) = " << time/second
<< " weight = " << weight << " time (s) = " << time/second
<< G4endl;
}
histo->fillTuple(2, 0, edep/MeV);
histo->fillTuple(2,1,time/second);
histo->fillTuple(2,2,weight);
histo->addRow(2);
fHisto->FillTuple(2, 0, edep/MeV);
fHisto->FillTuple(2,1,time/second);
fHisto->FillTuple(2,2,weight);
fHisto->AddRow(2);
//
exrdmEnergyDeposition A(edep,time,weight);
Edepo.push_back(A);
fEdepo.push_back(A);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::AddParticle(G4double pid, G4double energy, G4double weight, G4double time )
void exrdmAnalysisManager::AddParticle(G4double pid, G4double energy,
G4double weight, G4double time )
{
if(1 < verbose) {
if(1 < fVerbose) {
G4cout << "exrdmAnalysisManager::AddParticle: " << pid
<< G4endl;
}
histo->fillTuple(0,0, pid);
histo->fillTuple(0,1,energy/MeV);
histo->fillTuple(0,2,time/second);
histo->fillTuple(0,3,weight);
histo->addRow(0);
fHisto->FillTuple(0,0, pid);
fHisto->FillTuple(0,1,energy/MeV);
fHisto->FillTuple(0,2,time/second);
fHisto->FillTuple(0,3,weight);
fHisto->AddRow(0);
// now fill th emission spectrum
if (energy>0.0) histo->fillHisto(6,energy/MeV,weight);
if (energy>0.0) fHisto->FillHisto(6,energy/MeV,weight);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::AddIsotope(G4double pid,G4double weight, G4double time )
void exrdmAnalysisManager::AddIsotope(G4double pid,G4double weight,
G4double time )
{
if(1 < verbose) {
if(1 < fVerbose) {
G4cout << "exrdmAnalysisManager::AddIsotope: " << pid
<< G4endl;
}
histo->fillTuple(1,0,pid);
histo->fillTuple(1,1,time/second);
histo->fillTuple(1,2,weight);
histo->addRow(1);
fHisto->FillTuple(1,0,pid);
fHisto->FillTuple(1,1,time/second);
fHisto->FillTuple(1,2,weight);
fHisto->AddRow(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmAnalysisManager::AddDecayProduct(G4double pid,G4int Z, G4int A,
G4double energy, G4double time,
G4double weight)
{
fHisto->FillTuple(3,0,pid);
fHisto->FillTuple(3,1,double(Z));
fHisto->FillTuple(3,2,double(A));
fHisto->FillTuple(3,3,energy);
fHisto->FillTuple(3,4,time/s);
fHisto->FillTuple(3,5,weight);
fHisto->AddRow(3);
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmDetectorConstruction.cc
/// \brief Implementation of the exrdmDetectorConstruction class
//
#include "exrdmDetectorConstruction.hh"
#include "exrdmDetectorMessenger.hh"
//#include "exrdmDetectorSD.hh"
@@ -38,6 +41,8 @@
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
#include <sstream>
@@ -45,28 +50,26 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmDetectorConstruction::exrdmDetectorConstruction()
:solidWorld(0), logicWorld(0), physiWorld(0),
solidTarget(0), logicTarget(0), physiTarget(0),
solidDetector(0),logicDetector(0),physiDetector(0),
TargetMater(0), DetectorMater(0),
fWorldLength(0.)
:fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0),
fSolidTarget(0), fLogicTarget(0), fPhysiTarget(0),
fSolidDetector(0),fLogicDetector(0),fPhysiDetector(0),
fMaterialsManager(0),
fDefaultMater(0),fTargetMater(0),fDetectorMater(0),
fTargetLength (1.*cm), fTargetRadius(0.5*cm),
fDetectorLength(5.0 * cm), fDetectorThickness(2.0 * cm),
fWorldLength (std::max(fTargetLength,fDetectorLength)),
fWorldRadius (fTargetRadius + fDetectorThickness),
fTargetRegion(0), fDetectorRegion(0)
{
detectorMessenger = new exrdmDetectorMessenger(this);
fDetectorMessenger = new exrdmDetectorMessenger(this);
DefineMaterials();
fDetectorThickness = 2.* cm;
fTargetRadius = 0.5 * cm;
fDetectorLength = 5.0 * cm;
fTargetLength = 1.0 * cm;
//--------- Sizes of the principal geometrical components (solids) ---------
fWorldLength = std::max(fTargetLength,fDetectorLength);
fWorldRadius = fTargetRadius + fDetectorThickness;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmDetectorConstruction::~exrdmDetectorConstruction()
{
delete detectorMessenger;
delete fDetectorMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -75,20 +78,20 @@ void exrdmDetectorConstruction::DefineMaterials()
{
//--------- Material definition ---------
materialsManager = new exrdmMaterial();
fMaterialsManager = new exrdmMaterial();
// Lead
materialsManager->AddMaterial("Lead","Pb",11.3*g/cm3,"");
fMaterialsManager->AddMaterial("Lead","Pb",11.3*g/cm3,"");
//Germanium detector
materialsManager->AddMaterial("Germanium","Ge",5.323*g/cm3,"");
fMaterialsManager->AddMaterial("Germanium","Ge",5.323*g/cm3,"");
//CsI
materialsManager->AddMaterial("CsI","Cs-I",4.51*g/cm3,"");
fMaterialsManager->AddMaterial("CsI","Cs-I",4.51*g/cm3,"");
// G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
// G4cout << *(G4Material::GetMaterialTable()) << G4endl;
DefaultMater = materialsManager->GetMaterial("Air");
TargetMater = materialsManager->GetMaterial("CsI");
DetectorMater = materialsManager->GetMaterial("Germanium");
fDefaultMater = fMaterialsManager->GetMaterial("Air");
fTargetMater = fMaterialsManager->GetMaterial("CsI");
fDetectorMater = fMaterialsManager->GetMaterial("Germanium");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -105,37 +108,37 @@ G4VPhysicalVolume* exrdmDetectorConstruction::Construct()
// World
//------------------------------
solidWorld= new G4Tubs("world",0.,fWorldRadius,fWorldLength/2.,0.,twopi);
logicWorld= new G4LogicalVolume( solidWorld, DefaultMater, "World", 0, 0, 0);
fSolidWorld= new G4Tubs("world",0.,fWorldRadius,fWorldLength/2.,0.,twopi);
fLogicWorld= new G4LogicalVolume( fSolidWorld, fDefaultMater, "World", 0, 0, 0);
// Must place the World Physical volume unrotated at (0,0,0).
//
physiWorld = new G4PVPlacement(0, // no rotation
fPhysiWorld = new G4PVPlacement(0, // no rotation
G4ThreeVector(), // at (0,0,0)
logicWorld, // its logical volume
"World", // its name
fLogicWorld, // its logical volume
"World", // its name
0, // its mother volume
false, // no boolean operations
0); // no field specific to volume
//------------------------------
// Target
//------------------------------
G4ThreeVector positionTarget = G4ThreeVector(0,0,0);
solidTarget = new G4Tubs("target",0.,fTargetRadius,fTargetLength/2.,0.,twopi);
logicTarget = new G4LogicalVolume(solidTarget,TargetMater,"Target",0,0,0);
physiTarget = new G4PVPlacement(0, // no rotation
positionTarget, // at (x,y,z)
logicTarget, // its logical volume
"Target", // its name
logicWorld, // its mother volume
false, // no boolean operations
0); // no particular field
fSolidTarget = new G4Tubs("target",0.,fTargetRadius,fTargetLength/2.,0.,twopi);
fLogicTarget = new G4LogicalVolume(fSolidTarget,fTargetMater,"Target",0,0,0);
fPhysiTarget = new G4PVPlacement(0, // no rotation
positionTarget, // at (x,y,z)
fLogicTarget, // its logical volume
"Target", // its name
fLogicWorld, // its mother volume
false, // no boolean operations
0); // no particular field
// G4cout << "Target is a cylinder with rdius of " << targetradius/cm << " cm of "
// << TargetMater->GetName() << G4endl;
// << fTargetMater->GetName() << G4endl;
//------------------------------
// Detector
@@ -143,15 +146,17 @@ G4VPhysicalVolume* exrdmDetectorConstruction::Construct()
G4ThreeVector positionDetector = G4ThreeVector(0,0,0);
solidDetector = new G4Tubs("detector",fTargetRadius,fWorldRadius,fDetectorLength/2.,0.,twopi);
logicDetector = new G4LogicalVolume(solidDetector ,DetectorMater, "Detector",0,0,0);
physiDetector = new G4PVPlacement(0, // no rotation
positionDetector, // at (x,y,z)
logicDetector, // its logical volume
"Detector", // its name
logicWorld, // its mother volume
false, // no boolean operations
0); // no particular field
fSolidDetector = new G4Tubs("detector",fTargetRadius,fWorldRadius,
fDetectorLength/2.,0.,twopi);
fLogicDetector = new G4LogicalVolume(fSolidDetector ,fDetectorMater,
"Detector",0,0,0);
fPhysiDetector = new G4PVPlacement(0, // no rotation
positionDetector, // at (x,y,z)
fLogicDetector, // its logical volume
"Detector", // its name
fLogicWorld, // its mother volume
false, // no boolean operations
0); // no particular field
//------------------------------------------------
// Sensitive detectors
@@ -162,25 +167,25 @@ G4VPhysicalVolume* exrdmDetectorConstruction::Construct()
// G4String detectortargetSDname = "exrdm/DetectorTargetSD";
// exrdmDetectorSD* aDetectorSD = new exrdmDetectorSD( detectorTargetSDname );
// SDman->AddNewDetector( aDetectorSD );
//logicTarget->SetSensitiveDetector( aDetectorSD );
// logicDetector->SetSensitiveDetector( aDetectorSD );
//fLogicTarget->SetSensitiveDetector( aDetectorSD );
// fLogicDetector->SetSensitiveDetector( aDetectorSD );
//
//-------------------------------------------------
// regions
//
// if(targetRegion) delete targetRegion;
// if(detectorRegion) delete detectorRegion;
targetRegion = new G4Region("Target");
detectorRegion = new G4Region("Detector");
targetRegion->AddRootLogicalVolume(logicTarget);
detectorRegion->AddRootLogicalVolume(logicDetector);
// if(fTargetRegion) delete fTargetRegion;
// if(fDetectorRegion) delete fDetectorRegion;
fTargetRegion = new G4Region("Target");
fDetectorRegion = new G4Region("Detector");
fTargetRegion->AddRootLogicalVolume(fLogicTarget);
fDetectorRegion->AddRootLogicalVolume(fLogicDetector);
//--------- Visualization attributes -------------------------------
logicWorld->SetVisAttributes(G4VisAttributes::Invisible);
fLogicWorld->SetVisAttributes(G4VisAttributes::Invisible);
G4VisAttributes* TargetVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
logicTarget ->SetVisAttributes(TargetVisAtt);
fLogicTarget ->SetVisAttributes(TargetVisAtt);
G4VisAttributes* DetectorVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,.0));
logicDetector->SetVisAttributes(DetectorVisAtt);
fLogicDetector->SetVisAttributes(DetectorVisAtt);
//------------ set the incident position ------
@@ -206,33 +211,35 @@ G4VPhysicalVolume* exrdmDetectorConstruction::Construct()
UI->ApplyCommand("/gps/energy 100 MeV");
//
return physiWorld;
return fPhysiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmDetectorConstruction::setTargetMaterial(G4String materialName)
void exrdmDetectorConstruction::SetTargetMaterial(G4String materialName)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
if (pttoMaterial)
{TargetMater = pttoMaterial;
if (logicTarget) logicTarget->SetMaterial(pttoMaterial);
G4cout << "\n----> The target has been changed to " << fTargetLength/cm << " cm of "
{fTargetMater = pttoMaterial;
if (fLogicTarget) fLogicTarget->SetMaterial(pttoMaterial);
G4cout << "\n----> The target has been changed to " << fTargetLength/cm
<< " cm of "
<< materialName << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmDetectorConstruction::setDetectorMaterial(G4String materialName)
void exrdmDetectorConstruction::SetDetectorMaterial(G4String materialName)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
if (pttoMaterial)
{DetectorMater = pttoMaterial;
if (logicDetector) logicDetector->SetMaterial(pttoMaterial);
G4cout << "\n----> The Deetctor has been changed to" << fDetectorLength/cm << " cm of "
{fDetectorMater = pttoMaterial;
if (fLogicDetector) fLogicDetector->SetMaterial(pttoMaterial);
G4cout << "\n----> The Deetctor has been changed to" << fDetectorLength/cm
<< " cm of "
<< materialName << G4endl;
}
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmDetectorMessenger.cc
/// \brief Implementation of the exrdmDetectorMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "exrdmDetectorMessenger.hh"
@@ -36,79 +39,82 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmDetectorMessenger::exrdmDetectorMessenger(exrdmDetectorConstruction* myDet)
:myDetector(myDet)
:fMyDetector(myDet)
{
exrdmDir = new G4UIdirectory("/exrdm/");
exrdmDir->SetGuidance("UI commands specific to this example.");
fExrdmDir = new G4UIdirectory("/exrdm/");
fExrdmDir->SetGuidance("UI commands specific to this example.");
detDir = new G4UIdirectory("/exrdm/det/");
detDir->SetGuidance("detector control.");
fDetDir = new G4UIdirectory("/exrdm/det/");
fDetDir->SetGuidance("detector control.");
TargMatCmd = new G4UIcmdWithAString("/exrdm/det/setTargetMate",this);
TargMatCmd->SetGuidance("Select Material of the Target.");
TargMatCmd->SetParameterName("choice",false);
TargMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fTargMatCmd = new G4UIcmdWithAString("/exrdm/det/setTargetMate",this);
fTargMatCmd->SetGuidance("Select Material of the Target.");
fTargMatCmd->SetParameterName("choice",false);
fTargMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
TargRadiusCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetRadius",this);
TargRadiusCmd->SetGuidance("Set the Target Radius.");
TargRadiusCmd->SetUnitCategory("Length");
TargRadiusCmd->SetParameterName("choice",false);
TargRadiusCmd->AvailableForStates(G4State_PreInit);
fTargRadiusCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetRadius", this);
fTargRadiusCmd->SetGuidance("Set the Target Radius.");
fTargRadiusCmd->SetUnitCategory("Length");
fTargRadiusCmd->SetParameterName("choice",false);
fTargRadiusCmd->AvailableForStates(G4State_PreInit);
TargLengthCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetLength",this);
TargLengthCmd->SetGuidance("Set the Target Length.");
TargLengthCmd->SetUnitCategory("Length");
TargLengthCmd->SetParameterName("choice",false);
TargLengthCmd->AvailableForStates(G4State_PreInit);
fTargLengthCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetLength", this);
fTargLengthCmd->SetGuidance("Set the Target Length.");
fTargLengthCmd->SetUnitCategory("Length");
fTargLengthCmd->SetParameterName("choice",false);
fTargLengthCmd->AvailableForStates(G4State_PreInit);
DetectMatCmd = new G4UIcmdWithAString("/exrdm/det/setDetectorMate",this);
DetectMatCmd->SetGuidance("Select Material of the Detector.");
DetectMatCmd->SetParameterName("choice",false);
DetectMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fDetectMatCmd = new G4UIcmdWithAString("/exrdm/det/setDetectorMate",this);
fDetectMatCmd->SetGuidance("Select Material of the Detector.");
fDetectMatCmd->SetParameterName("choice",false);
fDetectMatCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
DetectThicknessCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorThickness",this);
DetectThicknessCmd->SetGuidance("Set the Detector Thickness.");
DetectThicknessCmd->SetUnitCategory("Length");
DetectThicknessCmd->SetParameterName("choice",false);
DetectThicknessCmd->AvailableForStates(G4State_PreInit);
fDetectThicknessCmd =
new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorThickness",this);
fDetectThicknessCmd->SetGuidance("Set the Detector Thickness.");
fDetectThicknessCmd->SetUnitCategory("Length");
fDetectThicknessCmd->SetParameterName("choice",false);
fDetectThicknessCmd->AvailableForStates(G4State_PreInit);
DetectLengthCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorLength",this);
DetectLengthCmd->SetGuidance("Set the Detector Length.");
DetectLengthCmd->SetUnitCategory("Length");
DetectLengthCmd->SetParameterName("choice",false);
DetectLengthCmd->AvailableForStates(G4State_PreInit);
fDetectLengthCmd =
new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorLength",this);
fDetectLengthCmd->SetGuidance("Set the Detector Length.");
fDetectLengthCmd->SetUnitCategory("Length");
fDetectLengthCmd->SetParameterName("choice",false);
fDetectLengthCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmDetectorMessenger::~exrdmDetectorMessenger()
{
delete TargMatCmd;
delete DetectMatCmd;
delete TargRadiusCmd;
delete DetectThicknessCmd;
delete TargLengthCmd;
delete DetectLengthCmd;
delete detDir;
delete exrdmDir;
delete fTargMatCmd;
delete fDetectMatCmd;
delete fTargRadiusCmd;
delete fDetectThicknessCmd;
delete fTargLengthCmd;
delete fDetectLengthCmd;
delete fDetDir;
delete fExrdmDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
void exrdmDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == TargMatCmd )
{ myDetector->setTargetMaterial(newValue);}
else if ( command == TargLengthCmd )
{ myDetector->setTargetLength(TargLengthCmd->GetNewDoubleValue(newValue));}
else if ( command == TargRadiusCmd )
{ myDetector->setTargetRadius(TargLengthCmd->GetNewDoubleValue(newValue));}
else if( command == DetectMatCmd )
{ myDetector->setDetectorMaterial(newValue);}
else if (command == DetectLengthCmd )
{ myDetector->setDetectorLength(DetectLengthCmd->GetNewDoubleValue(newValue));}
else if (command == DetectThicknessCmd )
{ myDetector->setDetectorThickness(DetectThicknessCmd->GetNewDoubleValue(newValue));}
if( command == fTargMatCmd )fMyDetector->SetTargetMaterial(newValue);
else if ( command == fTargLengthCmd )
fMyDetector->SetTargetLength(fTargLengthCmd->GetNewDoubleValue(newValue));
else if ( command == fTargRadiusCmd )
fMyDetector->SetTargetRadius(fTargLengthCmd->GetNewDoubleValue(newValue));
else if( command == fDetectMatCmd )
fMyDetector->SetDetectorMaterial(newValue);
else if (command == fDetectLengthCmd )
fMyDetector->SetDetectorLength(
fDetectLengthCmd->GetNewDoubleValue(newValue));
else if (command == fDetectThicknessCmd )
fMyDetector->SetDetectorThickness(
fDetectThicknessCmd->GetNewDoubleValue(newValue));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmEnergyDeposition.cc
/// \brief Implementation of the exrdmEnergyDeposition class
//
#include "exrdmEnergyDeposition.hh"
@@ -30,26 +33,28 @@
// Default constructor
//
exrdmEnergyDeposition::exrdmEnergyDeposition()
: fEnergy(0.), fTime(0.),fWeight(1.)
{;}
//
// Specific constructor
//
exrdmEnergyDeposition::exrdmEnergyDeposition( G4double energy,
G4double time,
G4double time,
G4double weight )
: Energy(energy),
Time(time),
Weight(weight)
: fEnergy(energy),
fTime(time),
fWeight(weight)
{;}
//
// Copy constructor
//
exrdmEnergyDeposition::exrdmEnergyDeposition( const exrdmEnergyDeposition &right )
: Energy(right.Energy),
Time(right.Time),
Weight(right.Weight)
exrdmEnergyDeposition::exrdmEnergyDeposition(
const exrdmEnergyDeposition &right )
: fEnergy(right.fEnergy),
fTime(right.fTime),
fWeight(right.fWeight)
{;}
//
@@ -60,21 +65,24 @@ exrdmEnergyDeposition::~exrdmEnergyDeposition() {;}
//
// Equivalence operator
//
G4bool exrdmEnergyDeposition::operator==( const exrdmEnergyDeposition &right ) const
G4bool exrdmEnergyDeposition::operator==
( const exrdmEnergyDeposition &right ) const
{
return Time == right.Time;
return fTime == right.fTime;
}
//
// Order operators
//
G4bool exrdmEnergyDeposition::operator<( const exrdmEnergyDeposition &right ) const
G4bool exrdmEnergyDeposition::operator<
( const exrdmEnergyDeposition &right ) const
{
return Time < right.Time;
return fTime < right.fTime;
}
G4bool exrdmEnergyDeposition::operator<=( const exrdmEnergyDeposition &right ) const
G4bool exrdmEnergyDeposition::operator<=
( const exrdmEnergyDeposition &right ) const
{
return Time <= right.Time;
return fTime <= right.fTime;
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmEventAction.cc
/// \brief Implementation of the exrdmEventAction class
//
// CHANGE HISTORY
// --------------
#include "G4ios.hh"
@@ -40,23 +43,23 @@ extern G4bool drawEvent;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmEventAction::exrdmEventAction()
: drawFlag("all")
: fDrawFlag("all")
{
eventMessenger = new exrdmEventActionMessenger(this);
fEventMessenger = new exrdmEventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmEventAction::~exrdmEventAction()
{
delete eventMessenger;
delete fEventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmEventAction::BeginOfEventAction(const G4Event* )
{
exrdmAnalysisManager::getInstance()->BeginOfEvent();
exrdmAnalysisManager::GetInstance()->BeginOfEvent();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -64,7 +67,7 @@ void exrdmEventAction::BeginOfEventAction(const G4Event* )
void exrdmEventAction::EndOfEventAction(const G4Event*)
{
//analysis
exrdmAnalysisManager::getInstance()->EndOfEvent();
exrdmAnalysisManager::GetInstance()->EndOfEvent();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmEventActionMessenger.cc
/// \brief Implementation of the exrdmEventActionMessenger class
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -34,31 +37,33 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmEventActionMessenger::exrdmEventActionMessenger(exrdmEventAction* EvAct)
:eventAction(EvAct)
exrdmEventActionMessenger::exrdmEventActionMessenger(
exrdmEventAction* EvAct)
:fEventAction(EvAct)
{
DrawCmd = new G4UIcmdWithAString("/event/draw",this);
DrawCmd->SetGuidance("Draw the tracks in the event");
DrawCmd->SetGuidance(" Choice : none, charged, all (default)");
DrawCmd->SetParameterName("choice",true);
DrawCmd->SetDefaultValue("all");
DrawCmd->SetCandidates("none charged all");
DrawCmd->AvailableForStates(G4State_Idle);
fDrawCmd = new G4UIcmdWithAString("/event/draw",this);
fDrawCmd->SetGuidance("Draw the tracks in the event");
fDrawCmd->SetGuidance(" Choice : none, charged, all (default)");
fDrawCmd->SetParameterName("choice",true);
fDrawCmd->SetDefaultValue("all");
fDrawCmd->SetCandidates("none charged all");
fDrawCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmEventActionMessenger::~exrdmEventActionMessenger()
{
delete DrawCmd;
delete fDrawCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmEventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
void exrdmEventActionMessenger::SetNewValue(G4UIcommand * command,
G4String newValue)
{
if(command == DrawCmd)
{eventAction->SetDrawFlag(newValue);}
if(command == fDrawCmd)
{fEventAction->SetDrawFlag(newValue);}
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmHisto.cc
/// \brief Implementation of the exrdmHisto class
//
#ifdef G4ANALYSIS_USE
#include <AIDA/AIDA.h>
#endif
@@ -48,40 +51,35 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
exrdmHisto::exrdmHisto()
:fHistName("exrdm"), fHistType("root"),
fNHisto(0), fNTuple(0), fVerbose(0),
fDefaultAct(1)
{
verbose = 1;
histName = "exrdm";
// histType = "aida";
histType = "root";
nHisto = 0;
nTuple = 0;
defaultAct = 1;
//
#ifdef G4ANALYSIS_USE
aida = 0;
tree = 0;
fAida = 0;
fTree = 0;
#endif
#ifdef G4ANALYSIS_USE_ROOT
ROOThisto.clear();
ROOTntup.clear();
Rarray.clear();
Rcol.clear();
fROOThisto.clear();
fROOTntup.clear();
fRarray.clear();
fRcol.clear();
#endif
active.clear();
bins.clear();
xmin.clear();
xmax.clear();
unit.clear();
ids.clear();
titles.clear();
tupleName.clear();
tupleId.clear();
tupleList.clear();
tupleListROOT.clear();
fActive.clear();
fBins.clear();
fXmin.clear();
fXmax.clear();
fUnit.clear();
fIds.clear();
fTitles.clear();
fTupleName.clear();
fTupleId.clear();
fTupleList.clear();
fTupleListROOT.clear();
messenger = new exrdmHistoMessenger(this);
fMessenger = new exrdmHistoMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -89,71 +87,73 @@ exrdmHisto::exrdmHisto()
exrdmHisto::~exrdmHisto()
{
#ifdef G4ANALYSIS_USE
histo.clear();
ntup.clear();
fHisto.clear();
fNtup.clear();
#endif
#ifdef G4ANALYSIS_USE_ROOT
//FIXME : G.Barrand : the below is crashy.
// In principle the TH are deleted
// when doing the TFile::Close !
// In fact the hfileROOT should
// be deleted in save(). And I am pretty
// In fact the fHfileROOT should
// be deleted in Save(). And I am pretty
// sure that the TApplication is not needed.
//
// removed by F.Lei
// for(G4int i=0; i<nHisto; i++) {
// if(ROOThisto[i]) delete ROOThisto[i];
// for(G4int i=0; i<fNHisto; i++) {
// if(fROOThisto[i]) delete fROOThisto[i];
// }
#endif
delete messenger;
delete fMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::book()
void exrdmHisto::Book()
{
#ifdef G4ANALYSIS_USE
G4cout << "### exrdmHisto books " << nHisto << " histograms " << G4endl;
G4cout << "### exrdmHisto books " << fNHisto << " histograms " << G4endl;
// Creating the analysis factory
aida = AIDA_createAnalysisFactory();
if(!aida) {
fAida = AIDA_createAnalysisFactory();
if(!fAida) {
G4cout << "ERROR: can't get AIDA." << G4endl;
return;
}
// Creating the tree factory
{AIDA::ITreeFactory* tf = aida->createTreeFactory();
// Creating a tree mapped to a new aida file.
G4String fileName = histName + "." + histType;
if (histType == "root") fileName = histName + "_aida." + histType;
tree = tf->create(fileName,histType,false,true,"");
// Creating the fTree factory
{AIDA::ITreeFactory* tf = fAida->createTreeFactory();
// Creating a fTree mapped to a new fAida file.
G4String fileName = fHistName + "." + fHistType;
if (fHistType == "root") fileName = fHistName + "_aida." + fHistType;
fTree = tf->create(fileName,fHistType,false,true,"");
delete tf;
if(!tree) {
G4cout << "ERROR: Tree store " << histName << " is not created!" << G4endl;
if(!fTree) {
G4cout << "ERROR: Tree store " << fHistName << " is not created!" << G4endl;
return;
}
G4cout << "Tree store : " << tree->storeName() << G4endl;}
// Creating a histogram factory, whose histograms will be handled by the tree
{AIDA::IHistogramFactory* hf = aida->createHistogramFactory(*tree);
// Creating an 1-dimensional histograms in the root directory of the tree
for(G4int i=0; i<nHisto; i++) {
if(active[i]) {
if(verbose>1)
G4cout<<"book: histogram "<< i << " id= " << ids[i] <<G4endl;
G4String tit = ids[i];
if(histType == "root") tit = "h" + ids[i];
histo[i] = hf->createHistogram1D(tit, titles[i], bins[i], xmin[i], xmax[i]);
G4cout << "Tree store : " << fTree->storeName() << G4endl;}
// Creating a histogram factory, whose histograms will be handled by the fTree
{AIDA::IHistogramFactory* hf = fAida->createHistogramFactory(*fTree);
// Creating an 1-dimensional histograms in the root directory of the fTree
for(G4int i=0; i<fNHisto; i++) {
if(fActive[i]) {
if(fVerbose>1)
G4cout<<"Book: histogram "<< i << " id= " << fIds[i] <<G4endl;
G4String tit = fIds[i];
if(fHistType == "root") tit = "h" + fIds[i];
fHisto[i] = hf->createHistogram1D(tit, fTitles[i], fBins[i], fXmin[i],
fXmax[i]);
}
}
delete hf;
G4cout << "AIDA histograms are booked" << G4endl;}
// Creating a tuple factory, whose tuples will be handled by the tree
{AIDA::ITupleFactory* tpf = aida->createTupleFactory( *tree );
G4cout << "AIDA will book " << nTuple << " ntuples" << G4endl;
for(G4int i=0; i<nTuple; i++) {
if(tupleList[i] != "") {
G4cout << "Creating Ntuple: " << tupleName[i] <<":" <<tupleList[i] <<G4endl;
ntup[i] = tpf->create(tupleId[i], tupleName[i], tupleList[i],"");
// Creating a tuple factory, whose tuples will be handled by the fTree
{AIDA::ITupleFactory* tpf = fAida->createTupleFactory( *fTree );
G4cout << "AIDA will Book " << fNTuple << " ntuples" << G4endl;
for(G4int i=0; i<fNTuple; i++) {
if(fTupleList[i] != "") {
G4cout << "Creating Ntuple: " << fTupleName[i] <<":" <<fTupleList[i]
<< G4endl;
fNtup[i] = tpf->create(fTupleId[i], fTupleName[i], fTupleList[i],"");
}
}
delete tpf;
@@ -162,25 +162,27 @@ void exrdmHisto::book()
#ifdef G4ANALYSIS_USE_ROOT
// new TApplication("App", ((int *)0), ((char **)0));
G4String fileNameROOT = histName + G4String(".root");
hfileROOT = new TFile(fileNameROOT.c_str() ,"RECREATE","ROOT file for exRDM");
G4String fileNameROOT = fHistName + G4String(".root");
fHfileROOT = new TFile(fileNameROOT.c_str() ,"RECREATE","ROOT file for exRDM");
G4cout << "Root file: " << fileNameROOT << G4endl;
// Creating an 1-dimensional histograms in the root directory of the tree
for(G4int i=0; i<nHisto; i++) {
if(active[i]) {
G4String id = G4String("h")+ids[i];
ROOThisto[i] = new TH1D(id, titles[i], bins[i], xmin[i], xmax[i]);
G4cout << "ROOT Histo " << ids[i] << " " << titles[i] << " booked " << G4endl;
// Creating an 1-dimensional histograms in the root directory of the fTree
for(G4int i=0; i<fNHisto; i++) {
if(fActive[i]) {
G4String id = G4String("h")+fIds[i];
fROOThisto[i] = new TH1D(id, fTitles[i], fBins[i], fXmin[i], fXmax[i]);
G4cout << "ROOT Histo " << fIds[i] << " " << fTitles[i] << " booked "
<< G4endl;
}
}
// Now the ntuples
for(G4int i=0; i<nTuple; i++) {
if(tupleListROOT[i] != "") {
G4String id = G4String("t")+tupleId[i];
G4cout << "Creating Ntuple "<<tupleId[i] << " in ROOT file: "
<< tupleName[i] << G4endl;
ROOTntup[i] = new TNtuple(id, tupleName[i], tupleListROOT[i]);
G4cout << "ROOT Ntuple " << id << " " << tupleName[i] <<" "<< tupleListROOT[i]<< " booked " << G4endl;
for(G4int i=0; i<fNTuple; i++) {
if(fTupleListROOT[i] != "") {
G4String id = G4String("t")+fTupleId[i];
G4cout << "Creating Ntuple "<<fTupleId[i] << " in ROOT file: "
<< fTupleName[i] << G4endl;
fROOTntup[i] = new TNtuple(id, fTupleName[i], fTupleListROOT[i]);
G4cout << "ROOT Ntuple " << id << " " << fTupleName[i] <<" "
<< fTupleListROOT[i]<< " booked " << G4endl;
}
}
#endif
@@ -189,29 +191,29 @@ void exrdmHisto::book()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::save()
void exrdmHisto::Save()
{
#ifdef G4ANALYSIS_USE
// Write histogram file
tree->commit();
G4cout << "Closing the AIDA tree..." << G4endl;
tree->close();
fTree->commit();
G4cout << "Closing the AIDA fTree..." << G4endl;
fTree->close();
G4cout << "Histograms and Ntuples are saved" << G4endl;
delete tree;
tree = 0;
delete aida;
aida = 0;
{for(G4int i=0; i<nHisto; i++) histo[i] = 0;}
{for(G4int i=0; i<nTuple; i++) ntup[i] = 0;}
delete fTree;
fTree = 0;
delete fAida;
fAida = 0;
{for(G4int i=0; i<fNHisto; i++) fHisto[i] = 0;}
{for(G4int i=0; i<fNTuple; i++) fNtup[i] = 0;}
#endif
#ifdef G4ANALYSIS_USE_ROOT
G4cout << "ROOT: files writing..." << G4endl;
hfileROOT->Write();
fHfileROOT->Write();
G4cout << "ROOT: files closing..." << G4endl;
hfileROOT->Close();
fHfileROOT->Close();
//
// F.Lei added following Guy's suggestion!
delete hfileROOT;
delete fHfileROOT;
#endif
}
@@ -219,94 +221,99 @@ void exrdmHisto::save()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::add1D(const G4String& id, const G4String& name, G4int nb,
G4double x1, G4double x2, G4double u)
void exrdmHisto::Add1D(const G4String& id, const G4String& name, G4int nb,
G4double x1, G4double x2, G4double u)
{
if(verbose > 0) {
if(fVerbose > 0) {
G4cout << "New histogram will be booked: #" << id << " <" << name
<< " " << nb << " " << x1 << " " << x2 << " " << u
<< G4endl;
}
nHisto++;
fNHisto++;
x1 /= u;
x2 /= u;
active.push_back(defaultAct);
bins.push_back(nb);
xmin.push_back(x1);
xmax.push_back(x2);
unit.push_back(u);
ids.push_back(id);
titles.push_back(name);
fActive.push_back(fDefaultAct);
fBins.push_back(nb);
fXmin.push_back(x1);
fXmax.push_back(x2);
fUnit.push_back(u);
fIds.push_back(id);
fTitles.push_back(name);
#ifdef G4ANALYSIS_USE
histo.push_back(0);
fHisto.push_back(0);
#endif
#ifdef G4ANALYSIS_USE_ROOT
ROOThisto.push_back(0);
fROOThisto.push_back(0);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::setHisto1D(G4int i, G4int nb, G4double x1, G4double x2, G4double u)
void exrdmHisto::SetHisto1D(G4int i, G4int nb, G4double x1, G4double x2, G4double u)
{
if(i>=0 && i<nHisto) {
if(verbose > 0) {
if(i>=0 && i<fNHisto) {
if(fVerbose > 0) {
G4cout << "Update histogram: #" << i
<< " " << nb << " " << x1 << " " << x2 << " " << u
<< G4endl;
}
bins[i] = nb;
xmin[i] = x1;
xmax[i] = x2;
unit[i] = u;
fBins[i] = nb;
fXmin[i] = x1;
fXmax[i] = x2;
fUnit[i] = u;
} else {
G4cout << "exrdmHisto::setexrdmHisto1D: WARNING! wrong histogram index " << i << G4endl;
G4cout << "exrdmHisto::setexrdmHisto1D: WARNING! wrong histogram index "
<< i << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::fillHisto(G4int i, G4double x, G4double w)
void exrdmHisto::FillHisto(G4int i, G4double x, G4double w)
{
if(verbose > 1) {
if(fVerbose > 1) {
G4cout << "fill histogram: #" << i << " at x= " << x
<< " weight= " << w
<< G4endl;
}
#ifdef G4ANALYSIS_USE
if(i>=0 && i<nHisto) {
histo[i]->fill(x/unit[i], w);
if(i>=0 && i<fNHisto) {
fHisto[i]->fill(x/fUnit[i], w);
} else {
G4cout << "exrdmHisto::fill: WARNING! wrong AIDA histogram index " << i << G4endl;
G4cout << "exrdmHisto::fill: WARNING! wrong AIDA histogram index "
<< i << G4endl;
}
#endif
#ifdef G4ANALYSIS_USE_ROOT
if(i>=0 && i<nHisto) {
ROOThisto[i]->Fill(x/unit[i],w);
if(i>=0 && i<fNHisto) {
fROOThisto[i]->Fill(x/fUnit[i],w);
} else {
G4cout << "exrdmHisto::fill: WARNING! wrong ROOT histogram index " << i << G4endl;
G4cout << "exrdmHisto::fill: WARNING! wrong ROOT histogram index "
<< i << G4endl;
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::scaleHisto(G4int i, G4double x)
void exrdmHisto::ScaleHisto(G4int i, G4double x)
{
if(verbose > 0) {
if(fVerbose > 0) {
G4cout << "Scale histogram: #" << i << " by factor " << x << G4endl;
}
#ifdef G4ANALYSIS_USE
if(i>=0 && i<nHisto) {
histo[i]->scale(x);
G4cout << "exrdmHisto::scale: WARNING! wrong AIDA histogram index " << i << G4endl;
if(i>=0 && i<fNHisto) {
fHisto[i]->scale(x);
G4cout << "exrdmHisto::scale: WARNING! wrong AIDA histogram index "
<< i << G4endl;
}
#endif
#ifdef G4ANALYSIS_USE_ROOT
if(i>=0 && i<nHisto) {
ROOThisto[i]->Scale(x);
if(i>=0 && i<fNHisto) {
fROOThisto[i]->Scale(x);
} else {
G4cout << "exrdmHisto::scale: WARNING! wrong ROOT histogram index " << i << G4endl;
G4cout << "exrdmHisto::scale: WARNING! wrong ROOT histogram index "
<< i << G4endl;
}
#endif
}
@@ -314,30 +321,33 @@ void exrdmHisto::scaleHisto(G4int i, G4double x)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifdef G4ANALYSIS_USE
void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3 )
void exrdmHisto::AddTuple(const G4String& w1, const G4String& w2,
const G4String& w3 )
#else
#ifdef G4ANALYSIS_USE_ROOT
void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& w3 )
void exrdmHisto::AddTuple(const G4String& w1, const G4String& w2,
const G4String& w3 )
#else
void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String& )
void exrdmHisto::AddTuple(const G4String& w1, const G4String& w2,
const G4String& )
#endif
#endif
{
//G4cout << w1 << " " << w2 << " " << w3 << G4endl;
nTuple++;
tupleId.push_back(w1);
tupleName.push_back(w2) ;
fNTuple++;
fTupleId.push_back(w1);
fTupleName.push_back(w2) ;
#ifdef G4ANALYSIS_USE
tupleList.push_back(w3);
ntup.push_back(0);
fTupleList.push_back(w3);
fNtup.push_back(0);
#endif
#ifdef G4ANALYSIS_USE_ROOT
std::vector<float> ar;
ar.clear();
for (size_t i = 0; i < 20; i++) ar.push_back(0.);
Rarray.push_back(ar);
fRarray.push_back(ar);
// convert AIDA header to ROOT header for ntuple
G4Tokenizer next(w3);
G4String token = next();
@@ -352,102 +362,102 @@ void exrdmHisto::addTuple(const G4String& w1, const G4String& w2, const G4String
}
G4String ROOTList = ROOTList1.substr(0,ROOTList1.length()-2);
// G4cout << ROOTList << G4endl;
tupleListROOT.push_back(ROOTList);
ROOTntup.push_back(0);
Rcol.push_back(col-1);
fTupleListROOT.push_back(ROOTList);
fROOTntup.push_back(0);
fRcol.push_back(col-1);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4double x)
void exrdmHisto::FillTuple(G4int i, const G4String& parname, G4double x)
{
if(verbose > 1)
if(fVerbose > 1)
G4cout << "fill tuple # " << i
<<" with parameter <" << parname << "> = " << x << G4endl;
<<" with parameter <" << parname << "> = " << x << G4endl;
#ifdef G4ANALYSIS_USE
if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
if(fNtup[i]) fNtup[i]->fill(fNtup[i]->findColumn(parname), x);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::fillTuple(G4int i, G4int col, G4double x)
void exrdmHisto::FillTuple(G4int i, G4int col, G4double x)
{
if(verbose > 1) {
if(fVerbose > 1) {
G4cout << "fill tuple # " << i
<<" in column < " << col << "> = " << x << G4endl;
<<" in column < " << col << "> = " << x << G4endl;
}
#ifdef G4ANALYSIS_USE
if(ntup[i]) ntup[i]->fill(col,double(x));
if(fNtup[i]) fNtup[i]->fill(col,double(x));
#endif
#ifdef G4ANALYSIS_USE_ROOT
if(ROOTntup[i]) (Rarray[i])[col] = float(x);
if(fROOTntup[i]) (fRarray[i])[col] = float(x);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::fillTuple(G4int i, const G4String& parname, G4String& x)
void exrdmHisto::FillTuple(G4int i, const G4String& parname, G4String& x)
{
if(verbose > 1) {
if(fVerbose > 1) {
G4cout << "fill tuple # " << i
<<" with parameter <" << parname << "> = " << x << G4endl;
<<" with parameter <" << parname << "> = " << x << G4endl;
}
#ifdef G4ANALYSIS_USE
if(ntup[i]) ntup[i]->fill(ntup[i]->findColumn(parname), x);
if(fNtup[i]) fNtup[i]->fill(fNtup[i]->findColumn(parname), x);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::addRow(G4int i)
void exrdmHisto::AddRow(G4int i)
{
if(verbose > 1) G4cout << "Added a raw #" << i << " to tuple" << G4endl;
if(fVerbose > 1) G4cout << "Added a raw #" << i << " to tuple" << G4endl;
#ifdef G4ANALYSIS_USE
if(ntup[i]) ntup[i]->addRow();
if(fNtup[i]) fNtup[i]->addRow();
#endif
#ifdef G4ANALYSIS_USE_ROOT
float ar[4];
for (G4int j=0; j < Rcol[i]; j++) {
// G4cout << i << " " << Rarray[i][j] << G4endl;
ar[j] = Rarray[i][j];
for (G4int j=0; j < fRcol[i]; j++) {
// G4cout << i << " " << fRarray[i][j] << G4endl;
ar[j] = fRarray[i][j];
}
if(ROOTntup[i]) ROOTntup[i]->Fill(ar);
if(fROOTntup[i]) fROOTntup[i]->Fill(ar);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::setFileName(const G4String& nam)
void exrdmHisto::SetFileName(const G4String& nam)
{
histName = nam;
fHistName = nam;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const G4String& exrdmHisto::getFileName() const
const G4String& exrdmHisto::GetFileName() const
{
return histName;
return fHistName;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void exrdmHisto::setFileType(const G4String& nam)
void exrdmHisto::SetFileType(const G4String& nam)
{
histType = nam;
fHistType = nam;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const G4String& exrdmHisto::FileType() const
{
return histType;
return fHistType;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmHistoMessenger.cc
/// \brief Implementation of the exrdmHistoMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "exrdmHistoMessenger.hh"
@@ -38,47 +41,47 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmHistoMessenger::exrdmHistoMessenger(exrdmHisto* manager)
:histo (manager)
:fHisto (manager)
{
histoDir = new G4UIdirectory("/histo/");
histoDir->SetGuidance("histograms control");
fHistoDir = new G4UIdirectory("/histo/");
fHistoDir->SetGuidance("histograms control");
factoryCmd = new G4UIcmdWithAString("/histo/fileName",this);
factoryCmd->SetGuidance("set name for the histograms file");
factoryCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fActoryCmd = new G4UIcmdWithAString("/histo/fileName",this);
fActoryCmd->SetGuidance("set name for the histograms file");
fActoryCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fileCmd = new G4UIcmdWithAString("/histo/fileType",this);
fileCmd->SetGuidance("set type (aida, hbook or root) for the histograms file");
fileCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fIleCmd = new G4UIcmdWithAString("/histo/fileType",this);
fIleCmd->SetGuidance("set type (aida, hbook or root) for the histograms file");
fIleCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
histoCmd = new G4UIcommand("/histo/setHisto",this);
histoCmd->SetGuidance("Set bining of the histo number ih :");
histoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
histoCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fHistoCmd = new G4UIcommand("/histo/setHisto",this);
fHistoCmd->SetGuidance("Set bining of the fHisto number ih :");
fHistoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
fHistoCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
//
G4UIparameter* ih = new G4UIparameter("ih",'i',false);
ih->SetGuidance("histo number : from 0 to MaxexrdmHisto");
ih->SetGuidance("fHisto number : from 0 to MaxexrdmHisto");
ih->SetParameterRange("ih>=0");
histoCmd->SetParameter(ih);
fHistoCmd->SetParameter(ih);
//
G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
nbBins->SetGuidance("number of bins");
nbBins->SetParameterRange("nbBins>0");
histoCmd->SetParameter(nbBins);
fHistoCmd->SetParameter(nbBins);
//
G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
valMin->SetGuidance("valMin, expressed in unit");
histoCmd->SetParameter(valMin);
fHistoCmd->SetParameter(valMin);
//
G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
valMax->SetGuidance("valMax, expressed in unit");
histoCmd->SetParameter(valMax);
fHistoCmd->SetParameter(valMax);
//
G4UIparameter* unit = new G4UIparameter("unit",'s',true);
unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
unit->SetDefaultValue("none");
histoCmd->SetParameter(unit);
fHistoCmd->SetParameter(unit);
}
@@ -86,23 +89,24 @@ exrdmHistoMessenger::exrdmHistoMessenger(exrdmHisto* manager)
exrdmHistoMessenger::~exrdmHistoMessenger()
{
delete fileCmd;
delete histoCmd;
delete factoryCmd;
delete histoDir;
delete fIleCmd;
delete fHistoCmd;
delete fActoryCmd;
delete fHistoDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmHistoMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
void exrdmHistoMessenger::SetNewValue(G4UIcommand* command,
G4String newValues)
{
if (command == factoryCmd)
histo->setFileName(newValues);
if (command == fActoryCmd)
fHisto->SetFileName(newValues);
if (command == fileCmd)
histo->setFileType(newValues);
if (command == fIleCmd)
fHisto->SetFileType(newValues);
if (command == histoCmd)
if (command == fHistoCmd)
{ G4int ih,nbBins; G4double vmin,vmax; char unts[30];
const char* t = newValues;
std::istringstream is(t);
@@ -110,7 +114,7 @@ void exrdmHistoMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
G4String unit = unts;
G4double vUnit = 1. ;
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
histo->setHisto1D(ih,nbBins,vmin,vmax,vUnit);
fHisto->SetHisto1D(ih,nbBins,vmin,vmax,vUnit);
}
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmMaterial.cc
/// \brief Implementation of the exrdmMaterial class
//
////////////////////////////////////////////////////////////////////////////////
//
#include "exrdmMaterial.hh"
@@ -31,6 +34,8 @@
#include "globals.hh"
#include "G4UnitsTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
#include <vector>
#include <iomanip>
@@ -38,9 +43,9 @@
//
exrdmMaterial::exrdmMaterial ()
{
Material.clear();
Element.clear();
Isotope.clear();
fMaterial.clear();
fElement.clear();
fIsotope.clear();
// some default materials vacuum (0), air (1) and aluminium (2) defined here
// examples of vacuum
//
@@ -70,23 +75,23 @@ exrdmMaterial::exrdmMaterial ()
bmat = true;
}
// create commands for interactive definition of the geometry
materialMessenger = new exrdmMaterialMessenger(this);
fMaterialMessenger = new exrdmMaterialMessenger(this);
}
////////////////////////////////////////////////////////////////////////////////
//
exrdmMaterial::~exrdmMaterial ()
{
delete materialMessenger;
delete fMaterialMessenger;
}
////////////////////////////////////////////////////////////////////////////////
//
void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double density,
G4String state, G4double tem, G4double pres)
void exrdmMaterial::AddMaterial (G4String name, G4String formula,
G4double density, G4String state, G4double tem, G4double pres)
{
G4int isotope, Z;
size_t i;
for (i = 0; i<Material.size(); i++) {
if (Material[i]->GetName() == name) {
for (i = 0; i<fMaterial.size(); i++) {
if (fMaterial[i]->GetName() == name) {
G4cerr <<" AddMaterial : material " <<name
<<" already exists." <<G4endl;
G4cerr <<"--> Command rejected." <<G4endl;
@@ -96,7 +101,7 @@ void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double densi
char *tokenPtr1 = NULL;
char *sname = NULL;
G4String s, s1("0123456789");
G4String s0, s1("0123456789");
G4String element, isotopename;
G4int ncomponents, natoms;
G4double fatoms = 0.;
@@ -114,16 +119,17 @@ void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double densi
delete[] sname;
G4Material* aMaterial = 0;
G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" " <<pres << G4endl;
G4cout << name <<" "<< formula << " " << density/(g/cm3) << " " << tem <<" "
<<pres << G4endl;
if (state == "") {
aMaterial = new G4Material(name, density, ncomponents);
} else if (state == "solid" && tem > 0.) {
aMaterial = new G4Material(name, density, ncomponents,
kStateSolid, tem );
kStateSolid, tem );
} else if (state == "gas" && pres > 0.) {
aMaterial = new G4Material(name, density, ncomponents,
kStateGas, tem, pres );
kStateGas, tem, pres );
}
if (aMaterial == 0) {
G4cerr <<" AddMaterial : Name " <<name <<"." <<G4endl;
@@ -138,25 +144,25 @@ void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double densi
while (tokenPtr1 != NULL) {
isotope = 0;
// G4cout << tokenPtr1 << G4endl;
s = G4String(tokenPtr1);
ls = s.length();
ll = s.find("(");
lr = s.find(")");
s0 = G4String(tokenPtr1);
ls = s0.length();
ll = s0.find("(");
lr = s0.find(")");
if (ll == lr) {
id = s.find_first_of(s1);
element = s.substr(0,id);
id = s0.find_first_of(s1);
element = s0.substr(0,id);
if (element.length() == 1) element.insert(0," ");
for (i = 0; i<110; i++) {
if (element == ELU[i]) break;
if (element == fELU[i]) break;
}
if (i == 110) {
for (i = 0; i<110; i++) {
if (element == ELL[i]) break;
if (element == fELL[i]) break;
}
if (i == 110) {
for (i = 0; i<110; i++) {
if (element == EUU[i]) break;
if (element == fEUU[i]) break;
}
}
}
@@ -166,34 +172,34 @@ void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double densi
<<element <<G4endl;
G4cerr <<"--> Command rejected." <<G4endl;
// delete aMaterial;
// Material[NbMat] = NULL;
// fMaterial[NbMat] = NULL;
return;
}
Z = i+1;
element = ELU[i];
element = fELU[i];
if (id == std::string::npos) {
natoms = 1;
} else {
natoms = atoi((s.substr(id,ls-id)).c_str());
natoms = atoi((s0.substr(id,ls-id)).c_str());
}
if (natoms < 1) fatoms = atof((s.substr(id,ls-id)).c_str());
// G4cout << " Elements = " << element << G4endl;
if (natoms < 1) fatoms = atof((s0.substr(id,ls-id)).c_str());
// G4cout << " Elements = " << element << G4endl;
//G4cout << " Nb of atoms = " << natoms << G4endl;
} else {
element = s.substr(0,ll);
isotope = atoi((s.substr(ll+1,lr-ll)).c_str());
element = s0.substr(0,ll);
isotope = atoi((s0.substr(ll+1,lr-ll)).c_str());
if (element.length() == 1) element.insert(0," ");
for (i = 0; i<110; i++) {
if (element == ELU[i]) break;
if (element == fELU[i]) break;
}
if (i == 110) {
for (i = 0; i<110; i++) {
if (element == ELL[i]) break;
if (element == fELL[i]) break;
}
if (i == 110) {
for (i = 0; i<110; i++) {
if (element == EUU[i]) break;
if (element == fEUU[i]) break;
}
}
}
@@ -202,82 +208,81 @@ void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double densi
<<element <<G4endl;
G4cerr <<"--> Command rejected." <<G4endl;
// delete aMaterial;
// Material[NbMat] = NULL;
// fMaterial[NbMat] = NULL;
return;
}
Z = i+1;
element = ELU[i];
isotopename = element+s.substr(ll+1,lr-ll-1);
element = fELU[i];
isotopename = element+s0.substr(ll+1,lr-ll-1);
if (lr == std::string::npos ) {
natoms = 1;
} else {
natoms = atoi((s.substr(lr+1,ls-lr)).c_str());
natoms = atoi((s0.substr(lr+1,ls-lr)).c_str());
}
if (natoms < 1) fatoms = atof((s.substr(id,ls-id)).c_str());
if (natoms < 1) fatoms = atof((s0.substr(id,ls-id)).c_str());
if (fatoms == 0.) natoms = 1;
//
// G4cout << " Elements = " << element << G4endl;
// G4cout << " Isotope Nb = " << isotope << G4endl;
// G4cout << " Nb of atoms = " << natoms << G4endl;
// G4cout << " Elements = " << element << G4endl;
// G4cout << " fIsotope Nb = " << isotope << G4endl;
// G4cout << " Nb of atoms = " << natoms << G4endl;
}
if (isotope != 0) {
if (G4Isotope::GetIsotope(isotopename) == NULL) {
// G4Isotope* aIsotope = new G4Isotope(isotopename, Z, isotope, A[Z-1]*g/mole);
G4Isotope* aIsotope = new G4Isotope(isotopename, Z, isotope, isotope*g/mole);
G4Element* aElement = new G4Element(isotopename, element, 1);
aElement->AddIsotope(aIsotope, 100.*perCent);
Isotope.push_back(aIsotope);
fIsotope.push_back(aIsotope);
if (natoms>0) {
aMaterial->AddElement(aElement, natoms);
} else {
aMaterial->AddElement(aElement, fatoms);
}
Element.push_back(aElement);
aMaterial->AddElement(aElement, natoms);
} else {
aMaterial->AddElement(aElement, fatoms);
}
fElement.push_back(aElement);
} else {
if (natoms>0) {
aMaterial->AddElement( G4Element::GetElement(isotopename,false) , natoms);
} else {
aMaterial->AddElement( G4Element::GetElement(isotopename,false) , fatoms);
}
aMaterial->AddElement( G4Element::GetElement(isotopename,false) , natoms);
} else {
aMaterial->AddElement( G4Element::GetElement(isotopename,false) , fatoms);
}
}
} else {
if ( G4Element::GetElement(element,false) == NULL) {
G4Element* aElement = new G4Element(element, element, Z, A[Z-1]*g/mole);
if (natoms>0) {
aMaterial->AddElement(aElement, natoms);
} else {
aMaterial->AddElement(aElement, fatoms);
}
Element.push_back(aElement);
G4Element* aElement = new G4Element(element, element, Z, fA[Z-1]*g/mole);
if (natoms>0) {
aMaterial->AddElement(aElement, natoms);
} else {
aMaterial->AddElement(aElement, fatoms);
}
fElement.push_back(aElement);
} else {
if (natoms>0) {
aMaterial->AddElement( G4Element::GetElement(element,false) , natoms);
} else {
aMaterial->AddElement( G4Element::GetElement(element,false) , fatoms);
}
if (natoms>0) {
aMaterial->AddElement( G4Element::GetElement(element,false) , natoms);
} else {
aMaterial->AddElement( G4Element::GetElement(element,false) , fatoms);
}
}
}
tokenPtr1 = strtok( NULL, "-");
// s.empty();
// s0.empty();
//element.erase();
//
}
delete[] sname;
Material.push_back(aMaterial);
G4cout <<" Material:" <<name <<" with formula: " <<formula <<" added! "
fMaterial.push_back(aMaterial);
G4cout <<" fMaterial:" <<name <<" with formula: " <<formula <<" added! "
<<G4endl;
G4cout <<" Nb of Material = " <<Material.size() <<G4endl;
G4cout <<" Nb of Isotope = " <<Isotope.size() <<G4endl;
G4cout <<" Nb of Element = " <<Element.size() <<G4endl;
G4cout <<" Nb of fMaterial = " <<fMaterial.size() <<G4endl;
G4cout <<" Nb of fIsotope = " <<fIsotope.size() <<G4endl;
G4cout <<" Nb of fElement = " <<fElement.size() <<G4endl;
}
////////////////////////////////////////////////////////////////////////////////
//
void exrdmMaterial::DeleteMaterial (G4int j)
{
size_t i(j-1);
if (i > Material.size()) {
if (i > fMaterial.size()) {
G4cerr <<"DeleteMaterial : Invalid material index " <<j <<"." <<G4endl;
G4cerr <<"--> Command rejected." <<G4endl;
} else {
@@ -299,24 +304,24 @@ void exrdmMaterial::DeleteMaterial (G4String )
G4int exrdmMaterial::GetMaterialIndex (G4String name)
{
size_t i ;
for (i = 0; i < Material.size(); i++) {
if (Material[i]->GetName() == name) break;
for (i = 0; i < fMaterial.size(); i++) {
if (fMaterial[i]->GetName() == name) break;
}
G4int k = G4int(i);
if (i == Material.size()) k = -1;
if (i == fMaterial.size()) k = -1;
return k;
}
////////////////////////////////////////////////////////////////////////////////
//
void exrdmMaterial::ListMaterial ()
{
G4cout <<" There are" <<std::setw(3) <<Material.size()
G4cout <<" There are" <<std::setw(3) <<fMaterial.size()
<<" materials defined." <<G4endl;
for (size_t i = 0; i< Material.size(); i++)
G4cout <<" Material Index " <<std::setw(3) <<i+1 <<" "
<<std::setw(14) <<Material[i]->GetName()
for (size_t i = 0; i< fMaterial.size(); i++)
G4cout <<" fMaterial Index " <<std::setw(3) <<i+1 <<" "
<<std::setw(14) <<fMaterial[i]->GetName()
<<" density: " <<std::setw(6) <<std::setprecision(3)
<<G4BestUnit(Material[i]->GetDensity(),"Volumic Mass") <<G4endl;
<<G4BestUnit(fMaterial[i]->GetDensity(),"Volumic Mass") <<G4endl;
G4cout <<G4endl;
}
@@ -23,95 +23,101 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmMaterialMessenger.cc
/// \brief Implementation of the exrdmMaterialMessenger class
//
////////////////////////////////////////////////////////////////////////////////
//
#include "exrdmMaterialMessenger.hh"
#include "exrdmMaterial.hh"
#include "G4SystemOfUnits.hh"
#include <sstream>
#include "exrdmMaterial.hh"
////////////////////////////////////////////////////////////////////////////////
//
exrdmMaterialMessenger::exrdmMaterialMessenger (exrdmMaterial * exrdmMat)
:materialsManager(exrdmMat)
:fMaterialsManager(exrdmMat)
{
MaterialDir = new G4UIdirectory("/geometry/material/");
MaterialDir->SetGuidance(" Controls for defining geometry materials" );
fMaterialDir = new G4UIdirectory("/geometry/material/");
fMaterialDir->SetGuidance(" Controls for defining geometry materials" );
AddCmd = new G4UIcommand("/geometry/material/add",this);
AddCmd->SetGuidance(
fAddCmd = new G4UIcommand("/geometry/material/add",this);
fAddCmd->SetGuidance(
" add a mateial by name, composition formula and density");
AddCmd->SetGuidance(" name: e.g. water ");
AddCmd->SetGuidance(" formula (e.g. H2-O for water");
AddCmd->SetGuidance(" density (in units of g/cm3) : den>0.");
fAddCmd->SetGuidance(" name: e.g. water ");
fAddCmd->SetGuidance(" formula (e.g. H2-O for water");
fAddCmd->SetGuidance(" density (in units of g/cm3) : den>0.");
G4UIparameter* MatName = new G4UIparameter("material",'s',false);
MatName->SetGuidance("material name");
AddCmd->SetParameter(MatName);
fAddCmd->SetParameter(MatName);
//
G4UIparameter* MatForm = new G4UIparameter("formula",'s',false);
MatForm->SetGuidance("material formula");
AddCmd->SetParameter(MatForm);
fAddCmd->SetParameter(MatForm);
//
G4UIparameter* DenPrm = new G4UIparameter("density",'d',false);
DenPrm->SetGuidance("density of the material");
DenPrm->SetParameterRange("density >0.");
AddCmd->SetParameter(DenPrm);
AddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAddCmd->SetParameter(DenPrm);
fAddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
G4UIparameter* StatePrm = new G4UIparameter("state",'s',true);
StatePrm->SetGuidance("state of the material (optional): gas | solid");
AddCmd->SetParameter(StatePrm);
AddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAddCmd->SetParameter(StatePrm);
fAddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
G4UIparameter* TempPrm = new G4UIparameter("temp",'d',true);
TempPrm->SetGuidance("temperature of the material in Kelvin (optional)");
AddCmd->SetParameter(TempPrm);
AddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAddCmd->SetParameter(TempPrm);
fAddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
G4UIparameter* PresPrm = new G4UIparameter("pres",'d',true);
PresPrm->SetGuidance("pressure of the gas material in Pascal (optional)");
AddCmd->SetParameter(PresPrm);
AddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAddCmd->SetParameter(PresPrm);
fAddCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
//
DeleteIntCmd = new G4UIcmdWithAnInteger("/geometry/material/delete",this);
DeleteIntCmd->SetGuidance("Delete material by its index");
DeleteIntCmd->SetParameterName("matIdx",false);
DeleteIntCmd->SetRange("matIdx>=0 && matIdx<100");
DeleteIntCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fDeleteIntCmd = new G4UIcmdWithAnInteger("/geometry/material/delete",this);
fDeleteIntCmd->SetGuidance("Delete material by its index");
fDeleteIntCmd->SetParameterName("matIdx",false);
fDeleteIntCmd->SetRange("matIdx>=0 && matIdx<100");
fDeleteIntCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
DeleteNameCmd = new G4UIcmdWithAString("/geometry/material/deleteName",this);
DeleteNameCmd->SetGuidance("Delete material by its name.");
DeleteNameCmd->SetParameterName("DeleteName",false);
DeleteNameCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fDeleteNameCmd = new G4UIcmdWithAString("/geometry/material/deleteName",this);
fDeleteNameCmd->SetGuidance("Delete material by its name.");
fDeleteNameCmd->SetParameterName("DeleteName",false);
fDeleteNameCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
ListCmd = new G4UIcmdWithoutParameter("/geometry/material/list",this);
ListCmd->SetGuidance("List the materials defined");
ListCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fListCmd = new G4UIcmdWithoutParameter("/geometry/material/list",this);
fListCmd->SetGuidance("List the materials defined");
fListCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
////////////////////////////////////////////////////////////////////////////////
//
exrdmMaterialMessenger::~exrdmMaterialMessenger ()
{
delete MaterialDir;
delete AddCmd;
delete DeleteIntCmd;
delete DeleteNameCmd;
delete ListCmd;
delete fMaterialDir;
delete fAddCmd;
delete fDeleteIntCmd;
delete fDeleteNameCmd;
delete fListCmd;
}
////////////////////////////////////////////////////////////////////////////////
//
void exrdmMaterialMessenger::SetNewValue (G4UIcommand* command,G4String newValue)
void exrdmMaterialMessenger::SetNewValue (G4UIcommand* command,
G4String newValue)
{
if (command == DeleteIntCmd) {
materialsManager->DeleteMaterial(DeleteIntCmd->GetNewIntValue(newValue));
if (command == fDeleteIntCmd) {
fMaterialsManager->DeleteMaterial(fDeleteIntCmd->GetNewIntValue(newValue));
} else if (command == DeleteNameCmd) {
materialsManager->DeleteMaterial(newValue);
} else if (command == fDeleteNameCmd) {
fMaterialsManager->DeleteMaterial(newValue);
} else if (command == ListCmd) {
materialsManager->ListMaterial();
} else if (command == fListCmd) {
fMaterialsManager->ListMaterial();
} else if (command == AddCmd) {
} else if (command == fAddCmd) {
G4double den, tem, pres ;
G4String state;
char mat[80], form[80], stat[10];
@@ -129,7 +135,7 @@ void exrdmMaterialMessenger::SetNewValue (G4UIcommand* command,G4String newValue
}
// G4cout<< "stat = " <<state<< "tem = " << tem<< " pre = " << pres << G4endl;
// tick *= G4UIcommand::ValueOf(unt);
materialsManager->AddMaterial(material,formula,den*g/cm3,state,tem,pres);
fMaterialsManager->AddMaterial(material,formula,den*g/cm3,state,tem,pres);
}
}
////////////////////////////////////////////////////////////////////////////////
@@ -23,9 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPhysListEmLowEnergy.cc
/// \brief Implementation of the exrdmPhysListEmLowEnergy class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "exrdmPhysListEmLowEnergy.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
@@ -83,6 +87,9 @@
#include "G4GoudsmitSaundersonMscModel.hh"
#include "G4CoulombScattering.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmPhysListEmLowEnergy::exrdmPhysListEmLowEnergy(const G4String& name)
@@ -112,21 +119,21 @@ void exrdmPhysListEmLowEnergy::ConstructProcess()
G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
G4LivermorePhotoElectricModel* theLivermorePhotoElectricModel =
new G4LivermorePhotoElectricModel();
new G4LivermorePhotoElectricModel();
theLivermorePhotoElectricModel->SetHighEnergyLimit(LivermoreHighEnergyLimit);
thePhotoElectricEffect->AddEmModel(0, theLivermorePhotoElectricModel);
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
G4ComptonScattering* theComptonScattering = new G4ComptonScattering();
G4LivermoreComptonModel* theLivermoreComptonModel =
new G4LivermoreComptonModel();
new G4LivermoreComptonModel();
theLivermoreComptonModel->SetHighEnergyLimit(LivermoreHighEnergyLimit);
theComptonScattering->AddEmModel(0, theLivermoreComptonModel);
pmanager->AddDiscreteProcess(theComptonScattering);
G4GammaConversion* theGammaConversion = new G4GammaConversion();
G4LivermoreGammaConversionModel* theLivermoreGammaConversionModel =
new G4LivermoreGammaConversionModel();
new G4LivermoreGammaConversionModel();
theLivermoreGammaConversionModel->SetHighEnergyLimit(LivermoreHighEnergyLimit);
theGammaConversion->AddEmModel(0, theLivermoreGammaConversionModel);
pmanager->AddDiscreteProcess(theGammaConversion);
@@ -161,7 +168,7 @@ void exrdmPhysListEmLowEnergy::ConstructProcess()
theBremLivermore->SetHighEnergyLimit(LivermoreHighEnergyLimit);
eBrem->AddEmModel(0, theBremLivermore);
pmanager->AddProcess(eBrem, -1,-3, 3);
} else if (particleName == "e+") {
// Identical to G4EmStandardPhysics_option3
@@ -221,7 +228,7 @@ void exrdmPhysListEmLowEnergy::ConstructProcess()
} else if (particleName == "pi+" ||
particleName == "pi-" ||
particleName == "kaon+" ||
particleName == "kaon+" ||
particleName == "kaon-" ||
particleName == "proton" ) {
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPhysListHadron.cc
/// \brief Implementation of the exrdmPhysListHadron class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "exrdmPhysListHadron.hh"
@@ -69,8 +72,15 @@
#include "G4RadioactiveDecay.hh"
#include "G4GenericIon.hh"
#include "G4SystemOfUnits.hh"
exrdmPhysListHadron::exrdmPhysListHadron(const G4String& name)
: G4VPhysicsConstructor(name)
: G4VPhysicsConstructor(name),
fTheNeutronElasticProcess(0), fTheFissionProcess(0),
fTheCaptureProcess(0),fTheDeuteronInelasticProcess(0),
fTheTritonInelasticProcess(0), fTheAlphaInelasticProcess(0),
fTheIonInelasticProcess(0)
{}
exrdmPhysListHadron::~exrdmPhysListHadron()
@@ -101,9 +111,10 @@ void exrdmPhysListHadron::ConstructProcess()
// a no-cascade generator-precompound interaface
G4GeneratorPrecompoundInterface * theCascade = new G4GeneratorPrecompoundInterface;
theCascade->SetDeExcitation(thePreEquilib);
// here come the high energy parts
// the string model; still not quite according to design - Explicite use of the forseen interfaces
// the string model; still not quite according to design
// - Explicite use of the forseen interfaces
G4VPartonStringModel * theStringModel;
theStringModel = new G4QGSModel<G4QGSParticipants>;
theTheoModel->SetTransport(theCascade);
@@ -117,7 +128,7 @@ void exrdmPhysListHadron::ConstructProcess()
// Elastic Process
theElasticProcess.RegisterMe(new G4LElastic());
fTheElasticProcess.RegisterMe(new G4LElastic());
// ---------------------------------------------------------------------------
// Hadron elastic process
@@ -128,14 +139,14 @@ void exrdmPhysListHadron::ConstructProcess()
G4ParticleDefinition* particle = theParticleIterator->value();
G4String particleName = particle->GetParticleName();
if (particleName != "neutron") {
G4ProcessManager* pManager = particle->GetProcessManager();
if (particle->GetPDGMass() > 110.*MeV && theElasticProcess.IsApplicable(*particle)
&& !particle->IsShortLived()) {
pManager->AddDiscreteProcess(&theElasticProcess);
//
// G4cout << "### Elastic model are registered for "
// << particle->GetParticleName()
// << G4endl;
pManager = particle->GetProcessManager();
if (particle->GetPDGMass() > 110.*MeV && fTheElasticProcess.IsApplicable(*particle)
&& !particle->IsShortLived()) {
pManager->AddDiscreteProcess(&fTheElasticProcess);
//
// G4cout << "### Elastic model are registered for "
// << particle->GetParticleName()
// << G4endl;
}
}
}
@@ -145,66 +156,66 @@ void exrdmPhysListHadron::ConstructProcess()
// Binary Cascade
G4BinaryCascade * theBC = new G4BinaryCascade;
theBC->SetMaxEnergy(10.5*GeV);
theProtonInelastic.RegisterMe(theBC);
fTheProtonInelastic.RegisterMe(theBC);
// Higher energy
theProtonInelastic.RegisterMe(theTheoModel);
fTheProtonInelastic.RegisterMe(theTheoModel);
// now the cross-sections.
G4ProtonInelasticCrossSection * theProtonData = new G4ProtonInelasticCrossSection;
theProtonInelastic.AddDataSet(theProtonData);
pManager->AddDiscreteProcess(&theProtonInelastic);
fTheProtonInelastic.AddDataSet(theProtonData);
pManager->AddDiscreteProcess(&fTheProtonInelastic);
//
//
// Neutron
pManager = G4Neutron::Neutron()->GetProcessManager();
// add process
// elastic scattering
theNeutronElasticProcess =
fTheNeutronElasticProcess =
new G4HadronElasticProcess();
G4LElastic* theElasticModel1 = new G4LElastic;
G4NeutronHPElastic * theElasticNeutron = new G4NeutronHPElastic;
theNeutronElasticProcess->RegisterMe(theElasticModel1);
fTheNeutronElasticProcess->RegisterMe(theElasticModel1);
theElasticModel1->SetMinEnergy(19.*MeV);
theNeutronElasticProcess->RegisterMe(theElasticNeutron);
fTheNeutronElasticProcess->RegisterMe(theElasticNeutron);
theElasticNeutron->SetMaxEnergy(20.*MeV);
G4NeutronHPElasticData * theNeutronData = new G4NeutronHPElasticData;
theNeutronElasticProcess->AddDataSet(theNeutronData);
pManager->AddDiscreteProcess(theNeutronElasticProcess);
fTheNeutronElasticProcess->AddDataSet(theNeutronData);
pManager->AddDiscreteProcess(fTheNeutronElasticProcess);
// inelastic
G4NeutronHPInelastic * theHPNeutronInelasticModel =
new G4NeutronHPInelastic;
theHPNeutronInelasticModel->SetMaxEnergy(20.*MeV);
theNeutronInelastic.RegisterMe(theHPNeutronInelasticModel);
fTheNeutronInelastic.RegisterMe(theHPNeutronInelasticModel);
G4NeutronHPInelasticData * theNeutronData1 = new G4NeutronHPInelasticData;
theNeutronInelastic.AddDataSet(theNeutronData1);
fTheNeutronInelastic.AddDataSet(theNeutronData1);
// binary
G4BinaryCascade * neutronBC = new G4BinaryCascade;
neutronBC->SetMinEnergy(19.*MeV);
neutronBC->SetMaxEnergy(10.5*GeV);
theNeutronInelastic.RegisterMe(neutronBC);
fTheNeutronInelastic.RegisterMe(neutronBC);
// higher energy
theNeutronInelastic.RegisterMe(theTheoModel);
fTheNeutronInelastic.RegisterMe(theTheoModel);
// now the cross-sections.
G4NeutronInelasticCrossSection * theNeutronData2 = new G4NeutronInelasticCrossSection;
theNeutronInelastic.AddDataSet(theNeutronData2);
pManager->AddDiscreteProcess(&theNeutronInelastic);
fTheNeutronInelastic.AddDataSet(theNeutronData2);
pManager->AddDiscreteProcess(&fTheNeutronInelastic);
// fission
theFissionProcess =
fTheFissionProcess =
new G4HadronFissionProcess;
G4LFission* theFissionModel = new G4LFission;
theFissionProcess->RegisterMe(theFissionModel);
pManager->AddDiscreteProcess(theFissionProcess);
fTheFissionProcess->RegisterMe(theFissionModel);
pManager->AddDiscreteProcess(fTheFissionProcess);
//capture
theCaptureProcess =
fTheCaptureProcess =
new G4HadronCaptureProcess;
G4LCapture* theCaptureModel = new G4LCapture;
theCaptureProcess->RegisterMe(theCaptureModel);
fTheCaptureProcess->RegisterMe(theCaptureModel);
theCaptureModel->SetMinEnergy(19.*MeV);
G4NeutronHPCapture * theHPNeutronCaptureModel = new G4NeutronHPCapture;
theCaptureProcess->RegisterMe(theHPNeutronCaptureModel);
fTheCaptureProcess->RegisterMe(theHPNeutronCaptureModel);
G4NeutronHPCaptureData * theNeutronData3 = new G4NeutronHPCaptureData;
theCaptureProcess->AddDataSet(theNeutronData3);
pManager->AddDiscreteProcess(theCaptureProcess);
fTheCaptureProcess->AddDataSet(theNeutronData3);
pManager->AddDiscreteProcess(fTheCaptureProcess);
// now light ions
// light Ion BC
@@ -216,56 +227,56 @@ void exrdmPhysListHadron::ConstructProcess()
// deuteron
pManager = G4Deuteron::Deuteron()->GetProcessManager();
theDeuteronInelasticProcess =
fTheDeuteronInelasticProcess =
new G4DeuteronInelasticProcess("inelastic");
// G4LEDeuteronInelastic* theDeuteronInelasticModel =
// new G4LEDeuteronInelastic;
// theDeuteronInelasticModel->SetMaxEnergy(100*MeV);
theDeuteronInelasticProcess->AddDataSet(TripathiCrossSection);
theDeuteronInelasticProcess->AddDataSet(aShen);
// theDeuteronInelasticProcess->RegisterMe(theDeuteronInelasticModel);
theDeuteronInelasticProcess->RegisterMe(theIonBC);
theDeuteronInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(theDeuteronInelasticProcess);
fTheDeuteronInelasticProcess->AddDataSet(TripathiCrossSection);
fTheDeuteronInelasticProcess->AddDataSet(aShen);
// fTheDeuteronInelasticProcess->RegisterMe(theDeuteronInelasticModel);
fTheDeuteronInelasticProcess->RegisterMe(theIonBC);
fTheDeuteronInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(fTheDeuteronInelasticProcess);
// triton
pManager = G4Triton::Triton()->GetProcessManager();
theTritonInelasticProcess =
fTheTritonInelasticProcess =
new G4TritonInelasticProcess("inelastic");
// G4LETritonInelastic* theTritonInelasticModel =
// new G4LETritonInelastic;
//theTritonInelasticModel->SetMaxEnergy(100*MeV);
theTritonInelasticProcess->AddDataSet(TripathiCrossSection);
theTritonInelasticProcess->AddDataSet(aShen);
// theTritonInelasticProcess->RegisterMe(theTritonInelasticModel);
theTritonInelasticProcess->RegisterMe(theIonBC);
theTritonInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(theTritonInelasticProcess);
fTheTritonInelasticProcess->AddDataSet(TripathiCrossSection);
fTheTritonInelasticProcess->AddDataSet(aShen);
// fTheTritonInelasticProcess->RegisterMe(theTritonInelasticModel);
fTheTritonInelasticProcess->RegisterMe(theIonBC);
fTheTritonInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(fTheTritonInelasticProcess);
// alpha
pManager = G4Alpha::Alpha()->GetProcessManager();
theAlphaInelasticProcess =
fTheAlphaInelasticProcess =
new G4AlphaInelasticProcess("inelastic");
// G4LEAlphaInelastic* theAlphaInelasticModel =
// new G4LEAlphaInelastic;
//theAlphaInelasticModel->SetMaxEnergy(100*MeV);
theAlphaInelasticProcess->AddDataSet(TripathiCrossSection);
theAlphaInelasticProcess->AddDataSet(aShen);
// theAlphaInelasticProcess->RegisterMe(theAlphaInelasticModel);
theAlphaInelasticProcess->RegisterMe(theIonBC);
theAlphaInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(theAlphaInelasticProcess);
fTheAlphaInelasticProcess->AddDataSet(TripathiCrossSection);
fTheAlphaInelasticProcess->AddDataSet(aShen);
// fTheAlphaInelasticProcess->RegisterMe(theAlphaInelasticModel);
fTheAlphaInelasticProcess->RegisterMe(theIonBC);
fTheAlphaInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(fTheAlphaInelasticProcess);
// GenericIon
pManager = G4GenericIon::GenericIon()->GetProcessManager();
// need to add the elastic explicitly
pManager->AddDiscreteProcess(&theElasticProcess);
theIonInelasticProcess =
pManager->AddDiscreteProcess(&fTheElasticProcess);
fTheIonInelasticProcess =
new G4IonInelasticProcess();
theIonInelasticProcess->AddDataSet(TripathiCrossSection);
theIonInelasticProcess->AddDataSet(aShen);
fTheIonInelasticProcess->AddDataSet(TripathiCrossSection);
fTheIonInelasticProcess->AddDataSet(aShen);
// G4BinaryLightIonReaction * theGenIonBC= new G4BinaryLightIonReaction;
// theGenIonBC->SetMinEnergy(0*MeV);
//theGenIonBC->SetMaxEnergy(20*GeV);
theIonInelasticProcess->RegisterMe(theIonBC);
theIonInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(theIonInelasticProcess);
fTheIonInelasticProcess->RegisterMe(theIonBC);
fTheIonInelasticProcess->RegisterMe(theTheoModel);
pManager->AddDiscreteProcess(fTheIonInelasticProcess);
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPhysListParticles.cc
/// \brief Implementation of the exrdmPhysListParticles class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPhysicsList.cc
/// \brief Implementation of the exrdmPhysicsList class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "exrdmPhysicsList.hh"
@@ -53,41 +56,39 @@
#include "G4EmExtraPhysics.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4QStoppingPhysics.hh"
#include "G4StoppingPhysics.hh"
#include "G4IonBinaryCascadePhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4NeutronTrackingCut.hh"
#include "G4DecayPhysics.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmPhysicsList::exrdmPhysicsList() : G4VModularPhysicsList()
exrdmPhysicsList::exrdmPhysicsList() :
G4VModularPhysicsList(),
fCutForGamma(1.*mm), fCutForElectron(1.*mm),
fCutForPositron(1.*mm), fHadPhysicsList(0),
fNhadcomp(0),fDetectorCuts(0), fTargetCuts(0)
{
G4LossTableManager::Instance();
defaultCutValue = 1.*mm;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForPositron = defaultCutValue;
defaultCutValue =1.*mm;
DetectorCuts = 0;
TargetCuts = 0;
pMessenger = new exrdmPhysicsListMessenger(this);
fPMessenger = new exrdmPhysicsListMessenger(this);
SetVerboseLevel(1);
//default physics
particleList = new G4DecayPhysics();
fParticleList = new G4DecayPhysics();
//default physics
raddecayList = new G4RadioactiveDecayPhysics();
fRaddecayList = new G4RadioactiveDecayPhysics();
// EM physics
emPhysicsList = new G4EmStandardPhysics();
fEmPhysicsList = new G4EmStandardPhysics();
// Had physics
hadPhysicsList = 0;
nhadcomp = 0;
}
@@ -95,13 +96,13 @@ exrdmPhysicsList::exrdmPhysicsList() : G4VModularPhysicsList()
exrdmPhysicsList::~exrdmPhysicsList()
{
delete pMessenger;
delete raddecayList;
delete emPhysicsList;
if (hadPhysicsList) delete hadPhysicsList;
if (nhadcomp > 0) {
for(G4int i=0; i<nhadcomp; i++) {
delete hadronPhys[i];
delete fPMessenger;
delete fRaddecayList;
delete fEmPhysicsList;
if (fHadPhysicsList) delete fHadPhysicsList;
if (fNhadcomp > 0) {
for(G4int i=0; i<fNhadcomp; i++) {
delete fHadronPhys[i];
}
}
}
@@ -110,7 +111,7 @@ exrdmPhysicsList::~exrdmPhysicsList()
void exrdmPhysicsList::ConstructParticle()
{
particleList->ConstructParticle();
fParticleList->ConstructParticle();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -119,17 +120,17 @@ void exrdmPhysicsList::ConstructProcess()
{
AddTransportation();
// em
emPhysicsList->ConstructProcess();
fEmPhysicsList->ConstructProcess();
// decays
particleList->ConstructProcess();
raddecayList->ConstructProcess();
fParticleList->ConstructProcess();
fRaddecayList->ConstructProcess();
// had
if (nhadcomp > 0) {
for(G4int i=0; i<nhadcomp; i++) {
(hadronPhys[i])->ConstructProcess();
if (fNhadcomp > 0) {
for(G4int i=0; i<fNhadcomp; i++) {
(fHadronPhys[i])->ConstructProcess();
}
}
if (hadPhysicsList) hadPhysicsList->ConstructProcess();
if (fHadPhysicsList) fHadPhysicsList->ConstructProcess();
G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl;
}
@@ -142,29 +143,29 @@ void exrdmPhysicsList::SelectPhysicsList(const G4String& name)
G4cout << "exrdmPhysicsList::SelectPhysicsList: <" << name << ">" << G4endl;
}
// default Had physics
if (name == "Hadron" && !hadPhysicsList) {
hadPhysicsList = new exrdmPhysListHadron("hadron");
if (name == "Hadron" && !fHadPhysicsList) {
fHadPhysicsList = new exrdmPhysListHadron("hadron");
} else if (name == "QGSP_BERT") {
AddExtraBuilders(false);
hadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron");
} else if (name == "QGSP_BIC" && !hadPhysicsList) {
fHadPhysicsList = new HadronPhysicsQGSP_BERT("std-hadron");
} else if (name == "QGSP_BIC" && !fHadPhysicsList) {
AddExtraBuilders(false);
hadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron");
} else if (name == "QGSP_BERT_HP" && !hadPhysicsList) {
fHadPhysicsList = new HadronPhysicsQGSP_BIC("std-hadron");
} else if (name == "QGSP_BERT_HP" && !fHadPhysicsList) {
AddExtraBuilders(true);
hadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron");
} else if (name == "QGSP_BIC_HP" && !hadPhysicsList) {
fHadPhysicsList = new HadronPhysicsQGSP_BERT_HP("std-hadron");
} else if (name == "QGSP_BIC_HP" && !fHadPhysicsList) {
AddExtraBuilders(true);
hadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron");
fHadPhysicsList = new HadronPhysicsQGSP_BIC_HP("std-hadron");
} else if (name == "LowEnergy_EM") {
delete emPhysicsList;
emPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em");
delete fEmPhysicsList;
fEmPhysicsList = new exrdmPhysListEmLowEnergy("lowe-em");
} else if (name == "Standard_EM") {
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics();
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics();
} else {
G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <"
<< name << "> Physics " << G4endl;
<< name << "> Physics " << G4endl;
}
}
@@ -172,32 +173,32 @@ void exrdmPhysicsList::SelectPhysicsList(const G4String& name)
void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP)
{
nhadcomp = 5;
hadronPhys.push_back( new G4EmExtraPhysics("extra EM"));
hadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel,
flagHP));
hadronPhys.push_back( new G4QStoppingPhysics("stopping",verboseLevel));
hadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
hadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
fNhadcomp = 5;
fHadronPhys.push_back( new G4EmExtraPhysics("extra EM"));
fHadronPhys.push_back( new G4HadronElasticPhysics("elastic",verboseLevel,
flagHP));
fHadronPhys.push_back( new G4StoppingPhysics("stopping",verboseLevel));
fHadronPhys.push_back( new G4IonBinaryCascadePhysics("ionBIC"));
fHadronPhys.push_back( new G4NeutronTrackingCut("Neutron tracking cut"));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmPhysicsList::SetCuts()
{
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForPositron, "e+");
SetCutValue(fCutForGamma, "gamma");
SetCutValue(fCutForElectron, "e-");
SetCutValue(fCutForPositron, "e+");
G4cout << "world cuts are set" << G4endl;
if( !TargetCuts ) SetTargetCut(cutForElectron);
if( !fTargetCuts ) SetTargetCut(fCutForElectron);
G4Region* region = (G4RegionStore::GetInstance())->GetRegion("Target");
region->SetProductionCuts(TargetCuts);
region->SetProductionCuts(fTargetCuts);
G4cout << "Target cuts are set" << G4endl;
if( !DetectorCuts ) SetDetectorCut(cutForElectron);
if( !fDetectorCuts ) SetDetectorCut(fCutForElectron);
region = (G4RegionStore::GetInstance())->GetRegion("Detector");
region->SetProductionCuts(DetectorCuts);
region->SetProductionCuts(fDetectorCuts);
G4cout << "Detector cuts are set" << G4endl;
if (verboseLevel>0) DumpCutValuesTable();
@@ -207,35 +208,35 @@ void exrdmPhysicsList::SetCuts()
void exrdmPhysicsList::SetCutForGamma(G4double cut)
{
cutForGamma = cut;
SetParticleCuts(cutForGamma, G4Gamma::Gamma());
fCutForGamma = cut;
SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmPhysicsList::SetCutForElectron(G4double cut)
{
cutForElectron = cut;
SetParticleCuts(cutForElectron, G4Electron::Electron());
fCutForElectron = cut;
SetParticleCuts(fCutForElectron, G4Electron::Electron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmPhysicsList::SetCutForPositron(G4double cut)
{
cutForPositron = cut;
SetParticleCuts(cutForPositron, G4Positron::Positron());
fCutForPositron = cut;
SetParticleCuts(fCutForPositron, G4Positron::Positron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void exrdmPhysicsList::SetTargetCut(G4double cut)
{
if( !TargetCuts ) TargetCuts = new G4ProductionCuts();
if( !fTargetCuts ) fTargetCuts = new G4ProductionCuts();
TargetCuts->SetProductionCut(cut, idxG4GammaCut);
TargetCuts->SetProductionCut(cut, idxG4ElectronCut);
TargetCuts->SetProductionCut(cut, idxG4PositronCut);
fTargetCuts->SetProductionCut(cut, idxG4GammaCut);
fTargetCuts->SetProductionCut(cut, idxG4ElectronCut);
fTargetCuts->SetProductionCut(cut, idxG4PositronCut);
}
@@ -243,11 +244,11 @@ void exrdmPhysicsList::SetTargetCut(G4double cut)
void exrdmPhysicsList::SetDetectorCut(G4double cut)
{
if( !DetectorCuts ) DetectorCuts = new G4ProductionCuts();
if( !fDetectorCuts ) fDetectorCuts = new G4ProductionCuts();
DetectorCuts->SetProductionCut(cut, idxG4GammaCut);
DetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
DetectorCuts->SetProductionCut(cut, idxG4PositronCut);
fDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
fDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
fDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPhysicsListMessenger.cc
/// \brief Implementation of the exrdmPhysicsListMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -36,71 +39,71 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmPhysicsListMessenger::exrdmPhysicsListMessenger(exrdmPhysicsList* pPhys)
:pPhysicsList(pPhys)
:fPPhysicsList(pPhys)
{
physDir = new G4UIdirectory("/exrdm/phys/");
physDir->SetGuidance("physics control.");
fPhysDir = new G4UIdirectory("/exrdm/phys/");
fPhysDir->SetGuidance("physics control.");
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setGCut",this);
gammaCutCmd->SetGuidance("Set gamma cut.");
gammaCutCmd->SetParameterName("Gcut",false);
gammaCutCmd->SetUnitCategory("Length");
gammaCutCmd->SetRange("Gcut>0.0");
gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setGCut",this);
fGammaCutCmd->SetGuidance("Set gamma cut.");
fGammaCutCmd->SetParameterName("Gcut",false);
fGammaCutCmd->SetUnitCategory("Length");
fGammaCutCmd->SetRange("Gcut>0.0");
fGammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
electCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setECut",this);
electCutCmd->SetGuidance("Set electron cut.");
electCutCmd->SetParameterName("Ecut",false);
electCutCmd->SetUnitCategory("Length");
electCutCmd->SetRange("Ecut>0.0");
electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setECut",this);
fElectCutCmd->SetGuidance("Set electron cut.");
fElectCutCmd->SetParameterName("Ecut",false);
fElectCutCmd->SetUnitCategory("Length");
fElectCutCmd->SetRange("Ecut>0.0");
fElectCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setPCut",this);
protoCutCmd->SetGuidance("Set positron cut.");
protoCutCmd->SetParameterName("Pcut",false);
protoCutCmd->SetUnitCategory("Length");
protoCutCmd->SetRange("Pcut>0.0");
protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setPCut",this);
fProtoCutCmd->SetGuidance("Set positron cut.");
fProtoCutCmd->SetParameterName("Pcut",false);
fProtoCutCmd->SetUnitCategory("Length");
fProtoCutCmd->SetRange("Pcut>0.0");
fProtoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
allCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setCuts",this);
allCutCmd->SetGuidance("Set cut for all.");
allCutCmd->SetParameterName("cut",false);
allCutCmd->SetUnitCategory("Length");
allCutCmd->SetRange("cut>0.0");
allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/setCuts",this);
fAllCutCmd->SetGuidance("Set cut for all.");
fAllCutCmd->SetParameterName("cut",false);
fAllCutCmd->SetUnitCategory("Length");
fAllCutCmd->SetRange("cut>0.0");
fAllCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
eCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/TargetCuts",this);
eCutCmd->SetGuidance("Set cuts for the target");
eCutCmd->SetParameterName("Ecut",false);
eCutCmd->SetUnitCategory("Length");
eCutCmd->SetRange("Ecut>0.0");
eCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fECutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/TargetCuts",this);
fECutCmd->SetGuidance("Set cuts for the target");
fECutCmd->SetParameterName("Ecut",false);
fECutCmd->SetUnitCategory("Length");
fECutCmd->SetRange("Ecut>0.0");
fECutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
mCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/DetectorCuts",this);
mCutCmd->SetGuidance("Set cuts for the Detector");
mCutCmd->SetParameterName("Ecut",false);
mCutCmd->SetUnitCategory("Length");
mCutCmd->SetRange("Ecut>0.0");
mCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fMCutCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/phys/DetectorCuts",this);
fMCutCmd->SetGuidance("Set cuts for the Detector");
fMCutCmd->SetParameterName("Ecut",false);
fMCutCmd->SetUnitCategory("Length");
fMCutCmd->SetRange("Ecut>0.0");
fMCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
pListCmd = new G4UIcmdWithAString("/exrdm/phys/SelectPhysics",this);
pListCmd->SetGuidance("Select modula physics list.");
pListCmd->SetParameterName("PList",false);
pListCmd->AvailableForStates(G4State_PreInit);
fPListCmd = new G4UIcmdWithAString("/exrdm/phys/SelectPhysics",this);
fPListCmd->SetGuidance("Select modula physics list.");
fPListCmd->SetParameterName("PList",false);
fPListCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
exrdmPhysicsListMessenger::~exrdmPhysicsListMessenger()
{
delete physDir;
delete gammaCutCmd;
delete electCutCmd;
delete protoCutCmd;
delete allCutCmd;
delete pListCmd;
delete eCutCmd;
delete mCutCmd;
delete fPhysDir;
delete fGammaCutCmd;
delete fElectCutCmd;
delete fProtoCutCmd;
delete fAllCutCmd;
delete fPListCmd;
delete fECutCmd;
delete fMCutCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -108,31 +111,31 @@ exrdmPhysicsListMessenger::~exrdmPhysicsListMessenger()
void exrdmPhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == gammaCutCmd )
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
if( command == fGammaCutCmd )
{ fPPhysicsList->SetCutForGamma(fGammaCutCmd->GetNewDoubleValue(newValue));}
if( command == electCutCmd )
{ pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
if( command == fElectCutCmd )
{ fPPhysicsList->SetCutForElectron(fElectCutCmd->GetNewDoubleValue(newValue));}
if( command == protoCutCmd )
{ pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
if( command == fProtoCutCmd )
{ fPPhysicsList->SetCutForPositron(fProtoCutCmd->GetNewDoubleValue(newValue));}
if( command == allCutCmd )
if( command == fAllCutCmd )
{
G4double cut = allCutCmd->GetNewDoubleValue(newValue);
pPhysicsList->SetCutForGamma(cut);
pPhysicsList->SetCutForElectron(cut);
pPhysicsList->SetCutForPositron(cut);
G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
fPPhysicsList->SetCutForGamma(cut);
fPPhysicsList->SetCutForElectron(cut);
fPPhysicsList->SetCutForPositron(cut);
}
if( command == eCutCmd )
{ pPhysicsList->SetTargetCut(eCutCmd->GetNewDoubleValue(newValue));}
if( command == fECutCmd )
{ fPPhysicsList->SetTargetCut(fECutCmd->GetNewDoubleValue(newValue));}
if( command == mCutCmd )
{ pPhysicsList->SetDetectorCut(mCutCmd->GetNewDoubleValue(newValue));}
if( command == fMCutCmd )
{ fPPhysicsList->SetDetectorCut(fMCutCmd->GetNewDoubleValue(newValue));}
if( command == pListCmd )
{ pPhysicsList->SelectPhysicsList(newValue);}
if( command == fPListCmd )
{ fPPhysicsList->SelectPhysicsList(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmPrimaryGeneratorAction.cc
/// \brief Implementation of the exrdmPrimaryGeneratorAction class
//
// **********************************************************************
@@ -35,17 +38,17 @@
exrdmPrimaryGeneratorAction::exrdmPrimaryGeneratorAction()
{
particleGun = new G4GeneralParticleSource ();
fParticleGun = new G4GeneralParticleSource ();
}
exrdmPrimaryGeneratorAction::~exrdmPrimaryGeneratorAction()
{
delete particleGun;
delete fParticleGun;
}
void exrdmPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
particleGun->GeneratePrimaryVertex(anEvent);
fParticleGun->GeneratePrimaryVertex(anEvent);
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmRunAction.cc
/// \brief Implementation of the exrdmRunAction class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "exrdmRunAction.hh"
@@ -50,7 +53,7 @@ exrdmRunAction::~exrdmRunAction()
void exrdmRunAction::BeginOfRunAction(const G4Run* aRun)
{
// Creation of the analysis manager
exrdmAnalysisManager* analysis = exrdmAnalysisManager::getInstance();
exrdmAnalysisManager* analysis = exrdmAnalysisManager::GetInstance();
analysis->BeginOfRun();
G4int RunN = aRun->GetRunID();
@@ -72,7 +75,7 @@ void exrdmRunAction::BeginOfRunAction(const G4Run* aRun)
void exrdmRunAction::EndOfRunAction(const G4Run* aRun)
{
// Get the analysis manager
exrdmAnalysisManager* analysis = exrdmAnalysisManager::getInstance();
exrdmAnalysisManager* analysis = exrdmAnalysisManager::GetInstance();
analysis->EndOfRun(aRun->GetNumberOfEvent());
#ifdef G4VIS_USE
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file radioactivedecay/rdecay02/src/exrdmSteppingAction.cc
/// \brief Implementation of the exrdmSteppingAction class
//
#include "G4ios.hh"
#include "exrdmSteppingAction.hh"
@@ -30,6 +33,7 @@
#include "G4Track.hh"
#include "globals.hh"
#include "G4SteppingManager.hh"
#include "G4ParticleDefinition.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -59,49 +63,38 @@ void exrdmSteppingAction::UserSteppingAction(const G4Step* fStep)
#endif
#ifdef COLLECT
if (StepNo == 1) {
if ( (fTrack->GetDefinition()->GetParticleType() == "nucleus") &&
!( fTrack->GetDefinition()->GetPDGStable()) &&
fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "Target" ) {
// G4String particleName = fTrack->GetDefinition()->GetParticleName();
G4double particleName = G4double(fTrack->GetDefinition()->GetPDGEncoding());
G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ;
// - fStep->GetPreStepPoint()->GetLocalTime(); // do we have to take out the local time?
G4double weight = fStep->GetPreStepPoint()->GetWeight() ;
// get the analysis manager
exrdmAnalysisManager* analysis = exrdmAnalysisManager::getInstance();
// G4cout << particleName << " " << weight << " " << time/s << G4endl;
analysis->AddIsotope(particleName, weight, time);
G4double time = fStep->GetPreStepPoint()->GetGlobalTime();
G4double weight = fStep->GetPreStepPoint()->GetWeight();
G4double edep = fStep->GetTotalEnergyDeposit();
exrdmAnalysisManager* analysis = exrdmAnalysisManager::GetInstance();
if (StepNo == 1) { //beginning of step
G4double pid=G4double(fTrack->GetDefinition()->GetPDGEncoding());
G4double energy = fStep->GetPreStepPoint()->GetKineticEnergy();
G4ParticleDefinition* thePartDef = fTrack->GetDefinition();
G4String partType= fTrack->GetDefinition()->GetParticleType();
if (( partType == "nucleus") && !(thePartDef->GetPDGStable()) &&
fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "Target" ) {
analysis->AddIsotope(pid, weight, time);
}
if (fTrack->GetTrackID() != 1 ){
//Radioactive decay products
if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {
// emitted particles
if (fTrack->GetDefinition()->GetParticleType() != "nucleus") {
// G4String particleName = fTrack->GetDefinition()->GetParticleName();
G4double particleName = G4double (fTrack->GetDefinition()->GetPDGEncoding());
G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ;
//- fStep->GetPreStepPoint()->GetLocalTime();
G4double weight = fStep->GetPreStepPoint()->GetWeight() ;
G4double energy = fStep->GetPreStepPoint()->GetKineticEnergy();
//
exrdmAnalysisManager::getInstance()->AddParticle(particleName, energy, weight, time);
}
//all products
G4int Z=thePartDef->GetAtomicNumber();
G4int A=thePartDef->GetAtomicMass();
analysis->AddDecayProduct(pid, Z, A, energy, time, weight);
// emitted particles except nuclei
if ( partType!= "nucleus") {
analysis->AddParticle(pid, energy, weight, time);
}
}
}
}
// energy deposition
if (fTrack->GetTrackID() != 1 ) {
// if (fTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {
if (fStep->GetTotalEnergyDeposit() ) {
G4double time = fStep->GetPreStepPoint()->GetGlobalTime() ;
// - fStep->GetPreStepPoint()->GetLocalTime();
// G4double time = fStep->GetPreStepPoint()->GetLocalTime(); // time since the track was created
G4double edep = fStep->GetTotalEnergyDeposit();
G4double weight = fStep->GetPreStepPoint()->GetWeight() ;
if (fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "Detector") edep = -edep;
exrdmAnalysisManager::getInstance()->AddEnergy(edep,weight,time);
}
// }
if (fTrack->GetTrackID() != 1 && edep) {
if (fStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "Detector")
edep = -edep;
analysis->AddEnergy(edep,weight,time);
}
#endif
}