Import Geant4 4.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:39:52 +02:00
parent 921d3b1cda
commit 330b82b769
4524 changed files with 178689 additions and 43575 deletions
+189 -20
View File
@@ -18,9 +18,9 @@
# you may fetch it yourself from your nearest archive site.)
#
# $Id: Configure,v 1.20 2001/12/14 12:19:57 sadilov Exp $
# $Id: Configure,v 1.29 2002/07/01 10:45:04 stesting Exp $
#
# Generated on Fri Dec 14 13:19:47 CET 2001 [metaconfig 3.0 PL70]
# Generated on Mon Jul 1 12:23:24 CEST 2002 [metaconfig 3.0 PL70]
cat >/tmp/c1$$ <<EOF
WARNING!!!!!
@@ -52,11 +52,12 @@ esac
: Proper PATH separator
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
if test -d c:/.; then
p_=\;
PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
fi
#if test -d c:/.; then
# p_=\;
# PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
#?X: That's a bug in ksh5.22
# OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
#fi
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
@@ -205,6 +206,7 @@ g4vis_build_openglxm_driver=''
g4vis_build_raytracer_driver=''
g4vis_build_vrml_driver=''
g4vis_build_vrmlfile_driver=''
g4vis_oglhome=''
g4vis_use_asciitree=''
g4vis_use_dawn=''
g4vis_use_dawnfile=''
@@ -226,6 +228,11 @@ g4wanalysis_use=''
g4wanalysis_use_jas=''
g4wanalysis_use_lab=''
g4wanalysis_use_lizard=''
g4_gmake=''
g4_gmake_version=''
g4_make=''
g4_make_version=''
g4make=''
lns=''
c=''
n=''
@@ -305,14 +312,26 @@ if `$sh -c '#' >/dev/null 2>&1`; then
echo "#!$xcat" >try
$eunicefix try
chmod +x try
./try > today
#
# $xcat is wrong on WIN32: there is no /bin/cat and /usr/bin/cat by default.
# But we are sure that sharpbang is to be '#!' and let 'today' will be !=0.
#
# ./try > today
echo "#!$xcat" >today
if test -s today; then
sharpbang='#!'
else
echo "#! $xcat" > try
$eunicefix try
chmod +x try
./try > today
#
# $xcat is wrong on WIN32: there is no /bin/cat and /usr/bin/cat by default.
# But we are sure that sharpbang is to be '#!' and let 'today' will be !=0.
#
# ./try > today
echo "#!$xcat" >today
if test -s today; then
sharpbang='#! '
else
@@ -1306,6 +1325,8 @@ cd ../..
dnix) osname=dnix
osvers="$3"
;;
cygwin*) osname=win32
;;
domainos) osname=apollo
osvers="$3"
;;
@@ -1556,6 +1577,10 @@ case "$g4osname" in
;;
'sunos') g4osname=SUN
;;
'solaris') g4osname=SUN
;;
'win32') g4osname=WIN32
;;
esac
esac
@@ -1596,6 +1621,9 @@ case "$g4compiler" in
'SUN')
g4compiler=CC
;;
'WIN32')
g4compiler=VC
;;
esac
esac
@@ -1604,13 +1632,14 @@ while test 1 = 1 ; do
g4message=`cat << EOM
Definition of G4SYSTEM variable.
Definition of G4SYSTEM variable is $g4osname-$g4compiler.
That stands for:
1) OS : $g4osname
2) Compiler : $g4compiler
Select from list above (e.g. 2)
To modify default settings, select number above (e.g. 2)
EOM`
dflt="Press [Enter] for default settings"
@@ -1640,6 +1669,9 @@ gans=$ans
'sunos')
g4osnamerec=SUN
;;
'win32')
g4osnamerec=WIN32
;;
esac
dflt=$g4osname
rp="What is your OS'?"
@@ -1684,6 +1716,9 @@ EOM
'SUN')
g4compilerrec=CC
;;
'WIN32')
g4compilerrec=VC
;;
esac
dflt=$g4compiler
rp="Which C++ compiler?"
@@ -2154,6 +2189,9 @@ esac
case "$g4install" in
'')
if [ X$HOME = X/ ] ; then
HOME=""
fi
g4install=$HOME/geant4
;;
esac
@@ -2172,7 +2210,8 @@ esac
case "$g4include" in
'')
g4include=$g4install/include
# g4include=$g4install/include
g4include=''
;;
esac
@@ -2248,7 +2287,7 @@ g4message=`cat << EOM
2) G4LIB: $g4lib
Select from list above (e.g. 2)
To modify default settings, select number above (e.g. 2)
EOM`
#dflt="NO DEFAULT ANSWER"
@@ -2315,7 +2354,7 @@ esac
case "$g4ledata" in
'')
g4ledata=$g4install/../G4EMLOW0.5
g4ledata=$g4install/../G4EMLOW1.1
;;
esac
@@ -2341,7 +2380,7 @@ Data which is not part of the default Geant4 distribution:
4) NeutronHPCrossSections: $g4neutronhpcrosssections
Select from list above (e.g. 2)
To modify default settings, select number above (e.g. 2)
EOM`
#dflt="NO DEFAULT ANSWER"
@@ -2371,7 +2410,7 @@ gans=$ans
3)
dflt=$g4ledata
fn='f~'
rp="Where is G4EMLOW0.5 data installed ?"
rp="Where is G4EMLOW1.1 data installed ?"
. ./getfile
g4ledata=$ans
;;
@@ -2492,7 +2531,7 @@ You can customize paths of you CLHEP installation:
2) CLHEP_LIB_DIR: $g4clhep_lib_dir
3) CLHEP_LIB: $g4clhep_lib
Select from list above (e.g. 2)
To modify default settings, select number above (e.g. 2)
EOM`
@@ -2586,7 +2625,9 @@ gans=$ans
;;
y*|Y*)
g4global=y
# Shoud be comment out to keep settings from config.sh - not now to keep as in release
g4granular=n
# Shoud be comment out to keep settings from config.sh - not now to keep as in release
g4lib_use_granular=n
break
;;
@@ -2728,6 +2769,7 @@ done
echo " "
case "$g4lib_build_shared" in
'')
g4lib_build_shared=n
@@ -2735,6 +2777,7 @@ case "$g4lib_build_shared" in
esac
echo " "
case "$g4lib_build_static" in
'')
g4lib_build_static=n
@@ -2742,6 +2785,7 @@ case "$g4lib_build_static" in
esac
echo " "
case "$g4lib_use_shared" in
'')
g4lib_use_shared=n
@@ -2749,6 +2793,7 @@ case "$g4lib_use_shared" in
esac
echo " "
case "$g4lib_use_static" in
'')
g4lib_use_static=n
@@ -2882,6 +2927,98 @@ fi
fi
echo " "
case "$g4make" in
'')
g4make=gmake
;;
esac
echo ""
g4_gmake_version=`(gmake -v) 2>/dev/null`
case $g4_gmake_version in
GNU*)
g4_gmake=y
;;
*)
g4_gmake=n
;;
esac
g4_make_version=`(make -v) 2>/dev/null`
case $g4_make_version in
GNU*)
g4_make=y
;;
*)
g4_make=n
;;
esac
if [ $g4_gmake = y ] ; then
g4make=gmake
g4message=`cat << EOM
G4MAKE
You have GNU make which could be used to build GEANT4.
You can select your own 'make' program if you want.
EOM`
fi
if [ $g4_gmake = n ] && [ $g4_make = y ] ; then
g4make=make
g4message=`cat << EOM
G4MAKE
You have GNU make which could be used to build GEANT4.
You can select your own 'make' program if you want.
EOM`
fi
if [ $g4_gmake = n ] && [ $g4_make = n ] ; then
g4make=none
g4message=`cat << EOM
G4MAKE
You have NO GNU make which could be used to build GEANT4.
Please select your own 'make' program compatible with GNU make.
EOM`
dflt=$g4make
rp=$g4message
. ./myread
gans=$ans
case $gans in
'')
g4make=$dflt
;;
*)
g4make=$gans
;;
esac
fi
echo " "
case "$g4ui_none" in
@@ -2979,8 +3116,10 @@ g4message=`cat << EOM
G4UI_NONE
If set, no UI sessions nor any UI libraries are built. This can be useful
when running a pure batch job or in a user framework having its own UI system.
If this variable is set, no UI sessions nor any UI libraries are built.
This can be useful when running a pure batch job or in a user framework
having its own UI system.
Do you want to set this variable ?
EOM`
@@ -3207,6 +3346,12 @@ case "$g4vis_none" in
;;
esac
case "$g4vis_oglhome" in
'')
g4vis_oglhome="/usr"
;;
esac
case "$g4vis_build_openglwin32_driver" in
'')
g4vis_build_openglwin32_driver=n
@@ -3365,7 +3510,8 @@ g4message=`cat << EOM
G4VIS_NONE
If specified, no visualization drivers will be built or used.
If this variable is set, no visualization drivers will be built or used.
Do you want to set this variable ?
EOM`
@@ -3766,7 +3912,24 @@ gans=y
;;
esac
if [ X$g4vis_build_openglx_driver = Xy ] || [ X$g4vis_build_openglxm_driver = Xy ] || [ X$g4vis_build_openglwin32_driver = Xy ] ; then
g4message=`cat << EOM
OGLHOME/include
OGLHOME/lib
You have selected to use OpenGL driver.
Specify the correct path (OGLHOME) where OpenGL is installed in your system:
EOM`
dflt=$g4vis_oglhome
fn='d~'
rp=$g4message
. ./getfile
g4vis_oglhome=$ans
fi
echo " "
case "$g4use_hepodbms" in
'')
@@ -3911,6 +4074,10 @@ contains='$contains'
d_portable='$d_portable'
eunicefix='$eunicefix'
g4_build_wo_session='$g4_build_wo_session'
g4_gmake='$g4_gmake'
g4_gmake_version='$g4_gmake_version'
g4_make='$g4_make'
g4_make_version='$g4_make_version'
g4base='$g4base'
g4bin='$g4bin'
g4clhep_base_dir='$g4clhep_base_dir'
@@ -3933,6 +4100,7 @@ g4lib_build_static='$g4lib_build_static'
g4lib_use_granular='$g4lib_use_granular'
g4lib_use_shared='$g4lib_use_shared'
g4lib_use_static='$g4lib_use_static'
g4make='$g4make'
g4neutronhpcrosssections='$g4neutronhpcrosssections'
g4osname='$g4osname'
g4radioactivedata='$g4radioactivedata'
@@ -3963,6 +4131,7 @@ g4vis_build_openglxm_driver='$g4vis_build_openglxm_driver'
g4vis_build_raytracer_driver='$g4vis_build_raytracer_driver'
g4vis_build_vrml_driver='$g4vis_build_vrml_driver'
g4vis_build_vrmlfile_driver='$g4vis_build_vrmlfile_driver'
g4vis_oglhome='$g4vis_oglhome'
g4vis_use_asciitree='$g4vis_use_asciitree'
g4vis_use_dawn='$g4vis_use_dawn'
g4vis_use_dawnfile='$g4vis_use_dawnfile'
+102
View File
@@ -0,0 +1,102 @@
Geant4 4.0 - patch-01 Release Notes
-----------------------------------
31st January 2002
List of fixes included in this public patch to release 4.0:
o Event:
-----
- G4PrimaryTransformer: removed check whether the primary vertex is
inside the world volume. The check has been moved to G4SteppingManager.
o Geometry:
--------
- Magnetic field:
o Activated G4DEBUG_FIELD in GNUmakefile.
o G4MagHelicalStepper.cc: renamed local variables "*Momentum*"
to "*Velocity*".
- Management:
o G4AffineTransform.icc: fixed trivial compilation warning for gcc-2.95.2.
- Volumes:
o G4AuxiliaryNavServices: critical fix, to only consider whether a
'ray' (Point,Direction) is on the surface (it was erroneously also
checking for those inside volumes). This erroneous condition occurred
frequently in the new usage of Locate with Direction to initialise a
step.
o G4Navigator: reset blocked volume when locating 'within volume',
after ensuring that it does not get called when ComputeSafety() is at
a boundary. Fixes cases of longstanding 'Point P is Inside' errors.
o Activated mechanism in GNUmakefile for allowing compilation with
G4DEBUG_FIELD or G4DEBUG_NAVIGATION flags.
- solids/Boolean:
o Moved all verbosity mode warnings to G4BOOLDEBUG.
o Activated G4BOOLDEBUG mechanism in GNUmakefile.
- solids/BREPS:
o G4BREPSolidPCone: bugfix for problem report #320.
Fixed missing use-case in constructor when RMAX and RMIN have been
changed for 2 consecutive equal z-values. Now it creates correctly
2 planar surfaces as expected.
Added private method ComputePlanarSurface() gained
by refactoring of some part of the code in the constructor.
o G4FPlane: fixed first constructor adding new argument for setting
explicitly the sense of a surface if required.
Fixed G4FPlane::Intersect() method which incorrectly ignored a special
case of a hit on surface point with ray direction opposite to surface
normal.
- solids/CSG:
o G4Sphere.cc: fixed a problem with tolerances in the case of large Radius.
o Moved all verbosity mode warnings to G4CSGDEBUG.
o Activated G4CSGDEBUG mechanism in GNUmakefile.
o Global:
------
- G4strstreambuf: plugged memory leak in destructor for buffer deletion.
Temporary fix to G4strstream::overflow(c) for GNU gcc-3.X compilers
(also problem report #342), which require returning of character 'c' in
case of buffer flushing for <CR>.
- Replaced 'NULL' with '0' in G4Allocator.hh, G4strstreambuf.icc
and G4Timer.cc.
- Removed obsolete inline definitions in g4std/wrappers/DEC-cxx/cmath.
o Materials:
---------
- Fixed G4MaterialPropertyVector::AddElement() to consider ordering
of elements.
o Track & Tracking:
----------------
- track:
o G4Track: corrected initialization of fStepLength in constructors.
Fixed bug in assignment operator for fStepLength.
- tracking:
o G4SteppingManager:
- fix safe comparison between floating numbers
- added check for primary track outside of the world
- bug fix for particles below threshold to avoid double steps
o Visualization:
-------------
- Corrected handling for already open file in HepRepXMLWriter.
o Examples:
--------
- Novice: syncronised files with CVS HEAD. No functional changes to code.
----------------------------------------------------------------------------
Technical Notes
---------------
o Technical notes distributed for release 4.0 are also applicable and valid
for this patch.
The code and rebuilt binary libraries for release 4.0 are available through
our "Source Code" Web page:
- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
Please refer to <A
href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
User Documentation</A> for further information about using Geant4.
+157
View File
@@ -0,0 +1,157 @@
Geant4 4.0 - patch-02 Release Notes
-----------------------------------
28th February 2002
List of fixes included in this public patch to release 4.0, to be added on
top of patch-01:
o Config:
------
- liblist.c: added flags __CYGWIN__ and __CYGWIN32__ for triggering proper
parsing algorithm on Windows systems, also on most recent versions of
Cygwin.
- WIN32-VC.gmk: use g77 instead of f77 as default fortran compiler.
- sys/HP-aCC.gmk: removed include path to
global/management/include/std/wrappers, which was unused and not
necessary.
o Decay processes:
---------------
- Removed a physics table from G4Decay.
o Electromagnetic processes:
-------------------------
- Fixed bug in G4Ve(h)EnergyLoss, G4VMuEnergyLoss:
o Adopt MinDeltaCut in-range instead of in-energy !
- G4VEnergyLoss:
o Set subSecFlag to false. NO default subcutoff generation.
o Set finalRange to 1mm as default (the actual value is computed in
G4VeEnergyLoss, G4VhEnergyLoss and G4VMuEnergyLoss).
o Event:
-----
- Optimised implementation of SetNewValue() in G4ParticleGunMessenger and
G4GeneralParticleSourceMessenger to allow porting on WIN32-VC for optimised
compilation.
o Geometry:
--------
- Management:
o G4GeometryManager.cc: fixed handling of ios manipulators and precision
to reset to their original state in G4GeometryManager::ReportVoxelStats().
Fixes problem report #343.
- Volumes:
o G4GeometryMessenger.cc: fixed local variable name not to clash with
class data member.
- solids/Boolean:
o G4ReflectionFactory.cc: fixed bug causing repetition of daughter volumes.
o G4ReflectedSolid[.hh.cc]:
- Defined new methods Set/GetTransform3D() and Set/GetDirectTransform3D()
for defining/accessing the reflected transformation.
o Moved utility methods for G4AffineTransform to protected.
- solids/BREPS:
o Bug fixes to G4BREPSolidPolyhedra:
- Added enhancement allowing to define RMIN and RMAX to be zero with the
exception of forbidden two consecutive zero RMAX values.
- Refactoring in constructor gained two new private methods for creation
of trapezoidal and triangular side planes of G4BREPSolidPolyhedra.
- Rewritten code for delta phi >= 2*PI case with full classification of
possible cases.
- Fixed sense of end planes.
- Fixed delta phi < 2*PI case where some old code remained after bug
fix #266.
- Added new private method for creation of planar surfaces gained
after code refactoring in constructor.
- Fixed bug for problem report #354 by adding the code handling the
cases where user supplies for the same z-section different RMIN or
RMAX values.
- Added more preconditions checks
- Added code forbidding "teeth" in polyhedra.
o G4ConvexHull.hh: moved initialisation of 'next' to constructor's body.
- solids/CSG:
o G4Sphere.cc: bug-fix in Inside() function. Fixes problem report #216.
o G4Para.cc: fixed bug in G4Para::Inside() in calculation of xt,
according to problem report #357.
- solids/STEPinterface:
o G4RepresentationRelationshipCreator.cc: fixed unsafe usage of
'<' operator.
o Hadronic processes:
------------------
o Fixes in pre-equilibrium and de-excitation generator models.
o Fixed bug in doppler broadening in neutron-transport model:
- Fixed sign error in calculation of effective luminosity.
o Stopping: trivial bug-fix in pi-absorption at rest.
o Util:
- Trivial bug-fix, affecting K-absorption at rest.
- G4Nucleus: moved definition of constructors/destructor from header to
source implementation file. Unresolved symbols were detected at link
time on SUN-CC for static constants used to initialise members in
inline constructors.
o CHIPS model: fixed accuracy problem.
o Optimised implementation in G4Fancy3DNucleus.cc to allow porting on
WIN32-VC for optimised compilation.
o Interfaces:
----------
- Fixed for odd behavior of G4UIcsh in Windows systems.
o Materials:
---------
- Optimised implementation of GetIndex() for fIndexTable in G4Material,
G4Element and G4Isotope.
o Particles:
---------
- Fixed bug in the decay table for G4KaonMinus.
o Track & Tracking:
----------------
- track:
o Added G4Track::CopyTrackInfo().
o Optimised G4ParticleChange::AddSecondary() to properly use touchable
handles.
o Fixed a bug of changing parent weight in
G4ParticleChange::UpdateStepForAlongStep().
o Optimised implementation in G4Track::GetVelocity().
- tracking:
o G4SteppingManager2.cc:
- fix for extra steps when the ApplyCuts flag is set
- G4SteppingManager.hh: changed scope for 'SizeOfSelectedDoItVector'
to allow porting on WIN-VC compiler.
o Fix in G4SteppingManager::SetInitialStep() for applyCuts.
o Visualization:
-------------
- HepRep: added check for missing hierarchy layers in HepRepXMLWriter.
- Bug fix in modeling: removed Begin/EndPrimitives from G4HitsModel and
G4TrajectoriesModel. This was causing nested calls to Begin/EndPrimitives
(and thus to glNewList/EndList in OpenGL stored mode), since the
trajectories and hits Draw methods themselves have Begin/EndPrimitives.
o Examples:
--------
- extended/electromagnetic/testem1,3,4,5:
o Improvements in PrimaryGenerator and macros
- novice/N03:
o New macros for tutorials/exercises.
----------------------------------------------------------------------------
Technical Notes
---------------
o This patch should be applied on top of "patch-01" for release 4.0.
o Technical notes distributed for release 4.0 are also applicable and
valid for this patch.
The code and rebuilt binary libraries for release 4.0 are available through
our "Source Code" Web page:
- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
Please refer to <A
href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
User Documentation</A> for further information about using Geant4.
+385
View File
@@ -0,0 +1,385 @@
Geant4 4.1 Release Notes
------------------------
28th June 2002
These are the main new features/fixes included in this release since the
last public release (for the detailed list of fixes/additions, please refer
to the related History files):
o Configuration:
-------------
- Added Darwin-g++.gmk configuration file for MacOS-X systems running
with GNU g++ compiler.
- Removed obsolete SUN-CC4.gmk configuration file.
o Event:
-----
- Introduced new G4TrajectoryContainer class aggregating STL vector.
- Added TransferOneStackedTrack() method to G4StackManager.
o Electromagnetic Processes (Low-energy):
--------------------------------------
- New more complete and detailed data files (G4LOWEN1.1 data set).
- Extended parameterisation of e- ionisation (24 parameters per each
atomic shell) in order to have better fit to EEDL data.
- Bug fixes in e- bremsstruhlung process.
- Fixes and updates to parameterisation of the cross section in
photo-electric effect.
- Updates to polarised Compton process.
- Provided simulation of ionisation for GenericIons.
- Fixes in simulation of fluctuations of energy loss.
- Fixes in simulation of hadron induced fluorescence.
- Provided simulation of Auger electrons production.
- Fixes to the angular distribution in Rayleigh scattering
(G4LowEnergyRayleigh process).
- Added UI control on the threshold to produce fluorescence photons
and Auger electrons as secondaries.
o Electromagnetic Processes (Standard):
------------------------------------
- New classes (G4VXTRenergyLoss, G4GammaXTRadiator and G4RegularXTRadiator)
for the description of X-ray transition radiation as continuous process.
- New electromagnetic process G4GammaConversionToMuons for gamma conversion
into muon pairs.
- G4MultipleScattering: new parametrisation for angle distribution.
Modified boundary algorithm and some other minor fixes. Improvements
and performance optimisation.
- Fixes to hadron ionisation/energy-loss processes for delta-electron
spectra of GenericIons.
- G4eIonisation: fixed access to energy cuts in BuildLossTables.
- Modifications in G4PAIxSection allowing to get additional information on
transverse and longitudinal excitations at atomic frequences.
- Bug fix in G4GammaConversion::DoIt() for e+e- angular distribution.
- G4ComptonScattering: set LowestEnergyLimit to 1*keV.
- G4PhotoElectricEffect:
o keep only Sandia crossSections, removed call to BuildPhysicsTables.
Simplified public interface.
o generate theta angle of the photoelectron from Sauter-Gravila
distribution.
- G4Scintillation, G4Cerenkov: tracks are suspended only in 'fAlive' state.
- G4VMuEnergyLoss: bug fix in number of subcutoff delta.
o General Processes, Parameterisation, Decay, Optical:
---------------------------------------------------
- Added method G4VProcess::GetCurrentInteractionLength().
- Fixed bug in G4VProcess::PostStepDoIt() when MeanFreePath is DBL_MAX.
o Geometry:
--------
- Introduced optional 3D geometry optimisation for parameterised volumes.
- Introduced ability to optionally disable optimisation of hierarchies of
geometry volume placements, through G4LogicalVolume.
- Enhanced reflection of volumes to cover all CSG and CSG-like solids.
- First release of module for importance biasing.
- Enhanced behavior for destructors of volumes/solids stores.
o Added locking mechanism for preventing conflicts when destroying
stores and deregistering pointers.
o Added Clean() static method to volumes/solids stores to explicitely
delete pointed objects in the stores and clear all entries.
- G4GeometryMessenger: added new commands to exploit more
features of the G4GeomTestVolume class for detecting geometry overlaps.
- G4Tubs: restored original "vertices" algorithm for
CalculateExtent() which was temporarly disabled.
- G4Sphere: bug fixed in Inside() for treatment of point p on z-axis.
- G4BREPSolidPCone: added sanity check of delta phi section value
and exception is thrown saying about this unsupported feature if
delta phi is less than 2*PI.
- G4AssemblyVolume:
o Fixed inconsistent handling of input rotation matrices.
o Corrected handling of cases when pointer to rotation matrix is zero.
o Moved accessors to assembly counters to public.
o Added support for user definable count base for generated physical
volumes.
- Implemented G4EllipticalTube::CreatePolyhedron().
- Fix in G4Navigator for problem concerning ExitNormal with photons.
o Global:
------
- G4String: use G4std::string instead of internal type 'std_string'
in signatures of public methods. No functional or interface changes.
- G4DataVector: initialise to zero values in collection for contructor
taking capacity.
- Added more verbosity to G4Exception.
- Introduced temporary patches for porting on gcc-3.1 compiler.
o Hadronic Processes:
------------------
- General code cleanup for removal of warnings.
- cross_sections:
o Included the high Q2 part of the cross-section into electro and
photo nuclear reaction cross-sections, and into the equivalent
photon production.
o New class for calculating projectile fragment cross-sections in
ion ion reactions. Implements Physical Review C61, 034607 (2000).
based on EPAX Version 2, with the kind permission of the authors.
- management:
o Included recoil charge state treatement in HadronicProcess.
o Bug-fix affecting energy conservation for anti-protons in hydrogene.
- models/chiral_inv_phase_space:
o Included Q2!=0 for gamma and electro nuclear reactions.
o Using quark-gluon string model now to simulate reactions with large
energy transfers.
o Added protection for reactions at threshold.
- models/coherent_elastic:
o Improvement for coulomb effects.
o Correction of array sizes; slightly extends the applicability.
- models/high_energy:
o Fix for a long standing problem in phi symmetry traced to the Cross
method of G4HEVector.
- models/leading_particle:
o New package, steming from a partial re-implementation of the MARS
code. Valid for energies below 5 Gev for proton/neutron/pi+-,
K+-/gamma/anti_proton
The code is intrinsically leading particle biased, hence applicable
for radiation background simulations.
Typical application of this would be in the ESA MOLASSIS application.
- models/low_energy:
o Correction for randomization of fermi motion (1 in 1000 effect).
o Better treatement for anti-nucleons through accounting of
annihilation energy.
o Various cross-sections in the accounting of nucleons.
o Improved pi-0 to charged pion rations used in low energy models.
o Improved treatement of Lorentz transformation, getting rid of the
1 in 100 phi=0 peak for nucleons.
- models/neutron_hp:
o Resolved a problem in the effective luminosity correction
in the doppler broadening on the fly. Removes a bias in capture time
on termal neutrons in hydrogen (was off by 10%).
- models/radiative_decay:
o Fixed problem with sort, leading to erroneous behavior.
- models/generator/de_excitation:
o Moving the catching of low energy gammas.
o Adding a complete set of fresh evaporation code, that is more or
less equivalent to the GEM evaporation models. It produces fragments
up to Na25. Currently at beta level. G4Evaporation::SetGEMChannel()
method should be used to activate this.
- models/generator/high_energy:
o Included direct strong resonance decay in case of scattering off
hydrogen, hence removing this boundary use-case from the cascade
interface specifications.
- models/generator/management:
o Added utility interface for nucleus and nuclear density functions,
for the use of cascade codes.
- models/generator/pre_equilibrium:
o Fixed error in the low energy proton distributions
o Improvements in the level density.
o Bug fixed in angular distributions (theta).
o Small bug fixed in the equilibrium exciton number.
o Migration to new pairing corrections.
- models/generator/quark_gluon_string:
o Design iteration to enable specialization of participants
in string excitation.
o Added gamma nuclear reactions by adding specialised participants for
this; based on single nucleon participant model, and mesonic structure;
assuming vector meson dominance in the reactions and splitting.
- models/generator/util:
o Added utility for the decay of strong resonances.
o Added consts to enforce few design considerations.
o Magnetic Field:
--------------
- Fix in G4MagIntegratorDriver to update the field track for small steps.
- Fixed LinearStep in G4MagHelicalStepper (expected unit direction).
- Changed maximum number of steps in driver from 500/order to 250/order.
- Fix in G4MagHelicalStepper::LinearStep().
- G4ChordFinder: corrected behaviour for very small or large step changes.
o Materials:
---------
- G4Material: removed check of the ideal gas state equation.
o Particles:
---------
- Added G4TauLeptonicDecayChannel for tau leptonic decay.
- Fixed a bug in G4NeutronBetaDecayChannel.
o Run, Intercoms and Interfaces
-----------------------------
- Introduced new class G4UIGainServer, socket extension for G4UIGAG.
- Adopt limit to the number of stored command strings.
- Cleared naive usage of G4String type arguments from most UI classes.
- Modified G4RunManager to re-open geometry when G4 changes to QUIT state.
- Use "virtual" inheritance for G4VModularPhysicsList.
- Fixed pedantic warnings.
o Tracking & Track:
----------------
- G4TrackingManager: implemented EventAborted() method.
o Transportation:
--------------
- Added new classes for management of biasing transportation and scoring.
o Visualization:
-------------
- Prevent copying of autoRefresh status with /vis/viewer/set/all command.
- Corrected out of date advice about /vis/set/culling, etc.
- Deprecated /vis/viewer/set/autoRefresh command.
- Workaround for pseudo-parallel/orthogonal projection in Ray Tracer.
- Updated OpenGL to compile on Windows (G4VIS_BUILD_OPENGLWIN32_DRIVER).
- Bug fixes in G4VRMLXFileSceneHandlerFunc class.
- Fixed pedantic warnings.
o Examples:
--------
- Novice:
o Added G4Scintillation process to example N06.
- Extended:
o Created 8 new examples for importance biasing and scoring.
o Created 2 new examples demonstrating event-level parallellism.
o Introduced first version of example for importing GDML geometries.
o Introduced first version of CMS tool for debugging geometries overlaps.
o Added example showing import of STEP CAD geometries.
o Created 2 new examples showing usage of HepMC event generator.
o Added new EM example TestEm6 for G4GammaConversionToMuons process.
o Migrated EM examples to use AIDA 2.2 for histogramming.
- Advanced:
o Updated examples to recent development and usage of histogramming
features in AIDA 2.2.
- Updated reference outputs.
----------------------------------------------------------------------------
Technical Notes
---------------
The code and some binary libraries are available through our "Source Code"
Web page:
- see our <A href="http://cern.ch/geant4">Geant4 Home Page</A>.
Please refer to <A
href="http://cern.ch/geant4/G4UsersDocuments/Overview/html/index.html">Geant4
User Documentation</A> for further information about using Geant4.
Contents
--------
1. Supported and Tested Platforms
2. AIDA and CLHEP
3. The Standard Template Library (STL)
4. Persistency
5. Compiler Specific Problems
6. Known Run-Time Problems
7. Compilation Warnings
8. Known Run-Time Warnings
1. Supported and Tested Platforms
---------------------------------
o SUN Solaris 5.7, C++ 5.2 Patch 109508-03.
o Linux, gcc 2.95.2, egcs-2.91.66 (egcs 1.1.2).
This configuration was tested with the RedHat 6.1 and 7.2 distributions,
versions of Geant4 have also been compiled successfully on other Linux
distributions, like Debian or Suse.
The default RedHat compiler gcc-2.96 ditributed in RedHat 7.X is NOT
supported. It has been verified that it produces incorrect binaries,
therefore is not reliable. See also note below.
o Windows-2000 and CygWin Tools with: Visual C++ 6.0 Service Pack 5
Platforms configured but not tested and not supported:
o DEC V4.0, cxx C++ V6.1-027 with/without ObjectSpace STL
o HP 10.20, aCC C++ B3910B A.01.23 with/without ObjectSpace STL
o SGI V6.5.5, CC 7.2.1 with ObjectSpace STL
o AIX 4.3.2, xlC compiler with ObjectSpace STL
o MacOS 10.1, gcc 2.92.2
2. AIDA and CLHEP
-----------------
Geant4 4.1 requires the installation of CLHEP.
See <A href="http://wwwinfo.cern.ch/asd/lhc++/INSTALLATION/clhep.html">
CLHEP</A>. Tests have been performed with CLHEP 1.7.5.0. However, first
level porting has also been verified on CLHEP 1.8.0.0.
By default, the CLHEP installation scripts will activate ISO/ANSI C++ features
if the compiler is capable. You need to explicitly disable CLHEP settings in
case you wish non-ISO/ANSI setup on specific compilers.
Geant4 4.1 examples with histogramming cowork with AIDA 2.2 implementations.
These include:
- ANAPHE 4.0.4 and components included therein:
Objectivity 6.1.3
HepODBMS 0.3.3.1
CLHEP 1.7.5.0
(see: <A href="http://cern.ch/anaphe">ANAPHE</A>)
- JAS 2.2.5
(see: <A href="http://jas.freehep.org">JAS</A>)
- Open Scientist v8
(see: <A href="http://www.lal.in2p3.fr/OpenScientist/v8/welcome.html">Open Scientist</A>)
AIDA headers can be downloaded from:
<A href="http://aida.freehep.org">AIDA</A>
3. The Standard Template Library
--------------------------------
Native versions of STL have been tested on the following platforms:
Windows/2000, Linux, and SUN.
NOTES:
- Platform specific setup:
o SUN: Native STL is required for ISO/ANSI setup.
o Linux: Native STL is required (non ISO/ANSI setup for egcs compiler only).
o W2000: Native STL and ISO/ANSI setup required (VC++ 6.0).
4. Persistency
--------------
See release notes for Geant4 4.0.
5. Compiler Specific Problems
-----------------------------
o Linux Red Hat 7.X, gcc-2.96.
- The default compiler distributed by Red Hat since release 7.0 is
NOT supported and not considered reliable for running a Geant4-based
application. In more than one test case, binaries produced by gcc-2.96
have shown incorrect behavior, either due to wrong order of
initialisation of static data in memory or to bugs in the system
iostream classes, problems which apparently have all been solved in
more recent versions of the compiler (3.X series).
For information, gcc-2.96 is a compiler that has never been
officially released, nor supported by the GNU team itself and is not
considered reliable by the authors (for more information, see also
http://gcc.gnu.org/gcc-2.96.html).
6. Known Run-Time Problems and Limitations
------------------------------------------
For a complete list of outstanding run-time problems and to submit any
problem you may find running this version of Geant4, please refer to the
Geant4 Problem Reporting System, available on the Web at this address:
http://wwwinfo.cern.ch/asd/cgi-bin/geant4/problemreport
7. Compilation Warnings
-----------------------
There are compilation warnings on some platforms. We do not believe
that any will lead to incorrect run-time behaviour, but we are working
on reducing them.
8. Known Run-Time Warnings
--------------------------
The following messages can be written to error output while tracking.
We believe none give rise to incorrect behaviour.
o G4PropagateInField: Warning: Particle is looping
- tracking in field will be stopped.
It has performed 10000 steps in Field while a maximum of 10000
are allowed.
+6 -2
View File
@@ -1,4 +1,4 @@
# $Id: G4VIS_USE.gmk,v 1.12 2001/12/03 08:09:48 barrand Exp $
# $Id: G4VIS_USE.gmk,v 1.13 2002/03/09 03:12:33 johna Exp $
# -------------------------------------------------------------
# GNUmakefile for CPPFLAGS for visualization USE phase.
# John Allison, 24th January 1998.
@@ -58,10 +58,14 @@ ifdef G4VIS_USE_OPENGLXM
INC_XM = 1
LOAD_XM = 1
endif
ifdef G4VIS_USE_OPENGLWIN32
G4VIS_USE_OPENGL = 1
CPPFLAGS += -DG4VIS_USE_OPENGLWIN32
endif
ifdef G4VIS_USE_OPENGL
CPPFLAGS += -DG4VIS_USE_OPENGL
CPPFLAGS += -I$(G4BASE)/visualization/OpenGL/include
VISLIBS += -lG4OpenGL
VISLIBS += -lG4OpenGL
INC_GL = 1
LOAD_GL = 1
endif
+50 -2
View File
@@ -1,5 +1,5 @@
$Id: History,v 1.177 2001/12/14 08:37:39 gcosmo Exp $
$Name: geant4-04-00 $
$Id: History,v 1.193 2002/06/26 17:27:18 gcosmo Exp $
$Name: geant4-04-01 $
-------------------------------------------------------------------
@@ -18,6 +18,54 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
26th June 2002 Gabriele Cosmo (config-V04-00-10)
- Moved STEP PERL scripts to examples/extended/geometry/cad/scripts.
- Updated scripts for Configure.
18th June 2002 Gabriele Cosmo (config-V04-00-09)
- Added -DG4USE_OSPACE for obsolete systems using ObjectSpace STL.
17th June 2002 Gabriele Cosmo (config-V04-00-08)
- Added flag G4NO_ISO_VECDIST for compilers (SUN-CC, HP-aCC) with non ISO
call to vector::distance() method.
14th June 2002 Gabriele Cosmo (config-V04-00-07)
- binmake.gmk: added include path to "leading_particle" hadronic module.
Retagged with correct numbering...
3rd May 2002 Gabriele Cosmo (config-V04-00-06)
- liblist.c: added patch to port code on MacOS-X.
Defined buffer[BUFSIZE] as "char static".
- Added Darwin-g++.gmk configuration file for MacOS-X systems running
with GNU g++ compiler.
- Removed SUN-CC4.gmk configuration file, no longer supported.
- Updated description header to system configuration files.
27th March 2002 Gabriele Cosmo (config-V04-00-05)
- binmake.gmk: added include path to new module geometry/biasing.
Co-works with "geometry-V04-00-01" and "transport-V04-00-00".
26th March 2002 Gabriele Cosmo (config-V04-00-04)
- liblist.c: cancelled changes made in previous tag.
Restored usage of function 'gets(buffer)', correctly adopted in this case.
14th March 2002 Gabriele Cosmo (config-V04-00-03)
- liblist.c: replaced usage of function 'gets(buffer)' with the safer
'fgets(buffer,BUFSIZE,stdin)'.
9th March 2002 John Allison (config-V04-00-02)
- Fixed bug in G4VIS_USE.gmk for G4VIS_USE_OPENGLWIN32.
- Corrected perl script g4sort_step_file.pl to specify correct path for perl.
07th February 2002 Gabriele Cosmo (config-V04-00-01)
- liblist.c: added flags __CYGWIN__ and __CYGWIN32__ for triggering proper
parsing algorithm on Windows systems, also on most recent versions of Cygwin.
- WIN32-VC.gmk: use g77 instead of f77 as default fortran compiler.
25th January 2002 Gabriele Cosmo (config-V04-00-00)
- sys/HP-aCC.gmk: removed include path to global/management/include/std/wrappers,
which was unused and not neccessary.
10th December 2001 Gabriele Cosmo (config-V03-02-15)
- architecture.gmk:
o updated list of supported compilers
+2 -4
View File
@@ -1,4 +1,4 @@
# $Id: architecture.gmk,v 1.77 2001/12/11 15:31:11 gcosmo Exp $
# $Id: architecture.gmk,v 1.78 2002/06/27 14:24:28 gcosmo Exp $
# ------------------------------------------------------------------------
# GEANT 4 - Architecture configuration script for GNU Make
#
@@ -13,14 +13,12 @@
# List of the supported architectures/compilers and related flavors for
# the environment variable G4SYSTEM:
#
# Linux-g++ Linux (Red Hat 6.1), gcc-2.95.2 (default)
# Linux-g++ Linux (Red Hat 6.1 or 7.2), gcc-2.95.2 (default)
#
# Linux-egcs Linux (Red Hat 6.1), egcs-1.1.2
#
# SUN-CC SunOS 5.7, CC 5.2
#
# DEC-cxx DEC-OSF/1 4.0, DEC C++ 6.1
#
# WIN32-VC Windows/2000 and Microsoft Visual C++ 6.0 - SP5
# Adding CYGWIN32 tools
# -------------------------------------------------------------------------
+3 -1
View File
@@ -1,4 +1,4 @@
# $Id: binmake.gmk,v 1.74 2001/12/13 11:36:05 gcosmo Exp $
# $Id: binmake.gmk,v 1.76 2002/06/13 11:08:08 jwellisc Exp $
# ----------------------------------------------------------
# Script defining rules and paths for making binaries.
# First implementation: Gabriele Cosmo, 25/06/1998.
@@ -94,6 +94,7 @@ ifndef INCFLAGS
-I$(G4BASE)/processes/hadronic/models/neutron_hp/include \
-I$(G4BASE)/processes/hadronic/models/isotope_production/include \
-I$(G4BASE)/processes/hadronic/models/radiative_decay/include \
-I$(G4BASE)/processes/hadronic/models/leading_particle/include \
-I$(G4BASE)/processes/hadronic/stopping/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/geometry/solids/CSG/include \
@@ -105,6 +106,7 @@ ifndef INCFLAGS
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/geometry/verification/include \
-I$(G4BASE)/geometry/magneticfield/include \
-I$(G4BASE)/geometry/biasing/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/tracking/include \
-I$(G4BASE)/digits+hits/detector/include \
+7 -7
View File
@@ -1,4 +1,4 @@
/* $Id: liblist.c,v 1.9 1999/11/19 18:01:40 morita Exp $ */
/* $Id: liblist.c,v 1.14 2002/05/03 12:59:08 gcosmo Exp $ */
/*
Given a "libname.map" file on standard input and a list or directory
@@ -115,13 +115,13 @@ char** parsedir(char *directory,int *argc)
int main (int argc, char** argv) {
char buffer[BUFSIZE],*bufferPtr,workbuf[256];
char static buffer[BUFSIZE],*bufferPtr,workbuf[256];
char *ptr,*p,**pp,**pp1,**pp2,*directory=0;
char **rargv;
int i,optl=0,swapping,c,rargc;
FILE *fp;
#ifdef _WIN32
#if defined ( _WIN32 ) || defined ( __CYGWIN__ ) || defined ( __CYGWIN32__ )
char *ntg4tmp=0,*ntg4tmp1=0;
int nti;
#endif
@@ -263,7 +263,7 @@ int main (int argc, char** argv) {
if(optl)fprintf(stderr," Reading dependency files...\n");
#ifdef _WIN32
#if defined ( _WIN32 ) || defined ( __CYGWIN__ ) || defined ( __CYGWIN32__ )
ntg4tmp=getenv("G4TMP");
if ( ! ntg4tmp )
{
@@ -278,7 +278,7 @@ int main (int argc, char** argv) {
fp=fopen(rargv[i],"r");
fgets(buffer,BUFSIZE,fp);
#ifdef _WIN32
#if defined ( _WIN32 ) || defined ( __CYGWIN__ ) || defined ( __CYGWIN32__ )
ptr=strchr(ntg4tmp1,':');
if ( ptr ) *(ptr+1)='\0';
@@ -362,7 +362,7 @@ int main (int argc, char** argv) {
fgets(buffer,BUFSIZE,fp);
bufferPtr=buffer;
#ifdef _WIN32
#if defined ( _WIN32 ) || defined ( __CYGWIN__ ) || defined ( __CYGWIN32__ )
while ( ptr=strchr(buffer,'\\') ) *ptr='/';
while (ntg4tmp1 && (ptr=strstr(buffer,ntg4tmp1)) )
@@ -376,7 +376,7 @@ int main (int argc, char** argv) {
}
}
#ifdef _WIN32
#if defined ( _WIN32 ) || defined ( __CYGWIN__ ) || defined ( __CYGWIN32__ )
free(ntg4tmp1);
#endif
+6
View File
@@ -277,6 +277,12 @@ setenv G4VIS_USE_VRML 1
echo "On this machine the G4VIS_USE_VRML=\$G4VIS_USE_VRML"
endif
#+
if ( X$g4vis_oglhome != X ) then
setenv OGLHOME "$g4vis_oglhome"
echo "On this machine the OGLHOME=\$OGLHOME"
endif
#+
#
# g4shared
+7
View File
@@ -316,6 +316,13 @@ export G4VIS_USE_VRML
echo "On this machine the G4VIS_USE_VRML=\$G4VIS_USE_VRML"
fi
#+
if [ X$g4vis_oglhome != X ] ; then
OGLHOME="$g4vis_oglhome"
export OGLHOME
echo "On this machine the OGLHOME=\$OGLHOME"
fi
#+
#
# g4shared
+10 -3
View File
@@ -323,6 +323,13 @@ export G4VIS_USE_VRML
echo "On this machine the G4VIS_USE_VRML=\$G4VIS_USE_VRML"
fi
#+
if [ X$g4vis_oglhome != X ] ; then
OGLHOME="$g4vis_oglhome"
export OGLHOME
echo "On this machine the OGLHOME=\$OGLHOME"
fi
#+
#
# g4shared
@@ -371,19 +378,19 @@ echo `pwd`
# THere is no env!
if [ X$g4global = Xy ] ; then
gmake global
$g4make global
fi
# There is env for binaries - for User: should be set in env.[c]sh!
if [ X$g4granular = Xy ] ; then
G4LIB_USE_GRANULAR=1
export G4LIB_USE_GRANULAR
gmake
$g4make
fi
# There is no env!
if [ X$g4includes_flag = Xy ] ; then
gmake includes
$g4make includes
fi
!GROK!THIS!
+1 -1
View File
@@ -31,7 +31,7 @@ ifeq ($(G4SYSTEM),AIX-xlC)
CPPFLAGS += -I$(G4BASE)/global/management/include/g4std/wrappers/$(G4SYSTEM)
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_AIX_4 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
endif
+1 -1
View File
@@ -29,7 +29,7 @@ ifeq ($(G4SYSTEM),DEC-cxx)
endif
CPPFLAGS += -I$(G4BASE)/global/management/include/g4std/wrappers/$(G4SYSTEM)
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_OSF1_4 -DOS_NEW_CHECK -DOS_STL_ASSERT -DOS_NO_WSTRING
CPPFLAGS += -DG4USE_OSPACE -DOS_OSF1_4 -DOS_NEW_CHECK -DOS_STL_ASSERT -DOS_NO_WSTRING
CPPFLAGS += -DOS_NO_ALLOCATORS -D__NO_EDG_EXCEPTION_CLASSES
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
CXXFLAGS += -nostdnew
+70
View File
@@ -0,0 +1,70 @@
#
# ------ MacOS-X ------ !!! not supported !!!
# MacOS 10.1 GNU-gcc 2.92.2
#
# Helmut Burkhardt - CERN
#
ifeq ($(G4SYSTEM),Darwin-g++)
CXX := g++
GNU_GCC = 1
CXXFLAGS := -Wall -ansi -pedantic -pipe -fno-for-scope -DGNU_GCC
ifdef G4OPTIMISE
CXXFLAGS += -O
FCFLAGS := -O
CCFLAGS := -O
else
ifdef G4DEBUG
CXXFLAGS += -g
FCFLAGS := -g
CCFLAGS := -g
endif
endif
ifdef G4PROFILE
CXXFLAGS += -pg
FCFLAGS += -pg
CCFLAGS += -pg
endif
ifdef G4LIB_BUILD_SHARED
CXXFLAGS += -fPIC
FCFLAGS += -fPIC
CCFLAGS += -fPIC
endif
G4RUNPATHOPTION := -Wl,-rpath
FC := g77
FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
FCLIBS := -lg2c -lnsl
ECHO := /bin/echo -e
SHEXT := so
X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lSM -lICE
XMFLAGS := -I/usr/X11R6/include
XMLIBS := -lXm -lXpm
DLDLIBS := -ldl
ifndef OGLHOME
OGLHOME := /usr/X11R6
endif
ifndef OGLFLAGS
OGLFLAGS := -I$(OGLHOME)/include
endif
ifndef OGLLIBS
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
endif
OIVFLAGS += -I$(OIHOME)/include
G4USE_STD_NAMESPACE := yes
CPPFLAGS += -DG4USE_STD_NAMESPACE
ifdef G4ODBMS
G4DDLX_FLAGS += -DG4std=""
endif
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) *.o
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
$(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) \
$(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
+4 -5
View File
@@ -1,6 +1,6 @@
#
# -------- HP ---------
#
# -------- HP --------- !!! not supported !!!
# HP-UX B.10.20 - aCC A.01.23
ifeq ($(G4SYSTEM),HP-aCC)
CXX := aCC
ifdef G4OPTIMISE
@@ -38,11 +38,10 @@ ifeq ($(G4SYSTEM),HP-aCC)
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
OGLLIBS += -L/opt/graphics/common/lib -lXwindow -lhpgfx -lXhp11 -ldld
endif
CPPFLAGS += -DG4NOT_ISO_DELETES
CPPFLAGS += -I$(G4BASE)/global/management/include/g4std/wrappers/$(G4SYSTEM)
CPPFLAGS += -DG4NOT_ISO_DELETES -DG4NO_ISO_VECDIST
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_HPUX_10_20 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS -D__HPACC_NOEH
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS -D__HPACC_NOEH
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
endif
+2 -2
View File
@@ -1,5 +1,5 @@
#
# ------ GNU/LINUX ------
# ------ GNU/LINUX ------ egcs-1.1.2 (gcc-2.91.66)
#
ifeq ($(G4SYSTEM),Linux-egcs)
CXX := g++
@@ -46,7 +46,7 @@ ifeq ($(G4SYSTEM),Linux-egcs)
OIVFLAGS += -I$(OIHOME)/include
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_LINUX_2 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)
endif
ifdef G4ODBMS
+1 -1
View File
@@ -30,7 +30,7 @@ ifeq ($(G4SYSTEM),SGI-CC)
CPPFLAGS += -I$(G4BASE)/global/management/include/g4std/wrappers/$(G4SYSTEM)
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_IRIX_6_5 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
endif
+2 -2
View File
@@ -45,13 +45,13 @@ ifeq ($(G4SYSTEM),SUN-CC)
endif
CPPFLAGS += -DSOCKET_IRIX_SOLARIS
LOADLIBS += -L/usr/lib -lsocket -lnsl
CPPFLAGS += -DG4NOT_ISO_DELETES
CPPFLAGS += -DG4NOT_ISO_DELETES -DG4NO_ISO_VECDIST
ifdef G4ODBMS
G4DDLX_FLAGS += -noline
endif
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_SOLARIS_2_5 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
CXXFLAGS += -compat
else
-69
View File
@@ -1,69 +0,0 @@
#
# -------- SUN --------- !!! not supported !!!
# SUN CC-4.2
ifeq ($(G4SYSTEM),SUN-CC4)
CXX := CC
ifdef G4OPTIMISE
CXXFLAGS := -O
else
ifdef G4DEBUG
CXXFLAGS := -g
FCFLAGS := -g
CCFLAGS := -g
endif
endif
ifdef G4LIB_BUILD_SHARED
CXXFLAGS += -KPIC
FCFLAGS += -KPIC
CCFLAGS += -KPIC
endif
G4RUNPATHOPTION = -R
# CXXFLAGS += -fnonstd
CFRONT_G4TEMPLATE_REPOSITORY := true
FC := f77
SHEXT := so
AR := $(CXX) -xar -ptr$(G4TREP) -o
ECHO := /bin/echo
GREP := /usr/xpg4/bin/grep
FCLIBS := -lM77 -lF77 -lsunmath
X11FLAGS := -I/usr/openwin/include/X11/extensions -I/usr/openwin/include/X11
X11FLAGS += -I/usr/openwin/include
X11LIBS := -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib
X11LIBS += -R/usr/openwin/lib -lXmu -lX11 -lXext
XMLIBS := -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib
XMLIBS += -R/usr/openwin/lib -lXt -lXm -lX11
XAWFLAGS := -I/usr/openwin/include/X11
XAWLIBS := -L/usr/openwin/lib -L/usr/dt/lib -L/usr/ucblib
XAWLIBS += -R/usr/openwin/lib -lXaw -lXmu -lXt -lX11 -lXext
ifndef OGLFLAGS
OGLFLAGS := -I$(OGLHOME)/include
endif
ifndef OGLLIBS
OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
endif
CPPFLAGS += -DSOCKET_IRIX_SOLARIS
LOADLIBS += -L/usr/lib -lsocket -lnsl
CPPFLAGS += -DG4NOT_ISO_DELETES
CPPFLAGS += -I$(G4BASE)/global/management/include/g4std/wrappers/$(G4SYSTEM)
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_SOLARIS_2_5 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += $(OSPACEINC) -I$(OSPACE_BASE_DIR)
endif
ifdef G4ODBMS
G4DDLX_FLAGS += -DG4std=""
endif
define build-granular-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMPDIR); \
$(CXX) -G $(CXXTEMPLATE_FLAGS) -o $$libdir/$(@F) -h $(@F) *.o
endef
define build-global-shared-lib
@libdir=`(cd $(@D);/bin/pwd)`; \
cd $(G4TMP)/$(G4SYSTEM); \
$(CXX) -G $(CXXTEMPLATE_FLAGS) -o $$libdir/$(@F) -h $(@F) \
$(foreach dir,$(SUBLIBS),$(dir)/*.o);
endef
endif
+3 -2
View File
@@ -1,5 +1,5 @@
#
# ------ WIN32/VC ------
# ------ WIN32/VC ------ Visual-C++ 6.0 SP5
#
ifeq ($(G4SYSTEM),WIN32-VC)
CXX := CL
@@ -19,6 +19,7 @@ ifeq ($(G4SYSTEM),WIN32-VC)
#
ifdef G4USE_OSPACE
CXXFLAGS += $(OSPACEINC)
CPPFLAGS += -DG4USE_OSPACE
else
ifdef G4USE_STLPORT
CXXFLAGS += $(OSPACEINC)
@@ -40,7 +41,7 @@ ifeq ($(G4SYSTEM),WIN32-VC)
AR := LIB
ECHO := echo -e
FC := f77
FC := g77
# FCLIBS := -lf2c
ifndef OGLFLAGS
OGLFLAGS :=
+2 -3
View File
@@ -3,8 +3,7 @@
# cygnus b20 with cygwin1.dll 1.1.5 patch
# Windows 95 4.00.1111
#
# Sys file by Stefano Agostinelli, July 2000
# IST Group: Franca Foppiano, Stefania Garelli, Stefano Agostinelli
# Stefano Agostinelli - IST Group, Genova
#
ifeq ($(G4SYSTEM),WIN32-g++)
CXX := g++
@@ -43,7 +42,7 @@ ifeq ($(G4SYSTEM),WIN32-g++)
OIVFLAGS += -I$(OIHOME)/include
ifdef G4USE_OSPACE
CPPFLAGS += -DOS_LINUX_2 -DOS_NEW_CHECK -DOS_STL_ASSERT
CPPFLAGS += -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -DG4USE_OSPACE -DOS_NO_WSTRING -DOS_NO_ALLOCATORS
CPPFLAGS += -I$(OSPACE_BASE_DIR)/ospace/std -I$(OSPACE_BASE_DIR)
endif
ifdef G4ODBMS
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: EXPO.cc,v 1.8.4.1 2001/06/28 19:06:29 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
#include <stdlib.h>
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: TEST.cc,v 1.3.4.1 2001/06/28 19:06:29 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
#include <stdlib.h>
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: EXPO_Detector.icc,v 1.3.4.1 2001/06/28 19:06:31 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// See also G4/run/example/MyDetectorConstruction.cc.
@@ -22,7 +22,7 @@
//
//
// $Id: EXPO_PhysicsList.hh,v 1.4.4.1 2001/06/28 19:06:31 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: EXPO_PhysicsList.icc,v 1.4.4.1 2001/06/28 19:06:31 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: EXPO_Primary.icc,v 1.3.4.1 2001/06/28 19:06:31 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// See also G4/run/example/EXPO_PrimaryGeneratorAction.cc.
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4o.h,v 1.3.4.1 2001/06/28 19:06:31 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oCommon.hh,v 1.3.4.1 2001/06/28 19:06:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/*
Included by G4o.h.
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oCommon.icc,v 1.3.4.1 2001/06/28 19:06:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/*
Included by G4o.cc.
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oDrawer.hh,v 1.3.4.1 2001/06/28 19:06:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oEXPO.h,v 1.3.4.1 2001/06/28 19:06:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oScene.hh,v 1.4.4.1 2001/06/28 19:06:33 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oState.hh,v 1.4.4.1 2001/06/28 19:06:33 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
#ifndef G4oState_h
#define G4oState_h
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: WoG4o.h,v 1.3.4.1 2001/06/28 19:06:33 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4o.cc,v 1.7.4.1 2001/06/28 19:06:33 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/*
#define DEBUG
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oDrawer.cc,v 1.6.4.1 2001/06/28 19:06:34 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/*
From geant4/visualization/management/src/G4VisManager.cc.
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oScene.cc,v 1.7.4.1 2001/06/28 19:06:34 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
/* +---------------------- Copyright notice -------------------------------+ */
/* | Copyright (C) 1995, Guy Barrand, LAL Orsay, (barrand@lal.in2p3.fr) | */
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4oState.cc,v 1.6.4.1 2001/06/28 19:06:34 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//#define DEBUG
+114 -79
View File
@@ -1,3 +1,4 @@
//
// ********************************************************************
// * DISCLAIMER *
@@ -26,121 +27,157 @@
// --------------------------------------------------------------
//
// Code developed by:
// S. Agostinelli, F. Foppiano, S. Garelli and M. Tropeano
// S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano,S.Guatelli
//
// Brachytherapy simulates the dose deposition in a cubic (30*cm)
// water phantom for a Ir-192 MicroSelectron High Dose Rate
// water phantom for a IsoSeed I-125 Bebig
// brachytherapy source.
//
// Simplified gamma generation is used.
// Source axis is oriented along Z axis.
// Voxel data on the X-Z plan
//e is output to ASCII file
// "Brachy.out".
//
// $Id: Brachy.cc,v 1.8 2001/12/13 13:44:53 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//e is output to
// "Brachy3.hbk".
// $Id: Brachy.cc,v 1.11 2002/06/18 22:20:37 guatelli Exp $
// GEANT4 tag $Name: brachy-V04-00-05 $
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#ifdef G4UI_USE_XM
#include "G4UIXm.hh"
#endif
#ifdef G4VIS_USE
#include "BrachyVisManager.hh"
#endif
#include "BrachyEventAction.hh"
#include "BrachyDetectorConstruction.hh"
#include "BrachyPhysicsList.hh"
#include "BrachyPrimaryGeneratorAction.hh"
#include "BrachyWaterBoxSD.hh"
#include "BrachyPhantomSD.hh"
#include "G4SDManager.hh"
#include"BrachyRunAction.hh"
#include "Randomize.hh"
#include "G4RunManager.hh"
#include "G4SDManager.hh"
#include "G4UImanager.hh"
int main()
{
// Number of generated photons
G4int NumberOfEvents = 1000;
// Define number of voxels in X-Z plane
G4int NumVoxelX = 101;
G4int NumVoxelZ = 101;
// Construct the default run manager
G4RunManager* pRunManager = new G4RunManager;
//Interactive mode//
// Set mandatory initialization classes
G4String SDName = "WaterBox";
BrachyDetectorConstruction *pDetectorConstruction;
pRunManager->SetUserInitialization(pDetectorConstruction = new BrachyDetectorConstruction(SDName,NumVoxelX,NumVoxelZ));
pRunManager->SetUserInitialization(new BrachyPhysicsList);
int main(int argc ,char ** argv)
// Set mandatory user action class
pRunManager->SetUserAction(new BrachyPrimaryGeneratorAction);
{
// semi diversi li ha usati per l'errore
// Initialize G4 kernel
pRunManager->Initialize();
//HepRandom::setTheSeed(16520);
// Alloc and initialize voxel matrix
G4float* pVoxel = new G4float[NumVoxelX*NumVoxelZ];
for(G4int j=0;j<NumVoxelX*NumVoxelZ;j++)
pVoxel[j] = 0.0F;
HepRandom::setTheEngine(new RanecuEngine);
BrachyEventAction *pEventAction;
pRunManager->SetUserAction(pEventAction = new BrachyEventAction(pVoxel,NumVoxelX,NumVoxelZ));
// Construct the default run manager
G4RunManager* pRunManager = new G4RunManager;
// Get the pointer to the UI manager and set verbosities
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/run/verbose 0");
UI->ApplyCommand("/event/verbose 0");
UI->ApplyCommand("/tracking/verbose 0");
pRunManager->BeamOn(NumberOfEvents);
// Set mandatory initialization classes
G4String SDName = "Phantom";
BrachyDetectorConstruction *pDetectorConstruction=new BrachyDetectorConstruction(SDName);
pRunManager->SetUserInitialization(pDetectorConstruction) ;
pRunManager->SetUserInitialization(new BrachyPhysicsList);
if(pVoxel)
{
G4std::ofstream ofs;
#ifdef G4VIS_USE
// visualization manager
G4VisManager* visManager = new BrachyVisManager;
visManager->Initialize();
#endif
// Output voxel data to text file
// Format = x coord [mm] <tab> z coord [mm] <tab> edep [MeV] <eol>
ofs.open("Brachy.out");
{
G4UIsession* session=0;
if (argc==1) // Define UI session for interactive mode.
{
// G4UIterminal is a (dumb) terminal.
#ifdef G4UI_USE_XM
session = new G4UIXm(argc,argv);
#else
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
#endif
}
ofs<<" x(mm)"<<'\t'<<"z(mm)"<<'\t'<<"released energy(Mev)"
<<G4endl;
G4double VoxelWidth_X = pDetectorConstruction->GetBoxDim_X()/NumVoxelX;
G4double VoxelWidth_Z = pDetectorConstruction->GetBoxDim_Z()/NumVoxelZ;
BrachyEventAction *pEventAction=new BrachyEventAction(SDName);
pRunManager->SetUserAction(pEventAction );
pRunManager->SetUserAction(new BrachyPrimaryGeneratorAction);
BrachyRunAction *pRunAction=new BrachyRunAction();
pRunManager->SetUserAction(pRunAction);
//Initialize G4 kernel
pRunManager->Initialize();
G4double x,z;
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/run/verbose 0");
UI->ApplyCommand("/event/verbose 0");
UI->ApplyCommand("/tracking/verbose 0");
for(G4int k=0;k<NumVoxelZ;k++)
{
z = (-NumVoxelZ+1+2*k)*VoxelWidth_Z/2;
if (session) // Define UI session for interactive mode.
{
// G4UIterminal is a (dumb) terminal.
UI->ApplyCommand("/control/execute initInter.mac");
#ifdef G4UI_USE_XM
// Customize the G4UIXm menubar with a macro file :
UI->ApplyCommand("/control/execute gui.mac");
#endif
session->SessionStart();
delete session;
}
else // Batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
//int numberOfEvent = 10000;
//pRunManager->BeamOn(numberOfEvent);
// Job termination
for(G4int i=0;i<NumVoxelX;i++)
{
G4int j = i+k*NumVoxelX;
x = (-NumVoxelX+1+2*i)*VoxelWidth_X/2;
// Do not consider near voxels
if(fabs(x) > 3*mm || fabs(z) > 6*mm)
{ ofs << x << '\t' << z << '\t' << pVoxel[j] << G4endl;
//check released energy
// if(pVoxel[j]!=0)
// G4cout<<x<<'\t'<<z<< '\t'<<pVoxel[j]<<G4endl;
}
}
}
ofs.close();
}
}
delete[] pVoxel;
#ifdef G4VIS_USE
delete visManager;
#endif
// Job termination
delete pRunManager;
delete pRunManager;
return 0;
return 0;
}
@@ -150,5 +187,3 @@ int main()
+16 -2
View File
@@ -1,5 +1,5 @@
# --------------------------------------------------------------
# $Id: GNUmakefile,v 1.2 2000/12/10 08:38:46 chauvie Exp $
# $Id: GNUmakefile,v 1.6 2002/06/13 15:11:27 guatelli Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -9,11 +9,25 @@ name := Brachy
G4TARGET := $(name)
G4EXLIB := true
G4ANALYSIS_USE = 1
ifndef G4INSTALL
G4INSTALL = ../../..
G4INSTALL = ../../../
endif
CPPFLAGS += -I${LHCXX_REL_DIR}/include -I/afs/cern.ch/sw/contrib/AIDA/2.2/cpp
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
# From lowenergy/test/GNUmakefile
CPPFLAGS += `aida-config --useHBook --include`
LDFLAGS += `aida-config --useHBook --lib`
LOADLIBS += `aida-config --useHBook --lib`
+96 -11
View File
@@ -1,5 +1,5 @@
-------------------------------------------------------------------
$Id: README,v 1.2 2000/12/10 08:39:39 chauvie Exp $
$Id: README,v 1.5 2002/06/13 15:59:43 guatelli Exp $
-------------------------------------------------------------------
=========================================================
@@ -12,27 +12,112 @@ $Id: README,v 1.2 2000/12/10 08:39:39 chauvie Exp $
0. Introduction.
Brachytherapy example simulates energy deposition on a voxel grid
for a MicroSelectron Ir-192 HDR brachytherapy source.
for a Ir brachytherapy source.
1. Technical description
1.0. MicroSelectron HDR Ir-192 source is constructed in the
1.0. the source is constructed in the
brachyDetectorConstruction class. The source is composed by
an iridium core encapsulated in a stainless steel capsule
(body + tip). The source is put into a 30*cm water box.
an iridium core encapsulated in a capsule (body + tip).
The source is put in the center of a 30*cm water box.
1.1. The water box is made sensitive detector. A longitudinal slice
of it is associated to a planar read out geometry. At every hit
energy deposition is read and stored into a voxel matrix.
1.2. Voxel matrix is output to an ASCII file for further processing
(e.g. anysotropy and isodose calculations).
energy deposition is read and stored in a 2D histogram.
1.2. the output is the file brachy2.hbk
(e.g. anysotropy and isodose calculations):
1)1Dhistogram with the spectrum of initial energy of gamma
2)2Dhistogram with the distribution of energy in the plane (x,z,energy)
2. Make
1.3.the default visualization is with Dawn
A standard Geant4 example GNUmakefile is provided.
2. Usage
Simply run "Brachy" executable. The ASCII "Brachy.out" file is
produced.
run "Brachy" executable.
The framework in in interactive mode,so
you have to do:
idle>/run/beamOn ( numberofevents)
The output is ("brachy2.hbk")
------How to run the new version of AIDA:----------------------
1)Aida platform for Linux:gcc compiler 2.95.2
-------------------------enviroment with the compiler 2.95.2 on lxplus---------
setenv G4LEDATA /afs/cern.ch/sw/geant4/dev/data/G4EMLOW1.1
setenv G4INSTALL /...
#
# ---- Linux setup ----
#
setenv G4SYSTEM Linux-g++
#choose where you want to put the G4-libraries and G4workdir
setenv G4LIB ....
setenv G4WORKDIR ...
---visualization-----
# ---- set up VRMLview
setenv G4VIS_BUILD_VRMLFILE_DRIVER 1
setenv G4VIS_USE_VRML 1
setenv G4VIS_USE_VRMLFILE 1
setenv G4VRMLFILE_MAX_FILE_NUM 100
setenv G4VRMLFILE_VIEWER vrmlview #if installed
setenv G4VIS_USE_VRML 1
setenv G4VIS_USE_VRMLFILE 1
setenv PATH ${PATH}:"/afs/cern.ch/sw/contrib/VRML/bin/Linux"
# ---- set up OpenGL or Mesa
setenv G4VIS_BUILD_OPENGLX_DRIVER 1
setenv G4VIS_USE_OPENGLX 1
setenv OGLHOME /afs/cern.ch/sw/geant4/dev/Mesa/Linux-g++
# ---- set up DAWN
setenv G4VIS_BUILD_DAWN_DRIVER 1
setenv G4VIS_BUILD_DAWNFILE_DRIVER 1
setenv G4VIS_USE_DAWN 1
setenv G4VIS_USE_DAWNFILE 1
setenv PATH ${PATH}:"/afs/cern.ch/sw/geant4/dev/DAWN/Linux-g++"
-----------------------------------------------------------------------------------
# ---- Analysis----
setenv G4ANALYSIS_BUILD 1
setenv PATH "${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2/4.0.0/bin"
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.0/install/sharedstart.csh
setenv G4ANALYSIS_AIDA_CONFIG_CFLAGS `aida-config --noLicense --include`
setenv G4ANALYSIS_AIDA_CONFIG_LIBS `aida-config --noLicense --libs`
# ---- add to the LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $OGLHOME/lib
#
# ---- end of Linux set-up ----
before running remenber to delete *.hbk
in the file brachy.py there are the instructions to visualize the histograms with the old version of Lizard;
in order to do that open another lxplus with egcs-2.91.66 and make:
source /afs/cern.ch/sw/lhcxx/share/LHCXX/3.6.3-sec/install/sharedstart.csh
then digit lizard in the directory where brachy3.hbk is and then follow the instruction of the brachy.py
+15
View File
@@ -0,0 +1,15 @@
hm.selectStore("brachy3.hbk")
hm.ls()
#spectrum of initial particles
hEn=hm.load1D("30")
hplot(hEn)
#if you want to print the results:pl.psPrint("Brachyspettro.ps")
h2=hm.load2D("20")
hplot(h2)
v=vm.from2D(h2)
vm.list()
vector=vm.retrieve2D (3)
pl.dataOption("representation","color")
pl.plot(vector)
vector.toAscii("brachy.dat")
pl.reset()
@@ -0,0 +1,55 @@
#ifndef G4PROCESSTESTANALYSIS_HH
#define G4PROCESSTESTANALYSIS_HH
#include "globals.hh"
#include "g4std/vector"
#include "G4ThreeVector.hh"
class ITree;
class IHistogramFactory;
class IAnalysisFactory;
class ITupleFactory;
class ITuple;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class BrachyAnalysisManager
{
public:
~BrachyAnalysisManager();
void book();
void finish();
static BrachyAnalysisManager* getInstance();
void analyse(G4double,G4double,G4float);
void hist(G4double,G4double,G4float);
void Spectrum(G4double);
private:
G4double xx,zz;
G4float en;
G4double x,z;
static BrachyAnalysisManager* instance;
private:
BrachyAnalysisManager();
private:
IAnalysisFactory *aFact;
ITree *theTree;
IHistogramFactory *histFact;
ITupleFactory *tupFact;
};
#endif
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ****************************************
// * *
// * BrachyDetectorConstruction.hh *
@@ -30,32 +8,111 @@
#ifndef BrachyDetectorConstruction_H
#define BrachyDetectorConstruction_H 1
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4LogicalVolume.hh"
class BrachyPhantomSD;
class BrachyDetectorMessenger;
class G4LogicalVolume;
class G4Material;
class G4Tubs;
class G4Box;
class G4Sphere;
class G4Tubs;
class G4VPhysicalVolume;
class BrachyWaterBoxSD;
class G4VPhysicalVolume;
class BrachyDetectorConstruction : public G4VUserDetectorConstruction
{
public:
BrachyDetectorConstruction(G4String &SDName,G4int NumVoxelX,G4int NumVoxelZ);
~BrachyDetectorConstruction();
public:
BrachyDetectorConstruction(G4String&);
~BrachyDetectorConstruction();
public:
G4double GetBoxDim_X() {return m_BoxDimX;};
G4double GetBoxDim_Z() {return m_BoxDimZ;};
public:
G4VPhysicalVolume* Construct();
private:
const G4int m_NumVoxelX;
const G4int m_NumVoxelZ;
G4double m_BoxDimX;
G4double m_BoxDimY;
G4double m_BoxDimZ;
G4double m_BoxDimX;
G4double m_BoxDimY;
G4double m_BoxDimZ;
G4int NumVoxelX;
G4int NumVoxelZ;
G4double dimVoxel;
G4String m_SDName;
};
public:
void PrintDetectorParameters();
void SetAbsorberMaterial(G4String);
const G4double VoxelWidth_X() {return m_BoxDimX/NumVoxelX;};//num voxel
const G4double VoxelWidth_Z() {return m_BoxDimZ/NumVoxelZ;};
const G4int GetNumVoxelX(){return NumVoxelX;};
const G4int GetNumVoxelZ(){return NumVoxelZ;};
const G4double GetDimX(){return m_BoxDimX;};
const G4double GetBoxDim_Z() {return m_BoxDimZ;};
private:
BrachyDetectorMessenger* detectorMessenger;
G4Box* ExpHall; //pointer to the solid World
G4LogicalVolume* ExpHallLog; //pointer to the logical World
G4VPhysicalVolume* ExpHallPhys; //pointer to the physical World
G4Box* Phantom;
G4LogicalVolume* PhantomLog;
G4VPhysicalVolume* PhantomPhys;
G4Tubs* Capsule ;
G4LogicalVolume* CapsuleLog; //pointer to the logical World
G4VPhysicalVolume* CapsulePhys;
G4Sphere* CapsuleTip;
G4LogicalVolume* CapsuleTipLog;
G4VPhysicalVolume* CapsuleTipPhys;
G4Tubs* IridiumCore;
G4LogicalVolume* IridiumCoreLog;
G4VPhysicalVolume* IridiumCorePhys;
G4Material* air;
//G4Material* water;
G4Material* CapsuleMat;
G4Material* IridiumMat;
G4Material* AbsorberMaterial;
G4VPhysicalVolume* Construct();
private:
void DefineMaterials();
void ComputeDimVoxel();
public:
G4VPhysicalVolume* ConstructDetector();
};
inline void BrachyDetectorConstruction::ComputeDimVoxel()
{
dimVoxel=m_BoxDimX/NumVoxelX;
}
#endif
@@ -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: BrachyDetectorMessenger.hh,v 1.2 2002/06/18 22:24:22 guatelli Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef BrachyDetectorMessenger_h
#define BrachyDetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class BrachyDetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class BrachyDetectorMessenger: public G4UImessenger
{
public:
BrachyDetectorMessenger(BrachyDetectorConstruction* );
~BrachyDetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
BrachyDetectorConstruction* Detector;
G4UIdirectory* detDir;
G4UIcmdWithAString* AbsMaterCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -36,16 +36,16 @@ class G4Step;
class BrachyDummySD : public G4VSensitiveDetector
{
public:
BrachyDummySD();
~BrachyDummySD() {};
public:
BrachyDummySD();
~BrachyDummySD() {};
void Initialize(G4HCofThisEvent*HCE) {};
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) {return false;}
void EndOfEvent(G4HCofThisEvent*HCE) {};
void clear() {};
void DrawAll() {};
void PrintAll() {};
void Initialize(G4HCofThisEvent*HCE) {};
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) {return false;}
void EndOfEvent(G4HCofThisEvent*HCE) {};
void clear() {};
void DrawAll() {};
void PrintAll() {};
};
BrachyDummySD::BrachyDummySD() : G4VSensitiveDetector("dummySD")
@@ -31,27 +31,40 @@
#include "G4UserEventAction.hh"
#include "globals.hh"
class BrachyDetectorConstruction;
class BrachyAnalysisManager;
class BrachyEventAction : public G4UserEventAction
{
public:
BrachyEventAction(G4float *pVoxel,G4int NumVoxelX,G4int NumVoxelZ);
~BrachyEventAction();
public:
BrachyEventAction(G4String&);
~BrachyEventAction();
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
public:
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
private:
private:
G4double EnergyDep;
G4int m_NumVoxelX;
G4int m_NumVoxelZ;
const G4int m_NumVoxelX;
const G4int m_NumVoxelZ;
G4float *m_pVoxel;
private:
G4int m_HitsCollectionID;
BrachyDetectorConstruction *pDetector;
G4double VoxelWidth_Z;
G4double VoxelWidth_X;
private:
G4int m_HitsCollectionID;
G4String drawFlag;
G4int j;
G4int i;
G4int k;
G4double x;
G4double z;
G4String SDname;
G4int printModulo;
};
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************
// * *
// * BrachyPhantomHit.hh *
// * *
// ********************************
#ifndef BrachyPhantomHit_h
#define BrachyPhantomHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
class BrachyPhantomHit : public G4VHit
{
public:
BrachyPhantomHit(G4LogicalVolume* logVol,G4int XID,G4int ZID);
~BrachyPhantomHit();
BrachyPhantomHit(const BrachyPhantomHit &right);
const BrachyPhantomHit& operator=(const BrachyPhantomHit &right);
int operator==(const BrachyPhantomHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
private:
G4ThreeVector m_Pos;
G4RotationMatrix m_Rot;
const G4LogicalVolume* m_pLogV;
G4double m_Edep;
G4int m_XID;
G4int m_ZID;
public:
inline void SetCellID(G4int XID,G4int ZID)
{m_XID = XID;m_ZID = ZID;}
inline G4int GetXID()
{return m_XID;}
inline G4int GetZID()
{return m_ZID;}
inline void SetEdep(G4double edep)
{m_Edep = edep;}
inline void AddEdep(G4double edep)
{m_Edep += edep;}
inline G4double GetEdep()
{return m_Edep;}
inline void SetPos(G4ThreeVector xyz)
{m_Pos = xyz;}
inline G4ThreeVector GetPos()
{return m_Pos;}
inline void SetRot(G4RotationMatrix rmat)
{m_Rot = rmat;}
inline G4RotationMatrix GetRot()
{return m_Rot;}
inline const G4LogicalVolume * GetLogV()
{return m_pLogV;}
};
typedef G4THitsCollection<BrachyPhantomHit> BrachyPhantomHitsCollection;
extern G4Allocator<BrachyPhantomHit> BrachyPhantomHitAllocator;
inline void* BrachyPhantomHit::operator new(size_t)
{
void *aHit;
aHit = (void *) BrachyPhantomHitAllocator.MallocSingle();
return aHit;
}
inline void BrachyPhantomHit::operator delete(void *aHit)
{
BrachyPhantomHitAllocator.FreeSingle((BrachyPhantomHit*) aHit);
}
#endif
@@ -27,25 +27,25 @@
// ************************************
#ifndef BrachyWaterBoxROGeometry_h
#define BrachyWaterBoxROGeometry_h
#ifndef BrachyPhantomROGeometry_h
#define BrachyPhantomROGeometry_h
#include "G4VReadOutGeometry.hh"
class BrachyWaterBoxROGeometry : public G4VReadOutGeometry
class BrachyPhantomROGeometry : public G4VReadOutGeometry
{
public:
BrachyWaterBoxROGeometry(G4String aString,G4double DetDimX,G4double DetDimZ,G4int NumVoxelX,G4int NumVoxelZ);
~BrachyWaterBoxROGeometry();
public:
BrachyPhantomROGeometry(G4String aString,G4double DetDimX,G4double DetDimZ,G4int NumVoxelX,G4int NumVoxelZ);
~BrachyPhantomROGeometry();
private:
const G4double m_DetDimX;
const G4double m_DetDimZ;
const G4int m_NumVoxelX;
const G4int m_NumVoxelZ;
private:
const G4double m_DetDimX;
const G4double m_DetDimZ;
const G4int m_NumVoxelX;
const G4int m_NumVoxelZ;
private:
G4VPhysicalVolume* Build();
private:
G4VPhysicalVolume* Build();
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************
// * *
// * BrachyWaterBoxSD.hh *
// * *
// ********************************
#ifndef BrachyPhantomSD_h
#define BrachyPHANTOMSD_h 1
#include "G4VSensitiveDetector.hh"
#include "BrachyPhantomHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class BrachyPhantomSD : public G4VSensitiveDetector
{
public:
BrachyPhantomSD(G4String name, G4int NumVoxelX, G4int NumVoxelZ);
~BrachyPhantomSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
BrachyPhantomHitsCollection *m_pPhantomHitsCollection;
const G4int m_NumVoxelX;
const G4int m_NumVoxelZ;
G4int *m_pVoxelID;
};
#endif
@@ -40,46 +40,46 @@ class G4LowEnergyBremsstrahlung;
class BrachyPhysicsList: public G4VUserPhysicsList
{
public:
BrachyPhysicsList();
~BrachyPhysicsList();
public:
BrachyPhysicsList();
~BrachyPhysicsList();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
void SetCuts();
public:
// Set Cuts
void SetGammaCut(G4double);
void SetElectronCut(G4double);
void SetPositronCut(G4double);
public:
// Set Cuts
void SetGammaCut(G4double);
void SetElectronCut(G4double);
void SetPositronCut(G4double);
void SetGammaLowLimit(G4double);
void SetElectronLowLimit(G4double);
void SetGELowLimit(G4double);
void SetLowEnSecPhotCut(G4double);
void SetLowEnSecElecCut(G4double);
void SetGammaLowLimit(G4double);
void SetElectronLowLimit(G4double);
void SetGELowLimit(G4double);
void SetLowEnSecPhotCut(G4double);
void SetLowEnSecElecCut(G4double);
private:
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
G4double cutForGamma;
G4double cutForElectron;
G4double cutForPositron;
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
protected:
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
void ConstructGeneral();
void ConstructEM();
private:
private:
G4LowEnergyIonisation* loweIon;
G4LowEnergyPhotoElectric* lowePhot;
G4LowEnergyBremsstrahlung* loweBrem;
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************************
// * *
// * BrachyPrimaryGeneratorAction.hh *
@@ -34,20 +12,28 @@
#include "G4RadioactiveDecay.hh"
class G4ParticleGun;
class G4Run;
class G4Event;
class BrachyAnalysisManager;
class BrachyPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
BrachyPrimaryGeneratorAction();
~BrachyPrimaryGeneratorAction();
public:
BrachyPrimaryGeneratorAction();
~BrachyPrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* m_pParticleGun;
G4RadioactiveDecay *m_pRadioactiveDecay;
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* m_pParticleGun;
G4RadioactiveDecay *m_pRadioactiveDecay;
G4double Energy;
// BrachyPrimaryGeneratorMessenger* gunMessenger;
G4std::vector<G4double> vettore;
};
#endif
@@ -0,0 +1,28 @@
#ifndef BrachyRunAction_h
#define BrachyRunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
class BrachyAnalysisManager;
class BrachyRunAction : public G4UserRunAction
{
public:
BrachyRunAction( );
~BrachyRunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run* );
private:
G4String SDname;
};
#endif
@@ -0,0 +1,28 @@
#ifndef BrachyVisManager_h
#define BrachyVisManager_h 1
#ifdef G4VIS_USE
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class BrachyVisManager: public G4VisManager {
public:
BrachyVisManager ();
private:
void RegisterGraphicsSystems ();
};
#endif
#endif
@@ -0,0 +1,31 @@
#
# Macro file for the initialization phase of "exampleN03.cc"
# when runing in interactive mode
#
# Sets some default verbose
#
#
# create empty scene
#
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# (Edit the next line(s) to choose another graphic system)
#/control/saveHistory
#/vis/open OGLIX
/vis/open DAWNFILE
/vis/viewer/flush
#
# draw scene/
#
#
# for drawing the tracks
# (if too many tracks cause core dump => storeTrajectory 0)
/tracking/storeTrajectory 1
/vis/scene/endOfEventAction accumulate
/run/verbose 1
/event/verbose 0
/tracking/verbose 0
/control/verbose 0
/vis/viewer/update
@@ -0,0 +1,159 @@
#include <stdlib.h>
#include "g4std/fstream"
#include "BrachyAnalysisManager.hh"
#include "G4ios.hh"
#include "AIDA/IHistogram1D.h"
#include "AIDA/IHistogram2D.h"
#include "AIDA/IManagedObject.h"
#include "AIDA/IAnalysisFactory.h"
#include "AIDA/IHistogramFactory.h"
#include "AIDA/ITupleFactory.h"
#include "AIDA/ITreeFactory.h"
#include "AIDA/ITree.h"
#include "AIDA/ITuple.h"
BrachyAnalysisManager* BrachyAnalysisManager::instance = 0;
BrachyAnalysisManager::BrachyAnalysisManager() :
aFact(0), theTree(0), histFact(0), tupFact(0)
{
//build up the factories
aFact = AIDA_createAnalysisFactory();
ITreeFactory * treeFact = aFact->createTreeFactory();
//parameters for the TreeFactory
bool fileExists = false;
bool readOnly = false;
std::string fileName="Brachy3.hbk";
theTree = treeFact->create(fileName, readOnly, fileExists, "hbook");
delete treeFact;
//HistoFactory and TupleFactory depend on theTree
histFact = aFact->createHistogramFactory( *theTree );
tupFact = aFact->createTupleFactory ( *theTree );
}
BrachyAnalysisManager::~BrachyAnalysisManager()
{
delete tupFact;
tupFact=0;
delete histFact;
histFact=0;
delete theTree;
histFact=0;
delete aFact;
aFact = 0;
}
BrachyAnalysisManager* BrachyAnalysisManager::getInstance()
{
if (instance == 0) instance = new BrachyAnalysisManager;
return instance;
}
void BrachyAnalysisManager::book()
{
// histograms and ntuple are managed by theTree
// h2 e h3 are not necessary ,useful for:check for non-zero
//you could do histFact->create2D("20","Energy, pos",300 ,-150.,150.,300,-15 //0.,150.);
IHistogram2D *h2 = histFact->create2D("20","Energy, pos",300 ,-150.,150.,300,-150.,150.);
// check for non-zero
IHistogram1D *h3 = histFact->create1D("30","Initial Energy", 100,0.,1.);
// check for non-zero
//Ntuple management
std::string columnNames = "float energy, float x, float z";
std::string options = "";
ITuple *tup = tupFact->create("1","brachy",columnNames, options);
// check for non-zero ...
if (tup) G4cout<<"The Ntuple is non-zero"<<G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void BrachyAnalysisManager::analyse(G4double xx,G4double zz,G4float en)
{
ITuple * ntuple = dynamic_cast<ITuple *> ( theTree->find("1") );
ntuple->fill(1, en);// fill ( int column, double value )
ntuple->fill(2, xx);
ntuple->fill(3, zz);
// alternatively(if all the columns are of the same type):
// std::vector<float> row;
// row.push_back(en);
// row.push_back(xx);
// row.push_back(zz);
// ntuple->fill(row);
// write Ntuple-row to file
// Should be called after fill is called for the columns.
// Unfilled columns will be filled with the default value for that column.
ntuple->addRow();
}
void BrachyAnalysisManager::hist(G4double x,G4double z, G4float enn)
{
IHistogram2D* h2 = dynamic_cast<IHistogram2D *> ( theTree->find("20") );
h2->fill(x,z,enn);
}
void BrachyAnalysisManager::Spectrum(G4double Init_En)
{
IHistogram1D* h3 = dynamic_cast<IHistogram1D *> ( theTree->find("30") );
h3->fill(Init_En);
}
void BrachyAnalysisManager::finish()
{
// write all histograms to file
theTree->commit();
// close (will again commit)
theTree->close();
}
@@ -1,35 +1,13 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ****************************************
// * *
// * BrachyDetectorConstruction.cc *
// * *
// ****************************************
#include "BrachyWaterBoxROGeometry.hh"
#include "BrachyWaterBoxSD.hh"
#include "BrachyPhantomROGeometry.hh"
#include "BrachyPhantomSD.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4CSGSolid.hh"
#include "G4Sphere.hh"
#include "G4MaterialPropertyVector.hh"
@@ -45,6 +23,8 @@
#include "G4PVPlacement.hh"
#include "globals.hh"
#include "G4MaterialTable.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4PVParameterised.hh"
@@ -53,153 +33,412 @@
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4SDManager.hh"
#include "G4Colour.hh"
#include "G4UserLimits.hh"
#include "G4UnionSolid.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
//....
BrachyDetectorConstruction::BrachyDetectorConstruction(G4String &SDName,G4int NumVoxelX,G4int NumVoxelZ) :
m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ),m_BoxDimX(30*cm),m_BoxDimY(30*cm),m_BoxDimZ(30*cm)
BrachyDetectorConstruction::BrachyDetectorConstruction(G4String &SDName):
NumVoxelX(0),NumVoxelZ(0),m_BoxDimX(0), m_BoxDimY(0), m_BoxDimZ(0),
ExpHall(0),ExpHallLog(0),ExpHallPhys(0),
Phantom(0), PhantomLog(0), PhantomPhys(0),
Capsule(0),CapsuleLog(0),CapsulePhys(0),
CapsuleTip(0),CapsuleTipLog(0),CapsuleTipPhys(0),
IridiumCore(0),IridiumCoreLog(0),IridiumCorePhys(0)
{
m_SDName = SDName;
NumVoxelX=300;
NumVoxelZ=300;
m_BoxDimX=30*cm ;
m_BoxDimY=30*cm;
m_BoxDimZ=30*cm;
ComputeDimVoxel();
m_SDName = SDName;//pointer to sensitive detector
// create commands for interactive definition of the calorimeter
detectorMessenger = new BrachyDetectorMessenger(this);
m_SDName = SDName;
}
//....
BrachyDetectorConstruction::~BrachyDetectorConstruction()
{
{
}
//....
G4VPhysicalVolume* BrachyDetectorConstruction::Construct()
{
// Define required materials
{
DefineMaterials();
return ConstructDetector();
}
G4double A; // atomic mass
G4double Z; // atomic number
G4double d; // density
void BrachyDetectorConstruction::DefineMaterials()
{
// Define required materials
G4double A; // atomic mass
G4double Z; // atomic number
G4double d; // density
// General elements
A = 1.01*g/mole;
Z = 1;
G4Element* elH = new G4Element ("Hydrogen","H",Z,A);
A = 1.01*g/mole;
G4Element* elH = new G4Element ("Hydrogen","H",Z=1.,A);
A = 14.01*g/mole;
Z = 7;
G4Element* elN = new G4Element("Nitrogen","N",Z,A);
A = 14.01*g/mole;
G4Element* elN = new G4Element("Nitrogen","N",Z=7.,A);
A = 16.00*g/mole;
G4Element* elO = new G4Element("Oxygen","O",Z=8.,A);
A=12.011*g/mole;
G4Element* elC=new G4Element("Carbon","C",Z=6.,A);
A=22.99*g/mole;
G4Element* elNa=new G4Element("Sodium","Na",Z=11.,A);
A=24.305*g/mole;
G4Element* elMg=new G4Element("Magnesium","Mg",Z=12.,A);
A=30.974*g/mole;
G4Element* elP=new G4Element("Phosphorus","P",Z=15.,A);
A=32.06*g/mole;
G4Element* elS=new G4Element("Sulfur","S",Z=16.,A);
A=35.453*g/mole;
G4Element* elCl=new G4Element("Chlorine","Cl",Z=17.,A);
A=39.098*g/mole;
G4Element* elK=new G4Element("Potassium","K",Z=19.,A);
A=40.08*g/mole;
G4Element* elCa=new G4Element("Calcium","Ca",Z=20.,A);
A = 16.00*g/mole;
Z = 8;
G4Element* elO = new G4Element("Oxygen","O",Z,A);
// Elements for source capsule and cable
A = 54.94*g/mole;
Z = 25;
G4Element* elMn = new G4Element("Manganese","Mn",Z,A);
A = 28.09*g/mole;
Z = 14;
G4Element* elSi = new G4Element("Silicon","Si",Z,A);
A=65.38*g/mole;
G4Element* elZn=new G4Element("Zinc","Zn",Z=30.,A);
A=26.98*g/mole;
G4Element* elAl=new G4Element("Aluminum","Al", Z=13.,A);
A = 52.00*g/mole;
Z = 24;
G4Element* elCr = new G4Element("Chromium","Cr",Z,A);
A = 58.70*g/mole;
Z = 28;
G4Element* elNi = new G4Element("Nickel","Ni",Z,A);
A = 55.85*g/mole;
Z = 26;
G4Element* elFe = new G4Element("Iron","Fe",Z,A);
A = 54.94*g/mole;
G4Element* elMn = new G4Element("Manganese","Mn",Z=25.,A);
A = 28.09*g/mole;
G4Element* elSi = new G4Element("Silicon","Si",Z=14.,A);
// Lead material
A = 207.19*g/mole;
Z = 82;
d = 11.35*g/cm3;
G4Material* matPb = new G4Material("Lead",Z,A,d);
A = 52.00*g/mole;
G4Element* elCr = new G4Element("Chromium","Cr",Z=24.,A);
// Air material
d = 1.290*mg/cm3;
G4Material* matAir = new G4Material("Air",d,2);
matAir->AddElement(elN,0.7);
matAir->AddElement(elO,0.3);
A = 58.70*g/mole;
G4Element* elNi = new G4Element("Nickel","Ni",Z=28.,A);
// Water
d = 1.000*g/cm3;
G4Material* matH2O = new G4Material("Water",d,2);
matH2O->AddElement(elH,2);
matH2O->AddElement(elO,1);
A = 55.85*g/mole;
G4Element* elFe = new G4Element("Iron","Fe",Z=26.,A);
// Lead material
A = 207.19*g/mole;
Z = 82;
d = 11.35*g/cm3;
G4Material* matPb = new G4Material("Lead",Z,A,d);
// Iridium (Medical Physics, Vol 25, No 10, Oct 1998)
d = 22.42*g/cm3;
A = 191.96260*g/mole ;
Z = 77;
G4Material* matIr192 = new G4Material("Iridium",Z,A,d);
d = 22.42*g/cm3;
A = 191.96260*g/mole ;
Z = 77;
G4Material* matIr192 = new G4Material("Iridium",Z,A,d);
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
d = 8.02*g/cm3 ;
G4Material* matSteel = new G4Material("Stainless steel",d,5);
matSteel->AddElement(elMn, 0.02);
matSteel->AddElement(elSi, 0.01);
matSteel->AddElement(elCr, 0.19);
matSteel->AddElement(elNi, 0.10);
matSteel->AddElement(elFe, 0.68);
//titanium
A=47.88*g/mole;
d=4.50*g/cm3;
G4Material* Titanium=new G4Material("titanium" ,Z=22.,A,d);
// Volumes
// Air material
d = 1.290*mg/cm3;
G4Material* matAir = new G4Material("Air",d,2);
matAir->AddElement(elN,0.7);
matAir->AddElement(elO,0.3);
// EXPERIMENTAL HALL (our world volume)
G4double ExpHall_x = 4.0*m;
G4double ExpHall_y = 4.0*m;
G4double ExpHall_z = 4.0*m;
// Water
d = 1.000*g/cm3;
G4Material* matH2O = new G4Material("Water",d,2);
matH2O->AddElement(elH,2);
matH2O->AddElement(elO,1);
//soft tissue(NIST data)
d=1.0*g/cm3;
G4Material* soft=new G4Material("tissue",d,13);
soft->AddElement(elH,0.104472);
soft->AddElement(elC,0.23219);
soft->AddElement(elN,0.02488);
soft->AddElement(elO,0.630238);
soft->AddElement(elNa,0.00113);
soft->AddElement(elMg,0.00013);
soft->AddElement(elP,0.00133);
soft->AddElement(elS,0.00199);
soft->AddElement(elCl,0.00134);
soft->AddElement(elK,0.00199);
soft->AddElement(elCa,0.00023);
soft->AddElement(elFe,0.00005);
soft->AddElement(elZn,0.00003);
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
d = 8.02*g/cm3 ;
G4Material* matSteel = new G4Material("Stainless steel",d,5);
matSteel->AddElement(elMn, 0.02);
matSteel->AddElement(elSi, 0.01);
matSteel->AddElement(elCr, 0.19);
matSteel->AddElement(elNi, 0.10);
matSteel->AddElement(elFe, 0.68);
//--elements for Iodium source which will be introduced in the next release
//--elements for Iodium source which will be introduced in the next release
//gold(chimica degli elementi N.N Greenwood,A.Earnshaw)
A=196.97*g/mole;
d=19.32*g/cm3;
G4Material* gold=new G4Material("gold",Z=79.,A,d);
//IodiumCore(chimica degli elementi N.N Greenwood,A.Earnshaw)
A=124.9*g/mole;
d=4.862*g/cm3;
G4Material* matI=new G4Material("Iodium",Z=53.,A,d);
//ceramica(Medical Physics, May 2000)
G4Box* ExpHall = new G4Box("ExpHall",ExpHall_x,ExpHall_y,ExpHall_z);
G4LogicalVolume* ExpHallLog = new G4LogicalVolume(ExpHall,matAir,"ExpHallLog",0,0,0);
G4VPhysicalVolume* ExpHallPhys = new G4PVPlacement(0,G4ThreeVector(),"ExpHallPhys",ExpHallLog,0,false,0);
d=2.88*g/cm3;
G4Material* ceramica=new G4Material("allumina",d,2);
ceramica->AddElement(elAl,2);
ceramica->AddElement(elO,3);
// Water Box
G4Box* WaterBox = new G4Box("WaterBox",m_BoxDimX/2,m_BoxDimY/2,m_BoxDimZ/2);
G4LogicalVolume* WaterBoxLog = new G4LogicalVolume(WaterBox,matH2O,"WaterBoxLog",0,0,0);
G4VPhysicalVolume* WaterBoxPhys = new G4PVPlacement(0,G4ThreeVector(),WaterBoxLog,"WaterBoxPhys",ExpHallLog,false,0);
// Capsule main body
AbsorberMaterial=matH2O;
air= matAir;
CapsuleMat=matSteel;
IridiumMat=matIr192;
G4Tubs* Capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
G4LogicalVolume* CapsuleLog = new G4LogicalVolume(Capsule,matSteel,"CapsuleLog");
G4VPhysicalVolume* CapsulePhys = new G4PVPlacement(0,G4ThreeVector(0,0,-1.975),CapsuleLog,"CapsulePhys",WaterBoxLog,false,0);
// Capsule tip
G4Sphere* CapsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
G4LogicalVolume* CapsuleTipLog = new G4LogicalVolume(CapsuleTip,matSteel,"CapsuleTipLog");
G4VPhysicalVolume* CapsuleTipPhys = new G4PVPlacement(0,G4ThreeVector(0.,0.,1.75*mm),CapsuleTipLog,"CapsuleTipPhys",WaterBoxLog,false,0);
// Iridium core
G4Tubs* IridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
G4LogicalVolume* IridiumCoreLog = new G4LogicalVolume(IridiumCore,matIr192,"IridiumCoreLog");
G4VPhysicalVolume* IridiumCorePhys = new G4PVPlacement(0,G4ThreeVector(),IridiumCoreLog,"IridiumCorePhys",CapsuleLog,false,0);
// Sensitive Detector and ReadOut geometry definition
G4SDManager* pSDManager = G4SDManager::GetSDMpointer();
BrachyWaterBoxSD* pWaterBoxSD = new BrachyWaterBoxSD(m_SDName,m_NumVoxelX,m_NumVoxelZ);
if(pWaterBoxSD)
{
G4String ROGeometryName = "WaterBoxROGeometry";
BrachyWaterBoxROGeometry* pWaterBoxROGeometry = new BrachyWaterBoxROGeometry(ROGeometryName,m_BoxDimX,m_BoxDimZ,m_NumVoxelX,m_NumVoxelZ);
pWaterBoxROGeometry->BuildROGeometry();
pWaterBoxSD->SetROgeometry(pWaterBoxROGeometry);
pSDManager->AddNewDetector(pWaterBoxSD);
WaterBoxLog->SetSensitiveDetector(pWaterBoxSD);
CapsuleLog->SetSensitiveDetector(pWaterBoxSD);
CapsuleTipLog->SetSensitiveDetector(pWaterBoxSD);
IridiumCoreLog->SetSensitiveDetector(pWaterBoxSD);
}
return ExpHallPhys;
}
G4VPhysicalVolume* BrachyDetectorConstruction::ConstructDetector()
{// Volumes
ComputeDimVoxel();
// EXPERIMENTAL HALL (our world volume)
G4double ExpHall_x = 4.0*m;
G4double ExpHall_y = 4.0*m;
G4double ExpHall_z = 4.0*m;
G4Colour white (1.0, 1.0, 1.0) ;
G4Colour grey (0.5, 0.5, 0.5) ;
G4Colour lgrey (.75, .75, .75) ;
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour blue (0.0, 0.0, 1.0) ;
G4Colour cyan (0.0, 1.0, 1.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Colour yellow (1.0, 1.0, 0.0) ;
G4Colour lblue (0.0, 0.0, .75);
//World volume
ExpHall = new G4Box("ExpHall",ExpHall_x,ExpHall_y,ExpHall_z);
ExpHallLog = new G4LogicalVolume(ExpHall,air,"ExpHallLog",0,0,0);
ExpHallPhys = new G4PVPlacement(0,G4ThreeVector(),"ExpHallPhys",ExpHallLog,NULL,false,0);
// Water Box
Phantom= new G4Box("Phantom",m_BoxDimX/2,m_BoxDimY/2,m_BoxDimZ/2);
PhantomLog = new G4LogicalVolume(Phantom,AbsorberMaterial,"PhantomLog",0,0,0);
PhantomPhys = new G4PVPlacement(0,G4ThreeVector(),"WaterBoxPhys",PhantomLog,ExpHallPhys,false,0);
// Capsule main body
G4Tubs* Capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
G4LogicalVolume* CapsuleLog = new G4LogicalVolume(Capsule,CapsuleMat,"CapsuleLog");
G4VPhysicalVolume* CapsulePhys = new G4PVPlacement(0,G4ThreeVector(0,0,-1.975),"CapsulePhys",CapsuleLog,PhantomPhys,false,0);
// Capsule tip
G4Sphere* CapsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
G4LogicalVolume* CapsuleTipLog = new G4LogicalVolume(CapsuleTip,CapsuleMat,"CapsuleTipLog");
G4VPhysicalVolume* CapsuleTipPhys = new G4PVPlacement(0,G4ThreeVector(0.,0.,1.75*mm),"CapsuleTipPhys",CapsuleTipLog,PhantomPhys,false,0);
// Iridium core
G4Tubs* IridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
G4LogicalVolume* IridiumCoreLog = new G4LogicalVolume(IridiumCore,IridiumMat,"IridiumCoreLog");
G4VPhysicalVolume* IridiumCorePhys = new G4PVPlacement(0,G4ThreeVector(),"IridiumCorePhys",IridiumCoreLog,CapsulePhys,false,0);
// Sensitive Detector and ReadOut geometry definition
//
G4SDManager* pSDManager = G4SDManager::GetSDMpointer();
BrachyPhantomSD* pPhantomSD = new BrachyPhantomSD(m_SDName,NumVoxelX,NumVoxelZ);
if(pPhantomSD)
{
G4String ROGeometryName = "PhantomROGeometry";
BrachyPhantomROGeometry* pPhantomROGeometry = new BrachyPhantomROGeometry(ROGeometryName,m_BoxDimX,m_BoxDimZ,NumVoxelX,NumVoxelZ);
pPhantomROGeometry->BuildROGeometry();
pPhantomSD->SetROgeometry(pPhantomROGeometry);
pSDManager->AddNewDetector(pPhantomSD);
PhantomLog->SetSensitiveDetector(pPhantomSD);
CapsuleLog->SetSensitiveDetector(pPhantomSD);
CapsuleTipLog->SetSensitiveDetector(pPhantomSD);
IridiumCoreLog->SetSensitiveDetector(pPhantomSD);
}
//
// Visualization attributes
//
ExpHallLog->SetVisAttributes (G4VisAttributes::Invisible);
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(lblue);
simpleBoxVisAtt->SetVisibility(true);
simpleBoxVisAtt->SetForceWireframe(true);
PhantomLog->SetVisAttributes(simpleBoxVisAtt);
G4VisAttributes* simpleIridiumVisAtt= new G4VisAttributes(magenta);
simpleIridiumVisAtt->SetVisibility(true);
simpleIridiumVisAtt->SetForceWireframe(true);
IridiumCoreLog->SetVisAttributes(simpleIridiumVisAtt);
G4VisAttributes* simpleCapsuleVisAtt= new G4VisAttributes(red);
simpleCapsuleVisAtt->SetVisibility(true);
simpleCapsuleVisAtt->SetForceWireframe(true);
CapsuleLog->SetVisAttributes( simpleCapsuleVisAtt);
G4VisAttributes* simpleCapsuleTipVisAtt= new G4VisAttributes(red);
simpleCapsuleTipVisAtt->SetVisibility(true);
simpleCapsuleTipVisAtt->SetForceSolid(true);
CapsuleTipLog->SetVisAttributes( simpleCapsuleTipVisAtt);
//always return the physical World
PrintDetectorParameters();
return ExpHallPhys;
}
void BrachyDetectorConstruction::PrintDetectorParameters()
{
G4cout << "-----------------------------------------------------------------------"
<< G4endl
<<"the detector is a box whose size is: "
<<G4endl
<<m_BoxDimX/cm
<< " cm * "
<<m_BoxDimY/cm
<< " cm * "
<<m_BoxDimZ/cm
<< " cm"
<< G4endl
<<"numVoxel: "
<<NumVoxelX
<<G4endl
<<"dim voxel: "
<<dimVoxel/mm
<<"mm"
<<G4endl
<<"material of the box : "
<<AbsorberMaterial->GetName()
<<G4endl
<<"the source is at the center of the detector"
<<G4endl
<<"-------------------------------------------------------------------------"
<< G4endl;
}
void BrachyDetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial)
{AbsorberMaterial = pttoMaterial;
PhantomLog->SetMaterial(pttoMaterial);
PrintDetectorParameters();
}
else G4cout<<"that's not avaiable!"<<G4endl;
}
@@ -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: BrachyDetectorMessenger.cc,v 1.2 2002/06/18 22:30:31 guatelli Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
BrachyDetectorMessenger::BrachyDetectorMessenger( BrachyDetectorConstruction* Det)
:Detector(Det)
{
detDir = new G4UIdirectory("/detector/");
detDir->SetGuidance(" detector control.");
AbsMaterCmd = new G4UIcmdWithAString("/detector/setMaterial",this);
AbsMaterCmd->SetGuidance("Select Material of the detector.");
AbsMaterCmd->SetParameterName("choice",false);
AbsMaterCmd->AvailableForStates(Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
BrachyDetectorMessenger::~BrachyDetectorMessenger()
{
delete AbsMaterCmd;
delete UpdateCmd;
delete detDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void BrachyDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == AbsMaterCmd )
{ Detector->SetAbsorberMaterial(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -27,9 +27,9 @@
// *******************************
#include "BrachyEventAction.hh"
#include "BrachyWaterBoxHit.hh"
#include "BrachyWaterBoxSD.hh"
#include "BrachyPhantomHit.hh"
#include "BrachyPhantomSD.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
@@ -40,54 +40,117 @@
#include "G4SDManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "G4VVisManager.hh"
#include"BrachyAnalysisManager.hh"
//....
BrachyEventAction::BrachyEventAction(G4float *pVoxel,G4int NumVoxelX,G4int NumVoxelZ) :
m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ)
BrachyEventAction::BrachyEventAction(G4String &SDName) :
drawFlag("all" ),printModulo(1)
{
m_HitsCollectionID = -1;
m_pVoxel = pVoxel;
m_HitsCollectionID = -1;
SDname=SDName;
pDetector=new BrachyDetectorConstruction(SDname);
m_NumVoxelX=pDetector-> GetNumVoxelX();
m_NumVoxelZ=pDetector->GetNumVoxelZ();
VoxelWidth_Z= pDetector -> VoxelWidth_Z() ;
VoxelWidth_X=pDetector->VoxelWidth_X();
}
//....
BrachyEventAction::~BrachyEventAction()
{
delete pDetector;
}
//....
void BrachyEventAction::BeginOfEventAction(const G4Event*)
void BrachyEventAction::BeginOfEventAction(const G4Event* aEvent)
{
G4SDManager* pSDManager = G4SDManager::GetSDMpointer();
if(m_HitsCollectionID == -1)
m_HitsCollectionID = pSDManager->GetCollectionID("WaterBoxHitsCollection");
G4SDManager* pSDManager = G4SDManager::GetSDMpointer();
if(m_HitsCollectionID == -1)
m_HitsCollectionID = pSDManager->GetCollectionID("PhantomHitsCollection");
}
//....
void BrachyEventAction::EndOfEventAction(const G4Event* evt)
{
if(m_HitsCollectionID < 0)
return;
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
BrachyWaterBoxHitsCollection* CHC = NULL;
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
if(HCE)
CHC = (BrachyWaterBoxHitsCollection*)(HCE->GetHC(m_HitsCollectionID));
if((evno==100)||(evno==500)||(evno==1000)||(evno==2500)
||(evno==5000)||(evno==7000)||(evno==9000)||
(evno==9500)||(evno==29000000)||(evno==29500000))
G4cout << evno << G4endl;
if(m_HitsCollectionID < 0)
return;
if(CHC)
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
BrachyPhantomHitsCollection* CHC = NULL;
if(HCE)
CHC = (BrachyPhantomHitsCollection*)(HCE->GetHC(m_HitsCollectionID));
if(CHC)
{
G4int HitCount = CHC->entries();
for (G4int h=0; h<HitCount; h++)
{
if(m_pVoxel)
{
// Fill voxel matrix with energy deposit data
G4int HitCount = CHC->entries();
for (G4int h=0; h<HitCount; h++)
m_pVoxel[((*CHC)[h])->GetZID() + ((*CHC)[h])->GetXID()*m_NumVoxelX] += (*CHC)[h]->GetEdep();
}
}
BrachyAnalysisManager* analysis = BrachyAnalysisManager::getInstance();
i=((*CHC)[h])->GetZID();
k=((*CHC)[h])->GetXID();
j=i+k*m_NumVoxelX;
EnergyDep=(*CHC)[h]->GetEdep();
x = (-m_NumVoxelZ+1+2*k)*VoxelWidth_X/2;
z = (- m_NumVoxelZ+1+2*i)*VoxelWidth_Z/2;
if(EnergyDep!=0){
{ if( abs(x)>0.56*mm && abs(z)>3.8*mm)
analysis->hist(x,z,EnergyDep); analysis->analyse(x,z,EnergyDep);}}}
}
// extract the trajectories and draw them
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]);
if (drawFlag == "all") trj->DrawTrajectory(50);
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(50);
else if ((drawFlag == "neutral")&&(trj->GetCharge() == 0.))
trj->DrawTrajectory(50);
}
}
}
@@ -99,5 +162,3 @@ void BrachyEventAction::EndOfEventAction(const G4Event* evt)
@@ -22,73 +22,73 @@
//
// ********************************
// * *
// * BrachyWaterBoxHit.cc *
// * BrachyPhantomHit.cc *
// * *
// ********************************
#include "BrachyWaterBoxHit.hh"
#include "BrachyPhantomHit.hh"
#include "G4ios.hh"
#include "G4VVisManager.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4LogicalVolume.hh"
G4Allocator<BrachyWaterBoxHit> BrachyWaterBoxHitAllocator;
G4Allocator<BrachyPhantomHit> BrachyPhantomHitAllocator;
//....
BrachyWaterBoxHit::BrachyWaterBoxHit(G4LogicalVolume* logVol,G4int XID,G4int ZID)
:m_pLogV(logVol),m_XID(XID),m_ZID(ZID)
BrachyPhantomHit::BrachyPhantomHit(G4LogicalVolume* logVol,G4int XID,G4int ZID)
:m_pLogV(logVol),m_XID(XID),m_ZID(ZID)
{
m_Edep=0;
m_Edep=0;
}
//....
BrachyWaterBoxHit::~BrachyWaterBoxHit()
BrachyPhantomHit::~BrachyPhantomHit()
{
}
//....
BrachyWaterBoxHit::BrachyWaterBoxHit(const BrachyWaterBoxHit &right)
BrachyPhantomHit::BrachyPhantomHit(const BrachyPhantomHit &right)
{
m_XID = right.m_XID;
m_ZID = right.m_ZID;
m_Edep = right.m_Edep;
m_Pos = right.m_Pos;
m_Rot = right.m_Rot;
m_pLogV = right.m_pLogV;
m_XID = right.m_XID;
m_ZID = right.m_ZID;
m_Edep = right.m_Edep;
m_Pos = right.m_Pos;
m_Rot = right.m_Rot;
m_pLogV = right.m_pLogV;
}
//....
const BrachyWaterBoxHit& BrachyWaterBoxHit::operator=(const BrachyWaterBoxHit &right)
const BrachyPhantomHit& BrachyPhantomHit::operator=(const BrachyPhantomHit &right)
{
m_XID = right.m_XID;
m_ZID = right.m_ZID;
m_Edep = right.m_Edep;
m_Pos = right.m_Pos;
m_Rot = right.m_Rot;
m_pLogV = right.m_pLogV;
return *this;
m_XID = right.m_XID;
m_ZID = right.m_ZID;
m_Edep = right.m_Edep;
m_Pos = right.m_Pos;
m_Rot = right.m_Rot;
m_pLogV = right.m_pLogV;
return *this;
}
//....
int BrachyWaterBoxHit::operator==(const BrachyWaterBoxHit &right) const
int BrachyPhantomHit::operator==(const BrachyPhantomHit &right) const
{
return((m_XID==right.m_XID)&&(m_ZID==right.m_ZID));
return((m_XID==right.m_XID)&&(m_ZID==right.m_ZID));
}
//....
void BrachyWaterBoxHit::Draw()
void BrachyPhantomHit::Draw()
{
}
//....
void BrachyWaterBoxHit::Print()
void BrachyPhantomHit::Print()
{
}
@@ -0,0 +1,116 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ************************************
// * *
// * BrachyWaterBoxROGeometry.cc *
// * *
// ************************************
#include "BrachyPhantomROGeometry.hh"
#include "BrachyDummySD.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4SDManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4SubtractionSolid.hh"
#include "G4ThreeVector.hh"
#include "G4Material.hh"
//....
BrachyPhantomROGeometry::BrachyPhantomROGeometry(G4String aString,G4double DetDimX,G4double DetDimZ,G4int NumVoxelX,G4int NumVoxelZ)
: G4VReadOutGeometry(aString),m_DetDimX(DetDimX),m_DetDimZ(DetDimZ),m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ)
{
}
//....
BrachyPhantomROGeometry::~BrachyPhantomROGeometry()
{
}
//....
G4VPhysicalVolume* BrachyPhantomROGeometry::Build()
{
// A dummy material is used to fill the volumes of the readout geometry.
// (It will be allowed to set a NULL pointer in volumes of such virtual
// division in future, since this material is irrelevant for tracking.)
G4Material* dummyMat = new G4Material(name="dummyMat", 1., 1.*g/mole, 1.*g/cm3);
// Slice thickness is the average of Voxel X and Z sizes
G4double DetVoxel_y = (m_DetDimX/m_NumVoxelX+m_DetDimZ/m_NumVoxelZ)/2.0;
G4double ExpHall_x = 4.0*m;
G4double ExpHall_y = 4.0*m;
G4double ExpHall_z = 4.0*m;
G4double Det_x = m_DetDimX/2;
G4double Det_y = DetVoxel_y;
G4double Det_z = m_DetDimZ/2;
G4double DetVoxelX_x = Det_x/m_NumVoxelX;
G4double DetVoxelX_y = DetVoxel_y;
G4double DetVoxelX_z = Det_z;
G4double DetVoxelX_dx = 2*DetVoxelX_x;
G4double DetVoxelZ_x = Det_x;
G4double DetVoxelZ_y = DetVoxel_y;
G4double DetVoxelZ_z = Det_z/m_NumVoxelZ;
G4double DetVoxelZ_dz = 2*DetVoxelZ_z;
G4Box *ROExpHall = new G4Box("ROExpHall",ExpHall_x,ExpHall_y,ExpHall_z);
G4LogicalVolume *ROExpHallLog = new G4LogicalVolume(ROExpHall,dummyMat,"ROExpHallLog",0,0,0);
G4VPhysicalVolume *ROExpHallPhys = new G4PVPlacement(0,G4ThreeVector(),"ROExpHallPhys",ROExpHallLog,0,false,0);
G4Box *RODetector = new G4Box("RODetector", Det_x, Det_y, Det_z);
G4LogicalVolume *RODetectorLog = new G4LogicalVolume(RODetector,dummyMat,"RODetectorLog",0,0,0);
G4VPhysicalVolume *RODetectorPhys = new G4PVPlacement(0,G4ThreeVector(),"DetectorPhys",RODetectorLog,ROExpHallPhys,false,0);
// ReadOut Voxel division
// X division first...
G4Box *RODetectorXDivision = new G4Box("RODetectorXDivision",DetVoxelX_x,DetVoxelX_y,DetVoxelX_z);
G4LogicalVolume *RODetectorXDivisionLog = new G4LogicalVolume(RODetectorXDivision,dummyMat,"RODetectorXDivisionLog",0,0,0);
G4VPhysicalVolume *RODetectorXDivisionPhys = new G4PVReplica("RODetectorXDivisionPhys",RODetectorXDivisionLog,RODetectorPhys,kXAxis,m_NumVoxelX,DetVoxelX_dx);
// ...then Z division
G4Box *RODetectorZDivision = new G4Box("RODetectorZDivision",DetVoxelZ_x,DetVoxelZ_y,DetVoxelZ_z);
G4LogicalVolume *RODetectorZDivisionLog = new G4LogicalVolume(RODetectorZDivision,dummyMat,"RODetectorZDivisionLog",0,0,0);
G4VPhysicalVolume *RODetectorZDivisionPhys = new G4PVReplica("RODetectorZDivisionPhys",RODetectorZDivisionLog,RODetectorXDivisionPhys,kZAxis,m_NumVoxelZ,DetVoxelZ_dz);
BrachyDummySD *dummySD = new BrachyDummySD;
RODetectorZDivisionLog->SetSensitiveDetector(dummySD);
return ROExpHallPhys;
}
@@ -0,0 +1,141 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************
// * *
// * BrachyWaterBoxSD.cc *
// * *
// ********************************
#include "BrachyPhantomSD.hh"
#include "BrachyPhantomHit.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4Track.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ParticleDefinition.hh"
//....
BrachyPhantomSD::BrachyPhantomSD(G4String name, G4int NumVoxelX, G4int NumVoxelZ)
:G4VSensitiveDetector(name),m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ)
{
G4String HCname;
collectionName.insert(HCname="PhantomHitsCollection");
m_pVoxelID = new G4int[NumVoxelX*NumVoxelZ];
m_pPhantomHitsCollection = NULL;
}
//....
BrachyPhantomSD::~BrachyPhantomSD()
{
delete[] m_pVoxelID;
}
//....
void BrachyPhantomSD::Initialize(G4HCofThisEvent*HCE)
{
m_pPhantomHitsCollection = new BrachyPhantomHitsCollection(SensitiveDetectorName,collectionName[0]);
for(G4int k=0;k<m_NumVoxelZ;k++)
for(G4int i=0;i<m_NumVoxelX;i++)
m_pVoxelID[i+k*m_NumVoxelX] = -1;
}
//....
G4bool BrachyPhantomSD::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist)
{
if(!ROhist)
return false;
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() != "WaterBoxPhys")
return false;
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep==0.)
return false;
G4VPhysicalVolume* physVol = ROhist->GetVolume();
G4VPhysicalVolume* mothVol = ROhist->GetVolume(1);
// Read Voxel indexes: i is the x index, k is the z index
G4int k = ROhist->GetReplicaNumber();
G4int i = ROhist->GetReplicaNumber(1);
if(m_pVoxelID[i+k*m_NumVoxelX]==-1)
{
BrachyPhantomHit* PhantomHit = new BrachyPhantomHit(physVol->GetLogicalVolume(),i,k);
G4RotationMatrix rotM;
if(physVol->GetObjectRotation())
rotM = *(physVol->GetObjectRotation());
PhantomHit->SetEdep(edep);
PhantomHit->SetPos(physVol->GetTranslation());
PhantomHit->SetRot(rotM);
G4int VoxelID = m_pPhantomHitsCollection->insert(PhantomHit);
m_pVoxelID[i+k*m_NumVoxelX] = VoxelID - 1;
}
else
(*m_pPhantomHitsCollection)[m_pVoxelID[i+k*m_NumVoxelX]]->AddEdep(edep);
return true;
}
//....
void BrachyPhantomSD::EndOfEvent(G4HCofThisEvent*HCE)
{
static G4int HCID = -1;
if(HCID<0)
{
HCID = GetCollectionID(0);
}
HCE->AddHitsCollection(HCID,m_pPhantomHitsCollection);
}
//....
void BrachyPhantomSD::clear()
{
}
//....
void BrachyPhantomSD::DrawAll()
{
}
//....
void BrachyPhantomSD::PrintAll()
{
}
@@ -1,25 +1,3 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************************
// * *
// * BrachyPrimaryGeneratorAction.cc *
@@ -27,7 +5,7 @@
// ********************************************
#include "BrachyPrimaryGeneratorAction.hh"
#include "BrachyAnalysisManager.hh"
#include "G4ParticleTable.hh"
#include "Randomize.hh"
#include "G4Event.hh"
@@ -37,66 +15,94 @@
#include "G4UImanager.hh"
#include "globals.hh"
#include <math.h>
#include "G4RunManager.hh"
//....
BrachyPrimaryGeneratorAction::BrachyPrimaryGeneratorAction()
{
// Generate a gamma particle with energy = Ir-192 mean energy
G4int NumParticles = 1;
G4double Energy = 0.356*MeV;
G4int NumParticles = 1;
m_pParticleGun = new G4ParticleGun(NumParticles);
m_pParticleGun = new G4ParticleGun(NumParticles);
m_pParticleGun = new G4ParticleGun(NumParticles);
if(m_pParticleGun)
m_pParticleGun->SetParticleEnergy(Energy);
}
//....
BrachyPrimaryGeneratorAction::~BrachyPrimaryGeneratorAction()
{
if(m_pParticleGun)
delete m_pParticleGun;
if(m_pParticleGun)
delete m_pParticleGun;
}
//....
void BrachyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4ParticleTable* pParticleTable = G4ParticleTable::GetParticleTable();
G4String ParticleName = "gamma";
G4ParticleDefinition* pParticle = pParticleTable->FindParticle(ParticleName);
BrachyAnalysisManager* analysis = BrachyAnalysisManager::getInstance();
m_pParticleGun->SetParticleDefinition(pParticle);
G4ParticleTable* pParticleTable = G4ParticleTable::GetParticleTable();
G4String ParticleName = "gamma";
G4ParticleDefinition* pParticle = pParticleTable->FindParticle(ParticleName);
// Random generation of gamma source point inside the Iridium core cylinder(R=0.3*mm,h=3.5*mm)
G4double radius = 0.3*mm;
G4double x,y,z;
do{
x = (G4UniformRand()-0.5)*radius/0.5;
y = (G4UniformRand()-0.5)*radius/0.5;
}while(x*x+y*y > radius*radius);
z = (G4UniformRand()-0.5)*1.75*mm/0.5;
m_pParticleGun->SetParticleDefinition(pParticle);
G4ThreeVector position(x,y,z);
m_pParticleGun->SetParticlePosition(position);
// Random generation of gamma source point inside the Iodium core
G4double x,y,z;
G4double radius= 0.30*mm;
do{
x = (G4UniformRand()-0.5)*(radius)/0.5;
y = (G4UniformRand()-0.5)*(radius)/0.5;
}while(x*x+y*y > radius*radius);
z = (G4UniformRand()-0.5)*1.75*mm/0.5 ;
// Random generation of the impulse direction
G4double a,b,c;
G4double n;
do{
a = (G4UniformRand()-0.5)/0.5;
b = (G4UniformRand()-0.5)/0.5;
c = (G4UniformRand()-0.5)/0.5;
n = a*a+b*b+c*c;
}while(n > 1 || n == 0.0);
n = sqrt(n);
a /= n;
b /= n;
c /= n;
G4ThreeVector position(x,y,z);
m_pParticleGun->SetParticlePosition(position);
G4ThreeVector direction(a,b,c);
m_pParticleGun->SetParticleMomentumDirection(direction);
m_pParticleGun->GeneratePrimaryVertex(anEvent);
// Random generation of the impulse direction
G4double a,b,c;
G4double n;
do{
a = (G4UniformRand()-0.5)/0.5;
b = (G4UniformRand()-0.5)/0.5;
c = (G4UniformRand()-0.5)/0.5;
n = a*a+b*b+c*c;
}while(n > 1 || n == 0.0);
n = sqrt(n);
a /= n;
b /= n;
c /= n;
G4ThreeVector direction(a,b,c);
m_pParticleGun->SetParticleMomentumDirection(direction);
//Energy = 0.356*MeV;
Energy = 356*keV;
m_pParticleGun->SetParticleEnergy(Energy);
//Check the energy
analysis->Spectrum(Energy);
m_pParticleGun->GeneratePrimaryVertex(anEvent);
}
@@ -0,0 +1,56 @@
#include "BrachyRunAction.hh"
#include "BrachyEventAction.hh"
#include "BrachyAnalysisManager.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4SDManager.hh"
#include "G4Timer.hh"
BrachyRunAction::BrachyRunAction()
{
}
BrachyRunAction::~BrachyRunAction()
{
}
void BrachyRunAction::BeginOfRunAction(const G4Run* aRun)
{ BrachyAnalysisManager* analysis = BrachyAnalysisManager::getInstance();
analysis->book();
G4RunManager* pRunManager=G4RunManager::GetRunManager() ;
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
}
void BrachyRunAction::EndOfRunAction(const G4Run* aRun)
{
BrachyAnalysisManager* analysis = BrachyAnalysisManager::getInstance();
G4cout << "number of event = " << aRun->GetNumberOfEvent() << G4endl;
analysis->finish();
}
@@ -0,0 +1,132 @@
#ifdef G4VIS_USE
#include "BrachyVisManager.hh"
// Supported drivers...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_DAWNFILE
#include "G4DAWNFILE.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
#ifdef G4VIS_USE_VRMLFILE
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
#endif
#ifdef G4VIS_USE_RAYTRACER
#include "G4RayTracer.hh"
#endif
*/
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
BrachyVisManager::BrachyVisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void BrachyVisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_DAWNFILE
RegisterGraphicsSystem (new G4DAWNFILE);
#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
#ifdef G4VIS_USE_VRMLFILE
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
#endif
#ifdef G4VIS_USE_RAYTRACER
RegisterGraphicsSystem (new G4RayTracer);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
*/
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -1,116 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ************************************
// * *
// * BrachyWaterBoxROGeometry.cc *
// * *
// ************************************
#include "BrachyWaterBoxROGeometry.hh"
#include "BrachyDummySD.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4SDManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4SubtractionSolid.hh"
#include "G4ThreeVector.hh"
#include "G4Material.hh"
//....
BrachyWaterBoxROGeometry::BrachyWaterBoxROGeometry(G4String aString,G4double DetDimX,G4double DetDimZ,G4int NumVoxelX,G4int NumVoxelZ)
: G4VReadOutGeometry(aString),m_DetDimX(DetDimX),m_DetDimZ(DetDimZ),m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ)
{
}
//....
BrachyWaterBoxROGeometry::~BrachyWaterBoxROGeometry()
{
}
//....
G4VPhysicalVolume* BrachyWaterBoxROGeometry::Build()
{
// A dummy material is used to fill the volumes of the readout geometry.
// (It will be allowed to set a NULL pointer in volumes of such virtual
// division in future, since this material is irrelevant for tracking.)
G4Material* dummyMat = new G4Material(name="dummyMat", 1., 1.*g/mole, 1.*g/cm3);
// Slice thickness is the average of Voxel X and Z sizes
G4double DetVoxel_y = (m_DetDimX/m_NumVoxelX+m_DetDimZ/m_NumVoxelZ)/2.0;
G4double ExpHall_x = 4.0*m;
G4double ExpHall_y = 4.0*m;
G4double ExpHall_z = 4.0*m;
G4double Det_x = m_DetDimX/2;
G4double Det_y = DetVoxel_y;
G4double Det_z = m_DetDimZ/2;
G4double DetVoxelX_x = Det_x/m_NumVoxelX;
G4double DetVoxelX_y = DetVoxel_y;
G4double DetVoxelX_z = Det_z;
G4double DetVoxelX_dx = 2*DetVoxelX_x;
G4double DetVoxelZ_x = Det_x;
G4double DetVoxelZ_y = DetVoxel_y;
G4double DetVoxelZ_z = Det_z/m_NumVoxelZ;
G4double DetVoxelZ_dz = 2*DetVoxelZ_z;
G4Box *ROExpHall = new G4Box("ROExpHall",ExpHall_x,ExpHall_y,ExpHall_z);
G4LogicalVolume *ROExpHallLog = new G4LogicalVolume(ROExpHall,dummyMat,"ROExpHallLog",0,0,0);
G4VPhysicalVolume *ROExpHallPhys = new G4PVPlacement(0,G4ThreeVector(),"ROExpHallPhys",ROExpHallLog,0,false,0);
G4Box *RODetector = new G4Box("RODetector", Det_x, Det_y, Det_z);
G4LogicalVolume *RODetectorLog = new G4LogicalVolume(RODetector,dummyMat,"RODetectorLog",0,0,0);
G4VPhysicalVolume *RODetectorPhys = new G4PVPlacement(0,G4ThreeVector(),"DetectorPhys",RODetectorLog,ROExpHallPhys,false,0);
// ReadOut Voxel division
// X division first...
G4Box *RODetectorXDivision = new G4Box("RODetectorXDivision",DetVoxelX_x,DetVoxelX_y,DetVoxelX_z);
G4LogicalVolume *RODetectorXDivisionLog = new G4LogicalVolume(RODetectorXDivision,dummyMat,"RODetectorXDivisionLog",0,0,0);
G4VPhysicalVolume *RODetectorXDivisionPhys = new G4PVReplica("RODetectorXDivisionPhys",RODetectorXDivisionLog,RODetectorPhys,kXAxis,m_NumVoxelX,DetVoxelX_dx);
// ...then Z division
G4Box *RODetectorZDivision = new G4Box("RODetectorZDivision",DetVoxelZ_x,DetVoxelZ_y,DetVoxelZ_z);
G4LogicalVolume *RODetectorZDivisionLog = new G4LogicalVolume(RODetectorZDivision,dummyMat,"RODetectorZDivisionLog",0,0,0);
G4VPhysicalVolume *RODetectorZDivisionPhys = new G4PVReplica("RODetectorZDivisionPhys",RODetectorZDivisionLog,RODetectorXDivisionPhys,kZAxis,m_NumVoxelZ,DetVoxelZ_dz);
BrachyDummySD *dummySD = new BrachyDummySD;
RODetectorZDivisionLog->SetSensitiveDetector(dummySD);
return ROExpHallPhys;
}
@@ -1,141 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// ********************************
// * *
// * BrachyWaterBoxSD.cc *
// * *
// ********************************
#include "BrachyWaterBoxSD.hh"
#include "BrachyWaterBoxHit.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4Track.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ParticleDefinition.hh"
//....
BrachyWaterBoxSD::BrachyWaterBoxSD(G4String name, G4int NumVoxelX, G4int NumVoxelZ)
:G4VSensitiveDetector(name),m_NumVoxelX(NumVoxelX),m_NumVoxelZ(NumVoxelZ)
{
G4String HCname;
collectionName.insert(HCname="WaterBoxHitsCollection");
m_pVoxelID = new G4int[NumVoxelX*NumVoxelZ];
m_pWaterBoxHitsCollection = NULL;
}
//....
BrachyWaterBoxSD::~BrachyWaterBoxSD()
{
delete[] m_pVoxelID;
}
//....
void BrachyWaterBoxSD::Initialize(G4HCofThisEvent*HCE)
{
m_pWaterBoxHitsCollection = new BrachyWaterBoxHitsCollection(SensitiveDetectorName,collectionName[0]);
for(G4int k=0;k<m_NumVoxelZ;k++)
for(G4int i=0;i<m_NumVoxelX;i++)
m_pVoxelID[i+k*m_NumVoxelX] = -1;
}
//....
G4bool BrachyWaterBoxSD::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist)
{
if(!ROhist)
return false;
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() != "WaterBoxPhys")
return false;
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep==0.)
return false;
G4VPhysicalVolume* physVol = ROhist->GetVolume();
G4VPhysicalVolume* mothVol = ROhist->GetVolume(1);
// Read Voxel indexes: i is the x index, k is the z index
G4int k = ROhist->GetReplicaNumber();
G4int i = ROhist->GetReplicaNumber(1);
if(m_pVoxelID[i+k*m_NumVoxelX]==-1)
{
BrachyWaterBoxHit* WaterBoxHit = new BrachyWaterBoxHit(physVol->GetLogicalVolume(),i,k);
G4RotationMatrix rotM;
if(physVol->GetObjectRotation())
rotM = *(physVol->GetObjectRotation());
WaterBoxHit->SetEdep(edep);
WaterBoxHit->SetPos(physVol->GetTranslation());
WaterBoxHit->SetRot(rotM);
G4int VoxelID = m_pWaterBoxHitsCollection->insert(WaterBoxHit);
m_pVoxelID[i+k*m_NumVoxelX] = VoxelID - 1;
}
else
(*m_pWaterBoxHitsCollection)[m_pVoxelID[i+k*m_NumVoxelX]]->AddEdep(edep);
return true;
}
//....
void BrachyWaterBoxSD::EndOfEvent(G4HCofThisEvent*HCE)
{
static G4int HCID = -1;
if(HCID<0)
{
HCID = GetCollectionID(0);
}
HCE->AddHitsCollection(HCID,m_pWaterBoxHitsCollection);
}
//....
void BrachyWaterBoxSD::clear()
{
}
//....
void BrachyWaterBoxSD::DrawAll()
{
}
//....
void BrachyWaterBoxSD::PrintAll()
{
}
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.17 2001/12/10 08:52:09 gcosmo Exp $
# $Id: GNUmakefile,v 1.19 2002/06/18 18:45:39 griccard Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -13,23 +13,14 @@ endif
include $(G4INSTALL)/config/architecture.gmk
# Copy the GammaRayTelAnalysis files according to which version
# is selected.
# As the dependency is checked before "all" is reached, we need
# to do some tricks here ...
ifdef G4ANALYSIS_AIDA_CONFIG_CFLAGS
# AIDA (version 2.2 for now) selected
FOO := $(shell cp -p include/GammaRayTelAnalysis.hh-AIDA include/GammaRayTelAnalysis.hh )
FOO := $(shell cp -p src/GammaRayTelAnalysis.cc-AIDA src/GammaRayTelAnalysis.cc )
else
# Anaphe selected
include anaphe.gmk
FOO := $(shell cp -p include/GammaRayTelAnalysis.hh-Anaphe include/GammaRayTelAnalysis.hh )
FOO := $(shell cp -p src/GammaRayTelAnalysis.cc-Anaphe src/GammaRayTelAnalysis.cc )
ifdef G4ANALYSIS_USE
CPPFLAGS += `aida-config --useHBook --include`
LDFLAGS += `aida-config --useHBook --lib`
endif
# End Analysis.
ifdef G4ANALYSIS_USE_NTUPLE
CPPFLAGS += -DG4ANALYSIS_USE_NTUPLE
endif
.PHONY: all
all: lib bin
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: GammaRayTel.cc,v 1.8 2001/12/04 11:40:27 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: GammaRayTel.cc,v 1.9 2002/06/18 18:45:39 griccard Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -60,8 +60,6 @@
#include "GammaRayTelAnalysis.hh"
#endif
//using namespace Lizard;
/* This global file is used to store relevant data for
analysis with external tools */
+31 -48
View File
@@ -1,4 +1,4 @@
$Id: README,v 1.11 2001/12/07 12:57:30 pfeiffer Exp $
$Id: README,v 1.16 2002/06/18 21:15:13 griccard Exp $
-------------------------------------------------------------------
=========================================================
@@ -79,34 +79,21 @@ The main features of this example are
set the following variables
setenv G4ANALYSIS_USE 1 # Use the analysis tools
setenv G4ANALYSIS_USE_NTUPLE 1 # Use the ntuple
To be sure to have the right compilation and link flags, the
'aida-config' command, provided by an AIDA compliant implementation
must be up and running ; in particular 'aida-config --cflags' and
'aida-config --libs' must be active.
- Set up for analysis using Anaphe/Lizard
To compile the GammaRayTel example with the analysis tools activated,
set the following variables
setenv G4ANALYSIS_USE 1 # Use the analysis tools
setenv G4ANALYSIS_USE_NTUPLE 1 # To store Ntuples
(IMPORTANT: Do not set G4UI_USE_XM when using Ntuples!)
and be sure to have the right path to the Lizard library, inserting this
on the .tcshrc:
and be sure to have the right path to the Anaphe library (or to another AIDA
compliant implementation), inserting this on the .tcshrc:
(on a CERN machine with the gcc-2.95 compiler)
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2/3.6.5/bin
source /afs/cern.ch/sw/lhcxx/share/LHCXX/3.6.5/install/sharedstart.csh
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2/4.0.3/bin
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.3/install/sharedstart.csh
(on a CERN machine with the egcs-2.91.66 compiler (G4SYSTEM Linux-egcs)
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/egcs_1.1.2/3.6.5-sec/bin
source /afs/cern.ch/sw/lhcxx/share/LHCXX/3.6.5-sec/install/sharedstart.csh
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/egcs_1.1.2/4.0.3-sec/bin
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.3-sec/install/sharedstart.csh
2. Sample run
@@ -130,17 +117,6 @@ The main features of this example are
your local G4 installation (see geant4/source/visualization/README for
more information).
ATTENTION:
If you use analysis with Lizard, you have to remove any hbook file in the
example directory obtained in previous Geant4 sessions. This issues will be
solved in future releases. Note also that the following error can be reported
during run with analysis activated
***** ERROR in HLNEXT : Bad sequence for RZ : ID= 1
Ignore this message; histograms (and ntuples) are correctly saved in the hbook files.
3. Detector description
-----------------------
@@ -202,26 +178,33 @@ The main features of this example are
8. Analysis
----------------
At present there are two options for analysis packages: either
explicitely the Anaphe 3.6.5 (or compatible) version is selected,
or any AIDA-2.2 compliant analysis system is chosen. This dual
approach will be removed in the next release when only the AIDA
compliant version will be present. Presently, the OpenScientist
package (version 8) provides an implementation of AIDA 2.2,
other packages as Anaphe and JAS will follow soon. The AIDA
compliant version has not been tested by the developers and is
here as a example of "forward compatibility" on how to use analysis.
The analysis part of GammaRayTel is based on the AIDA interfaces and their
implementation in Anaphe; please look at their documentation for more details.
Keep in mind that the actual implementation of the analysis tools in GammaRayTel
is of a pedagogical nature, so we kept it as simple as possible.
Further improvements will follow in future releases. The actual analysis produces
some histograms (see next section) and an ntuple. Both the histograms and
the ntuple are saved at the end of the run in the file "gammaraytel.hbook". You
can than analyze offline the contents of such a file; the GammaRayTel contains
also a very simple python script that can be used with Lizard to plot the
histograms See the Lizard documentation on how to access the ntuple.
Please note that in a multiple run session, the last run always override the
hbook file.
9. Histogramming
----------------
Some hits information can be visualized runtime using Lizard (if it is
available on the user platform); two 2D histograms and two 1D histograms
can be visualized and saved (as PostScript files) during the simulation
run. The 2D histograms contain the hits positions on the TKR projected on
Some hits information can be visualized runtime using the Anaphe QPlotter
(if it is available on the user platform); two 2D histograms and two
1D histograms can be visualized and saved (as PostScript files)
during the simulation run.
The 2D histograms contain the hits positions on the TKR projected on
the XZ plane and the YZ plane; the 1D histograms contain the energy
deposition in the last X plane of the TKR and the hits distribution along
the X planes of the TKR (note that this histograms have been chosen more
the X planes of the TKR (note again that this histograms have been chosen more
for pedagogical motivation than for physical one).
These histograms are filled and updated at every event and are initialized
@@ -1,38 +0,0 @@
# Some pieces to include if Anaphe is selected as analysis environment
# be aware that this will be obsolete as soon as Anaphe is implementing
# the AIDA 2.2 interfaces.
#
# This requires the env-var LHCXX_REL_DIR to be set up correctly,
# see the first lines in G4ComptonTest.cc
#
ifdef G4ANALYSIS_USE
CPPFLAGS += -I$(LHCXX_REL_DIR)/include
ifdef G4ANALYSIS_USE_NTUPLE
CPPFLAGS += -DG4ANALYSIS_USE_NTUPLE
endif
# C_FLAGS += -I$(LHCXX_REL_DIR)/include
LDFLAGS += -L$(LHCXX_REL_DIR)/lib
# general stuff:
LOADLIBS += -lHepUtilities -lAIDA_Annotation
# add for Histograms:
LOADLIBS += -lAIDA_HBook
# add for Vectors:
LOADLIBS += -lVector
# add for Plotter:
LOADLIBS += -lAIDA_Plotter -lqp -lqpview -lqt-mt -lqutil -lqt
# add for Ntuples:
LOADLIBS += -lAIDA_Ntuple -lNtupleTag -lNtupleTag_HBook
# ... and finally system stuff and to deal with the "Fortran legacy":
LOADLIBS += -lCHBook -ldl -lg2c
# Xm Xt
LDFLAGS += -L$/usr/local/lib -lXm -L/usr/X11R6/lib -lXt
endif
@@ -1,26 +1,28 @@
# tell HistoManager where to find the histograms:
# change the name to access hbook files different from the first run
hm.selectStore("gammaraytel0.hbook")
global tree, hm
# ... and load them into memory:
hE = hm.load1D(1)
hPl = hm.load1D(2)
hXZ = hm.load2D(3)
hYZ = hm.load2D(4)
# Here use the name of the hbook you want to analyze
tree = tf.create("gammaraytel.hbook",1,1,"hbook")
tree.thisown=1
hm = af.createHistogramFactory(tree)
# Retrieve histograms and load them into memory:
hE = tree.findH1D("10")
hPl = tree.findH1D("20")
hXZ = tree.findH2D("30")
hYZ = tree.findH2D("40")
# set plotter to 2*2 zones
pl.createRegions(2,2)
# set plotter to 3*2 zones
pl.zone(2,2)
# ... and plot the histograms
hplot(hE)
hplot(hPl)
hplot(hXZ)
hplot(hYZ)
pl.plot(hE ) ; pl.show() ; pl.next()
pl.plot(hPl ) ; pl.show() ; pl.next()
pl.plot(hXZ ) ; pl.show() ; pl.next()
pl.plot(hYZ ) ; pl.show() ; pl.next()
# get the primary ntuple from the NtupleManager (just a check)
nt1 = tree.findTuple("1")
# get the primary ntuple from the NtupleManager
nt1 = ntm.findNtuple("gammaraytel0.hbook::1" )
# see which attributes there are:
nt1.listAttributes()
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: GammaRayTelAnalysis.hh-AIDA,v 1.3 2001/12/07 13:20:20 pfeiffer Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: GammaRayTelAnalysis.hh,v 1.11 2002/06/18 18:47:14 griccard Exp $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -1,175 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Author: A. Pfeiffer (Andreas.Pfeiffer@cern.ch)
// (copy of his UserAnalyser class)
//
// History:
// -----------
// 7 Nov 2001 MGP Implemented according to A. Pfeiffer's instructions
// 18 Nov 2001 G.Santin GammaRayTel analysis management modified
// according to the new design
//
// -------------------------------------------------------------------
// Class description:
// Example of analysis in a simulation application (histograms, ntuples etc.)
// This class follows the singleton design pattern;
// it is responsible for the analysis management and algorithms
// Histograms are compliant with AIDA, except for the usage of IHistoManager,
// which is Anaphe/Lizard-specific
// For ntuples, for which the AIDA interfaces and compliant implementations
// are still in progress at the time of the current Geant4 release,
// an implementation with Anaphe/Lizard is shown
// Other implementations specific to an analysis system are possible too
// (see, for instance, JAS and OpenScientist documentation from the links
// in http://aida.freehep.org/)
// The implementation of the usage of ntuples shown in this example
// is expected to change in future Geant4 releases, when AIDA interfaces
// and related implementations would be available
// Further documentation is available from: http://www.ge.infn.it/geant4/lowE/
// http://aida.freehep.org/
// http://cern.ch/anaphe/
// -------------------------------------------------------------------
#ifdef G4ANALYSIS_USE
#ifndef GammaRayTelAnalysis_h
#define GammaRayTelAnalysis_h
#include "globals.hh"
// Histogramming from AIDA
#include "Interfaces/IHistogram1D.h"
#include "Interfaces/IHistogram2D.h"
// Histogramming from Anaphe
#include "Interfaces/IHistoManager.h"
// Vectors from ?
#include "Interfaces/IVector.h"
#include "Interfaces/IVectorFactory.h"
// Plotting from Anaphe?
#include "Interfaces/IPlotter.h"
//#include "AIDA_Plotter/AIDAPlotter.h"
// Ntuples from Anaphe
#ifdef G4ANALYSIS_USE_NTUPLE
#include "NtupleTag/LizardNTupleFactory.h"
#include "NtupleTag/LizardQuantity.h"
#include "NtupleTag/LizardNTuple.h"
//using namespace Lizard;
#endif
class G4Track;
class GammaRayTelAnalysisMessenger;
class GammaRayTelDetectorConstruction;
class GammaRayTelAnalysis
{
public:
~GammaRayTelAnalysis();
void BeginOfRun(G4int n);
void EndOfRun(G4int n);
void EndOfEvent(G4int flag);
void Init();
void Finish();
void SetHisto1DDraw(G4String str) {histo1DDraw = str;};
void SetHisto1DSave(G4String str) {histo1DSave = str;};
void SetHisto2DDraw(G4String str) {histo2DDraw = str;};
void SetHisto2DSave(G4String str) {histo2DSave = str;};
void SetHisto2DMode(G4String str) {histo2DMode = str;};
G4String GetHisto2DMode() {return histo2DMode;};
void InsertPositionXZ(double x, double z);
void InsertPositionYZ(double y, double z);
void InsertEnergy(double en);
void InsertHits(int nplane);
#ifdef G4ANALYSIS_USE_NTUPLE
void setNtuple(float E, float p, float x, float y, float z);
#endif
static GammaRayTelAnalysis* getInstance();
private:
GammaRayTelAnalysis();
void plot1D(IHistogram1D* histo);
void plot2D(IHistogram2D* histo);
void Plot();
static GammaRayTelAnalysis* instance;
IHistoManager* histoManager;
IVectorFactory* vectorFactory;
IPlotter* plotter;
#ifdef G4ANALYSIS_USE_NTUPLE
// ---- NOTE ----
// Histograms are compliant to AIDA interfaces, ntuples are Lizard specific
Lizard::NTuple* ntuple;
Lizard::NTupleFactory* ntFactory;
// Quantities for the ntuple
Lizard::Quantity<float> ntEnergy;
Lizard::Quantity<float> ntPlane;
Lizard::Quantity<float> ntX;
Lizard::Quantity<float> ntY;
Lizard::Quantity<float> ntZ;
#endif
GammaRayTelDetectorConstruction* GammaRayTelDetector;
G4String histo1DDraw;
G4String histo1DSave;
G4String histo2DDraw;
G4String histo2DSave;
G4String histo2DMode;
GammaRayTelAnalysisMessenger* analysisMessenger;
};
#endif
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelAnalysisMessenger.hh,v 1.3 2001/11/23 17:44:54 santin Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelAnticoincidenceHit.hh,v 1.2 2001/07/11 09:56:56 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelAnticoincidenceSD.hh,v 1.3 2001/11/29 11:19:17 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelCalorimeterHit.hh,v 1.2 2001/07/11 09:56:56 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelCalorimeterSD.hh,v 1.4 2001/11/29 11:19:17 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelDetectorConstruction.hh,v 1.6 2001/07/11 09:56:56 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelDetectorMessenger.hh,v 1.3 2001/07/11 09:56:56 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelDigi.hh,v 1.1 2001/10/24 13:11:54 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelDigitizer.hh,v 1.2 2001/11/29 09:34:17 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelDigitizerMessenger.hh,v 1.1 2001/11/29 09:34:17 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -23,7 +23,7 @@
//
// $Id: GammaRayTelDummySD.hh,v 1.4 2001/11/28 10:07:01 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelEventAction.hh,v 1.9 2001/12/04 11:40:28 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelPhysicsList.hh,v 1.3 2001/07/11 09:56:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelPrimaryGeneratorAction.hh,v 1.6 2001/11/29 11:19:17 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelPrimaryGeneratorMessenger.hh,v 1.3 2001/07/11 09:56:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelRunAction.hh,v 1.5 2001/11/23 17:44:54 santin Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelTrackerHit.hh,v 1.2 2001/07/11 09:56:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelTrackerROGeometry.hh,v 1.3 2001/11/29 11:19:17 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelTrackerSD.hh,v 1.4 2001/11/29 11:19:17 griccard Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelVisManager.hh,v 1.3 2001/07/11 09:56:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class header file
// CERN Geneva Switzerland
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: GammaRayTelAnalysis.cc-AIDA,v 1.3 2001/12/07 13:20:20 pfeiffer Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: GammaRayTelAnalysis.cc,v 1.14 2002/06/18 21:15:13 griccard Exp $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland
@@ -31,6 +31,9 @@
// ------------ GammaRayAnalysisManager ------
// by R.Giannitrapani, F.Longo & G.Santin (03 dic 2000)
//
// 18.06.2002 R.Giannitrapani, F.Longo & G.Santin
// - new release for Anaphe 4.0.3
//
// 07.12.2001 A.Pfeiffer
// - integrated Guy's addition of the ntuple
//
@@ -60,6 +63,7 @@
#include <AIDA/IPlotter.h>
#include <AIDA/ITupleFactory.h>
#include <AIDA/ITuple.h>
#include <AIDA/IManagedObject.h>
#endif
GammaRayTelAnalysis* GammaRayTelAnalysis::instance = 0;
@@ -87,10 +91,22 @@ GammaRayTelAnalysis::GammaRayTelAnalysis(int argc,char** argv)
ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
if(treeFactory) {
// Tree in memory :
//tree = treeFactory->create();
// Create a "tree" associated to a ROOT "store" (in RECREATE mode).
tree = treeFactory->create("GammaRayTel.root",false,false,"ROOT");
// Create a "tree" associated to an hbook
tree = treeFactory->create("gammaraytel.hbook", false, false,"hbook");
if(tree) {
// Get a tuple factory :
ITupleFactory* tupleFactory = analysisFactory->createTupleFactory(*tree);
if(tupleFactory) {
// Create a tuple :
tuple = tupleFactory->create("tuple","Event info",
"float energy, plane, x, y, z");
assert(tuple);
delete tupleFactory;
}
IHistogramFactory* histoFactory =
analysisFactory->createHistogramFactory(*tree);
if(histoFactory) {
@@ -104,43 +120,34 @@ GammaRayTelAnalysis::GammaRayTelAnalysis(int argc,char** argv)
// 1D histogram that store the energy deposition of the
// particle in the last (number 0) TKR X-plane
energy = histoFactory->create1D("1","Energy deposition in the last X plane (keV)", 100, 50, 200);
energy = histoFactory->create1D("10","Energy deposition in the last X plane (keV)", 100, 50, 200);
// 1D histogram that store the hits distribution along the TKR X-planes
hits = histoFactory->create1D("2","Hits distribution in the TKR X planes",Nplane, 0, Nplane-1);
hits = histoFactory->create1D("20","Hits distribution in the TKR X planes",Nplane, 0, Nplane-1);
// 2D histogram that store the position (mm) of the hits (XZ projection)
if (histo2DMode == "strip")
posXZ = histoFactory->create2D("3","Tracker Hits XZ (strip,plane)",
posXZ = histoFactory->create2D("30","Tracker Hits XZ (strip,plane)",
N, 0, N-1,
2*Nplane, 0, Nplane-1);
else
posXZ = histoFactory->create2D("3","Tracker Hits XZ (x,z) in mm",
posXZ = histoFactory->create2D("30","Tracker Hits XZ (x,z) in mm",
sizexy/5, -sizexy/2, sizexy/2,
sizez/5, -sizez/2, sizez/2);
// 2D histogram that store the position (mm) of the hits (YZ projection)
if(histo2DMode=="strip")
posYZ = histoFactory->create2D("4","Tracker Hits YZ (strip,plane)",
posYZ = histoFactory->create2D("40","Tracker Hits YZ (strip,plane)",
N, 0, N-1,
2*Nplane, 0, Nplane-1);
else
posYZ = histoFactory->create2D("4","Tracker Hits YZ (y,z) in mm",
posYZ = histoFactory->create2D("40","Tracker Hits YZ (y,z) in mm",
sizexy/5, -sizexy/2, sizexy/2,
sizez/5, -sizez/2, sizez/2);
delete histoFactory;
}
// Get a tuple factory :
ITupleFactory* tupleFactory = analysisFactory->createTupleFactory(*tree);
if(tupleFactory) {
// Create a tuple :
tuple = tupleFactory->create("tuple","tuple",
"energy plane x y z");
delete tupleFactory;
}
}
delete treeFactory; // Will not delete the ITree.
}
@@ -159,6 +166,7 @@ GammaRayTelAnalysis::GammaRayTelAnalysis(int argc,char** argv)
}
#endif
}
@@ -177,9 +185,11 @@ void GammaRayTelAnalysis::Init()
void GammaRayTelAnalysis::Finish()
{
#ifdef G4ANALYSIS_USE
delete tree;
delete plotter;
delete analysisFactory; // Will delete tree and histos.
delete analysisMessenger;
analysisMessenger = 0;
#endif
}
@@ -230,13 +240,14 @@ void GammaRayTelAnalysis::InsertHits(int nplane)
void GammaRayTelAnalysis::setNtuple(float E, float p, float x, float y, float z)
{
#ifdef G4ANALYSIS_USE
if(tuple) {
tuple->fill(0,E);
tuple->fill(1,p);
tuple->fill(2,x);
tuple->fill(3,y);
tuple->fill(4,z);
tuple->addRow();
ITuple * ntuple = dynamic_cast<ITuple *> ( tree->find("tuple") );
if(ntuple) {
ntuple->fill(tuple->findColumn("energy"),E);
ntuple->fill(tuple->findColumn("plane"),p);
ntuple->fill(tuple->findColumn("x"),x);
ntuple->fill(tuple->findColumn("y"),y);
ntuple->fill(tuple->findColumn("z"),z);
ntuple->addRow();
}
#endif
}
@@ -250,41 +261,13 @@ void GammaRayTelAnalysis::setNtuple(float E, float p, float x, float y, float z)
void GammaRayTelAnalysis::BeginOfRun(G4int n)
{
#ifdef G4ANALYSIS_USE
/*
if(energy) energy->reset();
if(hits) hits->reset();
if(posXZ) posXZ->reset();
if(posYZ) posYZ->reset();
// Set the plotter ; set the number of regions and attach histograms
// to plot for each region.
// It is done here, since then EndOfRun set regions
// for paper output.
if(plotter) {
if((histo2DDraw == "enable") && (histo1DDraw == "enable")) {
plotter->createRegions(2,2);
plotter->plot(*posXZ);
plotter->next();
plotter->plot(*posYZ);
plotter->next();
plotter->plot(*energy);
plotter->next();
plotter->plot(*hits);
} else if((histo1DDraw == "enable") && (histo2DDraw != "enable")) {
plotter->createRegions(1,2);
plotter->plot(*energy);
plotter->next();
plotter->plot(*hits);
} else if((histo1DDraw != "enable") && (histo2DDraw == "enable")) {
plotter->createRegions(1,2);
plotter->plot(*posXZ);
plotter->next();
plotter->plot(*posYZ);
} else { // Nothing to plot.
plotter->createRegions(1,1);
}
plotter->refresh();
}
*/
#endif
}
@@ -298,35 +281,43 @@ void GammaRayTelAnalysis::EndOfRun(G4int n)
#ifdef G4ANALYSIS_USE
if(tree) tree->commit();
if(plotter) {
// We set one single region for the plotter
plotter->createRegions(1,1);
// We now print the histograms, each one in a separate file
if(histo2DSave == "enable") {
char name[15];
plotter->createRegions(1,1);
sprintf(name,"posxz_%d.ps", n);
plotter->plot(*posXZ);
plotter->write(name,"PS");
plotter->refresh();
plotter->write(name,"ps");
plotter->createRegions(1,1);
sprintf(name,"posyz_%d.ps", n);
plotter->clearRegion();
plotter->plot(*posYZ);
plotter->write(name,"PS");
plotter->refresh();
plotter->write(name,"ps");
}
if(histo1DSave == "enable") {
plotter->createRegions(1,1);
char name[15];
sprintf(name,"energy_%d.ps", n);
plotter->plot(*energy);
plotter->write(name,"PS");
plotter->refresh();
plotter->write(name,"ps");
plotter->createRegions(1,1);
sprintf(name,"hits_%d.ps", n);
plotter->clearRegion();
plotter->plot(*hits);
plotter->write(name,"PS");
plotter->refresh();
plotter->write(name,"ps");
}
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -338,7 +329,53 @@ void GammaRayTelAnalysis::EndOfEvent(G4int flag)
// hits in the event
if(!flag) return;
#ifdef G4ANALYSIS_USE
if(plotter) plotter->refresh();
// Set the plotter ; set the number of regions and attach histograms
// to plot for each region.
// It is done here, since then EndOfRun set regions
// for paper output.
if(plotter) {
if((histo2DDraw == "enable") && (histo1DDraw == "enable")) {
plotter->createRegions(2,2);
plotter->plot(*posXZ);
plotter->show();
plotter->next();
plotter->plot(*posYZ);
plotter->show();
plotter->next();
plotter->plot(*energy);
plotter->show();
plotter->next();
plotter->plot(*hits);
plotter->show();
} else if((histo1DDraw == "enable") && (histo2DDraw != "enable")) {
plotter->createRegions(1,2);
plotter->plot(*energy);
plotter->show();
plotter->next();
plotter->plot(*hits);
} else if((histo1DDraw != "enable") && (histo2DDraw == "enable")) {
plotter->createRegions(1,2);
plotter->plot(*posXZ);
plotter->show();
plotter->next();
plotter->plot(*posYZ);
} else { // Nothing to plot.
plotter->createRegions(1,1);
}
plotter->refresh();
}
#endif
}
@@ -1,405 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Author: A. Pfeiffer (Andreas.Pfeiffer@cern.ch)
// (copied from his UserAnalyser class)
//
// History:
// -----------
// 7 Nov 2001 MGP Implementation
// 03 dic 2000 AnalysisManager by R.Giannitrapani, F.Longo & G.Santin
// 18 Nov 2001 G.Santin GammaRayTel analysis management modified
// according to the new design
//
// -------------------------------------------------------------------
#ifdef G4ANALYSIS_USE
#include "GammaRayTelAnalysis.hh"
#include "GammaRayTelAnalysisMessenger.hh"
#include "globals.hh"
#include "G4RunManager.hh"
#include "G4Track.hh"
#include "G4SteppingManager.hh"
#include "G4ThreeVector.hh"
#include "GammaRayTelDetectorConstruction.hh"
//using namespace Lizard;
GammaRayTelAnalysis* GammaRayTelAnalysis::instance = 0;
GammaRayTelAnalysis::GammaRayTelAnalysis() :
histoManager(0), vectorFactory(0),plotter(0),
histo1DDraw("enable"),histo1DSave("enable"),histo2DDraw("enable"),
histo2DSave("enable"),histo2DMode("strip"),
analysisMessenger(0)
{
}
GammaRayTelAnalysis::~GammaRayTelAnalysis()
{
Finish();
}
void GammaRayTelAnalysis::Init()
{
G4RunManager* runManager = G4RunManager::GetRunManager();
GammaRayTelDetector =
(GammaRayTelDetectorConstruction*)(runManager->GetUserDetectorConstruction());
analysisMessenger = new GammaRayTelAnalysisMessenger(this);
histoManager = createIHistoManager();
#ifdef G4ANALYSIS_USE_NTUPLE
ntFactory = Lizard::createNTupleFactory();
#endif
vectorFactory = createIVectorFactory();
plotter = createIPlotter();
}
void GammaRayTelAnalysis::Finish()
{
#ifdef G4ANALYSIS_USE_NTUPLE
delete ntFactory;
ntFactory = 0;
#endif
delete histoManager;
histoManager = 0;
delete vectorFactory;
vectorFactory = 0;
delete plotter;
plotter = 0;
delete analysisMessenger;
analysisMessenger = 0;
}
GammaRayTelAnalysis* GammaRayTelAnalysis::getInstance()
{
if (instance == 0) instance = new GammaRayTelAnalysis;
return instance;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fill the 2d histogram of the XZ positions
void GammaRayTelAnalysis::InsertPositionXZ(double x, double z)
{
IHistogram2D* posXZ = histoManager->retrieveHisto2D("3");
posXZ->fill(x, z);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fill the 2d histogram of the YZ positions
void GammaRayTelAnalysis::InsertPositionYZ(double y, double z)
{
IHistogram2D* posYZ = histoManager->retrieveHisto2D("4");
posYZ->fill(y, z);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fill the 1d histogram of the energy released in the last Si plane
void GammaRayTelAnalysis::InsertEnergy(double en)
{
IHistogram1D* energy = histoManager->retrieveHisto1D("1");
energy->fill(en);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// This function fill the 1d histogram of the hits distribution along the TKR planes
void GammaRayTelAnalysis::InsertHits(int nplane)
{
IHistogram1D* hits = histoManager->retrieveHisto1D("2");
hits->fill(nplane);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
/*
This member reset the histograms and it is called at the begin
of each run; here we put the inizialization so that the histograms have
always the right dimensions depending from the detector geometry
*/
void GammaRayTelAnalysis::BeginOfRun(G4int n)
{
float sizexy, sizez;
int Nstrip, Nplane, Ntile, N;
char name[30];
Init();
// Relevant data from the detector to set the histograms dimensions
Nplane = GammaRayTelDetector->GetNbOfTKRLayers();
Nstrip = GammaRayTelDetector->GetNbOfTKRStrips();
Ntile = GammaRayTelDetector->GetNbOfTKRTiles();
sizexy = GammaRayTelDetector->GetTKRSizeXY();
sizez = GammaRayTelDetector->GetTKRSizeZ();
N = Nstrip*Ntile;
if (histoManager) {
sprintf(name,"gammaraytel%d.hbook", n);
histoManager->selectStore(name);
// Check if deleteHisto is enough, maybe we need to delete the object
histoManager->deleteHisto("1");
histoManager->create1D("1","Energy deposition in the last X plane (keV)", 100, 50., 200.);
// 1D histogram that store the hits distribution along the TKR X-planes
histoManager->deleteHisto("2");
histoManager->create1D("2","Hits distribution in the TKR X planes",
Nplane, 0, Nplane-1);
// 2D histogram that store the position (mm) of the hits (XZ projection)
histoManager->deleteHisto("3");
if (histo2DMode == "strip")
histoManager->create2D("3","Tracker Hits XZ (strip,plane)",
N, 0, N-1,
2*Nplane, 0, Nplane-1);
else
histoManager->create2D("3","Tracker Hits XZ (x,z) in mm",
sizexy/5, -sizexy/2, sizexy/2,
sizez/5, -sizez/2, sizez/2);
// 2D histogram that store the position (mm) of the hits (YZ projection)
histoManager->deleteHisto("4");
if(histo2DMode=="strip")
histoManager->create2D("4","Tracker Hits YZ (strip,plane)",
N, 0, N-1,
2*Nplane, 0, Nplane-1);
else
histoManager->create2D("4","Tracker Hits YZ (y,z) in mm",
sizexy/5, -sizexy/2, sizexy/2,
sizez/5, -sizez/2, sizez/2);
}
IHistogram2D* posXZ = histoManager->retrieveHisto2D("3");
if (posXZ)
posXZ->reset();
IHistogram2D* posYZ = histoManager->retrieveHisto2D("4");
if(posYZ)
posYZ->reset();
IHistogram1D* energy = histoManager->retrieveHisto1D("1");
if(energy)
energy->reset();
IHistogram1D* hits = histoManager->retrieveHisto1D("2");
if(hits)
hits->reset();
// We divide the plotter in the right nuber of zone depending
// on which histograms the user want to draw
if((histo2DDraw == "enable") && (histo1DDraw == "enable"))
plotter->zone(2,2,0,0);
else if((histo1DDraw == "enable") || (histo2DDraw == "enable"))
plotter->zone(1,2,0,0);
else
plotter->zone(1,1,0,0);
#ifdef G4ANALYSIS_USE_NTUPLE
// Book ntuples
sprintf(name,"gammaraytel%d.hbook::1", n);
ntuple = ntFactory->createC(name);
// Add and bind the attributes to the ntuple
if ( !( ntuple->addAndBind( "energy", ntEnergy) &&
ntuple->addAndBind( "plane" , ntPlane) &&
ntuple->addAndBind( "x" , ntX ) &&
ntuple->addAndBind( "y" , ntY ) &&
ntuple->addAndBind( "z" , ntZ ) ) ) {
delete ntuple;
G4Exception(" GammaRayTelAnalysis::BeginOfRun - Could not addAndBind ntuple");
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
/*
This member is called at the end of each run
*/
void GammaRayTelAnalysis::EndOfRun(G4int n)
{
// This variable contains the names of the PS files
char name[15];
// We define some vectors
IVector* vxz = 0;
IVector* vyz = 0;
IVector* ve = 0;
IVector* vhit = 0;
// Temporary we set one single zone for the plotter
plotter->zone(1,1,0,0);
// We now print the histograms, each one in a separate file
if(histo2DSave == "enable") {
IHistogram2D* posXZ = histoManager->retrieveHisto2D("3");
IHistogram2D* posYZ = histoManager->retrieveHisto2D("4");
plot2D(posXZ);
sprintf(name,"posxz_%d.ps", n);
plotter->psPrint(name);
plot2D(posYZ);
sprintf(name,"posyz_%d.ps", n);
plotter->psPrint(name);
}
if(histo1DSave == "enable") {
IHistogram1D* energy = histoManager->retrieveHisto1D("1");
IHistogram1D* hits = histoManager->retrieveHisto1D("2");
plot1D(energy);
sprintf(name,"energy_%d.ps", n);
plotter->psPrint(name);
plot1D(hits);
sprintf(name,"hits_%d.ps", n);
plotter->psPrint(name);
}
delete vxz;
delete vyz;
delete ve;
delete vhit;
// Store histograms
// Because of a Lizard feature, ntuples must be deleted at this stage,
// not in the destructor (otherwise the ntuples are not stored)
// In version 3.6.4 of Anaphe, no licence, storing other histograms after
// having stored a 2D one generates an error message "ERROR in HLNEXT"
// Histograms are stored correctly, in spite of the error message
// The same error message is issued if attempting to store 1D or 2D
// histograms after deleting a ntuple
histoManager->store("1");
histoManager->store("3");
histoManager->store("2");
histoManager->store("4");
#ifdef G4ANALYSIS_USE_NTUPLE
delete ntuple;
ntuple = 0;
G4cout << "Deleted ntuple" << G4endl;
#endif
// close files for this run
if (histoManager != 0) Finish();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
/* This member is called at the end of every event */
void GammaRayTelAnalysis::EndOfEvent(G4int flag)
{
// The histograms are updated only if there is some
// hits in the event
if(flag) Plot();
}
void GammaRayTelAnalysis::Plot()
{
// In a normal case we use the following line to use the standard plot
// analysisSystem->Plot(histo);
// We define some vectors
IVector* vxz = 0;
IVector* vyz = 0;
IVector* ve = 0;
IVector* vhit= 0;
// We fill them with the histograms and
// draw them
if(histo2DDraw == "enable")
{
IHistogram2D* posXZ = histoManager->retrieveHisto2D("3");
IHistogram2D* posYZ = histoManager->retrieveHisto2D("4");
plot2D(posXZ);
plot2D(posYZ);
plotter->refresh();
}
if(histo1DDraw == "enable")
{
IHistogram1D* energy = histoManager->retrieveHisto1D("1");
IHistogram1D* hits = histoManager->retrieveHisto1D("2");
plot1D(energy);
plot1D(hits);
plotter->refresh();
}
delete vxz;
delete vyz;
delete ve;
delete vhit;
}
void GammaRayTelAnalysis::plot1D(IHistogram1D* histo)
{
IVector* v = vectorFactory->from1D(histo);
plotter->plot(v,0);
plotter->refresh();
delete v;
}
void GammaRayTelAnalysis::plot2D(IHistogram2D* histo)
{
IVector* v = vectorFactory->from2D(histo);
plotter->plot(v,0);
plotter->refresh();
delete v;
}
#ifdef G4ANALYSIS_USE_NTUPLE
void GammaRayTelAnalysis::setNtuple(float E, float p, float x, float y, float z)
{
ntEnergy = E;
ntPlane = p;
ntX = x;
ntY = y;
ntZ = z;
ntuple->addRow();
}
#endif
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelAnalysisMessenger.cc,v 1.5 2001/12/04 11:40:28 flongo Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -22,7 +22,7 @@
//
//
// $Id: GammaRayTelAnticoincidenceHit.cc,v 1.2 2001/07/11 09:56:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
// ------------------------------------------------------------
// GEANT 4 class implementation file
// CERN Geneva Switzerland

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