fb6fc115 |
1 | #!/bin/bash |
2 | |
3 | |
4 | if [ "$1" == "-local" ] && [ ! -z $2 ] |
5 | then |
6 | |
7 | nev=${3:-10000} |
8 | fev=${4:-0} |
9 | |
10 | cd reco/local |
11 | mkdir -p run$2 |
12 | rm -f run$2/* |
13 | cd run$2 |
14 | |
15 | echo "Reconstructing into reco/local/run$2 and redirecting output to the file reco/local/run$2/stdout" |
16 | |
17 | unbuffer aliroot -q ../../rec.C\($2,$nev,$fev\) 2>&1 | tee stdout |
18 | |
19 | else |
20 | |
21 | if [ "$1" != "-force" ] |
22 | then |
23 | pgrep aliroot > /dev/null |
24 | if [ "$?" -eq "0" ] |
25 | then |
26 | echo "Error: You can only start one rec.sh at a time. Please wait for the other session to terminate or close it." |
27 | exit |
28 | fi |
29 | else |
30 | shift |
31 | fi |
32 | |
33 | [ -z $1 ] && { echo "Usage: rec.sh [-local] <run_number>"; exit 1; } |
34 | |
35 | nev=${2:-10000} |
36 | fev=${3:-0} |
37 | |
38 | cd reco |
39 | aliroot -q run.C\($1,$nev,$fev\) |
40 | |
41 | fi |