Update master to aliroot
[u/mrichter/AliRoot.git] / doxygen / alidoxyimg.sh
CommitLineData
6cbb53dc 1#!/bin/bash
2
3# Usage:
4# alidoxyimg.sh <macro>.C
5#
6# Generates <macro>.png image as the output of <macro>.
7#
8# Needs aliroot executable.
9
10if [[ $1 == '' ]] ; then
11 echo 'Usage:'
12 echo ' alidoxyimg.sh <macro>.C'
13 echo ''
14 echo 'The output will be a file named <macro>.png.'
15 exit 1
16fi
17
18if ! which aliroot > /dev/null 2>&1 ; then
19 echo 'Error: aliroot executable not found in $PATH'
20 exit 2
21fi
22
23base=${1%.*}
24ext='png'
25
26aliroot -b "$1" <<EOF
f70248d8 27TVirtualPad *topPad = gPad;
28while (topPad->GetMother() != topPad) {
29 topPad = topPad->GetMother();
30}
31topPad->Print("$base.$ext");
6cbb53dc 32EOF
33
34if [[ ! -e "${base}.${ext}" ]] ; then
35 echo "Error: output file ${base}.${ext} not generated!"
36 exit 3
37fi