source: ZHANGProjects/ICOSIM/CPP/trunk/script/runicosim++.sh.sample @ 2

Last change on this file since 2 was 2, checked in by zhangj, 10 years ago

Initial import

File size: 1.3 KB
Line 
1#!/bin/bash
2
3#Script to run ICOSIM++ with only standard, magnetic or crystal collimators
4#Warning: do not forget to do: 'chmod +rx run_main.sh' the first time before running the script!!
5
6PROJECT_PATH=/afs/cern.ch/user/j/jclivaz/private/ICOSIM++svn/icosimplusplus/trunk
7SRC_PATH=$PROJECT_PATH/source
8SAMPLE_PATH=$PROJECT_PATH/sample
9OUTPUT_PATH=$PROJECT_PATH/outputs
10
11
12RFIRST=1
13RLAST=1
14RUN_IN_CURRENT=false
15CURRENT=$PWD
16
17die() {
18  echo >&2 "$1"
19  exit $E_BADARGS
20}
21
22  cd $OUTPUT_PATH
23
24  RUNDIR=$(mktemp -d -p $PWD ${1}.XXX)
25
26  cd $RUNDIR
27
28
29  echo "Running in the directory $RUNDIR"
30
31  cp $SAMPLE_PATH/collimatorfile_${1}.csv collimatorfile_${1}.csv
32  cp $SAMPLE_PATH/opticsfile_${1}.csv opticsfile_${1}.csv
33  cp $SAMPLE_PATH/crystalinfo.csv crystalinfo.csv
34  cp $SAMPLE_PATH/infoPlotLossSpectra.csv infoPlotLossSpectra.csv
35
36if [ ! -f $SAMPLE_PATH/collimatorfile_${1}.csv ]; then
37  die "The first argument (${1}) must correspond to the collimator and the optics file.."
38fi
39
40
41  cp $SAMPLE_PATH/initial.dat initial.dat
42
43
44
45echo Running ICOSIM++ with Standard, Magnetic or Crystal Collimator
46
47cd $SRC_PATH
48
49#Run ICOSIM++ in foreground
50echo " - Running the Tracker..." >> $RUNDIR/tracker_$i.log
51./icosim++ $SAMPLE_PATH/collimatorfile_${1}.csv $RUNDIR
52
53cd $RUNDIR
54
55rm -rf \$TMPDIR
56
57  cd $PROJECT_PATH
58
59
60echo End of the run
61
62exit 0
Note: See TracBrowser for help on using the repository browser.