-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathread.sh
More file actions
executable file
·54 lines (43 loc) · 1.28 KB
/
read.sh
File metadata and controls
executable file
·54 lines (43 loc) · 1.28 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
#!/usr/bin/env bash
inp=particles.root
seed=$RANDOM
nev=1
out=
usage()
{
cat <<EOF
Usage: $0 [OPTIONS]
Options:
-i,--input FILENAME Input HepMC file ($inp)
-s,--seed SEED Random number seed ($seed)
-n,--nevents EVENTS Number of events ($nev)
-o,--output NAME Ouptut name
-- Rest of command line sent to o2-sim
The input file FILENAME is assumed to contain a TTree with a
TBranch holding a TClonesArray of TParticle objects. Such a
file can be generated by the script myeg.sh in this directory.
Below follows the help output of o2-sim
EOF
}
while test $# -gt 0 ; do
case $1 in
-i|--input) inp=$2 ; shift ;;
-s|--seed) seed=$2 ; shift ;;
-n|--nevents) nev=$2 ; shift ;;
-o|--output) out=$2 ; shift ;;
-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=`basename $inp .root`
fi
out=`echo "$out" | tr ' ' '_'`
set -e
export VMCWORKDIR=${O2_ROOT}/share
o2-sim -g tparticle --configKeyValues "GeneratorFileOrCmd.fileNames=${inp}" \
--outPrefix "$out" --seed $seed --nEvents $nev $@