-
Notifications
You must be signed in to change notification settings - Fork 2
/
G4Batch.sh
executable file
·50 lines (40 loc) · 1.04 KB
/
G4Batch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
## Stop on error
set -e
## Geant 4 Version
# If a specific Geant4 version should be used, adapt and uncomment these lines.
# source /data/jmayer/software/geant4.10.05/bin/geant4.sh
echo "Using Geant4 Version $(geant4-config --version) in $(dirname $(dirname $(geant4-config --prefix)))"
## Build Project
# Remove previous build directory if it exists and recreate it
#rm -rf build
mkdir -p build
cd build
cmake ..
make -j 10
cd ..
## Set CAD Directory
if [ -z "${G4HORUS_CAD_DIR}" ]
then
export G4HORUS_CAD_DIR=$(pwd)/cad
fi
echo "CAD Dir: ${G4HORUS_CAD_DIR}"
## Create output dir and run full simulation
mkdir -p out
cd out
TS=$(date +%Y-%m-%dT%H-%M-%S)
mkdir "${TS}"
cd "${TS}"
## Macro File
if [ -n "$1" ]
then
MACRO=../../$1
else
MACRO=../../scripts/test.mac
fi
# Copy main settings over for later reference
cp ../../src/DetectorConstruction.cc .
cp $MACRO .
# Run executable in batch mode, niced and multithreaded
nice -n 19 ../../build/G4Horus -t 32 -k hist -m ${MACRO}
#nice -n 19 ../../build/G4Horus -t 32 -k soco -m ${MACRO}