]> git.uio.no Git - u/mrichter/AliRoot.git/blob - doxygen/alidoxyimg.sh
CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / doxygen / alidoxyimg.sh
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
10 if [[ $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
16 fi
17
18 if ! which aliroot > /dev/null 2>&1 ; then
19   echo 'Error: aliroot executable not found in $PATH'
20   exit 2
21 fi
22
23 base=${1%.*}
24 ext='png'
25
26 aliroot -b "$1" <<EOF
27 TVirtualPad *topPad = gPad;
28 while (topPad->GetMother() != topPad) {
29   topPad = topPad->GetMother();
30 }
31 topPad->Print("$base.$ext");
32 EOF
33
34 if [[ ! -e "${base}.${ext}" ]] ; then
35   echo "Error: output file ${base}.${ext} not generated!"
36   exit 3
37 fi