3 # This is deprecated. Use RunQAMT.sh instead
16 export PATH=$PATH:$ALICE_ROOT/PWGLF/FORWARD/analysis2/qa:../scripts
18 # --- Handle exit ----------------------------------------------------
26 # --- Usage information ----------------------------------------------
30 Usage: $0 -j JOBID [OPTIONS]
34 -j,--jobid JOBID Job id from MonALisa [$jobid]
35 -d,--nodownload Do not download [$nodw]
36 -t,--notrend Do not make new trend tree [$notr]
37 -r,--no-run Do not make per-run info [$norn]
38 -o,--output DIRECTORY Where to store the result [$top]
39 -v,--verbose Be verbose [$verb]
40 -m,--max NUMBER Maximum number of runs to get [$maxf]
41 -s,--skip-lines NUMBER Number of lines to skip in job list [$skip]
45 # --- Messages -------------------------------------------------------
48 if test $verb -lt 1 ; then return ; fi
53 # --- Get parts of the passed path -----------------------------------
63 P=`echo $x | sed 's/.*pass\([0-9]*\).*/\1/'`
64 R=`echo $x | sed -n "s/.*pass${P}_//p"`
65 Q=`echo $x | sed -n 's/pass.*//p'`
66 Y=`echo $p | sed 's/LHC\(..\).*/\1/'`
67 L=`echo $p | sed "s/LHC${Y}\(.\).*/\1/"`
68 S=`echo $p | sed "s/LHC${Y}${L}//"`
74 *) dprod=${dprod}${S} ;;
78 xQA*) q=`echo $r | sed 's/QA//'` ;;
84 if test "x$R" != "x" ; then opts="$opts -R $R" ; fi
85 if test "x$q" != "x" ; then opts="$opts -q $q" ; fi
86 if test "x$Q" != "x" ; then opts="$opts -Q $Q" ; fi
88 dest="${dprod}/${Q}pass${P}"
89 if test "x$R" != "x" ; then dest="${dest}_${R}" ; fi
93 # --- Get the options ------------------------------------------------
95 jobUrl="http://alimonitor.cern.ch/prod/jobs.jsp?t="
97 wget -q ${jobUrl}${jobid} -O job.html
98 p=`grep "/catalogue/index.jsp?path" job.html | head -n $skip | tail -n 1 | sed -e 's,.*/alice/data/\([^<]*\)<.*,\1,' | tr '/' ' '`
104 # --- Trapping errors ------------------------------------------------
107 echo "Got an error: $last"
112 # echo "Enabling trapping errors"
118 # echo "Disabling trapping errors"
124 # --- Deprecated -----------------------------------------------------
126 This script is deprecated. You should use the more advanced script RunQAMT.sh
127 which process the runs in parallel and in general is more flexible
129 read -n 1 -i n -p "Do you want to continue [yN]? "
136 # --- comamnd line ---------------------------------------------------
137 while test $# -gt 0 ; do
139 -h|--help) usage ; exit 0 ;;
140 -j|--jobid) jobid=$2; shift ;;
141 -o|--output) top=$2 ; shift ;;
142 -d|--no-download) nodw=1 ;;
143 -t|--no-trend) notr=1 ;;
144 -r|--no-run) norn=1 ;;
145 -v|--verbose) verb=1 ;;
146 -s|--skip-lines) skip=$2 ; shift ;;
147 -m|--max) maxf=$2 ; shift ;;
148 *) echo "Unknown option $1" > /dev/stderr ; exit 1 ;;
153 # --- Sanity ---------------------------------------------------------
154 if test $jobid -lt 1 ; then
155 echo "No JOBID specified" > /dev/stderr
159 # --- Extract options -----------------------------------------------
161 if test "x$opts" = "x" ; then
162 echo "No options found"
167 # --- Display job setting --------------------------------------------
169 ----------------------------------------------------------------------
172 Don't download: $nodw
173 Don't make tree: $notr
174 Download options: $opts
178 ----------------------------------------------------------------------
181 # --- Lock -----------------------------------------------------------
182 lock=${top}/${dest}/.lock
183 if test -f $lock ; then
184 echo "Another QA process is already running:" > /dev/stderr
185 echo "Content of ${top}/${dest}/.lock:" > /dev/stderr
186 cat $lock > /dev/stderr
199 # --- Download the files ---------------------------------------------
200 if test $nodw -lt 1 ; then
201 mess "Running getQAResults.sh $opts -d $top -n "
202 getQAResults.sh $opts -d $top -T -v -v -i -m $maxf
204 mess "Not downloading"
207 # --- Now run the QA code -------------------------------------------
209 mess "Now running code"
212 mess "Change directory to $top/$dest"
218 mess "List of trend_<x>.html files"
219 idx=`ls trend_*_*.html 2>/dev/null`
220 mess "Removing indeces"
223 if test -f $i ; then rm -f $i ; fi
227 if test $notr -gt 0 ; then let what=$what^0x2 ; fi
228 if test $norn -gt 0 ; then let what=$what^0x1 ; fi
230 scr=$ALICE_ROOT/PWGLF/FORWARD/analysis2/qa/RunQA.C
231 mess "Running root -l -b -q ${scr}\(\".\",1,-1,$what\)"
234 root -l -b -q ${scr}\(\".\",1,-1,$what\)
238 idx=`ls trend_*_*.html 2>/dev/null`
241 echo "making index.html point to $i"
243 sed -e "s,index.html,../index.html," \
244 -e "s,!--JOBID--,a target='_blank' href='${jobUrl}${jobid}'>Job</a," \
248 if test ! -f index.html ; then
249 echo "No index file found"
252 chmod g+rw index.html
253 chmod g+rw . > /dev/null 2>&1
256 if test -f $ALICE_ROOT/PWGLF/FORWARD/analysis2/qa/style.css ; then
257 style=$ALICE_ROOT/PWGLF/FORWARD/analysis2/qa/style.css
258 elif test -f $savdir/style.css ; then
259 style=$savdir/style.css
262 if test x$style != x ; then
270 Finished running QA for jobid $jobid.
271 Output is stored in $top/${dest}
275 # --- Make index.html ------------------------------------------------
279 period=`basename $period`
281 cat <<EOF > index.html
284 <title>$period</title>
285 <LINK REL="stylesheet" href="style.css">
292 if test ! -d $i ; then continue ; fi
293 echo "<li><a href='$i'>$i</a></li>" >> index.html
295 cat <<EOF >> index.html
301 <a href="../">Back</a>
309 chmod g+rw index.html
310 chmod g+rw . > /dev/null 2>&1
311 if test x$style != x ; then
317 # --- Make index.html ------------------------------------------------
320 cat <<EOF >index.html
323 <title>QA for the FMD</title>
324 <LINK REL="stylesheet" href="style.css">
327 <h1>QA for the FMD</h1>
329 For more information, see <a href='https://twiki.cern.ch/twiki/bin/viewauth/ALICE/FMDQA'>TWiki pages</a>
334 if test ! -d $i ; then continue ; fi
335 echo "<li><a href='$i'>$i</a></li>" >> index.html
337 cat <<EOF >> index.html
345 chmod g+rw index.html
346 chmod g+rw . > /dev/null 2>&1
347 if test x$style != x ; then