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