]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - PWG2/FORWARD/analysis2/qa/DrawQA.sh
Major overhaul of the QA code.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / qa / DrawQA.sh
... / ...
CommitLineData
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
11file=trending.root
12
13# --- Help message ---------------------------------------------------
14usage ()
15{
16 cat <<EOF
17Usage: $0 [OPTIONS]
18
19Options:
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
24EOF
25}
26
27# --- Command line parsing -------------------------------------------
28while 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
36done
37
38# --- Run aliroot ----------------------------------------------------
39scr=$ALICE_ROOT/PWG2/FORWARD/analysis2/qa/DrawQA.C
40
41root -l -b -q ${scr}\(\"$file\"\)
42
43# --- Make LaTeX code ------------------------------------------------
44if test "x$title" = "x" ; then
45 title=`echo "QA from $file" | sed -e 's/_/\\_/g'`
46fi
47if test "x$output" = "x" ; then
48 output=`basename $file .root`
49else
50 output=`basename $file .pdf`
51fi
52doc=${output}.tex
53
54echo $title
55cat <<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
66EOF
67pngs="fit_results neighbors beforeAfter 123 recAnaELoss occupancy elossVsPoisson"
68for 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
85EOF
86done
87
88cat <<EOF >> $doc
89\end{document}
90EOF
91
92pdflatex $doc
93
94rm -f $doc $output.aux $output.log FitResults.pdf
95for i in $pngs ; do rm -f $i.png ; done
96
97#
98# EOF
99#
100