Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
+8 -2
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.22 2004/02/09 22:21:58 asaim Exp $
$Id: History,v 1.24 2004/05/27 17:44:45 duns Exp $
-------------------------------------------------------------------
=========================================================
@@ -11,9 +11,15 @@ $Id: History,v 1.22 2004/02/09 22:21:58 asaim Exp $
---------------------------------------------------------------------------
27th May 2004 Mark Donszelmann (exampleA01-V06-01-01)
- Updated Mac file to write separate geometry.
26th May 2004 Mark Donszelmann (exampleA01-V06-01-00)
- Updated mac files for HepRep2 driver to set zoom factor and coordinate system.
9th February 2004 Makoto Asai (exampleA01-V06-00-00)
- Fix EM part of the physics list to use the new
processes introduced at 6.0.
processes introduced at 6.0.
- Reference output is updated accordingly.
1st December 2003 Joseph Perl
@@ -17,7 +17,9 @@
# Edit the next line(s) to choose another graphic system
#
/vis/open HepRepXML
/vis/heprep/setCoordinateSystem zxy
/vis/viewer/set/culling global false
/vis/viewer/zoom 0.0001
#/vis/scene/endOfEventAction accumulate
#
# Add volume to scene
@@ -17,7 +17,9 @@
# Edit the next line(s) to choose another graphic system
#
/vis/open HepRepXML
/vis/heprep/setCoordinateSystem zxy
/vis/viewer/set/culling global false
/vis/viewer/zoom 0.0001
#/vis/scene/endOfEventAction accumulate
#
# Add volume to scene
@@ -12,7 +12,10 @@
# Edit the next line(s) to choose another graphic system
#
/vis/open HepRepXML
/vis/heprep/setCoordinateSystem zxy
/vis/viewer/set/culling global false
/vis/viewer/zoom 0.0001
#/vis/viewer/set/viewpointThetaPhi 20 40 deg
#/vis/scene/endOfEventAction accumulate
#
# Add volume to scene
@@ -15,7 +15,9 @@
# Edit the next line(s) to choose another graphic system
#
/vis/open HepRepXML
/vis/heprep/setCoordinateSystem zxy
/vis/viewer/set/culling global false
/vis/viewer/zoom 0.0001
#
# Add volume to scene
#
@@ -15,7 +15,10 @@
# Edit the next line(s) to choose another graphic system
#
/vis/open HepRepXML
/vis/heprep/appendGeometry false
/vis/heprep/setCoordinateSystem zxy
/vis/viewer/set/culling global false
/vis/viewer/zoom 0.0001
#
# Add volume to scene
#
+26 -26
View File
@@ -1,8 +1,8 @@
*************************************************************
Geant4 version $Name: geant4-06-01 $ (25-March-2004)
Geant4 version $Name: geant4-06-02 $ (25-June-2004)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303.
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
@@ -149,8 +149,8 @@ msc: Model variant of multiple scattering for proton
hIoni: tables are built for proton
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Bether-Bloch model for Escaled > 2 MeV, parametrisation of Bragg peak below, Integral mode 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for Escaled > 2 MeV, parametrisation of Bragg peak below, Integral mode 1
msc: Model variant of multiple scattering for mu+
Lambda tables from 100 eV to 100 TeV in 120 bins.
@@ -159,7 +159,7 @@ msc: Model variant of multiple scattering for mu+
MuIoni: tables are built for mu+
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
radiative corrections for E > 1 GeV
@@ -177,7 +177,7 @@ MuPairProd: tables are built for mu+
MuIoni: tables are built for mu-
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
Lambda tables from threshold to 100 TeV in 120 bins.
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 0
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
radiative corrections for E > 1 GeV
@@ -185,26 +185,26 @@ msc: Model variant of multiple scattering for pi-
Lambda tables from 100 eV to 100 TeV in 120 bins.
Boundary algorithm is active with facrange= 0.199
Volume name | Importance| Tr.Entering| Population| Collisions| Coll*WGT| NumWGTedE| FluxWGTedE| Av.Tr.WGT|
cell_01_rep:0............ | 1 | 106 | 131 | 120 | 120 | 0.032472038 | 9.2527983 | 1 |
cell_02_rep:0............ | 2 | 72 | 157 | 148 | 74 | 8.9205605 | 9.2174133 | 1 |
cell_03_rep:0............ | 4 | 93 | 212 | 211 | 52.75 | 7.4823819 | 8.5261163 | 1 |
cell_04_rep:0............ | 8 | 112 | 219 | 254 | 31.75 | 3.5008375 | 7.7749792 | 1 |
cell_05_rep:0............ | 16 | 128 | 262 | 321 | 20.0625 | 4.1377944 | 7.7074206 | 1 |
cell_06_rep:0............ | 32 | 134 | 297 | 329 | 10.28125 | 6.6014772 | 7.7333631 | 1 |
cell_07_rep:0............ | 64 | 156 | 316 | 391 | 6.109375 | 0.18088036 | 7.4546045 | 1 |
cell_08_rep:0............ | 128 | 184 | 376 | 497 | 3.8828125 | 5.134922 | 6.7888989 | 1 |
cell_09_rep:0............ | 256 | 211 | 445 | 591 | 2.3085938 | 0.061641191 | 6.5983902 | 1 |
cell_10_rep:0............ | 512 | 239 | 494 | 707 | 1.3808594 | 5.1539762 | 6.6420088 | 1 |
cell_11_rep:0............ | 1024 | 260 | 530 | 781 | 0.76269531 | 0.17684092 | 6.5343371 | 1 |
cell_12_rep:0............ | 2048 | 289 | 596 | 928 | 0.453125 | 2.0888873 | 6.0537706 | 1 |
cell_13_rep:0............ | 4096 | 301 | 643 | 1004 | 0.24511719 | 3.6000169 | 5.9038428 | 1 |
cell_14_rep:0............ | 8192 | 327 | 682 | 1112 | 0.13574219 | 3.6317715 | 5.5996676 | 1 |
cell_15_rep:0............ | 16384 | 332 | 673 | 974 | 0.059448242 | 3.4512276 | 5.5878681 | 1 |
cell_16_rep:0............ | 32768 | 360 | 743 | 1194 | 0.036437988 | 3.1622704 | 5.4812661 | 1 |
cell_17_rep:0............ | 65536 | 394 | 812 | 1230 | 0.018768311 | 3.5856689 | 5.5173971 | 1 |
cell_18_rep:0............ | 131072 | 355 | 828 | 1436 | 0.010955811 | 0.23625257 | 5.1653559 | 1 |
rest_rep:0............... | 131072 | 385 | 385 | 0 | 0 | 0 | 0 | 0 |
shieldWorld_rep:0........ | 1 | 10 | 110 | 0 | 0 | 10 | 10 | 1 |
cell_01_rep:0............ | 1 | 110 | 131 | 118 | 118 | 8.5562926 | 9.237997 | 1 |
cell_02_rep:0............ | 2 | 73 | 167 | 174 | 87 | 7.1601913 | 8.7864585 | 1 |
cell_03_rep:0............ | 4 | 88 | 191 | 196 | 49 | 7.5359216 | 8.6869605 | 1 |
cell_04_rep:0............ | 8 | 104 | 214 | 305 | 38.125 | 3.1115996 | 7.4269722 | 1 |
cell_05_rep:0............ | 16 | 105 | 228 | 302 | 18.875 | 3.5556678 | 7.357289 | 1 |
cell_06_rep:0............ | 32 | 110 | 230 | 286 | 8.9375 | 6.3052811 | 7.3525379 | 1 |
cell_07_rep:0............ | 64 | 119 | 256 | 350 | 5.46875 | 5.6560453 | 6.8402582 | 1 |
cell_08_rep:0............ | 128 | 137 | 281 | 407 | 3.1796875 | 4.9128142 | 6.36468 | 1 |
cell_09_rep:0............ | 256 | 158 | 320 | 491 | 1.9179688 | 4.5960987 | 6.3811044 | 1 |
cell_10_rep:0............ | 512 | 183 | 386 | 561 | 1.0957031 | 4.6296183 | 6.3449131 | 1 |
cell_11_rep:0............ | 1024 | 190 | 403 | 606 | 0.59179688 | 4.3429934 | 6.1812327 | 1 |
cell_12_rep:0............ | 2048 | 188 | 381 | 698 | 0.34082031 | 0.036896157 | 5.4227668 | 1 |
cell_13_rep:0............ | 4096 | 211 | 440 | 822 | 0.20068359 | 3.0971965 | 4.9838145 | 1 |
cell_14_rep:0............ | 8192 | 216 | 452 | 781 | 0.095336914 | 3.0991602 | 4.9325683 | 1 |
cell_15_rep:0............ | 16384 | 251 | 510 | 901 | 0.054992676 | 1.9544162 | 4.851316 | 1 |
cell_16_rep:0............ | 32768 | 256 | 516 | 958 | 0.02923584 | 2.5277374 | 4.4940816 | 1 |
cell_17_rep:0............ | 65536 | 290 | 564 | 1105 | 0.016860962 | 2.5106552 | 4.1521405 | 1 |
cell_18_rep:0............ | 131072 | 265 | 624 | 1379 | 0.010520935 | 0.22549469 | 4.019048 | 1 |
rest_rep:0............... | 131072 | 267 | 267 | 0 | 0 | 0 | 0 | 0 |
shieldWorld_rep:0........ | 1 | 10 | 109 | 0 | 0 | 10 | 10 | 1 |
=== G4ProcessPlacer::RemoveProcess: for: neutron
ProcessName: MassImportanceProcess, will be removed!
The initial Vectors:
-7
View File
@@ -1,7 +0,0 @@
# This script may be executed from a lizard session to display
# the histogram in b02.hbook. To create the histogram and the file
# b02.hbook run exampleB02 first.
tree = tf.create ("b02.hbook", "hbook",1,0)
h = tree.findH1D("10")
hplot(h)
+5 -8
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.8 2003/06/20 15:32:09 dressel Exp $
# $Id: GNUmakefile,v 1.9 2004/06/18 15:59:39 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -21,12 +21,9 @@ endif
.PHONY: all
all: lib bin
CPPFLAGS +=
#LDFLAGS += -L/usr/local/lib
include $(G4INSTALL)/config/binmake.gmk
CPPFLAGS += `aida-config -i`
LDFLAGS += `aida-config -l`
ifdef G4ANALYSIS_USE
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
endif
+25
View File
@@ -0,0 +1,25 @@
$Id: History,v 1.1 2004/06/18 16:05:17 daquinog Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun 18th, 2004 G.Daquino - B02-V06-01-00
- porting B02 from Anaphe (Lizard) to PI. Actually, PI 1.2.1 still DOES NOT
allow the plotting in the same way, previously set in Anaphe. Therefore the
HBOOk file produced at the end of the example still needs other packages to
be displayed. However, future PI releases could contain python modules with
this property.
@@ -1,148 +0,0 @@
#!/bin/tcsh -x
#set verbose = 0
set release = "5.0.1"
set redHat72 = "redhat72"
set redHat61 = "redhat61"
set redhat73 = "redhat73"
set gcc295 = "gcc-2.95.2"
set gcc296 = "gcc-2.96"
set gcc32 = "gcc-3.2"
set platform = "$redHat72/$gcc295" # default
set COMP = `g++ --version | tail -1`
set os = `uname`
set osVersion = `uname -r`
set unavailable = "Sorry, Anaphe $release is not available for $os, compiler $COMP"
# deal with non-Linux (= Solaris CC 5.3) first
if ($os != "Linux" && ) then
if ($os == "SunOS" && $osVersion == "5.8") then
set platform = "sun4x_58/CC-5.3"
else
echo $unavailable
exit
endif
endif
# Linux next. Find Redhat/SuSE flavours
set is61 = "no"
if { grep "6.1" /etc/issue > /dev/null } then
set is61 = "yes"
endif
set is72 = "no"
if { grep "7.2" /etc/issue > /dev/null } then
set is72 = "yes"
endif
set is73 = "no"
if { grep "7.3" /etc/issue > /dev/null } then
set is73 = "yes"
endif
set isSuSE = "no"
if { grep "SuSE" /etc/issue > /dev/null } then
set isSuSE = "yes"
endif
# Constraint: all these vars are now "yes" or "no"
# deal with SuSE
if ($isSuSE == "yes") then
echo "Found SuSE distribution"
if ($is72 == "yes") then # SuSE 7.2 is compatible with RH61
# use Red Hat 6.1 / gcc-2.95.2 for SuSE 7.2 (gcc-2.95.3)
set platform = "$redHat61/$gcc295"
else
echo "Unknown version of SuSE - please report to HepLib.Support@cern.ch"
echo "/etc/issue contains:"
cat /etc/issue
exit
endif
endif
# deal with non-SuSE - assumed to be Red Hat (but might be wrong..!)
if ($isSuSE == "no") then
# first deal with Red Hat 6.1
if ($is61 == "yes") then
if ($COMP == "gcc-2.96") then
echo $unavailable
exit
else if ($COMP == "2.95.2") then
set platform = "redhat61/gcc-2.95.2"
else
set platform = "redhat61/egcs_1.1.2" # assumption!
endif
endif
# now deal with Red Hat 7.2
if ($is72 == "yes") then
if ($COMP == "gcc-2.96") then
echo $unavailable
exit
else if ($COMP == "2.95.2") then
set platform = "redhat72/gcc-2.95.2"
else
set platform = "redhat72/gcc-3.2" # assumption!
endif
endif
# finally deal with Red Hat 7.3
else if ($is73 == "yes") then
if ( $COMP == "gcc-2.96" ) then
echo $unavailable
exit
else if ( $COMP == "gcc-2.95.2" ) then
set platform = "redhat73/gcc-2.95.2"
else
set platform = "redhat73/gcc-3.2" # assumption!
endif
endif
else
echo $unavailable
endif
setenv PLATF $platform
if ($?AIDA_DIR == 0) then
setenv AIDA_DIR /afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp
endif
if ($?ANAPHETOP == 0) then
setenv ANAPHETOP /afs/cern.ch/sw/lhcxx
endif
# add to PATH and LD_LIBRARY_PATH, but only if not already present ...
set pubDom = "${ANAPHETOP}/specific/${PLATF}/PublicDomainPackages/2.0.0"
if ( { echo $PATH | grep $pubDom } == 0 ) then
setenv PATH "${pubDom}/bin:${PATH}"
endif
if ( $?LD_LIBRARY_PATH == 0 ) then
setenv LD_LIBRARY_PATH "${pubDom}/lib"
else if ( { echo $LD_LIBRARY_PATH | grep $pubDom } == 0 ) then
setenv LD_LIBRARY_PATH "${pubDom}/lib:${LD_LIBRARY_PATH}"
endif
set releaseDirectory = "${ANAPHETOP}/specific/${PLATF}/${release}"
if ( { echo $PATH | grep $releaseDirectory } == 0 ) then
setenv PATH "${releaseDirectory}/bin:${PATH}"
endif
if ( { echo $LD_LIBRARY_PATH | grep $releaseDirectory } == 0 ) then
setenv LD_LIBRARY_PATH "${releaseDirectory}/lib:${LD_LIBRARY_PATH}"
endif
if ( $?GRACE_HOME == 0 ) then
setenv GRACE_HOME "${pubDom}/grace"
endif
if ( { echo $PATH | grep $GRACE_HOME } == 0 ) then
setenv PATH "${GRACE_HOME}/bin:${PATH}"
endif
+63
View File
@@ -0,0 +1,63 @@
#!/bin/tcsh -x
#set verbose = 0
if (${?PI_BASE_DIR} == 1) then
setenv PI_VERSION 1_2_1
setenv PI_VER 1.2.1
setenv PLATF rh73_gcc32
setenv PATH ${PATH}:${PI_BASE_DIR}/${PI_VER}/app/releases/PI/PI_${PI_VER}/${PLATF}/bin
setenv PATH ${PI_BASE_DIR}/Linux-g++/bin:$PATH
eval `aida-config -r csh`
#
# python from PI
#
setenv PYTHONVERSION 2.2
setenv PYTHON_INCLUDE_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/include/python${PYTHONVERSION}
setenv PYTHON_LIB_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/lib/python${PYTHONVERSION}/config
#
# python for PI
if (${?PYTHONPATH} == 0) then
setenv PYTHONPATH
endif
setenv PYTHONPATH ${PI_BASE_DIR}/Linux-g++/python:$PYTHONPATH
setenv PYTHONPATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/${PLATF}/lib:$PYTHONPATH
#
#
else # not using PI
echo "-- WARNING: histograms are not activated !"
echo " Either PI_BASE_DIR are not set."
#
if ( ${?PYTHONVERSION} == 1 && \
${?PYTHON_BASE_DIR} == 1 && \
${?CLHEP_BASE_DIR} == 1) then # settings without PI
setenv PYTHON_LIB_DIR ${PYTHON_BASE_DIR}/lib/python${PYTHONVERSION}/config
setenv PYTHON_INCLUDE_DIR ${PYTHON_BASE_DIR}/include/python${PYTHONVERSION}
#
if ( ! -d $PYTHON_LIB_DIR ) then
echo -- ERROR: no pyhton lib/config directory: $PYTHON_LIB_DIR
endif
if ( ! -d $PYTHON_INCLUDE_DIR ) then
echo -- ERROR: no pyhton include directory: $PYTHON_INCLUDE_DIR
endif
else # environment not completed in case no PI is used
echo "-- ERROR: PYTHONVERSION or PYTHON_BASE_DIR or CLHEP_BASE_DIR not set!" exit
endif
endif # end settings for not using PI
if ( ${?LD_LIBRARY_PATH} == 0 ) then
setenv LD_LIBRARY_PATH
endif
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${PYTHON_LIB_DIR}
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH /afs/cern.ch/sw/lcg/external/Python/2.2.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/external/Boost/1.30.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
if (${?PYTHONPATH} == 0) then
setenv PYTHONPATH
endif
setenv PYTHONPATH ${PYTHONPATH}:${LD_LIBRARY_PATH}
@@ -8,13 +8,13 @@
# This example needs python2.2 http://www.python.org or later.
#
# This script may be used without or with ANAPHE e.g. lizard.
# Without lizard: just execute this file.
# With lizard: start lizard and than do
# This script may be used without or with PI.
# Without python: just execute this file.
# With python: start python2.2 and then do
# execfile("B03RunApplication.py")
import string
from PyAida import *
execfile("B03Application.py")
#executing the application could be done "by hand"
@@ -27,19 +27,17 @@ Bapp.setupSampler()
Bapp.run(30)
# using lizard and ANAPHE to create a histogram
# check if lizrd is loaded by looking for the af instance of the AnalysisFactory
if 'af' in dir():
tr = tf.create()
hf = af.createHistogramFactory(tr)
n = Bapp.nevents
minm = int(min(Bapp.messurements))-0.5
maxm = int(max(Bapp.messurements)+1)+0.5
h = hf.createHistogram1D ("10","Tracks entering in " +
'%(n)d' % vars() +
" events",30, minm, maxm)
for v in Bapp.messurements:
h.fill(v)
hplot(h)
# using PI to create a histogram
if 'af' in dir():
tr = tf.create("TracksEntering.hbook","hbook")
hf = af.createHistogramFactory(tr)
n = Bapp.nevents
minm = int(min(Bapp.messurements))-0.5
maxm = int(max(Bapp.messurements)+1)+0.5
h = hf.createHistogram1D ("10","Tracks entering in " + '%(n)d' % vars() + " events",30, minm, maxm)
for v in Bapp.messurements:
h.fill(v)
# hplot(h)
tr.commit()
tr.close()
+18 -12
View File
@@ -1,23 +1,21 @@
# $Id: GNUmakefile,v 1.11 2003/06/30 16:40:27 dressel Exp $
# $Id: GNUmakefile,v 1.12 2004/06/20 17:26:13 daquinog Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
#
# The variable PYTHON_DIR has to be setup. See ../README.
# The variable PI_BASE_DIR has to be setup. See ../README.
#
name := exampleB03
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
include $(G4INSTALL)/config/architecture.gmk
SWIGINC = include/B03App.i
SWIGCC = src/B03App_wrap.cc
SWIGD = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/B03App_wrap.d
@@ -26,27 +24,29 @@ SWIGSO = $(G4WORKDIR)/tmp/$(G4SYSTEM)/exampleB03/_B03App.so
moduleName = B03App
MYLIBS = $(subst -l$(name),,$(LDLIBS))
SWIG = $(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/bin/swig-1.3.15
SWIG = ${SWIG_BASE_DIR}/bin/swig-${SWIGVERSION}
.PHONY: all
.PHONY: clean_all all
all: $(SWIGD) $(SWIGCC) lib $(SWIGSO) bin
CPPFLAGS += -I$(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/include/python$(PYTHON_VERSION)
CPPFLAGS += -I${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/include/python${PYTHONVERSION}
CXXFLAGS += -w
LDFLAGS += \
-L$(ANAPHETOP)/specific/$(PLATF)/PublicDomainPackages/2.0.0/lib/python$(PYTHON_VERSION)/config \
-L${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/lib/python${PYTHONVERSION}/config \
-L/lib \
-lnsl -ldl -lreadline /lib/libtermcap.so.2 -lieee -lpthread -lutil -lexampleB03 -lpython$(PYTHON_VERSION)
-lnsl -ldl -lreadline /lib/libtermcap.so.2 -lieee -lpthread -lutil -lexampleB03 -lpython$(PYTHONVERSION)
include $(G4INSTALL)/config/binmake.gmk
ifdef G4ANALYSIS_USE
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
endif
$(SWIGSO): $(objectfilesWrapper)
@echo Creating shared library: $@
$(CXX) -Wl,-soname,$(@F) -shared $(LDFLAGS) $(objectfilesWrapper) $(MYLIBS) -lc -o $(SWIGSO)
@@ -60,6 +60,12 @@ ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name):
@mkdir ${G4WORKDIR}/tmp/${G4SYSTEM}/$(name)
clean_all: clean
@rm -f B03App.pyc
@rm B03App.py
@rm src/B03App_wrap.cc
#libdir = $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)
#objectfiles = $(shell /bin/ls $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/*.o)
#_B03App.so:
+26
View File
@@ -0,0 +1,26 @@
$Id: History,v 1.1 2004/06/20 17:26:14 daquinog Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun 20th, 2004 G.Daquino - B03-V06-01-00
- porting B03 from Anaphe (Lizard) to PI. Actually, PI 1.2.1 still DOES NOT
allow the plotting in the same way, previously set in Anaphe. Therefore the
HBOOk file produced at the end of the example still needs other packages to
be displayed. However, future PI releases could contain python modules with
this property.
README file has been updated accordingly.
+73
View File
@@ -0,0 +1,73 @@
# #Id: setupPI.csh,v 1.6 2004/06/19 17:22:46 daquinog Exp $
# -------------------------------------------------------------------
# GEANT4 tag $Name: geant4-06-02 $
# -------------------------------------------------------------------
# before sourcing this script make sure you have set the
# environment variables according to the description in README
# setting in case PI and analysis is used
if (${?PI_BASE_DIR} == 1) then
setenv PI_VERSION 1_2_1
setenv PI_VER 1.2.1
setenv PLATF rh73_gcc32
setenv PATH ${PATH}:${PI_BASE_DIR}/${PI_VER}/app/releases/PI/PI_${PI_VER}/${PLATF}/bin
setenv PATH ${PI_BASE_DIR}/Linux-g++/bin:$PATH
eval `aida-config -r csh`
#
# python from PI
#
setenv PYTHONVERSION 2.2
setenv PYTHON_INCLUDE_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/include/python${PYTHONVERSION}
setenv PYTHON_LIB_DIR ${PI_BASE_DIR}/${PI_VER}/external/Python/2.2.2/${PLATF}/lib/python${PYTHONVERSION}/config
#
# python for PI
if (${?PYTHONPATH} == 0) then
setenv PYTHONPATH
endif
setenv PYTHONPATH ${PI_BASE_DIR}/Linux-g++/python:$PYTHONPATH
setenv PYTHONPATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/${PLATF}/lib:$PYTHONPATH
#
# SWIG settings
setenv SWIGVERSION 1.3.15
#
else # not using PI
echo "-- WARNING: histograms are not activated !"
echo " Either PI_BASE_DIR are not set."
#
if ( ${?PYTHONVERSION} == 1 && \
${?PYTHON_BASE_DIR} == 1 && \
${?SWIG_BASE_DIR} == 1 && \
${?SWIG_VERSION} == 1 && \
${?CLHEP_BASE_DIR} == 1) then # settings without PI
setenv PYTHON_LIB_DIR ${PYTHON_BASE_DIR}/lib/python${PYTHONVERSION}/config
setenv PYTHON_INCLUDE_DIR ${PYTHON_BASE_DIR}/include/python${PYTHONVERSION}
#
if ( ! -d $PYTHON_LIB_DIR ) then
echo -- ERROR: no pyhton lib/config directory: $PYTHON_LIB_DIR
endif
if ( ! -d $PYTHON_INCLUDE_DIR ) then
echo -- ERROR: no pyhton include directory: $PYTHON_INCLUDE_DIR
endif
else # environment not completed in case no PI is used
echo "-- ERROR: PYTHONVERSION or PYTHON_BASE_DIR or CLHEP_BASE_DIR or SWIG_VERSION or SWIG_BASE_DIR not set!"
exit
endif
endif # end settings for not using PI
#
if ( ${?LD_LIBRARY_PATH} == 0 ) then
setenv LD_LIBRARY_PATH
endif
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB03
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${PYTHON_LIB_DIR}
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/app/releases/SEAL/SEAL_1_3_4/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH /afs/cern.ch/sw/lcg/external/Python/2.2.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH ${PI_BASE_DIR}/${PI_VER}/external/Boost/1.30.2/rh73_gcc32/lib:$LD_LIBRARY_PATH
setenv B03_BASE `pwd`
if (${?PYTHONPATH} == 0) then
setenv PYTHONPATH
endif
setenv PYTHONPATH ${PYTHONPATH}:${LD_LIBRARY_PATH}
setenv PYTHONPATH ${PYTHONPATH}:${B03_BASE}
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.27 2003/08/25 12:33:52 dressel Exp $
$Id: History,v 1.28 2004/06/21 09:28:04 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun 21st, 2004 G. Daquino - exbiasing-V06-01-00
- Ported B02 and B03 to AIDA 3.2.1 and PI 1.2.1.
Jul 31th, 2003 M. Dressel - exbiasing-V05-02-02
- added weight window example to B01
+31 -59
View File
@@ -58,7 +58,7 @@ importance of the current volumes.
Further information:
--------------------
Short description of importance sampling and scoring:
http://dressel.home.cern.ch/dressel/biasscore/Sampling.html
http://cern.ch/geant4/working_groups/geometry/biasing/Sampling.html
Example B01
===========
@@ -89,90 +89,62 @@ the scoring. In this example one scorer creates a histogram.
Compiling and running
---------------------
To compile this example you need AIDA 3.0 installed. To link
Can be compiled and executed on a RedHat-7.3 system with gcc-3.2.3
compiler and the tcsh shell.
To compile this example you need AIDA 3.2.1 installed. To link
and run it you need a AIDA compliant analysis package. The
GNUmakefile of this example shows how to use Anaphe as analysis
package.
The following list shows what to do if you are at CERN using rehat73
and gcc-3.2 and the tcsh:
1) set the following variables (for example):
setenv ANAPHETOP /afs/cern.ch/sw/lhcxx
(or if installed in opt: /opt/Anaphe/5.0.5)
setenv AIDA_DIR /afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp
(or if installed in opt: /opt/AIDA/3.0.0/3.0.0/AIDA/3.0/src/cpp)
2) Source the script:
source $ANAPHETOP/share/LHCXX/5.0.5/scripts/setupAnaphe.csh
This should set the LD_LIBRARY_PATH and the PATH environment to find the
lizrd executable and Anaphe libraries and header files.
It also sets the environment variable PLATF.
3) and add to lirary path the following directories:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB02
GNUmakefile of this example shows how to use AIDA through PI as
analysis interface.
Histograms are saved in HBOOK format. It can be displayed with PAW or
compatible packages.
You need to set the following variables in your environment:
"G4ANALYSIS_USE"
"PI_BASE_DIR" (where PI has been installed)
Finally, source the script setupPI.csh.
Now you should be able to run gmake and to run exampleB02.
The example stores the plot in the file b02.hbook.
To look at the histogram using lizard you also may use Anaphe 5.0.5
http://anaphe.web.cern.ch/anaphe/index2.html.
Files in B02:
B02plot.py: a simple script that may be executed from a lizzard session
to show the plot created by running the exampleB02.
To look at the histogram using lizard you also may use PI 1.2.1
http://cern.ch/PI.
Example B03
===========
This example uses Geant4 and in particular importance sampling and
scoring through python. It creates a simple histogram. It's ment
scoring through python. It creates a simple histogram. It's meant
to demonstrate how to use a customized scorer and importance sampling
in combination with a scripting language, python.
Geant4 code is executed from a python session. Therefore, swig is used
to create python shadow classes and to generate the code necessary to
use the Geant4 libraries from a python session.
For simplicity it is recommended to use Anaphe. Anaphe comes with
python and swig installations.
See http://anaphe.web.cern.ch/
It can be built and run using PI: http://cern.ch/PI.
At the end a histogram called "trackentering.hbook" is created and can be
displayed using standard packages (such as PAW).
Building, compiling and running
-------------------------------
Follow similar steps as for example B02. If you already have
the environment set up for example B02 jump to point 3 below:
You need to set the following variables in your environment:
"G4ANALYSIS_USE"
"PI_BASE_DIR" (where PI has been installed)
"SWIG_BASE_DIR" (where SWIG 1.3.15 has been installed)
Finally source the script setupPI.csh.
1) set the following variables (for example):
setenv ANAPHETOP /afs/cern.ch/sw/lhcxx
(or if installed in opt: /opt/Anaphe/5.0.5)
setenv AIDA_DIR /afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp
(or if installed in opt: /opt/AIDA/3.0.0/3.0.0/AIDA/3.0/src/cpp)
2) Source the script:
source $ANAPHETOP/share/LHCXX/5.0.5/scripts/setupAnaphe.csh
3) and add to lirary path the following directories:
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB03
====
setenv PYTHONPATH $LD_LIBRARY_PATH
4) setenv PYTHON_VERSION 2.2
You may run gmake now.
You should be able to execute the file B03RunApplication.py from your
You may run gmake now.
You should be able to execute the file B03RunApplication.py from your
shell or from a lizard session now.
The histogram is displayed only if the script is beeing ran
from lizard.
At the moment the plotting is not available using a python script, but
it is planned in future releases. A histogram is created and later displayed
using standard analysis packages.
Files in B03;
B03Application.py: Is a example class utilizing importance sampling
and scoring using python.
B03RunApplication.py: Is a python script running the example.
It may be executed from the shell or in a python or lizard
session. In case it is executed from lizard it creates a plot
with a histogram.
It may be executed from the shell or in a python session.
B03App.py: Is created by swig using swig.
TracksEntering.hbook:
It is the histogram file created by running B03RunApplication.py
@@ -0,0 +1,40 @@
# $Id: GNUmakefile,v 1.1 2004/06/14 10:09:19 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := MuonProcesses
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
.PHONY: all
all: lib bin
#### G4ANALYSIS_USE := true
ifdef G4ANALYSIS_USE
USE_AIDA := true
endif
ifdef USE_AIDA
CPPFLAGS += -DG4ANALYSIS_USE
CPPFLAGS += -DUSE_AIDA
endif
include $(G4INSTALL)/config/architecture.gmk
ifdef USE_AIDA
# for the aida-config command see the README file
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
endif
include $(G4INSTALL)/config/binmake.gmk
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
@@ -0,0 +1,23 @@
$Id: History,v 1.2 2004/06/16 10:46:47 maire Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
PhotonProcesses History file
--------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
16.06.04 V. Ivantchenko (muonprocesses-V06-01-01)
- std::max in MuCrossSections
14.06.04 Michel Maire (muonprocesses-V06-01-00)
- creation, from A. Bogdanov and R. Kokoulin's TestMu program.
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: MuonProcesses.cc,v 1.1 2004/06/14 10:09:20 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "SteppingVerbose.hh"
#include "StackingAction.hh"
#include "HistoManager.hh"
#ifdef G4VIS_USE
#include "VisManager.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv) {
//choose the Random engine
HepRandom::setTheEngine(new RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new SteppingVerbose);
// Construct the default run manager
G4RunManager * runManager = new G4RunManager;
// set mandatory initialization classes
DetectorConstruction* det;
PrimaryGeneratorAction* prim;
runManager->SetUserInitialization(det = new DetectorConstruction);
runManager->SetUserInitialization(new PhysicsList);
runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
#ifdef G4VIS_USE
// visualization manager
G4VisManager* visManager = new VisManager;
visManager->Initialize();
#endif
HistoManager* histo = 0;
#ifdef G4ANALYSIS_USE
histo = new HistoManager();
#endif
// set user action classes
RunAction* run;
runManager->SetUserAction(run = new RunAction(det,prim,histo));
runManager->SetUserAction(new EventAction);
runManager->SetUserAction(new SteppingAction(run,histo));
runManager->SetUserAction(new StackingAction);
// Start execution
//
if (argc > 1) { // execute an argument macro file if exist
G4String command = "/control/execute ";
G4String fileName = argv[1];
G4UImanager::GetUIpointer()->ApplyCommand(command+fileName);
} else { // start interactive session
G4UIsession* session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
session->SessionStart();
delete session;
}
// job termination
//
#ifdef G4ANALYSIS_USE
delete histo;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,22 @@
# $Id: MuonProcesses.in,v 1.1 2004/06/14 10:09:20 maire Exp $
#
# Macro file for "MuonProcesses.cc"
# (can be run in batch, without graphic)
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Iron
/testem/det/setSize 1 m
#
/testem/phys/addPhysics standard
/testem/phys/setCuts 1 mm
#
/run/initialize
#
/gun/particle mu+
/gun/energy 10 TeV
#
/testem/event/printModulo 1000
#
/run/beamOn 10000
@@ -0,0 +1,149 @@
$Id: README,v 1.2 2004/06/23 11:28:04 maire Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
MuonProcesses
-------------
This example is intended to check implementation of the processes
of muon interactions: ionization, direct (e+,e-) production,
bremsstrahlung, mu-nuclear interaction.
It allows to compute differential cross sections (as function of the
energy tranfered to secondaries), total cross sections and to compare
with analytic calculations.
1- GEOMETRY DEFINITION
It is a single box of homogeneous medium.
Two parameters define the geometry :
- the material of the box,
- the (full) size of the box.
The default geometry (1 m of Iron) is constructed in
DetectorConstruction, but the above parameters can be changed
interactively via the commands defined in DetectorMessenger.
2- PHYSICS LIST
The physics list contains only electromagnetic processes for muon,
adding G4MuNuclearInteraction and seting of upper energy range limit
to 1000 PeV).
Standard (default) and g4v52 (frozen at the release Genat4 v.5.2)
physics can be choosen.
3- AN EVENT : THE PRIMARY GENERATOR
The primary kinematic consists of a single particle starting at the edge
of the box. The type of the particle and its energy are set in
PrimaryGeneratorAction (mu+ 10 TeV), and can be changed via the G4
build-in commands of ParticleGun class (see the macros provided with
this example).
4- PHYSICS
The incident particle is a muon. During the tracking, secondary particles
are killed.
The number of interactions are plotted as a function of the energy
transfered to the secondaries.
The total number of interactions is recorded, and the total crossSection
computed from this.
At EndOfRun, the above results are compared with analytic calculations.
The functions which compute the theoritical crossSections have been
provided by the G4 MEPhI group, and grouped in MuCrossSection class.
5- HISTOGRAMS
The test contains 4 built-in 1D histograms, which are managed by the
HistoManager class and its Messenger.
1 Monte-Carlo relative transferred energy distribution histo
(log10(eps/Emu kin) for knock-on electrons (ionization)
2 -"- direct (e+,e-) pair production
3 -"- bremsstrahlung
4 -"- nuclear interaction
The histos can be activated individually with the command :
/testem/histo/setHisto id nbBins valMin valMax : min and max values of
log10(eps/Emu kin).
At EndOfRun the corresponding histos for analytic calculations are
automatically created anf filled (histo 6 to 9), and the comparison
(G4 divided by theory) is done in histos 11 to 14.
The histograms can be viewed using PAW. See below the note on
ANAPHE+AIDA.
Note that, by default, histograms are disabled. To activate them,
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
6- VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
> /control/execute vis.mac
The detector has a default view which is a longitudinal view of the
box.
The tracks are drawn at the end of event, and erased at the end of run.
7- HOW TO START ?
compile and link to generate an executable
% cd geant4/examples/extended/electromagnetic/MuonProcesses
% gmake
execute MuonProcesses in 'batch' mode from macro files :
% MuonProcesses allproc.mac
execute MuonProcesses in 'interactive mode' with visualization :
% MuonProcesses
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
8- Using histograms
-------------------
By default the histograms are not activated. To activate histograms
the environment variable G4ANALYSIS_USE should be defined. For instance
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
To use histograms any of implementations of AIDA interfaces should
be available (see http://aida.freehep.org).
A package including AIDA and extended interfaces also using Python
is PI, available from: http://cern.ch/pi .
Once installed PI or PI-Lite in a specified local area $MYPY, it is
required to add the installation path to $PATH, i.e. for example,
for release 1.2.1 of PI:
setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
CERN users can use the PATH to the LCG area on AFS.
Before compilation of the example it is optimal to clean up old
files:
gmake histclean
gmake
Before running the example the command should be issued:
eval `aida-config --runtime csh`
It is possible to choose the format of the output file with
histograms using UI command:
/testem/histo/setFileType type
The following types are available: hbook, root, xml.
@@ -0,0 +1,29 @@
# $Id: allproc.mac,v 1.1 2004/06/14 10:09:20 maire Exp $
#
# Macro file for "MuonProcesses.cc"
# (can be run in batch, without graphic)
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Iron
/testem/det/setSize 1 m
#
/testem/phys/addPhysics standard
### /testem/phys/addPhysics g4v52
#
/testem/phys/setCuts 1 mm
#
/run/initialize
#
/gun/particle mu+
/gun/energy 10 TeV
#
/testem/histo/setFileName allproc.paw
/testem/histo/setHisto 1 100 -10. 0.
/testem/histo/setHisto 2 100 -10. 0.
/testem/histo/setHisto 3 100 -10. 0.
#
/testem/event/printModulo 1000
#
/run/beamOn 10000
@@ -0,0 +1,89 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorConstruction.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4LogicalVolume;
class G4Material;
class DetectorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
~DetectorConstruction();
public:
G4VPhysicalVolume* Construct();
void SetSize (G4double);
void SetMaterial (G4String);
void UpdateGeometry();
public:
const
G4VPhysicalVolume* GetWorld() {return pBox;};
G4double GetSize() {return BoxSize;};
G4Material* GetMaterial() {return aMaterial;};
void PrintParameters();
private:
G4VPhysicalVolume* pBox;
G4LogicalVolume* lBox;
G4double BoxSize;
G4Material* aMaterial;
DetectorMessenger* detectorMessenger;
private:
void DefineMaterials();
G4VPhysicalVolume* ConstructVolumes();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorMessenger.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger: public G4UImessenger
{
public:
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
DetectorConstruction* Detector;
G4UIdirectory* testemDir;
G4UIdirectory* detDir;
G4UIcmdWithAString* MaterCmd;
G4UIcmdWithADoubleAndUnit* SizeCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventAction.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef EventAction_h
#define EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class EventActionMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class EventAction : public G4UserEventAction
{
public:
EventAction();
~EventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void SetPrintModulo(G4int val) {printModulo = val;};
private:
G4int printModulo;
EventActionMessenger* eventMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventActionMessenger.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef EventActionMessenger_h
#define EventActionMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class EventAction;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class EventActionMessenger: public G4UImessenger
{
public:
EventActionMessenger(EventAction*);
~EventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
EventAction* eventAction;
G4UIdirectory* eventDir;
G4UIcmdWithAnInteger* PrintCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoManager.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoManager_h
#define HistoManager_h 1
#ifdef USE_AIDA
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace AIDA {
class ITree;
class IHistogramFactory;
class IHistogram1D;
}
class HistoMessenger;
const G4int MaxHisto = 5;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager();
void SetFileName (G4String name) { fileName = name;};
void SetFactory ();
void SaveFactory ();
void SetHisto (G4int, G4int, G4double, G4double, G4String unit="none");
void RemoveHisto (G4int);
AIDA::ITree* GetTree() {return tree;}
AIDA::IHistogramFactory* GetHistogramFactory() {return hf;}
AIDA::IHistogram1D* GetHisto(G4int id) {return histo[id];}
G4double GetHistoUnit(G4int id) {return Unit[id];}
G4double GetBinWidth (G4int id) {return Width[id];}
private:
G4String fileName;
AIDA::ITree* tree;
AIDA::IHistogramFactory* hf;
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 factoryOn;
HistoMessenger* histoMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoMessenger.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoMessenger_h
#define HistoMessenger_h 1
#ifdef G4ANALYSIS_USE
#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;
G4UIcommand* histoCmd;
G4UIcmdWithAnInteger* rmhistoCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: MuCrossSections.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef MuCrossSections_h
#define MuCrossSections_h 1
#include "globals.hh"
class G4Material;
class G4Element;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class MuCrossSections
{
public:
MuCrossSections();
~MuCrossSections();
public:
G4double CR_Macroscopic (G4String, G4Material*, G4double, G4double);
G4double CR_PerAtom (G4String, G4Element* , G4double, G4double);
private:
G4double CRB_Mephi (G4double, G4double, G4double, G4double);
G4double CRK_Mephi (G4double, G4double, G4double, G4double);
G4double CRN_Mephi (G4double, G4double, G4double, G4double);
G4double CRP_Mephi (G4double, G4double, G4double, G4double);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -20,9 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmG4v52.hh,v 1.1 2003/10/08 17:28:36 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmG4v52.hh,v 1.1 2004/06/14 10:09:22 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,26 +20,25 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListGeneral.hh,v 1.1 2003/10/08 17:28:37 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmStandard.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListGeneral_h
#define PhysListGeneral_h 1
#ifndef PhysListEmStandard_h
#define PhysListEmStandard_h 1
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListGeneral : public G4VPhysicsConstructor
class PhysListEmStandard : public G4VPhysicsConstructor
{
public:
PhysListGeneral(const G4String& name = "general");
~PhysListGeneral();
PhysListEmStandard(const G4String& name = "standard");
~PhysListEmStandard();
public:
// This method is dummy for physics
@@ -49,7 +48,6 @@ class PhysListGeneral : public G4VPhysicsConstructor
// each physics process will be instantiated and
// registered to the process manager of each particle type
void ConstructProcess();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsList.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
class PhysicsListMessenger;
class G4VPhysicsConstructor;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsList: public G4VModularPhysicsList
{
public:
PhysicsList();
~PhysicsList();
void ConstructParticle();
void ConstructProcess();
void AddPhysicsList(const G4String& name);
void SetCuts();
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForPositron(G4double);
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
G4double currentDefaultCut;
G4VPhysicsConstructor* emPhysicsList;
G4String emName;
PhysicsListMessenger* pMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsListMessenger.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListMessenger_h
#define PhysicsListMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class PhysicsList;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListMessenger: public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList* );
~PhysicsListMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
PhysicsList* pPhysicsList;
G4UIcmdWithADoubleAndUnit* gammaCutCmd;
G4UIcmdWithADoubleAndUnit* electCutCmd;
G4UIcmdWithADoubleAndUnit* protoCutCmd;
G4UIcmdWithADoubleAndUnit* allCutCmd;
G4UIcmdWithAString* pListCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "globals.hh"
class G4Event;
class DetectorConstruction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
~PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() {return particleGun;};
private:
G4ParticleGun* particleGun;
DetectorConstruction* detector;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: ProcessesCount.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ProcessesCount_HH
#define ProcessesCount_HH
#include "globals.hh"
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OneProcessCount
{
public:
OneProcessCount(G4String name) {Name=name; Counter=0;};
~OneProcessCount() {};
public:
G4String GetName() {return Name;};
G4int GetCounter() {return Counter;};
void Count() {Counter++;};
private:
G4String Name; // process name
G4int Counter; // process counter
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef std::vector<OneProcessCount*> ProcessesCount;
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "ProcessesCount.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction;
class PrimaryGeneratorAction;
class HistoManager;
class G4Run;
class G4Material;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class RunAction : public G4UserRunAction
{
public:
RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*);
~RunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void CountProcesses(G4String);
private:
G4double ComputeTheory (G4String, G4int);
G4double GetEnergyCut (G4Material*, G4int);
private:
DetectorConstruction* detector;
PrimaryGeneratorAction* primary;
ProcessesCount* ProcCounter;
HistoManager* histoManager;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: StackingAction.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef StackingAction_h
#define StackingAction_h 1
#include "G4UserStackingAction.hh"
#include "globals.hh"
class G4Track;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class StackingAction : public G4UserStackingAction
{
public:
StackingAction();
~StackingAction();
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* );
};
#endif
@@ -20,46 +20,36 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingAction.hh,v 1.1 2004/06/14 10:09:23 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// $Id: PhysListParticles.hh,v 1.1 2003/10/06 10:02:25 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListParticles_h
#define PhysListParticles_h 1
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4VPhysicsConstructor.hh"
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class RunAction;
class HistoManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListParticles : public G4VPhysicsConstructor
class SteppingAction : public G4UserSteppingAction
{
public:
PhysListParticles(const G4String& name = "particles");
~PhysListParticles();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
void ConstructParticle();
// This method is dummy.
void ConstructProcess() {};
public:
SteppingAction(RunAction*, HistoManager*);
~SteppingAction();
void UserSteppingAction(const G4Step*);
private:
RunAction* runAction;
HistoManager* histoManager;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingVerbose.hh,v 1.1 2004/06/14 10:09:24 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
// It shows how to extract informations during the tracking of a particle.
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef SteppingVerbose_h
#define SteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class SteppingVerbose : public G4SteppingVerbose {
public:
SteppingVerbose();
~SteppingVerbose();
void StepInfo();
void TrackingStarted();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: VisManager.hh,v 1.1 2004/06/14 10:09:24 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Example Visualization Manager implementing virtual function
// RegisterGraphicsSystems. Exploits C-pre-processor variables
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
// environment variables of the same name are set.
// So all you have to do is set environment variables and compile and
// instantiate this in your main().
// Alternatively, you can implement an empty function here and just
// register the systems you want in your main(), e.g.:
// G4VisManager* myVisManager = new MyVisManager;
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef VisManager_h
#define VisManager_h 1
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class VisManager: public G4VisManager {
public:
VisManager ();
private:
void RegisterGraphicsSystems ();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,176 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorConstruction.cc,v 1.1 2004/06/14 10:09:25 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4GeometryManager.hh"
#include "G4PhysicalVolumeStore.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4SolidStore.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
:pBox(0), lBox(0), aMaterial(0)
{
BoxSize = 1*m;
DefineMaterials();
SetMaterial("Iron");
detectorMessenger = new DetectorMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{ delete detectorMessenger;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::Construct()
{
return ConstructVolumes();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::DefineMaterials()
{
//
// define Elements
//
G4double z,a;
G4Element* C = new G4Element("Carbon" ,"C" , z= 6., a= 12.01*g/mole);
G4Element* N = new G4Element("Nitrogen" ,"N" , z= 7., a= 14.01*g/mole);
G4Element* O = new G4Element("Oxygen" ,"O" , z= 8., a= 16.00*g/mole);
G4Element* Ca = new G4Element("Calcium" ,"Ca", z=20., a= 40.08*g/mole);
//
// define materials
//
G4double density;
G4int ncomponents, natoms;
G4double fractionmass;
new G4Material("galactic", z=1., a= 1.01*g/mole, universe_mean_density,
kStateGas, 2.73*kelvin, 3.e-18*pascal);
G4Material* Air =
new G4Material("Air", density= 1.290*mg/cm3, ncomponents=2);
Air->AddElement(N, fractionmass=70.*perCent);
Air->AddElement(O, fractionmass=30.*perCent);
G4Material* CaCO3 =
new G4Material("CaCO3", density= 2.80*g/cm3, ncomponents=3);
CaCO3->AddElement(Ca, natoms= 1);
CaCO3->AddElement(C , natoms= 1);
CaCO3->AddElement(O , natoms= 3);
new G4Material("Carbon", z= 6., a= 12.01*g/mole, density= 2.265*g/cm3);
new G4Material("Iron" , z=26., a= 55.85*g/mole, density= 7.870*g/cm3);
new G4Material("Tin" , z=50., a= 118.7*g/mole, density= 7.310*g/cm3);
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
{
// Cleanup old geometry
G4GeometryManager::GetInstance()->OpenGeometry();
G4PhysicalVolumeStore::GetInstance()->Clean();
G4LogicalVolumeStore::GetInstance()->Clean();
G4SolidStore::GetInstance()->Clean();
G4Box*
sBox = new G4Box("Container", //its name
BoxSize/2,BoxSize/2,BoxSize/2); //its dimensions
lBox = new G4LogicalVolume(sBox, //its shape
aMaterial, //its material
aMaterial->GetName()); //its name
pBox = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
lBox, //its logical volume
aMaterial->GetName(), //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
PrintParameters();
//always return the root volume
//
return pBox;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::PrintParameters()
{
G4cout << "\n The Box is " << G4BestUnit(BoxSize,"Length")
<< " of " << aMaterial->GetName() << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial) aMaterial = pttoMaterial;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSize(G4double value)
{
BoxSize = value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4RunManager.hh"
void DetectorConstruction::UpdateGeometry()
{
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,95 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorMessenger.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorMessenger.hh"
#include "DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
:Detector(Det)
{
testemDir = new G4UIdirectory("/testem/");
testemDir->SetGuidance("commands specific to this example");
detDir = new G4UIdirectory("/testem/det/");
detDir->SetGuidance("detector construction");
MaterCmd = new G4UIcmdWithAString("/testem/det/setMat",this);
MaterCmd->SetGuidance("Select material of the box.");
MaterCmd->SetParameterName("choice",false);
MaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
SizeCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setSize",this);
SizeCmd->SetGuidance("Set size of the box");
SizeCmd->SetParameterName("Size",false);
SizeCmd->SetRange("Size>0.");
SizeCmd->SetUnitCategory("Length");
SizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
UpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
UpdateCmd->SetGuidance("Update calorimeter geometry.");
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
UpdateCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::~DetectorMessenger()
{
delete MaterCmd;
delete SizeCmd;
delete UpdateCmd;
delete detDir;
delete testemDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == MaterCmd )
{ Detector->SetMaterial(newValue);}
if( command == SizeCmd )
{ Detector->SetSize(SizeCmd->GetNewDoubleValue(newValue));}
if( command == UpdateCmd )
{ Detector->UpdateGeometry(); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventAction.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "EventAction.hh"
#include "EventActionMessenger.hh"
#include "G4Event.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction()
:printModulo(10000),eventMessenger(0)
{
eventMessenger = new EventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::~EventAction()
{
delete eventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
//printing survey
if (evtNb%printModulo == 0)
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::EndOfEventAction(const G4Event* evt)
{
if (G4VVisManager::GetConcreteInstance())
{
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for (G4int i=0; i<n_trajectories; i++) {
G4Trajectory* trj = (G4Trajectory*)
((*(evt->GetTrajectoryContainer()))[i]);
trj->DrawTrajectory(1000);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: EventActionMessenger.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "EventActionMessenger.hh"
#include "EventAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAnInteger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventActionMessenger::EventActionMessenger(EventAction* EvAct)
:eventAction(EvAct)
{
eventDir = new G4UIdirectory("/testem/event/");
eventDir ->SetGuidance("physics list");
PrintCmd = new G4UIcmdWithAnInteger("/testem/event/printModulo",this);
PrintCmd->SetGuidance("Print events modulo n");
PrintCmd->SetParameterName("EventNb",false);
PrintCmd->SetRange("EventNb>0");
PrintCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventActionMessenger::~EventActionMessenger()
{
delete PrintCmd;
delete eventDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventActionMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if (command == PrintCmd)
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,165 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoManager.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef USE_AIDA
#include "HistoManager.hh"
#include "HistoMessenger.hh"
#include "G4UnitsTable.hh"
#include "AIDA/AIDA.h"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
:tree(0),hf(0),factoryOn(false)
{
fileName = "muonprocesses.paw";
// histograms
for (G4int k=0; k<MaxHisto; k++) { histo[k] = 0; exist[k] = false;}
histoMessenger = new HistoMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
SaveFactory();
delete histoMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetFactory()
{
if (factoryOn) {
G4cout << "\n--->HistoManager::SetFactory(): factory already exists"
<< G4endl;
SaveFactory();
}
// Creating the analysis factory
AIDA::IAnalysisFactory* af = AIDA_createAnalysisFactory();
// Creating the tree factory
AIDA::ITreeFactory* tf = af->createTreeFactory();
// Creating a tree mapped to an hbook file.
G4bool readOnly = false;
G4bool createNew = true;
tree = tf->create(fileName, "hbook", readOnly, createNew);
// Creating a histogram factory, whose histograms will be handled by the tree
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]);
}
delete tf;
delete af;
factoryOn = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SaveFactory()
{
if (factoryOn) {
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
delete hf;
delete tree;
factoryOn = false;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetHisto(G4int ih,
G4int nbins, G4double valmin, G4double valmax, 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"};
const G4String title[] =
{ "dummy", //0
"log10(Etransfert/Emu) Ionization", //1
"log10(Etransfert/Emu) Pair", //2
"log10(Etransfert/Emu) Brems", //3
"log10(Etransfert/Emu) Nuclear" //4
};
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];
}
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::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......
#endif
@@ -0,0 +1,118 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoMessenger.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4ANALYSIS_USE
#include "HistoMessenger.hh"
#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("/testem/histo/");
histoDir->SetGuidance("histograms control");
factoryCmd = new G4UIcmdWithAString("/testem/histo/setFileName",this);
factoryCmd->SetGuidance("set name for the histograms file");
histoCmd = new G4UIcommand("/testem/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);
rmhistoCmd = new G4UIcmdWithAnInteger("/testem/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 histoCmd;
delete factoryCmd;
delete histoDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
if (command == factoryCmd)
histoManager->SetFileName(newValues);
if (command == histoCmd)
{ G4int ih,nbBins; G4double vmin,vmax; char unts[30];
const char* t = newValues;
std::istrstream is((char*)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 == rmhistoCmd)
{ histoManager->RemoveHisto(rmhistoCmd->GetNewIntValue(newValues));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,392 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: MuCrossSections.cc,v 1.2 2004/06/15 16:33:50 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "MuCrossSections.hh"
#include "G4Material.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
MuCrossSections::MuCrossSections()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
MuCrossSections::~MuCrossSections()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double MuCrossSections::CR_Macroscopic(G4String process, G4Material* material,
G4double tkin, G4double ep)
// return the macroscopic cross section (1/L) in GEANT4 internal units
{
const G4ElementVector* theElementVector = material->GetElementVector();
const G4double* NbOfAtomsPerVolume = material->GetVecNbOfAtomsPerVolume();
G4double SIGMA = 0 ;
for ( size_t i=0 ; i < material->GetNumberOfElements() ; i++ )
{
G4Element* element = (*theElementVector)[i];
SIGMA += NbOfAtomsPerVolume[i] * CR_PerAtom(process, element, tkin, ep);
}
return SIGMA;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double MuCrossSections::CR_PerAtom(G4String process, G4Element* element,
G4double tkin, G4double ep)
{
G4double z = element->GetZ();
G4double a = element->GetA();
G4double sigma = 0.;
if (process == "MuBrems")
sigma = CRB_Mephi(z,a/(g/mole),tkin/GeV,ep/GeV)*(cm2/(g*GeV))*a/Avogadro;
else if (process == "MuIoni")
sigma = CRK_Mephi(z,a/(g/mole),tkin/GeV,ep/GeV)*(cm2/(g*GeV))*a/Avogadro;
else if (process == "MuNucl")
sigma = CRN_Mephi(z,a/(g/mole),tkin/GeV,ep/GeV)*(cm2/(g*GeV))*a/Avogadro;
else if (process == "MuPairProd")
sigma = CRP_Mephi(z,a/(g/mole),tkin/GeV,ep/GeV)*(cm2/(g*GeV))*a/Avogadro;
return sigma;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double MuCrossSections::CRB_Mephi(double z,double a,double tkin,double ep)
//***********************************************************************
//*** crb_g4_1.inc in comparison with crb_.inc, following
//*** changes are introduced (September 24th, 1998):
//*** 1) function crb_g4 (Z,A,Tkin,EP), Tkin is kinetic energy
//*** 2) special case of hidrogen (Z<1.5; b,b1,Dn_star)
//*** Numerical comparison: 5 decimal digits coincide.
//***
//*** Cross section for bremsstrahlung by fast muon
//*** By R.P.Kokoulin, September 1998
//*** Formulae from Kelner,Kokoulin,Petrukhin 1995, Preprint MEPhI
//*** (7,18,19,20,21,25,26); Dn (18) is modified to incorporate
//*** Bugaev's inelatic nuclear correction (28) for Z > 1.
//***********************************************************************
{
// double Z,A,Tkin,EP;
double crb_g4;
double e,v,delta,rab0,z_13,dn,b,b1,dn_star,rab1,fn,epmax1,fe,rab2;
//
double ame=0.51099907e-3; // GeV
double amu=0.105658389; // GeV
double re=2.81794092e-13; // cm
double avno=6.022137e23;
double alpha=1./137.036;
double rmass=amu/ame; // "207"
double coeff=16./3.*alpha*avno*(re/rmass)*(re/rmass); // cm^2
double sqrte=1.64872127; // sqrt(2.71828...)
double btf=183.;
double btf1=1429.;
double bh=202.4;
double bh1=446.;
//***
if(ep >= tkin)
{
crb_g4=0.;
return crb_g4;
}
e=tkin+amu;
v=ep/e;
delta=amu*amu*v/(2.*(e-ep)); // qmin
rab0=delta*sqrte;
z_13=pow(z,-0.3333333); //
//*** nuclear size and excitation, screening parameters
dn=1.54*pow(a,0.27);
if(z <= 1.5) // special case for hydrogen
{
b=bh;
b1=bh1;
dn_star=dn;
}
else
{
b=btf;
b1=btf1;
dn_star=pow(dn,(1.-1./z)); // with Bugaev's correction
}
//*** nucleus contribution logarithm
rab1=b*z_13;
fn=log(rab1/(dn_star*(ame+rab0*rab1))*(amu+delta*(dn_star*sqrte-2.)));
if(fn < 0.) fn=0.;
//*** electron contribution logarithm
epmax1=e/(1.+amu*rmass/(2.*e));
if(ep >= epmax1)
{
fe=0.;
goto label10;
}
rab2=b1*z_13*z_13;
fe=log(rab2*amu/((1.+delta*rmass/(ame*sqrte))*(ame+rab0*rab2)));
if(fe < 0.) fe=0.;
//***
label10:
crb_g4=coeff*(1.-v*(1.-0.75*v))*z*(z*fn+fe)/(a*ep);
return crb_g4;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double MuCrossSections::CRK_Mephi(double z,double a,double tkin,double ep)
//***********************************************************************
//*** Cross section for knock-on electron production by fast muons
//*** (including bremsstrahlung e-diagrams and rad. correction).
//*** Units: cm^2/(g*GeV); Tkin, ep - GeV.
//*** By R.P.Kokoulin, October 1998
//*** Formulae from Kelner,Kokoulin,Petrukhin, Phys.Atom.Nuclei, 1997
//*** (a bit simplified Kelner's version of Eq.30 - with 2 logarithms).
//***
{
// double Z,A,Tkin,EP;
double crk_g4;
double e,epmax,v,sigma0,a1,a3;
//
double ame=0.51099907e-3; // GeV
double amu=0.105658389; // GeV
double re=2.81794092e-13; // cm
double avno=6.022137e23;
double alpha=1./137.036;
double pi=3.141592654;
double bmu=amu*amu/(2.*ame);
double coeff0=avno*2.*pi*ame*re*re;
double coeff1=alpha/(2.*pi);
//***
e=tkin+amu;
epmax=e/(1.+bmu/e);
if(ep >= epmax)
{
crk_g4=0.;
return crk_g4;
}
v=ep/e;
sigma0=coeff0*(z/a)*(1.-ep/epmax+0.5*v*v)/(ep*ep);
a1=log(1.+2.*ep/ame);
a3=log(4.*e*(e-ep)/(amu*amu));
crk_g4=sigma0*(1.+coeff1*a1*(a3-a1));
return crk_g4;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double MuCrossSections::CRN_Mephi(double z,double a,double tkin,double ep)
//***********************************************************************
//*** Differential cross section for photonuclear muon interaction.
//*** Formulae from Borog & Petrukhin, 1975
//*** Real photon cross section: Caldwell e.a., 1979
//*** Nuclear shadowing: Brodsky e.a., 1972
//*** Units: cm^2 / g GeV.
//*** CRN_G4_1.inc January 31st, 1998 R.P.Kokoulin
//***********************************************************************
{
// double Z,A,Tkin,EP;
double crn_g4;
double dummy,e,aeff,sigph,v,v1,v2,amu2,up,down;
//***
double amu=0.105658389; // GeV
double avno=6.022137e23;
double amp=0.9382723; // GeV
double pi=3.14159265;
double alpha=1./137.036;
//***
double epmin_phn=0.20; // GeV
double alam2=0.400000; // GeV**2
double alam =0.632456; // sqrt(alam2)
double coeffn=alpha/pi*avno*1e-30; // cm^2/microbarn
//***
dummy=z; // Z is a formal parameter at the moment
e=tkin+amu;
crn_g4=0.;
if(ep >= e-0.5*amp) return crn_g4;
if(ep <= epmin_phn) return crn_g4;
aeff=0.22*a+0.78*pow(a,0.89); // shadowing
sigph=49.2+11.1*log(ep)+151.8/sqrt(ep); // microbarn
v=ep/e;
v1=1.-v;
v2=v*v;
amu2=amu*amu;
up=e*e*v1/amu2*(1.+amu2*v2/(alam2*v1));
down=1.+ep/alam*(1.+alam/(2.*amp)+ep/alam);
crn_g4=coeffn*aeff/a*sigph/ep*(-v1+(v1+0.5*v2*(1.+2.*amu2/alam2))*log(up/down));
if(crn_g4 < 0.) crn_g4=0.;
return crn_g4;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double MuCrossSections::CRP_Mephi(double z,double a,double tkin,double ep)
//**********************************************************************
//*** crp_g4_1.inc in comparison with crp_m.inc, following
//*** changes are introduced (January 16th, 1998):
//*** 1) Avno/A, cm^2/gram GeV
//*** 2) zeta_loss(E,Z) from Kelner 1997, Eqs.(53-54)
//*** 3) function crp_g4 (Z,A,Tkin,EP), Tkin is kinetic energy
//*** 4) bbb=183 (Thomas-Fermi)
//*** 5) special case of hidrogen (Z<1.5), bbb,g1,g2
//*** 6) expansions in 'xi' are simplified (Jan.17th,1998)
//***
//*** Cross section for electron pair production by fast muon
//*** By R.P.Kokoulin, December 1997
//*** Formulae from Kokoulin & Petrukhin 1971, Hobart, Eqs.(1,8,9,10)
{
// double Z,A,Tkin,EP;
double crp_g4;
double bbbtf,bbbh,g1tf,g2tf,g1h,g2h,e,z13,e1,alf,a3,bbb;
double g1,g2,zeta1,zeta2,zeta,z2,screen0,a0,a1,bet,xi0,del;
double tmn,sum,a4,a5,a6,a7,a9,xi,xii,xi1,screen,yeu,yed,ye1;
double ale,cre,be,fe,ymu,ymd,ym1,alm_crm,a10,bm,fm;
//
double ame=0.51099907e-3; // GeV
double amu=0.105658389; // GeV
double re=2.81794092e-13; // cm
double avno=6.022137e23;
double pi=3.14159265;
double alpha=1./137.036;
double rmass=amu/ame; // "207"
double coeff=4./(3.*pi)*(alpha*re)*(alpha*re)*avno; // cm^2
double sqrte=1.64872127; // sqrt(2.71828...)
double c3=3.*sqrte*amu/4.; // for limits
double c7=4.*ame; // -"-
double c8=6.*amu*amu; // -"-
double xgi[8]={.0199,.1017,.2372,.4083,.5917,.7628,.8983,.9801}; // Gauss, 8
double wgi[8]={.0506,.1112,.1569,.1813,.1813,.1569,.1112,.0506}; // Gauss, 8
bbbtf=183.; // for the moment...
bbbh=202.4; // for the moment...
g1tf=1.95e-5;
g2tf=5.3e-5;
g1h=4.4e-5;
g2h=4.8e-5;
e=tkin+amu;
z13=pow(z,0.3333333);
e1=e-ep;
crp_g4=0.;
if(e1 <= c3*z13) return crp_g4; // ep > max
alf=c7/ep; // 4m/ep
a3=1.-alf;
if(a3 <= 0.) return crp_g4; // ep < min
//*** zeta calculation
if(z <= 1.5) // special case of hidrogen
{
bbb=bbbh;
g1=g1h;
g2=g2h;
}
else
{
bbb=bbbtf;
g1=g1tf;
g2=g2tf;
}
zeta1=0.073*log(e/(amu+g1*z13*z13*e))-0.26;
if(zeta1 > 0.)
{
zeta2=0.058*log(e/(amu+g2*z13*e))-0.14;
zeta=zeta1/zeta2;
}
else
{
zeta=0.;
}
z2=z*(z+zeta); //
//*** just to check (for comparison with crp_m)
// z2=z*(z+1.)
// bbb=189.
//***
screen0=2.*ame*sqrte*bbb/(z13*ep); // be careful with "ame"
a0=e*e1;
a1=ep*ep/a0; // 2*beta
bet=0.5*a1; // beta
xi0=0.25*rmass*rmass*a1; // xi0
del=c8/a0; // 6mu^2/EE'
tmn=log((alf+2.*del*a3)/(1.+(1.-del)*sqrt(a3))); // log(1-rmax)
sum=0.;
for(int i=0; i<=7; i++) // integration
{
a4=exp(tmn*xgi[i]); // 1-r
a5=a4*(2.-a4); // 1-r2
a6=1.-a5; // r2
a7=1.+a6; // 1+r2
a9=3.+a6; // 3+r2
xi=xi0*a5;
xii=1./xi;
xi1=1.+xi;
screen=screen0*xi1/a5;
yeu=5.-a6+4.*bet*a7;
yed=2.*(1.+3.*bet)*log(3.+xii)-a6-a1*(2.-a6);
ye1=1.+yeu/yed;
ale=log(bbb/z13*sqrt(xi1*ye1)/(1.+screen*ye1));
cre=0.5*log(1.+(1.5/rmass*z13)*(1.5/rmass*z13)*xi1*ye1);
if(xi <= 1e3) //
{
be=((2.+a6)*(1.+bet)+xi*a9)*log(1.+xii)+(a5-bet)/xi1-a9;
}
else
{
be=(3.-a6+a1*a7)/(2.*xi); // -(6.-5.*a6+3.*bet*a6)/(6.*xi*xi);
}
fe=std::max(0.,(ale-cre)*be);
ymu=4.+a6+3.*bet*a7;
ymd=a7*(1.5+a1)*log(3.+xi)+1.-1.5*a6;
ym1=1.+ymu/ymd;
alm_crm=log(bbb*rmass/(1.5*z13*z13*(1.+screen*ym1)));
if(xi >= 1e-3) //
{
a10=(1.+a1)*a5; // (1+2b)(1-r2)
bm=(a7*(1.+1.5*bet)-a10*xii)*log(xi1)+xi*(a5-bet)/xi1+a10;
}
else
{
bm=(5.-a6+bet*a9)*(xi/2.); // -(11.-5.*a6+.5*bet*(5.+a6))*(xi*xi/6.)
}
fm=std::max(0.,(alm_crm)*bm);
//***
sum=sum+a4*(fe+fm/(rmass*rmass))*wgi[i];
}
crp_g4=-tmn*sum*(z2/a)*coeff*e1/(e*ep);
return crp_g4;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmG4v52.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListEmG4v52.hh"
#include "G4ParticleDefinition.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4ProcessManager.hh"
#include "G4MuIonisation52.hh"
#include "G4MuBremsstrahlung52.hh"
#include "G4MuPairProduction52.hh"
#include "G4MuNuclearInteraction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmG4v52::PhysListEmG4v52(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmG4v52::~PhysListEmG4v52()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListEmG4v52::ConstructProcess()
{
// Add standard EM Processes for Muon
G4ParticleDefinition* particle = G4MuonPlus::MuonPlus();
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager->AddProcess(new G4MuIonisation52, -1, 1,1);
pmanager->AddProcess(new G4MuBremsstrahlung52, -1,-1,2);
pmanager->AddProcess(new G4MuPairProduction52, -1,-1,3);
/// pmanager->AddProcess(new G4MuNuclearInteraction,-1,-1,4);
particle = G4MuonMinus::MuonMinus();
pmanager = particle->GetProcessManager();
pmanager->AddProcess(new G4MuIonisation52, -1, 1,1);
pmanager->AddProcess(new G4MuBremsstrahlung52, -1,-1,2);
pmanager->AddProcess(new G4MuPairProduction52, -1,-1,3);
/// pmanager->AddProcess(new G4MuNuclearInteraction,-1,-1,4);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,84 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysListEmStandard.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListEmStandard.hh"
#include "G4ParticleDefinition.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4ProcessManager.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4MuNuclearInteraction.hh"
#include "G4LossTableManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmStandard::PhysListEmStandard(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmStandard::~PhysListEmStandard()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListEmStandard::ConstructProcess()
{
// Add standard EM Processes for Muon
G4ParticleDefinition* particle = G4MuonPlus::MuonPlus();
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager->AddProcess(new G4MuIonisation, -1, 1,1);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2,2);
pmanager->AddProcess(new G4MuPairProduction, -1, 3,3);
/// pmanager->AddProcess(new G4MuNuclearInteraction,-1,-1,4);
particle = G4MuonMinus::MuonMinus();
pmanager = particle->GetProcessManager();
pmanager->AddProcess(new G4MuIonisation, -1, 1,1);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2,2);
pmanager->AddProcess(new G4MuPairProduction, -1, 3,3);
/// pmanager->AddProcess(new G4MuNuclearInteraction,-1,-1,4);
//extend binning of PhysicsTables
//
G4LossTableManager::Instance()->SetMaxEnergy(1000.0*PeV);
G4LossTableManager::Instance()->SetDEDXBinning(220);
G4LossTableManager::Instance()->SetLambdaBinning(220);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,19 +21,53 @@
// ********************************************************************
//
//
// $Id: PhysListParticles.cc,v 1.1 2003/04/22 16:25:07 maire Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: PhysicsList.cc,v 1.1 2004/06/14 10:09:26 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListParticles.hh"
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "PhysListEmStandard.hh"
#include "PhysListEmG4v52.hh"
#include "G4LossTableManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList() : G4VModularPhysicsList()
{
SetVerboseLevel(1);
pMessenger = new PhysicsListMessenger(this);
// cuts
currentDefaultCut = 1.0*mm;
cutForGamma = currentDefaultCut;
cutForElectron = currentDefaultCut;
cutForPositron = currentDefaultCut;
// EM physics
emName = G4String("standard");
emPhysicsList = new PhysListEmStandard(emName);
// instanciate EnergyLossTable
G4LossTableManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::~PhysicsList()
{
delete pMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
// leptons
#include "G4MuonPlus.hh"
@@ -73,33 +107,15 @@
#include "G4He3.hh"
#include "G4GenericIon.hh"
#include "IonC12.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListParticles::PhysListParticles(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListParticles::~PhysListParticles()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListParticles::ConstructParticle()
void PhysicsList::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
// leptons
G4Electron::ElectronDefinition();
@@ -137,7 +153,96 @@ void PhysListParticles::ConstructParticle()
G4He3::He3Definition();
G4Alpha::AlphaDefinition();
G4GenericIon::GenericIonDefinition();
IonC12::IonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructProcess()
{
// transportation
//
AddTransportation();
// electromagnetic Physics List
//
emPhysicsList->ConstructProcess();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddPhysicsList(const G4String& name)
{
if (verboseLevel>1) {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
}
if (name == emName) return;
if (name == "standard") {
emName = name;
delete emPhysicsList;
emPhysicsList = new PhysListEmStandard(name);
} else if (name == "g4v52") {
emName = name;
delete emPhysicsList;
emPhysicsList = new PhysListEmG4v52(name);
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForPositron, "e+");
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
void PhysicsList::SetCutForGamma(G4double cut)
{
cutForGamma = cut;
SetParticleCuts(cutForGamma, G4Gamma::Gamma());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForElectron(G4double cut)
{
cutForElectron = cut;
SetParticleCuts(cutForElectron, G4Electron::Electron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForPositron(G4double cut)
{
cutForPositron = cut;
SetParticleCuts(cutForPositron, G4Positron::Positron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PhysicsListMessenger.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListMessenger.hh"
#include "PhysicsList.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAString.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:pPhysicsList(pPhys)
{
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/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);
electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/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);
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/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);
allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/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);
pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
pListCmd->SetGuidance("Add modula physics list.");
pListCmd->SetParameterName("PList",false);
pListCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::~PhysicsListMessenger()
{
delete gammaCutCmd;
delete electCutCmd;
delete protoCutCmd;
delete allCutCmd;
delete pListCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == gammaCutCmd )
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
if( command == electCutCmd )
{ pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
if( command == protoCutCmd )
{ pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
if( command == allCutCmd )
{
G4double cut = allCutCmd->GetNewDoubleValue(newValue);
pPhysicsList->SetCutForGamma(cut);
pPhysicsList->SetCutForElectron(cut);
pPhysicsList->SetCutForPositron(cut);
}
if( command == pListCmd )
{ pPhysicsList->AddPhysicsList(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "G4Event.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
:detector(det)
{
particleGun = new G4ParticleGun(1);
G4ParticleDefinition* particle
= G4ParticleTable::GetParticleTable()->FindParticle("mu+");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleEnergy(10*TeV);
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete particleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
G4double halfSize = 0.5*(detector->GetSize());
G4double x0 = - halfSize;
//randomize (y0,z0)
//
G4double beam = 0.8*halfSize;
G4double y0 = (2*G4UniformRand()-1.)*beam;
G4double z0 = (2*G4UniformRand()-1.)*beam;
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,265 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RunAction.hh"
#include "DetectorConstruction.hh"
#include "PrimaryGeneratorAction.hh"
#include "HistoManager.hh"
#include "MuCrossSections.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
#include "Randomize.hh"
#ifdef USE_AIDA
#include "AIDA/AIDA.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim,
HistoManager* HistM)
: detector(det), primary(prim), ProcCounter(0), histoManager(HistM)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
// save Rndm status
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
HepRandom::showEngineStatus();
ProcCounter = new ProcessesCount;
#ifdef G4ANALYSIS_USE
histoManager->SetFactory();
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::CountProcesses(G4String procName)
{
//does the process already encounted ?
size_t nbProc = ProcCounter->size();
size_t i = 0;
while ((i<nbProc)&&((*ProcCounter)[i]->GetName()!=procName)) i++;
if (i == nbProc) ProcCounter->push_back( new OneProcessCount(procName));
(*ProcCounter)[i]->Count();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run* aRun)
{
G4int NbOfEvents = aRun->GetNumberOfEvent();
if (NbOfEvents == 0) return;
std::ios::fmtflags mode = G4cout.flags();
G4int prec = G4cout.precision(2);
G4Material* material = detector->GetMaterial();
G4double length = detector->GetSize();
G4double density = material->GetDensity();
G4String particle = primary->GetParticleGun()->GetParticleDefinition()
->GetParticleName();
G4double energy = primary->GetParticleGun()->GetParticleEnergy();
G4cout << "\n The run consists of " << NbOfEvents << " "<< particle << " of "
<< G4BestUnit(energy,"Energy") << " through "
<< G4BestUnit(length,"Length") << " of "
<< material->GetName() << " (density: "
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
//total number of process calls
G4double countTot = 0.;
G4cout << "\n Number of process calls --->";
for (size_t i=0; i< ProcCounter->size();i++) {
G4String procName = (*ProcCounter)[i]->GetName();
if (procName != "Transportation") {
G4int count = (*ProcCounter)[i]->GetCounter();
G4cout << "\t" << procName << " : " << count;
countTot += count;
}
}
G4cout << G4endl;
//compute totalCrossSection, meanFreePath and massicCrossSection
//
G4double totalCrossSection = countTot/(NbOfEvents*length);
G4double MeanFreePath = 1./totalCrossSection;
G4double massCrossSection =totalCrossSection/density;
G4cout.precision(5);
G4cout << "\n Simulation: "
<< "total CrossSection = " << totalCrossSection*cm << " /cm"
<< "\t MeanFreePath = " << G4BestUnit(MeanFreePath,"Length")
<< "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g"
<< G4endl;
//compute theoritical predictions
//
totalCrossSection = 0.;
for (size_t i=0; i< ProcCounter->size();i++) {
G4String procName = (*ProcCounter)[i]->GetName();
if (procName != "Transportation")
totalCrossSection += ComputeTheory(procName, NbOfEvents);
}
MeanFreePath = 1./totalCrossSection;
massCrossSection = totalCrossSection/density;
G4cout << " Theory: "
<< "total CrossSection = " << totalCrossSection*cm << " /cm"
<< "\t MeanFreePath = " << G4BestUnit(MeanFreePath,"Length")
<< "\t massicCrossSection = " << massCrossSection*g/cm2 << " cm2/g"
<< G4endl;
G4cout.setf(mode,std::ios::floatfield);
G4cout.precision(prec);
// delete and remove all contents in ProcCounter
while (ProcCounter->size()>0){
OneProcessCount* aProcCount=ProcCounter->back();
ProcCounter->pop_back();
delete aProcCount;
}
delete ProcCounter;
#ifdef G4ANALYSIS_USE
histoManager->SaveFactory();
#endif
// show Rndm status
HepRandom::showEngineStatus();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double RunAction::ComputeTheory(G4String process, G4int NbOfMu)
{
G4Material* material = detector->GetMaterial();
G4double length = detector->GetSize();
G4double ekin = primary->GetParticleGun()->GetParticleEnergy();
MuCrossSections crossSections;
G4int id = 0; G4double cut = 0.;
if (process == "MuIoni") { id = 1; cut = GetEnergyCut(material,1); }
if (process == "MuPairProd") { id = 2; cut = 2*GetEnergyCut(material,1); }
if (process == "MuBrems") { id = 3; cut = GetEnergyCut(material,0); }
if (process == "MuNucl") id = 4;
if (id == 0) return 0.;
G4int nbOfBins = 100;
G4double binMin = -10., binMax = 0., binWidth = (binMax-binMin)/nbOfBins;
#ifdef USE_AIDA
//create histo for theoritical crossSections, with same bining as simulation
//
const G4String label[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19"};
AIDA::IHistogram1D* histoMC = 0; AIDA::IHistogram1D* histoTh = 0;
if (histoManager->GetHisto(id)) {
histoMC = histoManager->GetHisto(id);
nbOfBins = (histoMC->axis()).bins();
binMin = (histoMC->axis()).lowerEdge();
binMax = (histoMC->axis()).upperEdge();
binWidth = (binMax-binMin)/nbOfBins;
G4String labelTh = label[MaxHisto + id];
G4String titleTh = histoMC->title() + " (Th)";
histoTh = histoManager->GetHistogramFactory()
->createHistogram1D(labelTh,titleTh,nbOfBins,binMin,binMax);
}
#endif
//compute and plot differential crossSection, as function of energy transfert.
//compute and return integrated crossSection for a given process.
//(note: to compare with simulation, the integrated crossSection is function
// of the energy cut.)
//
G4double lgeps, etransf, sigmaE, dsigma, NbProcess;
G4double sigmaTot = 0.;
const G4double ln10 = log(10);
for (G4int ibin=0; ibin<nbOfBins; ibin++) {
lgeps = binMin + (ibin+0.5)*binWidth;
etransf = ekin*pow(10,lgeps);
sigmaE = crossSections.CR_Macroscopic(process,material,ekin,etransf);
dsigma = sigmaE*etransf*binWidth*ln10;
if (etransf > cut) sigmaTot += dsigma;
NbProcess = NbOfMu*length*dsigma;
#ifdef USE_AIDA
if (histoTh) histoTh->fill(lgeps,NbProcess);
#endif
}
#ifdef USE_AIDA
//compare simulation and theory
//
if (histoMC && histoTh) histoManager->GetHistogramFactory()
->divide(label[2*MaxHisto+id], *histoMC, *histoTh);
#endif
//return integrated crossSection
//
return sigmaTot;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProductionCutsTable.hh"
G4double RunAction::GetEnergyCut(G4Material* material, G4int idParticle)
{
G4ProductionCutsTable* table = G4ProductionCutsTable::GetProductionCutsTable();
size_t index = 0;
while ( (table->GetMaterialCutsCouple(index)->GetMaterial() != material) &&
(index < table->GetTableSize())) index++;
return (*(table->GetEnergyCutsVector(idParticle)))[index];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: StackingAction.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StackingAction.hh"
#include "G4Track.hh"
#include "G4TrackStatus.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::StackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::~StackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
StackingAction::ClassifyNewTrack(const G4Track* aTrack)
{
G4ClassificationOfNewTrack classification = fUrgent;
// kill all secondaries
if(aTrack->GetParentID() != 0) classification = fKill;
return classification;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingAction.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingAction.hh"
#include "RunAction.hh"
#include "HistoManager.hh"
#include "G4RunManager.hh"
#ifdef USE_AIDA
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::SteppingAction(RunAction* RuAct, HistoManager* Hist)
:runAction(RuAct), histoManager(Hist)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingAction::~SteppingAction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4StepPoint* endPoint = aStep->GetPostStepPoint();
G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName();
//count processes
//
runAction->CountProcesses(procName);
//plot energy transfered
//
G4StepPoint* startPoint = aStep->GetPreStepPoint();
G4double E0 = startPoint->GetKineticEnergy();
G4double edep = aStep->GetTotalEnergyDeposit();
G4double E1 = E0 - edep;
G4double E2 = endPoint->GetKineticEnergy();
G4double etrans = E1 - E2;
G4double lgepsE = 0.;
if (etrans > 0.) lgepsE = log10(etrans/E1);
#ifdef USE_AIDA
//
G4int id = 0;
if (procName == "MuIoni") id = 1;
if (procName == "MuPairProd") id = 2;
if (procName == "MuBrems") id = 3;
if (procName == "MuNucl") id = 4;
if ((id > 0) && (histoManager->GetHisto(id)))
histoManager->GetHisto(id)->fill(lgepsE);
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,177 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: SteppingVerbose.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingVerbose::SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingVerbose::~SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
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;
}
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")
<< " ";
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << " "
<< std::setw(10) << fStep->GetPostStepPoint()
->GetProcessDefinedStep()->GetProcessName();
} else {
G4cout << " UserLimit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
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;
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")
<< " ";
if(fTrack->GetNextVolume()){
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
G4cout << " initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,151 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: VisManager.cc,v 1.1 2004/06/14 10:09:27 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4VIS_USE
#include "VisManager.hh"
// Supported drivers...
// Not needing external packages or libraries...
#include "G4ASCIITree.hh"
#include "G4DAWNFILE.hh"
#include "G4GAGTree.hh"
#include "G4HepRepFile.hh"
#include "G4HepRep.hh"
#include "G4RayTracer.hh"
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
// Needing external packages or libraries...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
#ifdef G4VIS_USE_OIX
#include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
VisManager::VisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void VisManager::RegisterGraphicsSystems () {
// Graphics Systems not needing external packages or libraries...
RegisterGraphicsSystem (new G4ASCIITree);
RegisterGraphicsSystem (new G4DAWNFILE);
RegisterGraphicsSystem (new G4GAGTree);
RegisterGraphicsSystem (new G4HepRepFile);
RegisterGraphicsSystem (new G4HepRep);
RegisterGraphicsSystem (new G4RayTracer);
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
// Graphics systems needing external packages or libraries...
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
#ifdef G4VIS_USE_OIX
RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,30 @@
#
# Macro file for the initialization phase of "TestEm1.cc"
#
# Sets some default verbose
# and initializes the graphic.
#
/control/verbose 2
/run/verbose 2
#
/run/initialize
#
# Create empty scene ("world" is default)
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# Edit the next line(s) to choose another graphic system
#
/vis/open OGLIX
#
#/vis/open DAWNFILE
#
# Draw scene
/vis/viewer/zoom 1.4
/vis/viewer/flush
#
# for drawing the tracks
# if too many tracks cause core dump => storeTrajectory 0
/tracking/storeTrajectory 1
/vis/scene/endOfEventAction accumulate
@@ -0,0 +1,40 @@
# $Id: GNUmakefile,v 1.1 2004/04/28 11:09:04 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := PhotonProcesses
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
.PHONY: all
all: lib bin
#### G4ANALYSIS_USE := true
ifdef G4ANALYSIS_USE
USE_AIDA := true
endif
ifdef USE_AIDA
CPPFLAGS += -DG4ANALYSIS_USE
CPPFLAGS += -DUSE_AIDA
endif
include $(G4INSTALL)/config/architecture.gmk
ifdef USE_AIDA
# for the aida-config command see the README file
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
endif
include $(G4INSTALL)/config/binmake.gmk
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
@@ -0,0 +1,23 @@
$Id: History,v 1.3 2004/06/10 15:55:35 maire Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
PhotonProcesses History file
--------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
10.06.04 mma (photonprocesses-V06-01-01)
- modifs in HistoManager and messenger to allow a multiruns job.
23.04.04 Michel Maire (photonprocesses-V06-01-00)
- creation, from TestEm1
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhotonProcesses.cc,v 1.2 2004/06/10 15:55:35 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "SteppingVerbose.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "HistoManager.hh"
#ifdef G4VIS_USE
#include "VisManager.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv) {
//choose the Random engine
HepRandom::setTheEngine(new RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new SteppingVerbose);
// Construct the default run manager
G4RunManager * runManager = new G4RunManager;
// set mandatory initialization classes
DetectorConstruction* det;
PrimaryGeneratorAction* prim;
runManager->SetUserInitialization(det = new DetectorConstruction);
runManager->SetUserInitialization(new PhysicsList);
runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
#ifdef G4VIS_USE
// visualization manager
G4VisManager* visManager = new VisManager;
visManager->Initialize();
#endif
HistoManager* histo = 0;
#ifdef G4ANALYSIS_USE
histo = new HistoManager();
#endif
// set user action classes
RunAction* run;
runManager->SetUserAction(run = new RunAction(det,prim,histo));
runManager->SetUserAction(new EventAction);
runManager->SetUserAction(new SteppingAction(run,histo));
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
if (argc==1) // Define UI terminal for interactive mode
{
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
session->SessionStart();
delete session;
}
else // Batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
// job termination
#ifdef G4ANALYSIS_USE
delete histo;
#endif
#ifdef G4VIS_USE
delete visManager;
#endif
delete runManager;
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,20 @@
# $Id: PhotonProcesses.in,v 1.1 2004/04/28 11:09:05 maire Exp $
#
# Macro file for "PhotonProcesses.cc"
# (can be run in batch, without graphic)
#
# photon 100 keV; all processes
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Water
/testem/det/setSize 100 m
#
/run/initialize
#
/gun/energy 100 keV
#
/testem/event/printModulo 10000
#
/run/beamOn 100000
@@ -0,0 +1,143 @@
$Id: README,v 1.3 2004/06/23 11:28:26 maire Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
PhotonProcesses
---------------
This test is devoted to the photon processes: gamma conversion, coherent
and incoherent scattering, photoelectric effect. It allows to compute
absorption coefficients and to plot final state.
1- GEOMETRY DEFINITION
It is a single box representing a 'semi infinite' homogeneous medium.
Two parameters define the geometry :
- the material of the box,
- the (full) size of the box.
The default geometry (100 m of water) is constructed in
DetectorConstruction, but the above parameters can be changed
interactively via the commands defined in DetectorMessenger.
2- PHYSICS LIST
The particle list contains only gamma, e+, e-, mu+, mu-.
The physics list contains the 'standard' electromagnetic processes.
3- AN EVENT : THE PRIMARY GENERATOR
The primary kinematic consists of a single particle starting at the edge
of the box. The type of the particle and its energy are set in
PrimaryGeneratorAction (1 MeV gamma), and can be changed via the G4
build-in commands of ParticleGun class (see the macros provided with
this example).
4- PHYSICS
The incident particle is a photon. The event is killed at the first
interaction of the photon.
The absorption length is computed as the mean value of the track length
of the photon.
The energy spectrum and the angular distribution of the scattered photon
(if any) and of the secondaries are plotted (see SteppingAction).
A set of macros defining various run conditions are provided.
The processes are actived/inactived in order to survey the processes
individually.
5- HISTOGRAMS
The test contains 6 built-in 1D histograms, which are managed by the
HistoManager class and its Messenger. The histos can be individually
activated with the command :
/testem/histo/setHisto id nbBins valMin valMax unit
where unit is the desired unit for the histo (MeV or keV, etc..)
(see the macros xxxx.mac).
1 "scattered primary particle: energy spectrum"
2 "scattered primary particle: costheta distribution"
3 "charged secondaries: energy spectrum"
4 "charged secondaries: costheta distribution"
5 "neutral secondaries: energy spectrum"
6 "neutral secondaries: costheta distribution"
The histograms can be viewed using PAW. See below the note on
ANAPHE+AIDA.
One can control the name of the histograms file with the command:
/testem/histo/setFileName name (default photonprocesses.paw)
Note that, by default, histograms are disabled. To activate them,
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
6- VISUALIZATION
The Visualization Manager is set in the main().
The initialisation of the drawing is done via the commands
/vis/... in the macro vis.mac. To get visualisation:
> /control/execute vis.mac
The detector has a default view which is a longitudinal view of the
box.
The tracks are drawn at the end of event, and erased at the end of run.
7- HOW TO START ?
compile and link to generate an executable
% cd geant4/examples/extended/electromagnetic/PhotonProcesses
% gmake
execute PhotonProcesses in 'batch' mode from macro files :
% PhotonProcesses compt.mac
execute PhotonProcesses in 'interactive mode' with visualization :
% PhotonProcesses
Idle> control/execute vis.mac
....
Idle> type your commands
....
Idle> exit
8- Using histograms
-------------------
By default the histograms are not activated. To activate histograms
the environment variable G4ANALYSIS_USE should be defined. For instance
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
To use histograms any of implementations of AIDA interfaces should
be available (see http://aida.freehep.org).
A package including AIDA and extended interfaces also using Python
is PI, available from: http://cern.ch/pi .
Once installed PI or PI-Lite in a specified local area $MYPY, it is
required to add the installation path to $PATH, i.e. for example,
for release 1.2.1 of PI:
setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
CERN users can use the PATH to the LCG area on AFS.
Before compilation of the example it is optimal to clean up old
files:
gmake histclean
gmake
Before running the example the command should be issued:
eval `aida-config --runtime csh`
It is possible to choose the format of the output file with
histograms using UI command:
/testem/histo/setFileType type
The following types are available: hbook, root, xml.
@@ -0,0 +1,20 @@
# $Id: allproceses.mac,v 1.1 2004/04/28 11:09:06 maire Exp $
#
# Macro file for "PhotonProcesses.cc"
# (can be run in batch, without graphic)
#
# photon 100 keV; all processes
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Water
/testem/det/setSize 100 m
#
/run/initialize
#
/gun/energy 100 keV
#
/testem/event/printModulo 10000
#
/run/beamOn 100000
@@ -0,0 +1,29 @@
# $Id: compton.mac,v 1.1 2004/04/28 11:09:06 maire Exp $
#
# Macro file for "PhotonProcesses.cc"
# (can be run in batch, without graphic)
#
# photon 300 keV; compton
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Aluminium
#
/run/initialize
#
/process/inactivate phot
/process/inactivate conv
/process/inactivate GammaToMuPair
#
/gun/energy 300 keV
#
/testem/histo/setFileName compton.paw
/testem/histo/setHisto 1 100 0. 300. keV #energy of primary
/testem/histo/setHisto 2 200 -1. +1. none #costeta of primary
/testem/histo/setHisto 3 100 0. 300. keV #energy of ch. secondary
/testem/histo/setHisto 4 200 -1. +1. none #costeta of ch. secondary
#
/testem/event/printModulo 10000
#
/run/beamOn 100000
@@ -0,0 +1,27 @@
# $Id: conv.mac,v 1.2 2004/06/10 15:55:36 maire Exp $
#
# Macro file for "PhotonProcesses.cc"
# (can be run in batch, without graphic)
#
# photon 100 MeV; gamma conversion to e+e-
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Lead
#
/run/initialize
#
/process/inactivate phot
/process/inactivate compt
/process/inactivate GammaToMuPair
#
/gun/energy 100 MeV
#
/testem/histo/setFileName conv.paw
/testem/histo/setHisto 3 200 0. 100. MeV #energy of ch. secondaries
/testem/histo/setHisto 4 200 0. +1. none #costeta of ch. secondaries
#
/testem/event/printModulo 10000
#
/run/beamOn 100000
@@ -0,0 +1,28 @@
# $Id: convtomu.mac,v 1.1 2004/04/28 11:09:07 maire Exp $
#
# Macro file for "PhotonProcesses.cc"
# (can be run in batch, without graphic)
#
# photon 100 TeV; gamma conversion to mu+mu-
#
/control/verbose 2
/run/verbose 2
#
/testem/det/setMat Iron
/testem/det/setSize 10 km
#
/run/initialize
#
/process/inactivate phot
/process/inactivate compt
/process/inactivate conv
#
/gun/energy 100 TeV
#
/testem/histo/setFileName convtomu.paw
/testem/histo/setHisto 3 200 0. 100. TeV #energy of ch. secondaries
/testem/histo/setHisto 4 100 0.9 1.1 none #costeta of ch. secondaries
#
/testem/event/printModulo 10000
#
/run/beamOn 100000
@@ -0,0 +1,44 @@
photonprocesses is the geant3 equivalent of PhotonProcesses
% cd geant3
% gmakeB to make an executable (Batch version)
% gmakeT to make an executable (inTeractive version)
To execute:
% cd geant3
% $G4SYSTEM/photonprocesses.xb (for batch) or photonprocesses.xt (for interactive)
The program will ask:
G3 > gives the filename of the data cards to be read:
myMacro.dat (myMacro.dat is the equivalent of the G4 myMacro.mac)
data cards
----------
Most of the data cards used in xxxx.dat are standard data cards of GEANT3,
but some of them are defined in testem5:
KEY VARIABLE/type Short description
FILE fileName (character) fileName of the histos
(the FILE data card should be the
first, with the format A4,A2,A25)
DETECTOR MAT (integer) mat.number of the absorber
THICK (real) X thickness of the absorber
histograms
----------
The list of built-in histograms is identical to TestEm5.cc
(see G4 README or histo.F)
One can control the binning of the histograms with the data card:
*HISTO id1 nbBins valMin valMax valUnit
*HISTO id2 nbBins valMin valMax valUnit
... etc ...........
valMin and ValMax are given in the desired unit, whose numerical value must
be specified in valUnit. Remember that Geant3 defaults are: GeV, cm, rad.
@@ -0,0 +1,18 @@
FILE allprocesses.paw
LIST
C
C Photon Processes; gamma 1 MeV
C
DETECTOR 3 (Water) 10000. (cm)
KINE 1 (gamma) 0.001 (GeV)
C
PHOT 1
COMP 1
PAIR 1
C
CUTS 10.e-6 (cutgam) 10.e-6 (cutele)
C
SWIT 0 (draw)
DEBUG 10 5 10000
C
TRIG 100000
@@ -0,0 +1,23 @@
FILE compton.paw
LIST
C
C Photon 300 keV; compton
C
DETECTOR 5 (Aluminium) 10000. (cm)
KINE 1 (gamma) 300.e-6 (GeV)
C
*HISTO 1 (id) 100 (nbins) 0. (Emin) 300. (Emax) 1.e-6 (keV)
*HISTO 2 (id) 200 (nbins) -1. (cost1) +1. (cost2)
*HISTO 3 (id) 100 (nbins) 0. (Emin) 300. (Emax) 1.e-6 (keV)
*HISTO 4 (id) 200 (nbins) -1. (cost1) +1. (cost2)
C
PHOT 0
COMP 1
PAIR 0
C
CUTS 10.e-6 (cutgam) 10.e-6 (cutele)
C
SWIT 0 (draw)
DEBUG 10 5 10000
C
TRIG 100000
@@ -0,0 +1,21 @@
FILE conversion.paw
LIST
C
C Photon 100 MeV; gamma conversion to e+e-
C
DETECTOR 8 (Lead) 10000. (cm)
KINE 1 (gamma) 0.1 (GeV)
C
*HISTO 3 (id) 200 (nbins) 0. (Emin) 100. (Emax) 1.e-3 (MeV)
*HISTO 4 (id) 200 (nbins) 0. (cost1) +1. (cost2)
C
PHOT 0
COMP 0
PAIR 1
C
CUTS 10.e-6 (cutgam) 10.e-6 (cutele)
C
SWIT 0 (draw)
DEBUG 10 5 10000
C
TRIG 100000
@@ -0,0 +1,32 @@
#
# @(#) Script to build a Batch geant executable
#
set name=photonprocesses
set extnam=" "
if ($G4SYSTEM == AIX-AFS) set extnam=-qextname
#
mkdir $G4SYSTEM
cd $G4SYSTEM
#
# fortran compilation
#
hepf77 $extnam -c -g -Dbatch -I/cern/pro/include -I../include ../src/*.F
#
# Link
#
echo 'linking geant3+cernlib libraries ...'
#
hepf77 $extnam -g -o $name.xb *.o \
`cernlib geant321 pawlib graflib packlib mathlib kernlib`
#
#
chmod +x $name.xb
#
# cleanup
#
rm -f *.o
echo 'done'
exit
@@ -0,0 +1,31 @@
#
# @(#) Script to build an inTeractive geant executable
#
set name=photonprocesses
set extnam=" "
if ($G4SYSTEM == AIX-AFS) set extnam=-qextname
#
mkdir $G4SYSTEM
cd $G4SYSTEM
#
# fortran compilation
#
hepf77 $extnam -c -g -I/cern/pro/include -I../include ../src/*.F
#
# Link
#
echo 'linking geant3+cernlib libraries...'
#
hepf77 $extnam -g -o $name.xt *.o \
`cernlib geant321 pawlib graflib packlib mathlib kernlib`
#
#
chmod +x $name.xt
#
# cleanup
#
rm -f *.o
echo 'done'
exit
@@ -0,0 +1,6 @@
COMMON/DETECTOR/Imat,BoxSize
*
* Imat = GEANT material number. (data card DETECTOR)
* BoxSize = total size of the box (cm) (data card DETECTOR)
*
@@ -0,0 +1,8 @@
CHARACTER*25 fileName
COMMON/HISTO1/fileName
COMMON/HISTO2/idhist,nbBins,valmin,valmax,valunit
PARAMETER (MaxHist = 6)
LOGICAL histo
COMMON/HISTO3/histo(MaxHist),histUnit(MaxHist),binWidth(MaxHist)
@@ -0,0 +1,2 @@
COMMON/PROCESS/nbCall(12),sumTrak,sumTrak2
@@ -0,0 +1,11 @@
SUBROUTINE FFUSER(ikey)
*
* The routine is called when a *key card is read
*
CHARACTER*4 keyw
*
call UHTOC(ikey,4,keyw,4)
if (keyw.eq.'HIST') call uhinit
*
END
@@ -0,0 +1,267 @@
SUBROUTINE GTGAMA
C.
C. ******************************************************************
C. * *
C. * Photon track. Computes step size and propagates particle *
C. * through step. *
C. * *
C. * ==>Called by : GTRACK *
C. * Authors R.Brun, F.Bruyant L.Urban ******** *
C. * *
C. ******************************************************************
C.
#include "geant321/gcbank.inc"
#include "geant321/gccuts.inc"
#include "geant321/gcjloc.inc"
#include "geant321/gconsp.inc"
#include "geant321/gcphys.inc"
#include "geant321/gcstak.inc"
#include "geant321/gctmed.inc"
#include "geant321/gcmulo.inc"
#include "geant321/gctrak.inc"
#include "geant321/gcunit.inc"
PARAMETER (EPSMAC=1.E-6)
DOUBLE PRECISION ONE,XCOEF1,XCOEF2,XCOEF3,ZERO
PARAMETER (ONE=1,ZERO=0)
PARAMETER (EPCUT=1.022E-3)
C.
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IABAN = NINT(DPHYS1)
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
C. ------------------------------------------------------------------
*
* *** Particle below energy threshold ? Short circuit
*
*
IF (GEKIN.LE.CUTGAM) GOTO 998
*
* *** Update local pointers if medium has changed
*
IF(IUPD.EQ.0)THEN
IUPD = 1
JPHOT = LQ(JMA-6)
JCOMP = LQ(JMA-8)
JPAIR = LQ(JMA-10)
JPFIS = LQ(JMA-12)
JRAYL = LQ(JMA-13)
ENDIF
*
* *** Compute current step size
*
IPROC = 103
STEP = STEMAX
GEKRT1 = 1 .-GEKRAT
*
* ** Step limitation due to pair production ?
*
IF (GETOT.GT.EPCUT) THEN
IF (IPAIR.GT.0) THEN
STEPPA = GEKRT1*Q(JPAIR+IEKBIN) +GEKRAT*Q(JPAIR+IEKBIN+1)
SPAIR = STEPPA*ZINTPA
IF (SPAIR.LT.STEP) THEN
STEP = SPAIR
IPROC = 6
ENDIF
ENDIF
ENDIF
*
* ** Step limitation due to Compton scattering ?
*
IF (ICOMP.GT.0) THEN
STEPCO = GEKRT1*Q(JCOMP+IEKBIN) +GEKRAT*Q(JCOMP+IEKBIN+1)
SCOMP = STEPCO*ZINTCO
IF (SCOMP.LT.STEP) THEN
STEP = SCOMP
IPROC = 7
ENDIF
ENDIF
*
* ** Step limitation due to photo-electric effect ?
*
IF (GEKIN.LT.0.4) THEN
IF (IPHOT.GT.0) THEN
STEPPH = GEKRT1*Q(JPHOT+IEKBIN) +GEKRAT*Q(JPHOT+IEKBIN+1)
SPHOT = STEPPH*ZINTPH
IF (SPHOT.LT.STEP) THEN
STEP = SPHOT
IPROC = 8
ENDIF
ENDIF
ENDIF
*
* ** Step limitation due to photo-fission ?
*
IF (JPFIS.GT.0) THEN
STEPPF = GEKRT1*Q(JPFIS+IEKBIN) +GEKRAT*Q(JPFIS+IEKBIN+1)
SPFIS = STEPPF*ZINTPF
IF (SPFIS.LT.STEP) THEN
STEP = SPFIS
IPROC = 23
ENDIF
ENDIF
*
* ** Step limitation due to Rayleigh scattering ?
*
IF (IRAYL.GT.0) THEN
IF (GEKIN.LT.0.01) THEN
STEPRA = GEKRT1*Q(JRAYL+IEKBIN) +GEKRAT*Q(JRAYL+IEKBIN+1)
SRAYL = STEPRA*ZINTRA
IF (SRAYL.LT.STEP) THEN
STEP = SRAYL
IPROC = 25
ENDIF
ENDIF
ENDIF
*
IF (STEP.LT.0.) STEP = 0.
*
* ** Step limitation due to geometry ?
*
IF (STEP.GE.SAFETY) THEN
CALL GTNEXT
IF (IGNEXT.NE.0) THEN
STEP = SNEXT + PREC
INWVOL= 2
IPROC = 0
NMEC = 1
LMEC(1)=1
ENDIF
*
* Update SAFETY in stack companions, if any
IF (IQ(JSTAK+3).NE.0) THEN
DO 10 IST = IQ(JSTAK+3),IQ(JSTAK+1)
JST = JSTAK +3 +(IST-1)*NWSTAK
Q(JST+11) = SAFETY
10 CONTINUE
IQ(JSTAK+3) = 0
ENDIF
*
ELSE
IQ(JSTAK+3) = 0
ENDIF
*
* *** Linear transport
*
IF (INWVOL.EQ.2) THEN
DO 20 I = 1,3
VECTMP = VECT(I) +STEP*VECT(I+3)
IF(VECTMP.EQ.VECT(I)) THEN
*
* *** Correct for machine precision
*
IF(VECT(I+3).NE.0.) THEN
VECTMP = VECT(I)+ABS(VECT(I))*SIGN(1.,VECT(I+3))*
+ EPSMAC
IF(NMEC.GT.0) THEN
IF(LMEC(NMEC).EQ.104) NMEC=NMEC-1
ENDIF
NMEC=NMEC+1
LMEC(NMEC)=104
#ifdef G3DEBUG
WRITE(CHMAIL, 10000)
CALL GMAIL(0,0)
WRITE(CHMAIL, 10100) GEKIN, NUMED, STEP, SNEXT
CALL GMAIL(0,0)
10000 FORMAT(' Boundary correction in GTGAMA: ',
+ ' GEKIN NUMED STEP SNEXT')
10100 FORMAT(31X,E10.3,1X,I10,1X,E10.3,1X,E10.3,1X)
#endif
ENDIF
ENDIF
VECT(I) = VECTMP
20 CONTINUE
ELSE
DO 30 I = 1,3
VECT(I) = VECT(I) +STEP*VECT(I+3)
30 CONTINUE
ENDIF
*
SLENG = SLENG +STEP
*
* *** Update time of flight
*
TOFG = TOFG +STEP/CLIGHT
*
* *** Update interaction probabilities
*
IF (GETOT.GT.EPCUT) THEN
IF (IPAIR.GT.0) ZINTPA = ZINTPA -STEP/STEPPA
ENDIF
IF (ICOMP.GT.0) ZINTCO = ZINTCO -STEP/STEPCO
IF (GEKIN.LT.0.4) THEN
IF (IPHOT.GT.0) ZINTPH = ZINTPH -STEP/STEPPH
ENDIF
IF (JPFIS.GT.0) ZINTPF = ZINTPF -STEP/STEPPF
IF (IRAYL.GT.0) THEN
IF (GEKIN.LT.0.01) ZINTRA = ZINTRA -STEP/STEPRA
ENDIF
*
IF (IPROC.EQ.0) GO TO 999
NMEC = 1
LMEC(1) = IPROC
*
* ** Pair production ?
*
IF (IPROC.EQ.6) THEN
CALL GPAIRG
*
* ** Compton scattering ?
*
ELSE IF (IPROC.EQ.7) THEN
CALL GCOMP
*
* ** Photo-electric effect ?
*
ELSE IF (IPROC.EQ.8) THEN
*
IF ((IABAN.NE.0).AND.(GEKIN.LE.0.001)) THEN
* Calculate range of the photoelectron ( with kin. energy Ephot)
JCOEF = LQ(JMA-17)
IF(GEKRAT.LT.0.7) THEN
I1 = MAX(IEKBIN-1,1)
ELSE
I1 = MIN(IEKBIN,NEKBIN-1)
ENDIF
I1 = 3*(I1-1)+1
XCOEF1 = Q(JCOEF+I1)
XCOEF2 = Q(JCOEF+I1+1)
XCOEF3 = Q(JCOEF+I1+2)
IF(XCOEF1.NE.0.) THEN
STOPMX = -XCOEF2+SIGN(ONE,XCOEF1)*SQRT(XCOEF2**2 - (XCOEF3-
+ GEKIN/XCOEF1))
ELSE
STOPMX = - (XCOEF3-GEKIN)/XCOEF2
ENDIF
*
* DO NOT call GPHOT if this (overestimated) range is smaller
* than SAFETY
*
IF (STOPMX.LE.SAFETY) GOTO 998
ENDIF
CALL GPHOT
*
* ** Rayleigh effect ?
*
ELSE IF (IPROC.EQ.25) THEN
CALL GRAYL
*
* ** Photo-fission ?
*
ELSE IF (IPROC.EQ.23) THEN
CALL GPFIS
*
ENDIF
*
GOTO 999
998 DESTEP = GEKIN
GEKIN = 0.
GETOT = 0.
VECT(7)= 0.
ISTOP = 2
NMEC = 1
LMEC(1)= 30
999 END
@@ -0,0 +1,40 @@
SUBROUTINE GUKINE
*
* Generates Kinematics for primary track
*
* Data card Kine : Itype Ekine
*
#include "geant321/gcbank.inc"
#include "geant321/gcflag.inc"
#include "geant321/gckine.inc"
*
#include "detector.inc"
*
DIMENSION vertex(3),Plab(3)
dimension rndm(2)
*
DATA vertex/3*0./
DATA Plab /3*0./
*
vertex(1) = -0.5*BoxSize
*
* random in YZ
beam = 0.4*BoxSize
call GRNDM (rndm,2)
*
vertex(2) = (2*rndm(1)-1.)*beam
vertex(3) = (2*rndm(2)-1.)*beam
*
CALL GSVERT(vertex,0,0,0,0,NVERT)
*
JPA = LQ(JPART-IKINE)
XMASS = Q(JPA+7)
Plab(1) = SQRT(PKINE(1)*(PKINE(1)+2*XMASS))
*
CALL GSKINE(Plab,IKINE,NVERT,0,0,NT)
*
* *** Kinematics debug
IF (IEVENT.EQ.1.OR.IDEBUG.NE.0) CALL GPRINT('KINE',0)
*
END
@@ -0,0 +1,18 @@
SUBROUTINE GUOUT
*
* User routine called at the end of each event
*
#include "geant321/gcflag.inc"
*
* *** drawing
*
#ifndef batch
IF (ISWIT(1).NE.0) THEN
CALL GDHEAD (110110,'PhotonProcesses',0.)
CALL GDSHOW (3)
CALL GDXYZ (0)
END IF
#endif
*
END
@@ -0,0 +1,67 @@
SUBROUTINE GUSTEP
*
* User routine called at the end of each tracking step
*
#include "geant321/gcflag.inc"
#include "geant321/gckine.inc"
#include "geant321/gcking.inc"
#include "geant321/gctrak.inc"
*
#include "process.inc"
#include "histo.inc"
*
character*20 cdum
*
* *** Debug event and store tracks for drawing
IF (IDEBUG.NE.0) CALL GPCXYZ
IF (IDEBUG.NE.0) CALL GPGKIN
IF ((ISWIT(1).EQ.1).AND.(CHARGE.NE.0.)) CALL GSXYZ
IF (ISWIT(1).EQ.2) CALL GSXYZ
*
* *** if no process: return
IF (NMEC.EQ.0) return
*
* *** count nb of invoked processes
DO IM = 1,NMEC
IPROC = LMEC(IM)
IF (IPROC.EQ.21) IPROC = 12
IF (IPROC.LE.12) NBCALL(IPROC) = NBCALL(IPROC)+1
ENDDO
*
* *** sum track length for photon processes
if ((iproc.eq.6).or.(iproc.eq.7).or.(iproc.eq.8)) then
sumTrak = sumTrak + sleng
sumTrak2 = sumTrak2 + sleng*sleng
endif
*
* *** plot final state
*
* scattered primary particle (if still alive)
if (istop.eq.0) then
id = 1
if (histo(id)) call hfill (id,gekin/histUnit(id),0.,1.)
id = 2
if (histo(id)) call hfill (id,vect(4),0.,1.)
endif
*
* *** secondaries
if (ngkine.gt.0) then
do lp = 1,ngkine
ipar = gkin(5,lp) + 0.1
call gfpart(ipar,cdum,ndum,gmass,gcharg,dum,dum,ndum)
ekin = gkin(4,lp) - gmass
pc = sqrt(gkin(1,lp)**2 + gkin(2,lp)**2 + gkin(3,lp)**2)
cost = gkin(1,lp)/pc
if (gcharg.ne.0.) id = 3
if (gcharg.eq.0.) id = 5
if (histo(id)) call hfill (id,ekin/histUnit(id),0.,1.)
id = id + 1
if (histo(id)) call hfill (id,cost,0.,1.)
enddo
endif
*
* *** stop the tracking
istop = 1
*
END
@@ -0,0 +1,61 @@
#ifdef batch
PROGRAM main
*
*
PARAMETER (NGBANK=100000, NHBOOK=10000)
COMMON/GCBANK/Q(NGBANK)
COMMON/PAWC /H(NHBOOK)
*
CALL GZEBRA( NGBANK)
CALL HLIMIT(-NHBOOK)
*
* *** initialize HIGZ
CALL HPLINT(0)
*
* *** GEANT initialisation
CALL UGINIT
*
* *** Start events processing
CALL GRUN
*
* *** End of RUN
CALL UGLAST
*
STOP
END
#else
PROGRAM main
*
* GEANT main program. To link with the MOTIF user interface
* the routine GPAWPP(NWGEAN,NWPAW) should be called, whereas
* the routine GPAW(NWGEAN,NWPAW) gives access to the basic
* graphics version.
*
PARAMETER (NWGEAN=3000000, NWPAW=1000000)
COMMON/GCBANK/GEANT(NWGEAN)
COMMON/PAWC /PAW (NWPAW)
*
*
CALL GPAW (NWGEAN,NWPAW)
*
END
*
SUBROUTINE qnext
END
*
SUBROUTINE czopen
END
*
SUBROUTINE cztcp
END
*
SUBROUTINE czclos
END
*
SUBROUTINE czputa
END
#endif
@@ -0,0 +1,74 @@
SUBROUTINE UGEOM
*
* *** Define user geometry set up
*
*
#include "detector.inc"
*
DIMENSION PAR(3)
DIMENSION Aair(2),Zair(2),Wair(2)
DIMENSION AH2O(2),ZH2O(2),WH2O(2)
*
* *** Air compound parameters
DATA Aair/14.01, 16.00/
DATA Zair/ 7. , 8. /
DATA Wair/ 0.7 , 0.3 /
*
* *** Air compound parameters
DATA AH2O/ 1.01, 16.00/
DATA ZH2O/ 1. , 8. /
DATA WH2O/ 2. , 1. /
*
* *** Defines USER perticular materials
CALL GSMIXT( 1,'Air' , Aair ,Zair, 1.29E-3, 2 , Wair)
CALL GSMATE( 2,'H2 Liquid', 1.01, 1., 0.0708 , 865., 790., 0,0)
CALL GSMIXT( 3,'Water' , AH2O ,ZH2O, 1.0 ,-2 , WH2O)
CALL GSMATE( 4,'Liquid Ar', 39.95, 18., 1.39 , 14.0, 84.0, 0,0)
CALL GSMATE( 5,'Aluminium', 26.98, 13., 2.7 , 8.9, 37.2, 0,0)
CALL GSMATE( 6,'Iron' , 55.85, 26., 7.87 , 1.76, 17.1, 0,0)
CALL GSMATE( 7,'Tungsten' ,183.85, 74., 19.30 , 0.35, 18.5, 0,0)
CALL GSMATE( 8,'Lead' ,207.19, 82., 11.35 , 0.56, 18.5, 0,0)
CALL GSMATE( 9,'Uranium' ,238.03, 92., 18.95 , 0.32, 12. , 0,0)
CALL GSMATE(10,'Germanium', 72.61, 32., 5.323 , 2.30, 16.6, 0,0)
*
* *** Defines USER tracking media parameters
IFIELD = 0
FIELDM = 0.
TMAXFD = 10.0
STEMAX = 1000.
DEEMAX = 0.20
EPSIL = 0.001
STMIN = 0.010
*
CALL GSTMED( 1,'Container',Imat, 0 ,IFIELD,FIELDM,TMAXFD,
* STEMAX,DEEMAX,EPSIL,STMIN, 0 , 0 )
*
*
* *** Geometry
PAR(1) = BoxSize/2.
PAR(2) = BoxSize/2.
PAR(3) = BoxSize/2.
CALL GSVOLU('aBox','BOX ',1,PAR,3,IVOL)
*
* *** Close geometry banks. (obligatory system routine)
CALL GGCLOS
*
*
* *** dessin
CALL GSATT ('*','SEEN',1)
*
DO IX = 1,3
CALL GDOPEN (IX)
SCALE = 18./BoxSize
PAXIS = 0.
SAXIS = 0.1*BoxSize
CALL GDRAWC ('aBox',IX,0.,10.,9.3,SCALE,SCALE)
CALL GDAXIS (PAXIS,PAXIS,PAXIS,SAXIS)
CALL GDSCAL (10. , 0.3)
CALL GDCLOS
END DO
*
END
@@ -0,0 +1,66 @@
SUBROUTINE UGINIT
*
* To initialise GEANT/USER program and read data cards
*
#include "detector.inc"
#include "process.inc"
#include "histo.inc"
*
CHARACTER*20 filnam
CHARACTER*4 key
CHARACTER*2 spaces
*
* *** Define the GEANT parameters
CALL GINIT
*
* histograms
do ih = 1,MaxHist
histo(ih) = .false.
enddo
*
* *** Detector definition
CALL FFKEY('DETECTOR',Imat,2,'MIXED')
*
* histograms
CALL FFKEY('HISTO',idhist,5,'MIXED')
*
* *** read data cards
PRINT *, 'G3 > gives the filename of the data cards to be read:'
READ (*,'(A)') filnam
IF (filnam.EQ.' ') filnam = 'allprocesses.dat'
OPEN (unit=5,file=filnam,status='unknown',form='formatted')
*
* filename should be 1st data card !
fileName = 'photonprocesses.paw'
READ(5,98)key,spaces,fileName
98 FORMAT(A4,A2,A25)
*
* *** read data cards
CALL GFFGO
*
write(6,99) fileName
99 FORMAT(/,15x,'histogram file --> Name: ',A25)
*
CALL GZINIT
CALL GPART
*
CALL GDINIT
*
* *** Geometry and materials description
CALL UGEOM
*
* *** Energy loss and cross-sections initialisations
CALL GPHYSI
*
CALL GPRINT('MATE',0)
CALL GPRINT('TMED',0)
CALL GPRINT('VOLU',0)
*
* *** initialisation of /process/
CALL VZERO (nbCall,12)
sumTrak = 0.
sumTrak2 = 0.
*
END
@@ -0,0 +1,63 @@
SUBROUTINE UGLAST
*
* Termination routine to print histograms and statistics
*
#include "geant321/gcflag.inc"
#include "geant321/gckine.inc"
#include "geant321/gctrak.inc"
*
#include "detector.inc"
#include "process.inc"
#include "histo.inc"
*
character*20 material, particle
character*4 unit
real massMFP, massAC
*
* *** run conditions
call gfmate(Imat,material,dum,dum,density,dum,dum,dum,ndum)
call gfpart(Ikine,particle,ndum,dum,dum,dum,dum,ndum)
call gevkev(pkine(1),energy,unit)
PRINT 750, ievent,particle,energy,unit,boxSize,material,density
*
* *** frequency of processes call
CALL UCTOH('MUNU',NAMEC(12),4,4)
PRINT 760,(NAMEC(I),I=1,12)
PRINT 761,(NBCALL(I),I=1,12)
*
* *** compute mean free path and related quantities
nbProc = nbcall(6) + nbcall(7) + nbcall(8)
avTrak = sumTrak /nbProc
avTrak2 = sumTrak2/nbProc
rms = sqrt(abs(avTrak2 - avTrak*avTrak))
AtteCoef = 1./avTrak
*
massMFP = avTrak*density
massAC = 1./massMFP
print 770, avTrak,rms,massMFP,AtteCoef,massAC
*
* *** geant termination
CALL GLAST
*
* *** close HIGZ file
CALL HPLEND
*
* *** histograms
CALL HRPUT(0,fileName,'N')
*
* *** formats
*
750 FORMAT(/,1X,'The run consists of ',I7,1X,A8,' of ',F7.2,A4,
+ ' throught',F10.2,' cm of ',A8,' (density: ',F7.3,' g/cm3)')
760 FORMAT(/,1X,'Frequency of process calls: ',
+ /,1X,12A8)
761 FORMAT( 1X,12I8,/)
770 FORMAT(/,1X,'MeanFreePath: ',F12.5,' cm +- ',F12.5,' cm',
+ 5X,'massic: ',F12.5,' g/cm2',
+ /,1X,'AttenuationCoef: ',F12.5,' cm^-1 ',15X,
+ 5X,'massic: ',F12.5,' cm2/g',/)
*
END
@@ -0,0 +1,28 @@
SUBROUTINE UHINIT
*
*
#include "histo.inc"
*
CHARACTER*50 title(6)
*
data title /
1 'scattered primary particle: energy spectrum',
2 'scattered primary particle: costheta distribution',
3 'charged secondaries: energy spectrum',
4 'charged secondaries: costheta distribution',
5 'neutral secondaries: energy spectrum',
6 'neutral secondaries: costheta distribution' /
*
if (histo(idhist)) call hdelet(idhist)
*
vmin = valmin
vmax = valmax
call hbook1(idhist,title(idhist),nbBins,vmin,vmax,0.)
*
histo (idhist) = .true.
binWidth(idhist) = (valmax-valmin)/nbBins
if (valunit.le.0.) valunit = 1.
histUnit(idhist) = valunit
*
END
@@ -0,0 +1,89 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorConstruction.hh,v 1.1 2004/04/28 11:11:54 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4LogicalVolume;
class G4Material;
class DetectorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
~DetectorConstruction();
public:
G4VPhysicalVolume* Construct();
void SetSize (G4double);
void SetMaterial (G4String);
void UpdateGeometry();
public:
const
G4VPhysicalVolume* GetWorld() {return pBox;};
G4double GetSize() {return BoxSize;};
G4Material* GetMaterial() {return aMaterial;};
void PrintParameters();
private:
G4VPhysicalVolume* pBox;
G4LogicalVolume* lBox;
G4double BoxSize;
G4Material* aMaterial;
DetectorMessenger* detectorMessenger;
private:
void DefineMaterials();
G4VPhysicalVolume* ConstructVolumes();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: DetectorMessenger.hh,v 1.1 2004/04/28 11:11:54 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef DetectorMessenger_h
#define DetectorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger: public G4UImessenger
{
public:
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
DetectorConstruction* Detector;
G4UIdirectory* testemDir;
G4UIdirectory* detDir;
G4UIcmdWithAString* MaterCmd;
G4UIcmdWithADoubleAndUnit* SizeCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: EventAction.hh,v 1.1 2004/04/28 11:11:54 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef EventAction_h
#define EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class EventActionMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class EventAction : public G4UserEventAction
{
public:
EventAction();
~EventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
void SetPrintModulo(G4int val) {printModulo = val;};
private:
G4int printModulo;
EventActionMessenger* eventMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -21,45 +21,40 @@
// ********************************************************************
//
//
// $Id: PhysListParticles.hh,v 1.2 2003/10/07 11:58:29 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: EventActionMessenger.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListParticles_h
#define PhysListParticles_h 1
#ifndef EventActionMessenger_h
#define EventActionMessenger_h 1
#include "G4VPhysicsConstructor.hh"
#include "G4UImessenger.hh"
#include "globals.hh"
class EventAction;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListParticles : public G4VPhysicsConstructor
class EventActionMessenger: public G4UImessenger
{
public:
PhysListParticles(const G4String& name = "particles");
~PhysListParticles();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
void ConstructParticle();
// This method is dummy.
void ConstructProcess() {};
public:
EventActionMessenger(EventAction*);
~EventActionMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
EventAction* eventAction;
G4UIdirectory* eventDir;
G4UIcmdWithAnInteger* PrintCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: HistoManager.hh,v 1.2 2004/06/10 15:55:36 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoManager_h
#define HistoManager_h 1
#ifdef USE_AIDA
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace AIDA {
class ITree;
class IHistogramFactory;
class IHistogram1D;
}
class HistoMessenger;
const G4int MaxHisto = 7;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager();
void SetFileName (G4String name) { fileName = name;};
void SetFactory ();
void SaveFactory ();
void SetHisto (G4int, G4int, G4double, G4double, G4String unit="none");
void RemoveHisto (G4int);
AIDA::ITree* GetTree() {return tree;}
AIDA::IHistogramFactory* GetHistogramFactory() {return hf;}
AIDA::IHistogram1D* GetHisto(G4int id) {return histo[id];}
G4double GetHistoUnit(G4int id) {return Unit[id];}
G4double GetBinWidth (G4int id) {return Width[id];}
private:
G4String fileName;
AIDA::ITree* tree;
AIDA::IHistogramFactory* hf;
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 factoryOn;
HistoMessenger* histoMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: HistoMessenger.hh,v 1.2 2004/06/10 15:55:36 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoMessenger_h
#define HistoMessenger_h 1
#ifdef G4ANALYSIS_USE
#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;
G4UIcommand* histoCmd;
G4UIcmdWithAnInteger* rmhistoCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: PhysListEmStandard.hh,v 1.1 2003/10/08 17:28:36 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PhysListEmStandard.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysicsList.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// 14.10.02 (V.Ivanchenko) provide modular list on base of old PhysicsList
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsList_h
#define PhysicsList_h 1
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
class G4VPhysicsConstructor;
class PhysicsListMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsList: public G4VModularPhysicsList
{
public:
PhysicsList();
~PhysicsList();
void ConstructParticle();
void ConstructProcess();
void AddPhysicsList(const G4String& name);
void SetCuts();
private:
G4String emName;
G4VPhysicsConstructor* emPhysicsList;
PhysicsListMessenger* messenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: PhysicsListMessenger.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListMessenger_h
#define PhysicsListMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class PhysicsList;
class G4UIdirectory;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListMessenger: public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList* );
~PhysicsListMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
PhysicsList* physicsList;
G4UIdirectory* physDir;
G4UIcmdWithAString* pListCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -21,35 +21,38 @@
// ********************************************************************
//
//
// $Id: PhysListGeneral.hh,v 1.1 2003/10/06 10:02:25 maire Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: PrimaryGeneratorAction.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysListGeneral_h
#define PhysListGeneral_h 1
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VPhysicsConstructor.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "globals.hh"
class G4Event;
class DetectorConstruction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysListGeneral : public G4VPhysicsConstructor
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PhysListGeneral(const G4String& name = "general");
~PhysListGeneral();
public:
PrimaryGeneratorAction(DetectorConstruction*);
~PrimaryGeneratorAction();
public:
// This method is dummy for physics
void ConstructParticle() {};
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
void ConstructProcess();
public:
void GeneratePrimaries(G4Event*);
G4ParticleGun* GetParticleGun() {return particleGun;};
private:
G4ParticleGun* particleGun;
DetectorConstruction* detector;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -57,9 +60,3 @@ class PhysListGeneral : public G4VPhysicsConstructor
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: ProcessesCount.hh,v 1.1 2004/04/28 11:11:55 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ProcessesCount_HH
#define ProcessesCount_HH
#include "globals.hh"
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class OneProcessCount
{
public:
OneProcessCount(G4String name) {Name=name; Counter=0;};
~OneProcessCount() {};
public:
G4String GetName() {return Name;};
G4int GetCounter() {return Counter;};
void Count() {Counter++;};
private:
G4String Name; // process name
G4int Counter; // process counter
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef std::vector<OneProcessCount*> ProcessesCount;
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: RunAction.hh,v 1.2 2004/06/10 15:55:37 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "ProcessesCount.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorConstruction;
class PrimaryGeneratorAction;
class HistoManager;
class G4Run;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class RunAction : public G4UserRunAction
{
public:
RunAction(DetectorConstruction*, PrimaryGeneratorAction*, HistoManager*);
~RunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
void CountProcesses(G4String);
void SumTrack (G4double track)
{totalCount++; sumTrack += track; sumTrack2 += track*track;};
private:
DetectorConstruction* detector;
PrimaryGeneratorAction* primary;
ProcessesCount* ProcCounter;
HistoManager* histoManager;
G4int totalCount; //all processes counter
G4double sumTrack; //sum of trackLength
G4double sumTrack2; //sum of trackLength*trackLength
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif

Some files were not shown because too many files have changed in this diff Show More