]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/qa/DrawQA.sh
Fixes for coverity checks.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / qa / DrawQA.sh
1 #!/bin/sh 
2
3 file=trending.root 
4
5 # --- Help message ---------------------------------------------------
6 usage ()
7 {
8     cat <<EOF
9 Usage: $0 [OPTIONS] 
10
11 Options:
12         -f,--file    FILE       Input file 
13         -t,--title   STRING     Title string 
14         -o,--output  FILE       Write output on this file 
15         -h,--help               Show this help
16 EOF
17 }
18
19 # --- Command line parsing -------------------------------------------
20 while test $# -gt 0 ; do 
21     case $1 in  
22         -f|--file) file=$2 ; shift ;;
23         -t|--title) title=$2 ; shift ;; 
24         -h|--help) usage ; exit 0 ;; 
25         *)  echo "Uknown option $1" > /dev/stderr ; exit 1 ;; 
26     esac
27     shift 
28 done 
29
30 # --- Run aliroot ----------------------------------------------------
31 scr=$ALICE_ROOT/PWG2/FORWARD/analysis2/qa/DrawQA.C 
32
33 root -l -b -q ${scr}\(\"$file\"\)
34
35 # --- Make LaTeX code ------------------------------------------------
36 if test "x$title" = "x" ; then 
37     title=`echo "QA from $file" | sed -e 's/_/\\_/g'`
38 fi
39 if test "x$output" = "x" ; then 
40     output=`basename $file .root` 
41 else 
42     output=`basename $file .pdf` 
43 fi
44 doc=${output}.tex
45
46 echo $title
47 cat <<EOF > $doc
48 \documentclass[landscape,12pt,a4paper]{article}
49 \usepackage[a4paper,margin=2cm]{geometry}
50 \usepackage{graphicx}
51 \title{$title}
52 \author{FMD Team}
53 \date{\today}
54 \begin{document}
55 \maketitle
56 \clearpage
57
58 EOF
59 pngs="fit_results neighbors beforeAfter 123 recAnaELoss occupancy elossVsPoisson"
60 for i in $pngs ; do
61     case $i in  
62         fit_results) t="Energy loss fits" ;; 
63         neighbors)   t="Correlation of neighbors" ;; 
64         beforeAfter) t="Effect of sharing correction" ;; 
65         123)         t="Energy loss from single, double, and tripple hits" ;; 
66         recAnaELoss) t="Energy loss from reconstruction and used in analysis" ;;
67         occupancy)   t="Calculated occupancy" ;;
68         elossVsPoisson) t="Correlation of Poisson and Energy loss methods" ;;
69         *)           t="Unkknown" ;;
70     esac
71     cat <<EOF >> $doc
72 \section*{$t}
73 \begin{center}
74 \includegraphics[keepaspectratio,height=.9\textheight]{$i}
75 \end{center}
76 \clearpage
77 EOF
78 done
79
80 cat <<EOF >> $doc
81 \end{document}
82 EOF
83
84 pdflatex $doc    
85
86 rm -f $doc $output.aux $output.log FitResults.pdf 
87 for i in $pngs ; do rm -f $i.png ; done 
88
89
90 # EOF
91
92