2 #################################################################
3 # This script sets up and runs the online display.
5 # Data gets put in a dir named after the run number in the
6 # $DATADIRBASE dir (default in ~/data)
7 # Never overwrite existing data, make a new directory if necessary
8 # and give it a unique (sequential) number
10 # it is possible to override the default rec.C by putting a symlink
13 # origin: Mikolaj Krzewicki, Nikhef, Mikolaj.Krzewicki@cern.ch
14 #################################################################
19 echo " Usage: `basename $0` RunNumber GDCnumber"
24 DATADIRBASE="/local/home/daq/data/current"
25 RECMACRO="$ALICE_ROOT/test/cosmic/rec.C"
26 PROMPTOFFLINEMACRO="/local/home/daq/alisoft/macros/RunPromptOffline.C"
28 #override the default rec.C if ~/rec.C exists and is symlink
32 echo "~/rec.C will override the default rec.C"
33 read -n 1 -p "Do you want to use the new one? [Y/n]" ans
34 if [[ $ans == "Y" || $ans == "y" || $ans == "" ]]
36 RECMACRO="$HOME/rec.C"
38 echo "OK, using $RECMACRO"
42 echo "OK, using $RECMACRO"
47 # data gets put in a dir named after the run number
48 DATADIR="${DATADIRBASE}/${1}_OnlineDisplay"
50 # never overwrite existing data, make a new directory if necessary
51 # and give it a unique (sequential) number
58 DIRNUMBER=`echo ${x} | sed -e s%${DATADIR}_*%%`
59 if [[ ${DIRNUMBER} == "" ]]
63 if [[ ${DIRNUMBER} -ge ${BIGGESTNUMBER} ]]
65 BIGGESTNUMBER=$((DIRNUMBER+1))
68 DATADIR=${DATADIR}_${BIGGESTNUMBER}
71 #Prepare ang go to the dir
73 cp ${RECMACRO} ${DATADIR}
76 xterm -T "Reconstruction run: ${1} GDC: ${2}" -e "cd $DATADIR;aliroot ${PROMPTOFFLINEMACRO}\(${1},${2}\)"&
78 #wait some time for data to appear
81 while [ ! -f AliESDs.root ]; do
82 waitcount=$((waitcount+1))
83 if [[ $waitcount -ge 20000 ]]; then
87 echo "reconstruction produced no data yet"
91 if [[ $runalieve -eq 1 ]]; then
92 alieve anyscan_init.C > display.log