-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathchild.sh
More file actions
executable file
·57 lines (46 loc) · 1.32 KB
/
child.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.32 KB
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
51
52
53
54
55
56
#!/usr/bin/env bash
cmd="./myeg.sh"
seed=$RANDOM
nev=1
out=
opt=
usage()
{
cat <<EOF
Usage: $0 [OPTIONS]
Options:
-c,--cmdline COMMAND Command line
-s,--seed SEED Random number seed ($seed)
-n,--nevents EVENTS Number of events ($nev)
-o,--output OUTPUT Output prefix ($out)
-+,--compile Compile script ($opt)
-- Rest of command line sent to o2-sim
COMMAND must be quoted if it contains spaces or other special
characters
Below follows the help output of o2-sim
EOF
}
while test $# -gt 0 ; do
case $1 in
-c|--cmdline) cmd="$2" ; shift ;;
-s|--seed) seed=$2 ; shift ;;
-n|--nevents) nev=$2 ; shift ;;
-o|--output) out=$2 ; shift ;;
-+|--compile) opt=" -+";;
-h|--help) usage; o2-sim --help full ; exit 0 ;;
--) shift ; break ;;
*) echo "Unknown option '$1', did you forget '--'?" >/dev/stderr
exit 1
;;
esac
shift
done
if test "x$out" = "x" ; then
out=`echo $cmd | sed 's,^\./,,' | tr '[$/. ]' '_'`
fi
out=`echo "$out" | tr ' ' '_'`
set -x
export VMCWORKDIR=${O2_ROOT}/share
o2-sim -g tparticle \
--configKeyValues "GeneratorFileOrCmd.cmd=$cmd $opt;GeneratorFileOrCmd.outputSwitch=-o" \
--outPrefix "$out" --seed $seed --nEvents $nev $@