3
# First get to main level directory for this process
6
if [[ ! -d ./bin || ! -d ./SubProcesses ]]; then
8
if [[ ! -d ./bin || ! -d ./SubProcesses ]]; then
9
echo "Error: store must be executed from the main, or bin directory"
14
# Check that mg5 exists
17
if [[ ! -x $mgdir/mg5 ]]; then
18
mgdir=$main/../madgraph5/bin
20
if [[ ! -x $mgdir/mg5 ]]; then
21
echo "Error no mg5 executable $mgdir/mg5 found"
26
dirbin=$main/bin/internal
29
# Local versions to work on the cluster
31
while [[ "$1" != "" ]]; do
32
if [[ "$1" == "--web" ]]; then
33
mgdir=$MADGRAPH_BASE/MG_ME/mg5
34
dirbin=$MADGRAPH_BASE/MG_ME/WebBin
35
bin =$MADGRAPH_BASE/MG_ME/WebBin
41
# some external executable
42
#gen_card=$dirbin/gen_cardhtml-pl
43
#gen_info=$dirbin/gen_infohtml-pl
45
# Check if we have to use MG4 proc_card.dat or MG5 proc_card.dat
46
if [[ -e ./Cards/proc_card_mg5.dat ]]; then
47
if [[ -e ./Cards/proc_card.dat ]]; then
48
if [[ $tag != '--web' ]]; then
49
echo "both mg4 and mg5 proc_card.dat are detected. Which one do you want to use? [4/5]"
57
elif [[ -e ./Cards/proc_card.dat ]]; then
60
echo "neither proc_card.dat or proc_card_mg5.dat"
61
echo "are present in directory Cards"
62
echo "Prepare a card (see examples on the web) and"
63
echo "copy it there, or run directly ../bin/mg5."
68
rm proc_log.txt >& /dev/null
69
echo "Started `date`" > ./proc_log.txt
72
cp -p HTML/thinking.gif HTML/card.jpg
73
rm SubProcesses/done >& /dev/null
75
$gen_card >& /dev/null
77
# launch the mg5 program
78
if [[ $card_use == '4' ]]; then
79
# Run ./mg5 with stderr going to both the file proc_log.txt and to terminal
80
# output. See http://acs.lbl.gov/~ksb/Scratch/sh_redir_pipe.html
81
((echo import proc_v4 ./Cards/proc_card.dat | $mgdir/mg5 3>&1 1>&2 2>&3) | tee /dev/tty) >> proc_log.txt 2>&1
82
elif [[ $card_use == '5' ]]; then
83
# Run ./mg5 with stderr going to both the file proc_log.txt and to terminal
84
# output. See http://acs.lbl.gov/~ksb/Scratch/sh_redir_pipe.html
85
(($mgdir/mg5 ./Cards/proc_card_mg5.dat 3>&1 1>&2 2>&3) | tee /dev/tty) >> proc_log.txt 2>&1
87
echo 'not recognized mode'
90
echo "Finished `date` " >> ./proc_log.txt
91
echo "`date` " >& ./CREATED
96
if [[ $tag == "--web" ]]; then
102
# Check that generation worked
103
if [[ ! -e SubProcesses/subproc.mg ]]; then
105
cp -p HTML/stop.jpg HTML/card.jpg
106
echo "No diagrams for this process!"
109
$gen_card >& /dev/null