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