]>
Commit | Line | Data |
---|---|---|
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 | ||
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 | gPad->Print("$base.$ext"); | |
28 | EOF | |
29 | ||
30 | if [[ ! -e "${base}.${ext}" ]] ; then | |
31 | echo "Error: output file ${base}.${ext} not generated!" | |
32 | exit 3 | |
33 | fi |