Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -1,17 +1,11 @@
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
# Find Geant4 package, no UI and Vis drivers activated
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
find_package(Geant4 REQUIRED)
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
@@ -1,11 +0,0 @@
#----------------------------------------------------------------------------
# Find Geant4 package, no UI and Vis drivers activated
#
find_package(Geant4 REQUIRED)
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
@@ -0,0 +1,17 @@
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI drivers by default
# You can set WITH_GEANT4_UI to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UI "Build example with Geant4 UI drivers" ON)
if(WITH_GEANT4_UI)
find_package(Geant4 REQUIRED ui_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
@@ -0,0 +1,17 @@
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
@@ -0,0 +1,17 @@
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available Vis drivers by default
# You can set WITH_GEANT4_VIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_VIS "Build example with Geant4 Vis drivers" ON)
if(WITH_GEANT4_VIS)
find_package(Geant4 REQUIRED vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
@@ -1,8 +1,8 @@
#----------------------------------------------------------------------------
# Find EXTERN_PACKAGE (optional package)
#
find_package(EXTERN_PACKAGE)
if(EXTERN_PACKAGE_TO_UPPER_FOUND QUIET)
find_package(EXTERN_PACKAGE QUIET)
if(EXTERN_PACKAGE_TO_UPPER_FOUND)
message(STATUS "G4 Examples: EXTERN_PACKAGE found. --> EXAMPLE_NAME example with EXTERN_PACKAGE enabled.")
# Uncomment this line if suitable (some customization may be needed)
# add_definitions(-DG4EXTERN_PACKAGE_USE)
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Usage:
# check_long_lines.sh [maxColumn]
#set -x
CURDIR=`pwd`
MAX=90
if [ $# -eq 1 ]; then
MAX=$1
fi
for SOURCE in `ls *.cc include/*.hh src/*.cc`
do
LINE_LENGTH=`wc -L $SOURCE | sed sY" $SOURCE"YYg`
RESULT=`echo "$LINE_LENGTH > $MAX" | bc`
if [ $RESULT -ne 0 ];
then
echo "LONG LINE ($LINE_LENGTH characters) detected in $SOURCE"
fi
done
cd $CURDIR
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Usage:
# check_separator.sh
#set -x
CURDIR=`pwd`
#The correct separator with 80 characters
#SEPARATOR="//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......"
#Still tolerated separator with 78 characters
SEPARATOR="//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...."
for SOURCE in `ls src/*.cc`
do
LINES=`cat $SOURCE | grep $SEPARATOR | wc -l `
RESULT=`echo "$LINES > 0" | bc`
if [ $RESULT -ne 1 ];
then
echo "NO SEPARATOR found in $SOURCE"
fi
done
cd $CURDIR
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Usage:
# check_tabs.sh
#set -x
CURDIR=`pwd`
for SOURCE in `ls *.cc include/*.hh src/*.cc`
do
RESULT=`cat $SOURCE | sed 's/\t/TAB_TO_BE_REMOVED/g' | grep TAB_TO_BE_REMOVED`
if [ ! "$RESULT" = "" ];
then
echo "TAB detected in $SOURCE"
#cat $SOURCE | sed 's/\t/TAB_TO_BE_REMOVED/g' > $CURDIR/"$DIR"_tabs/$SOURCE
fi
done
cd $CURDIR
@@ -50,12 +50,15 @@ generate() {
fi
done
# Extract use of visualization
# Extract use of ui/visualization
UI_VIS=""
GREP_UI=`cat "$EXAMPLE_PROGRAM_NAME"".cc" | grep G4UIExecutive`
if [ "${GREP_UI}" != "" ]; then
UI_VIS=${UI_VIS}"_ui"
fi
GREP_VIS=`cat "$EXAMPLE_PROGRAM_NAME"".cc" | grep G4VisExecutive`
if [ "${GREP_VIS}" = "" ]; then
NO_VIS="_no_vis"
else
NO_VIS=""
if [ "${GREP_VIS}" != "" ]; then
UI_VIS=${UI_VIS}"_vis"
fi
# Extract list of scripts:
@@ -84,7 +87,7 @@ generate() {
# Project
cat $CURDIR/CMakeLists_template_1.txt | sed s/"EXAMPLE_NAME"/"${EXAMPLE_NAME}"/g > CMakeLists.txt
# Use Geant4
cat $CURDIR/CMakeLists_template_2"${NO_VIS}".txt >> CMakeLists.txt
cat $CURDIR/CMakeLists_template_2"${UI_VIS}".txt >> CMakeLists.txt
# Find extern package
cat $CURDIR/CMakeLists_template_3"${WITH_EXTERN}""${OPTIONAL}".txt | sed s/"EXAMPLE_NAME"/"${EXAMPLE_NAME}"/g | sed s/"EXTERN_PACKAGE_TO_UPPER"/"${EXTERN_PACKAGE_TO_UPPER}"/g | sed s/"EXTERN_PACKAGE"/"${EXTERN_PACKAGE}"/g >> CMakeLists.txt
# Locate sources and headers
@@ -228,6 +231,24 @@ generate_visualization() {
generate visualization/userVisAction
}
generate_novice() {
generate ../novice/N01
generate ../novice/N02
generate ../novice/N03
generate ../novice/N04
generate ../novice/N05
generate ../novice/N06
generate ../novice/N07
}
generate_advanced() {
generate ../advanced/air_shower
generate ../advanced/gammaknife
generate ../advanced/ChargeExchangeMC
generate ../advanced/dnaphysics
# to be completed
}
# Check arguments
if [ $# -ne 1 ]; then
echo " Usage: "
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Usage:
# process_examples.sh script
#set -x
CURDIR=`pwd`
SCRIPT=$1
SCRIPT_ARG=$2
# call a script
# {1} example directory
call_script() {
echo "... calling ${1} for example ${2}"
${1}
}
# basic
for DIR in basic; do
echo ... processing $DIR
cd $DIR
BASIC_DIR=`pwd`
for EXAMPLE in B1 B2/B2a B3 B4/B4a B4/B4b B4/B4c B4/B4d; do
cd $EXAMPLE
call_script $SCRIPT $EXAMPLE
cd $BASIC_DIR
done
cd $CURDIR
done
@@ -0,0 +1,52 @@
#!/bin/bash
#
# Usage:
# process_examples.sh script
#set -x
CURDIR=`pwd`
SCRIPT=$1
SCRIPT_ARG=$2
# call a script
# {1} example directory
call_script() {
echo "... calling ${1} for example ${2}"
${1}
}
# extended
#CATEGORY errorpropagation; polarisation
for DIR in extended; do
echo ... processing $DIR
cd $DIR
EXTENDED_DIR=`pwd`
for CATEGORY in `ls`; do
# select directories with .README
if [ -f ${CATEGORY}/.README ]; then
echo ... processing $CATEGORY
cd $CATEGORY
CATEGORY_DIR=`pwd`
for FILE in `find -name .README`; do
EXAMPLE_DIR=`echo $FILE | sed sY/.READMEYYg`
NOT_EXAMPLE=`echo ". ./gdml ./pythia ./MPI" | grep $EXAMPLE_DIR`
if [ "${NOT_EXAMPLE}" = "" ]; then
cd $EXAMPLE_DIR
call_script $SCRIPT $EXAMPLE_DIR
cd $CATEGORY_DIR
fi
done
fi
cd $EXTENDED_DIR
done
# categories with a single example in the same level
for EXAMPLE_DIR in errorpropagation; do
cd $EXAMPLE_DIR
call_script $SCRIPT $EXAMPLE_DIR
cd $CATEGORY_DIR
cd $EXTENDED_DIR
done
cd $CURDIR
done
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
#
# Usage:
# replace_tabs.sh
#set -x
CURDIR=`pwd`
for SOURCE in `ls *.cc include/*.hh src/*.cc`
do
RESULT=`cat $SOURCE | sed 's/\t/TAB_TO_BE_REMOVED/g' | grep TAB_TO_BE_REMOVED`
if [ ! "$RESULT" = "" ];
then
echo "Updating file $SOURCE ... "
cat $SOURCE | sed --posix -e 's/\t/ /g' > $SOURCE.1
mv $SOURCE.1 $SOURCE
fi
done
cd $CURDIR