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 | |
---|
6 | PROJECT_PATH=/afs/cern.ch/user/j/jclivaz/private/ICOSIM++svn/icosimplusplus/trunk |
---|
7 | SRC_PATH=$PROJECT_PATH/source |
---|
8 | SAMPLE_PATH=$PROJECT_PATH/sample |
---|
9 | OUTPUT_PATH=$PROJECT_PATH/outputs |
---|
10 | |
---|
11 | |
---|
12 | RFIRST=1 |
---|
13 | RLAST=1 |
---|
14 | RUN_IN_CURRENT=false |
---|
15 | CURRENT=$PWD |
---|
16 | |
---|
17 | die() { |
---|
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 | |
---|
36 | if [ ! -f $SAMPLE_PATH/collimatorfile_${1}.csv ]; then |
---|
37 | die "The first argument (${1}) must correspond to the collimator and the optics file.." |
---|
38 | fi |
---|
39 | |
---|
40 | |
---|
41 | cp $SAMPLE_PATH/initial.dat initial.dat |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | echo Running ICOSIM++ with Standard, Magnetic or Crystal Collimator |
---|
46 | |
---|
47 | cd $SRC_PATH |
---|
48 | |
---|
49 | #Run ICOSIM++ in foreground |
---|
50 | echo " - Running the Tracker..." >> $RUNDIR/tracker_$i.log |
---|
51 | ./icosim++ $SAMPLE_PATH/collimatorfile_${1}.csv $RUNDIR |
---|
52 | |
---|
53 | cd $RUNDIR |
---|
54 | |
---|
55 | rm -rf \$TMPDIR |
---|
56 | |
---|
57 | cd $PROJECT_PATH |
---|
58 | |
---|
59 | |
---|
60 | echo End of the run |
---|
61 | |
---|
62 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.